NDSolve: Precision and Stability
- To: mathgroup at smc.vnet.net
- Subject: [mg42459] NDSolve: Precision and Stability
- From: owenqunwu at hotmail.com (Owen Wu)
- Date: Wed, 9 Jul 2003 08:24:31 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello,
In using NDSolve for 2nd-order Linear ODE IVP, I found that
Mathematica fails to achieve both high precision and stability. My
original problem is very complicated. To save your time, I constructed
the following example with explicit analytic solution to illustrate my
point. (Please just copy and paste the following lines.)
Result1=NDSolve[{-5-5x-V[x]-V'[x]+0.3V''[x]==0, V[0]==0, V'[0]==-5},
V, {x,0,10}]
Plot[Evaluate[V[x]/.Result1], {x,0,10}]
Result2=NDSolve[{-5-5x-V[x]-V'[x]+0.3V''[x]==0, V[0]==0, V'[0]==-5},
V, {x,0,10}, AccuracyGoal->5, PrecisionGoal->5]
Plot[Evaluate[V[x]/.Result2], {x,0,10}]
In this example, the correct answer should be V[x]=-5x. However,
Result1 explodes quickly when x becomes large. In Results2, I use a
low precision, which gives correct result. It seems that Mathematica
cannot achieve both precision and stability. (If expanding the range
to {x,0,20}, an even lower precision is needed for stability.)
I'd be very appreciate if you can share your experience.
Thanks,
Owen