       # Re: NDSolve vs. DSolve

• To: mathgroup@smc.vnet.net
• Subject: [mg10931] Re: NDSolve vs. DSolve
• From: Paul Abbott <paul@physics.uwa.edu.au>
• Date: Thu, 12 Feb 1998 20:16:14 -0500
• Organization: University of Western Australia
• References: <6brh2k\$ee9@smc.vnet.net>

```Students wrote:

> In the following examples the DSolve solves easily while the NDSolve is
> producing the listed error messages. Why is that and how is it bypassed.
>
> DSolve[y'''[x]==-Cos[x],y==0,y==0,y'==0,y[x],x]
>
> NDSolve[y'''[x]==-Cos[x],y==0,y==0,y'==0,y[x],{x,0,5}]
>
> NDSolve::unsol:
> Not possible to initiate boundary value problem with the chasing method

DSolve solves the differential equations and then fits the undetermined
coefficients using the boundary conditions.

For problems of this type you can use the shooting method (replacing
y==0 with y''==a and determining a):

In:= system[a_]:= s=

NDSolve[{y'''[x]==-Cos[x],y==0,y'==0,y''==a},y,{x,0,5}]]//First

In:= gun := y /. system[#1] &

In:= FindRoot[gun[a] == 0, {a, 0, 0.3}] Out= {a -> 0.476715}

In:= y /. s
Out=
-12
9.47337 10

In:= Plot[Evaluate[y[x] /. s], {x, 0, 5}]

Cheers,
Paul

____________________________________________________________________
Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia            Nedlands WA  6907
mailto:paul@physics.uwa.edu.au  AUSTRALIA
http://www.pd.uwa.edu.au/~paul

God IS a weakly left-handed dice player
____________________________________________________________________

```

• Prev by Date: Re: Knowledge about a Mathematica book
• Next by Date: Re: String patterns
• Prev by thread: NDSolve vs. DSolve
• Next by thread: eigenmatrix of a tensor