Re: False divergence of the NDSolve solution: how to avoid
- To: mathgroup at smc.vnet.net
- Subject: [mg101781] Re: [mg101771] False divergence of the NDSolve solution: how to avoid
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Fri, 17 Jul 2009 05:01:49 -0400 (EDT)
- References: <200907161221.IAA02662@smc.vnet.net>
Alexei Boulbitch wrote:
> Dear Community,
>
> I am simulating a system of ODE using v6. Here are the equations:
>
> eq1 = x'[t] == y[t];
> eq2 = y'[t] == 1/x[t] - 1.4 - (4.5 + y[t])*(1 + z[t]^2);
> eq3 = z'[t] == 18*z[t] - 0.75*(4.5 + y[t])^2*z[t] - z[t]^3;
>
> It is simulated at x>0. This system at x>0 seems to be globally stable.
> To understand it observe that at large x, y, and z one finds
> y' ~ - y*z^2 and z' ~ - z^3. In other words, there is a kind of a
> non-linear "returning force" for y and z, while x follows the dynamics
> of y.
>
> However, when solving it on Mathematica I sometimes find trajectories
> that counterintuitively diverge.
> Check this for example:
>
> NDSolve[{eq1, eq2, eq3, x[0] == 0.669, y[0] == 0.881,
> z[0] == 0.988}, {x, y, z}, {t, 0, 40}];
>
> Plot[{Evaluate[x[t] /. s], Evaluate[y[t] /. s],
> Evaluate[z[t] /. s]}, {t, 0, 45}, PlotRange -> All,
> PlotStyle -> {Red, Green, Blue},
> AxesLabel -> {Style["t", 16], Style["x, y, z", 16]}]
>
> My guess is that this is due to some peculiarity in the numeric method
> used, and the method should be probably changed, or its parameters
> specified. I am however, not experienced in numeric approaches for
> solving ODEs.
>
> Now comes the question:
> Can you give me a hint, of
> (i) what may be the reason of such a behavior?
> and
> (ii) What should I do to avoid such a false divergence?
>
> Thank you, Alexei
I see the following message.
NDSolve::mxst: Maximum number of 10000 steps reached at the point t ==
27.978395024740337`. >>
When I then restrict the plot to t from 0 to 28, I see more sensible
oscillatory behavior.
Alternatively, calling NDSolve with the setting MaxSteps -> 20000 allows
the computation to proceed without warning, and the plot to t=40 looks
fine. Since you only compute the solution to t=40, plotting to 45 is a
bad idea (it will blindly extrapolate, and thats where the bad "growth"
phenomenon appears).
Daniel Lichtblau
Wolfram Research
- References:
- False divergence of the NDSolve solution: how to avoid
- From: Alexei Boulbitch <Alexei.Boulbitch@iee.lu>
- False divergence of the NDSolve solution: how to avoid