Re: Re: NDSolve help needed for nonlinear eq.
- To: mathgroup at smc.vnet.net
- Subject: [mg26045] Re: [mg26033] Re: NDSolve help needed for nonlinear eq.
- From: Reza Malek-Madani <research at usna.edu>
- Date: Sat, 18 Nov 2000 23:08:00 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Dear Bill: I don't know how to solve nonlinear boundary value problems in general but I have had some success with BVPs that appear in boundary layer theory in fluid dynamics. The following program finds the solution to y1'=y2, y2'=y3, y3'=-1/2 y1 y3; y1(0) = y2(0) = 0, y2(10) = 1; My program uses NDSolve with FindRoot to implement a simple shooting technique. (I have a few other examples of the shooting method and the spectral method on my homepage at http://web.usna.navy.mil/~rmm). **************************** $TextStyle = {FontFamily -> "Times", FontSize -> 14}; llabel[x_] := StyleForm[TraditionalForm[x]]; b1 = 1; b2 = 0.4; b3 = 2.4; (* Starting guesses for FindRoot *) f[y1_, y2_, y3_] = y2; g[y1_, y2_, y3_] = y3; h[y1_, y2_, y3_] = -1/2 y1 y3; a = 10; sol[b_] := NDSolve[{y1'[x] == f[y1[x], y2[x], y3[x]], y2'[x] == g[y1[x], y2[x], y3[x]], y3'[x] == h[y1[x], y2[x], y3[x]], y1[0] == 0, y2[0] == 0, y3[0] == b}, {y1, y2, y3}, {x, 0, a}]; F[b_] := Module[{shoot}, shoot = sol[b]; out1 = First[Evaluate[y2[x] /. shoot /. x -> a]]]; shoot1 = FindRoot[F[b] - b1, {b, b2, b3}]; solution = sol[b /. shoot1] graph = Plot[y1'[x] /. solution, {x, 0, a}, PlotLabel -> llabel["Graph of y_2"], PlotRange -> All]; ****************************** Reza. ------------------------------------------------------------------------- Reza Malek-Madani Director of Research Research Office, MS 10m Phone: 410-293-2504 (FAX -2507) 589 McNair Road DSN: 281-2504 U.S. Naval Academy Nimitz Room 17 in ERC Annapolis MD 21402-5031 Email: research at usna.edu -------------------------------------------------------------------------- On Fri, 17 Nov 2000, Bill Bertram wrote: > > Jens-Peer Kuska <kuska at informatik.uni-leipzig.de> wrote in message > news:qDKQ5.1279$b16.93558 at ralph.vnet.net... > > Hi, > > > > did you have a differential equation too ? > > And not only the boundary conditions. Otherwise > > A=0, B=const is your solution. You realy need Mathematica > > for that ? > > > > The original poster stated quite clearly that he was trying to solve two > non-linear ordinary DEs. It doesn't matter what these DEs are, Mathematica > V4 doesn't solve non-linear boudary value problems. > > Cheers, > > Bill > > > >