0
|
7786 Views
|
15 Replies
|
1 Total Likes
View groups...
Share
GROUPS:

# Complex integral with NDSolve

Posted 8 years ago
 If seeking an indefinite integral, then Integrate[] solves the problem, but sometimes it chokes on hard ones. NDSolve seems to give an alternative producing an interpolated solution, but such solutions take only real variables, not complex. Is there a way to change this or a way to restate the integral altogether as a PDE?
15 Replies
Sort By:
Posted 8 years ago
 Just to follow up, I eventually did get some positive results. The motivation for this problem was the Schwarz-Christoffel transformation (taken from Complex Analysis for Mathematics and Engineering by Mathews & Howell). A conformal map from an arbitrary polygon onto a unit circle is the solution of the integral. My result is a conformal map extending to a boundary roughly the shape of the starting polygon, but there are significant errors in accuracy for all but the simplest of polygons, as of yet. Perhaps I can find a way to improve the computation, but I find that increasing "MinPoints" doesn't always make things any better, and in fact, sometimes worse.
Posted 8 years ago
 Here's a version of NDSolve used the way that I was imagining....and it gets going, but it's still not giving me quite what I had in mind...maybe it just needs a tweak.  Posted 8 years ago
 Yes, but, see that the first example which succeeds with Integrate[], it gives a solution that meaningfully takes a complex value, and I would like to have something which does this for the second example. Anyway, I like the idea of the differential form that Daniel gave. I suppose I will go that route.
Posted 8 years ago
 In:= expr = Product[(x - i)^(-2/5), {i, 0, 3, 1}] Out= 1/((-3 + x)^(2/5) (-2 + x)^(2/5) (-1 + x)^(2/5) x^(2/5)) In:= NIntegrate[expr, {x, 0, 10}] During evaluation of In:= NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small. >> During evaluation of In:= NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in x near {x} = {2.01156}. NIntegrate obtained -0.982375-1.58796 I and 0.08710236099655635 for the integral and error estimates. >> Out= -0.982375 - 1.58796 I In:= int[x_] = NDSolveValue[{y'[x] == expr, y[-1] == 0}, y[x], {x, -1, 10}] Out= InterpolatingFunction[{{-1., 10.}}, <>][x] In:= int - int Out= -0.975968 - 1.57868 I 
Posted 8 years ago
 What's the range of integration?
Posted 8 years ago
 I think that the distinction here is that the goal is not to solve a contour integral per se but rather a complex-valued, indefinite integral. Perhaps I am mistaken in thinking that there is a difference between the two.
Posted 8 years ago
 An example of the kind of problem you're trying to solve would be helpful.
Posted 8 years ago
 Here are two cases, one that works with Integrate, and one that doesn't. The latter is why I try to find an alternative using NDSolve[]Product[(x-i)^(-1/2),{i,0,2,1}]Integrate[%,x]Product[(x-i)^(-2/5),{i,0,3,1}]Integrate[%,x]
Posted 8 years ago
 Daniel, I'm puzzled by your answer. Wouldn't it be easier to parameterize the integration path and do a change of variable?
Posted 8 years ago
 Yes, if the goal is to get a result on a linear path. From the wording I had thought the goal was to get a result that works on a region (rectangle, say) of C.
Posted 8 years ago
 Maybe recast as d/dz (=1/2(d/dx-Id/dy) in the original ODE, and use d/dz==0 where that latter is 1/2(d/dx+I*d/dy). So now it is a PDE involving complex coordinates, but in terms of real x and y.
Posted 8 years ago
 I was hoping somehow to use the fact that the solution is of the form f(x + i y) = u(x,y)+ i v(x,y), and moreover, that for the derivative, f'(x + i y) = du/dx + i dv/dx = dv/dy - I du/dy. I think that this comes from Cauchy-Riemann equations.
Posted 8 years ago
 I see what you mean. Can you transform the problem so that the path of integration is along the real axis?
Posted 8 years ago
 yes, but in this case your solution is complex valued, but the domain is still pure real. What happens if you change x -> 1 to x -> 2 + 3 I in your line ?
Posted 8 years ago
 I think NDSolve can handle complex variables: In:= sln = NDSolve[{y'[x] == y[x], y == I}, y[x], {x, 0, 1}]; In:= (y[x] /. sln[]) /. x -> 1 Out= 0. + 2.71828 I `