help-octave
[Top][All Lists]
Advanced

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

Re: lsode problems


From: address@hidden
Subject: Re: lsode problems
Date: Mon, 25 Jul 2016 06:52:02 +0900 (JST)

--- gus.bergstralh
> I have been messing with lsode for a few days and I just can't get it to
> function without errors.
> *M-file:*
> clear all
> clc
> 
> % Time span
> tspan = [0 1]';
> 
> % Initial Conditions
> IC = [0 0]';
> 
> % ODE Solver
> [z,t] = lsode(@odem5,tspan,IC)
> 
> *Function*
> function zdot = odem5(z,t)
> 
> 
> %% if statement for step input f
> if t < 0 
>     f = 0
> elseif 0 < t >= .4
>     f = 600
> else 
>     f = 0
> endif
> 
> zdot = zeros(2,1);
> zdot(1) = z(2);
> zdot(2) = (-12*z(2) - 900*z(1) + .15*f);
> endfunction
> 
> *This returns the error:*
>  LSODE--  REPEATED CALLS WITH ISTATE = 1 AND TOUT = T (=R1)
>       In above message,  R1 =  0.0000000000000D+00
>  LSODE--  RUN ABORTED.. APPARENT INFINITE LOOP
> f = 0
> error: lsode: exception encountered in Fortran subroutine dlsode_
> error: called from
> 
> any help would be great,
> 
> Gus
>
In function, f  is not defined.

Tatsuro



reply via email to

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