Re: [julia-users] Re: quadgk with 2 arguments

2016-10-19 Thread Michele Zaffalon
You are right. On Wed, Oct 19, 2016 at 12:37 AM, Steven G. Johnson wrote: > > > On Tuesday, October 18, 2016 at 4:34:38 PM UTC-4, Michele Zaffalon wrote: >> >> quadgk(t -> cis(gamma(t)), 0, 1) >> > > No, this is wrong because you forgot the Jacobian factor. >

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 7:05:17 PM UTC-4, Mosè Giordano wrote: > > In any case, I have to admit that quadgk is much more powerful than > what I expected, at least because purely implemented in Julia, so can > work with any Julia type. > quadgk also supports arbitrary-precision

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 7:05:17 PM UTC-4, Mosè Giordano wrote: > > Hi Steven, > > 2016-10-19 0:36 GMT+02:00 Steven G. Johnson >: > > For example: > > > > quadgk(z -> 1/z, 1, 1im, -1, -1im) > > > > integrates 1/z over a closed counter-clockwise

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Mosè Giordano
Hi Steven, 2016-10-19 0:36 GMT+02:00 Steven G. Johnson : > For example: > > quadgk(z -> 1/z, 1, 1im, -1, -1im) > > integrates 1/z over a closed counter-clockwise diamond-shaped contour around > the origin in the complex plane, returning 2πi by the residue theorem. Did

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 4:34:38 PM UTC-4, Michele Zaffalon wrote: > > quadgk(t -> cis(gamma(t)), 0, 1) > No, this is wrong because you forgot the Jacobian factor.

[julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Steven G. Johnson
On Tuesday, October 18, 2016 at 4:27:22 PM UTC-4, digxx wrote: > > do u have an example for how to use a contour? > quadgk(cis,0,1+1*im)= > probably integrates over the straight line so how can I integrate over the > line gamma(t)=t+im*t^2 > By contour, I just meant straight-line segments.

Re: [julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread Michele Zaffalon
quadgk(t -> cis(gamma(t)), 0, 1) On Tue, Oct 18, 2016 at 10:27 PM, digxx wrote: > do u have an example for how to use a contour? > quadgk(cis,0,1+1*im) > probably integrates over the straight line so how can I integrate over the > line gamma(t)=t+im*t^2 >

[julia-users] Re: quadgk with 2 arguments

2016-10-18 Thread digxx
do u have an example for how to use a contour? quadgk(cis,0,1+1*im) probably integrates over the straight line so how can I integrate over the line gamma(t)=t+im*t^2

[julia-users] Re: quadgk with 2 arguments

2016-10-16 Thread Steven G. Johnson
quadgk is fine for vector-valued functions (and in fact any integrand type supporting +, -, *real, and norm, and can also integrate over infinite intervals and contours in the complex plane. But for multidimensional integrals you should use Cuba.jl or Cubature.jl or GSL.jl or similar.

[julia-users] Re: quadgk with 2 arguments

2016-10-15 Thread digxx
Btw: Can quadgk also be used for complex functions? (the integration is still over a real range)

[julia-users] Re: quadgk with 2 arguments

2016-10-15 Thread digxx
thx

[julia-users] Re: quadgk with 2 arguments

2016-10-15 Thread Daniel O'Malley
I think what you want is g(s) = quadgk(t->f(s,t), 0, 1) On Saturday, October 15, 2016 at 6:37:58 PM UTC-6, digxx wrote: > > having a function of the form f(s,t) defined is it possible to somehow > tell quadgk to not evaluate until I supply a value for s while t should be > the integration

[julia-users] Re: quadgk with 2 arguments

2016-10-15 Thread Kristoffer Carlsson
Perhaps this is what you mean: s = 1.0 quadgk(t -> f(s,t),0,1) On Sunday, October 16, 2016 at 2:37:58 AM UTC+2, digxx wrote: > > having a function of the form f(s,t) defined is it possible to somehow > tell quadgk to not evaluate until I supply a value for s while t should be > the