help-octave
[Top][All Lists]
Advanced

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

lsode problems


From: CarlB
Subject: lsode problems
Date: Sun, 24 Jul 2016 08:00:28 -0700 (PDT)

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



--
View this message in context: 
http://octave.1599824.n4.nabble.com/lsode-problems-tp4678790.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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