       Re: Re: Solving differential equations in the

• To: mathgroup at smc.vnet.net
• Subject: [mg103805] Re: [mg103772] Re: [mg103768] Solving differential equations in the
• From: DrMajorBob <btreat1 at austin.rr.com>
• Date: Wed, 7 Oct 2009 07:01:30 -0400 (EDT)
• References: <200910051139.HAA28779@smc.vnet.net>

```No need to settle for NDSolve, when you can get the symbolic solution as
follows:

Clear[x, y, y1, s]
Off[Solve::"ifun"]

Solve the transformed ODE (thanks to Dan Dubin):

x[s_] = 2 + Exp[-I s];
y1[s_] = y[s] /.
First@DSolve[{y'[s]/x'[s] == Exp[y[s]], y[Pi] == 1}, y, s]

-Log[-((-1 + E)/E) - E^(-I s)]

(y1 is y as a function of s, not x.)

Now invert the x function:

s[z_] = s /. First@Solve[x[s] == z, s]

I Log[-2 + z]

Define y as a function of x:

y[x_] = y1[s[x]] // Simplify

1 - Log[1 + E - E x]

Check the initial conditions:

y'[x] - Exp[y[x]]

0

y

1

Bobby

On Mon, 05 Oct 2009 12:16:34 -0500, Dan Dubin <ddubin at ucsd.edu> wrote:

>> Hi !
>> How can I solve an ordinary differential equation of order n in the
>> complex plane following a prescribed contour ?
>> I can of course write my own Runge-Kutta package but is there a quickest
>> way to do that (maybe NDSolve but how to define the contour ??) ?
>>
>> Example : NDSolve[{y'[x] == Exp[y[x]], y == 1}, y, {x, 1, 3}]
>> fails because of a singularity in x=1+1/e.
>> However integrating the ODE following a path which avoids the
>> singularity should be possible eventually leading to a multivalued
>> function.
>>
>> Thanks for a hint.
>
>
> Let x[s] be a complex path parametrized by a real variable s, for
> instance
>
> x[s_] = 2 + Exp[-I s];
>
> Then Re[x] runs from 1 to 3 as s runs from Pi to 0. This is the range
> of x you wanted. You can choose other paths if this one is not
> convenient.
>
> Now transform the ODE in x to an ODE in s using the chain rule, and
> solve this ODE in s:
>
> NDSolve[{y'[s]/x'[s]==Exp[y[s]],y[Pi]==1},y,{s,0,Pi}]
>
> yields the function y[s] along the chosen contour.
>

--
DrMajorBob at yahoo.com

```

• Prev by Date: Limiting the number of messages
• Next by Date: Graphics3D Problem
• Previous by thread: Re: Solving differential equations in the complex plane
• Next by thread: What Mathematica "says" on two BBP type infinite sums ?