On Fri, Oct 5, 2012 at 2:23 AM, t t <

[hidden email]> 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

>

[hidden email]
>

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/_______________________________________________

Help-octave mailing list

[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave