MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: numerical_solution


Hi,

you can't know, because the solution has two numerical errors,
from rounding and more important from the method.
Since NDSolve[] has an local error control it should
keep the local error smaller than 10^(-PrecisionGoal) and
since it does it with both version the numerical quality
of the solutions is the same. If you don't have additional
information like "I wish to conserve the energy." or something
else solutions are equivalent.

But the runtime may be different for different methods and you
should use the method that offer the best performance.

Regards
   Jens

j. r. campanha wrote:
> Dear MathGroup people
> 
> 
> How can I know which is the best numerical solution?
> 
> 
> w == 6;
> A == 0.1;
> B == 0.17;
> F == 0.501;
> 
> solution1 == NDSolve[{x'[t] ==== v[t], v'[t] ==== -(B)*(v[t]) - (A)*(((x[t]=
> ))/(1 - (x[t])^2)) + (F)*(Cos[w*t]),x[0] ==== 0.4, v[0] ==== 0.3}, {x, v}, =
> {t, 260, 270}];
> 
> ParametricPlot[Evaluate[{x[t], v[t]} /. solution1], {t, 260, 270}, Frame ->=
>  True]
> 
> 
> OR
> 
> solution2 == NDSolve[{x'[t] ==== v[t], v'[t] ==== -(B)*(v[t]) - (A)*(((x[t]=
> ))/(1 - (x[t])^2)) + (F)*(Cos[w*t]),x[0] ==== 0.4, v[0] ==== 0.3}, {x, v}, =
> {t, 260, 270}, Method -> StiffnessSwitching];
> 
> 
> ParametricPlot[Evaluate[{x[t], v[t]} /. solution2], {t, 260, 270}, Frame ->=
>  True]
> 
> 
> 
> Jose R. Campanha
> UNESP-Physics Dpto
> Rio Claro - S=E3o Paulo
> Brasil
> 
> 


  • Prev by Date: Re: row,column question
  • Next by Date: Re: conditional plotstyles in ListPlot
  • Previous by thread: Re: numerical_solution
  • Next by thread: Re: numerical_solution