help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with equation


From: Juan Pablo Carbajal
Subject: Re: help with equation
Date: Fri, 5 Oct 2012 08:42:51 +0200

On Fri, Oct 5, 2012 at 2:23 AM, t t <address@hidden> wrote:
> Hi, everyone!
> Thank you for your attention.
> I got to solve numerically higly non-linear equation and get the following
> error.
> I use Octave 3.6.3 and lsode seemingly is the only included ode.
> Best wishes, lan
>
>
> function xdot = f (x, t);
> ep=0.000001;
> si=-1;
> a=2;
> C=100;
> xdot = [x(2),
> -ep/si*(-a*x(1)^(a-1)+C+2*si/t*tanh(x(2)/ep))*cosh(x(2)/ep)^2]';
> endfunction
> x0 = [100; 1]';
> t = linspace(1, 12, 10000)';
> lsode_options ("integration method", "stiff")
> x = lsode ("f", x0, t);
> plot(x(:,1), t);
> print -deps R.ep
>
> LSODE-- WARNING..INTERNAL T (=R1) AND H (=R2) ARE
> SUCH THAT IN THE MACHINE, T + H = T ON THE NEXT STEP
> (H = STEP SIZE). SOLVER WILL CONTINUE ANYWAY
> In above, R1 = 0.1000000000000D+01 R2 = 0.0000000000000D+00
> LSODE-- AT T (=R1) AND STEP SIZE H (=R2), THE
> CORRECTOR CONVERGENCE FAILED REPEATEDLY
> OR WITH ABS(H) = HMIN
> In above, R1 = 0.1000000000000D+01 R2 = 0.0000000000000D+00
> error: lsode: repeated convergence failures (t = 1; perhaps bad Jacobian
> supplied or wrong choice of integration method or tolerances)
> error: called from:
>
>
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>

hi,
You can try the following.

0. Are there singularities in the equation?
1. Provide a Jacobian.
2. Choose a suitable "integration method"' (for example "bdf").
3. Try reducing the time step.

How to do all this is explained in "help lsode" or "doc lsode".

If everything fails try the Runge-Kutta integrators in the package
odepkg available from Octave Forge. Remember, providing Jacobian will
help the integrator produce better solutions if they exist.

-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]