       Re: Mathematica question : Stepsize control

• To: mathgroup at smc.vnet.net
• Subject: [mg83409] Re: Mathematica question : Stepsize control
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Tue, 20 Nov 2007 03:41:38 -0500 (EST)
• Organization: Uni Leipzig
• References: <fhp1uf\$1h9\$1@smc.vnet.net>

```Hi,

switch to a solver (Method) that works for stiff systems,
this solver will take care about fast and slow components
and reduce the local error because the step size control will
only estimate the local error but you look for the global error
and the simplets way would be to request a higher precision.

Regards
Jens

Yannick Bartocci wrote:
> Hy,
> I would like to ask a question on your forum bout some Mathematica code I
> cannot solve.
>
> Here is a Riccati type equation I want to solve numerically :
>
> tend = 0.5*10^4;
> ktest = 10^(-8);
> h[t_, k_] = k + 10^(-6)*Cos[[Pi]/(2*tend)*t];
> equ = {f'[t]+(f[t])^2+h[t,ktest] == 0, f == 0.1};
> {ndsol, steps} = Reap[NDSolve[equ, f, {t, 1, tend}, MaxSteps -> \[Infinity],
> StepMonitor :> Sow[{t, f[t]}]]]
>
> this code gives diverging solution for f[t], but note that if
> tend = 10^2
> the solution is not diverging, which is what I want to reproduce for tend =
> 0.5*10^4 or larger.
>
> Actually the system I want to solve uses a more complicated h[t,ktest] as
> Interpolating function input which is slowly varying in the beginning but
> rapidly oscillating in the end. Initially it behaves like the system
> described above and gives NDSolve message ::ndsz.
>
> This clearly is a problem of stepsize control but which has to be adapted on
> the fast or slow behavior of the input function h[t,ktest].
>
> Can anybody help me to find out how to control stepsize for this problem?
> The mathod in NDSolve is by default Automatic.
>
> Thank you very much,
>
> Yan
>
>

```

• Prev by Date: Re: Basic Question about Mathematica
• Next by Date: Re: RandomChoice does not accept null weights
• Previous by thread: Mathematica question : Stepsize control
• Next by thread: Plot to Plot3D problem