Message Boards Message Boards

NDSolve & IVP DIFFeq HELP :(

Posted 10 years ago
POSTED BY: Ashley Lombardi

You can use NDSolve like this

ode = y'[x] == Cos[x] - Exp[-y[x]];
ic = y[1] == 0;
sol = First[y /. NDSolve[{ode, ic}, y, {x, 0, 2}]]
Plot[sol[x], {x, 0, 2}]

To see what happens as the range changes:

Manipulate[
 Module[{sol},
  sol = First[y /. NDSolve[{ode, ic}, y, {x, 0, max}]];
  Plot[sol[x], {x, 0, max}]
  ],
 {{max, 2, "max limit"}, .1, 4, .01, Appearance -> "Labeled"},
 Initialization :>
  (
   ode = y'[x] == Cos[x] - Exp[-y[x]];
   ic = y[1] == 0
   )
 ]

You'll see the singularity after 2.0 show up.

enter image description here

POSTED BY: Nasser M. Abbasi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract