Re: NDSolve: Precision and Stability
- To: mathgroup at smc.vnet.net
- Subject: [mg42479] Re: NDSolve: Precision and Stability
- From: bobhanlon at aol.com (Bob Hanlon)
- Date: Thu, 10 Jul 2003 03:37:03 -0400 (EDT)
- References: <beh277$qk2$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Extend the working precision Result1=NDSolve[{-5-5x-V[x]-V'[x]+0.3V''[x]==0,V[0]==0,V'[0]==-5}, V,{x,0,20}, WorkingPrecision->50]; Plot[Evaluate[V[x]/.Result1],{x,0,20}]; Bob Hanlon In article <beh277$qk2$1 at smc.vnet.net>, owenqunwu at hotmail.com (Owen Wu) wrote: << 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.)