help-octave
[Top][All Lists]
Advanced

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

Re: lsode problem


From: marco atzeri
Subject: Re: lsode problem
Date: Thu, 06 Sep 2012 17:19:56 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0

On 9/6/2012 2:17 PM, sassir wrote:
Hello i'm a real Ocatve newbie and have a problem with lsode.
i want to solve an ode of the form c*dx/dt= ax+b but somehow i have some
problem in using "lsode".
I get the following error messages:

error: `t' undefined near line 2 column 25
error: evaluating argument list element number 1
error: evaluating argument list element number 1
error: called from:
error:   f at line 2, column 3

I hope you can help and tell me what i did wrong!

http://octave.1599824.n4.nabble.com/file/n4643805/f.m f.m


Hi Sassir,
start with removing the comment in front of "t"

There are other typing mistakes, so
try with something like that:

-------------------------------------
function xdot = f(T2,t)

% Given Parameters
c = 6017.895;
Tamb = 293;
T1 = 7555.3551+Tamb;
z = 0.1;
u = z; % u in [0,22]
a = 16.8501;
b = 132245.6157;
% t=linspace(0,20,200);
xdot = (b -a*T2-u*(T1-Tamb))/c;
endfunction

% Set ODE solver options
% lsode_options("integration method","stiff");
% lsode_options("maximum step size",10);
t=[0:0.1:10]; %linspace(0,20,200);
T0=273+50;
y=lsode( "f",T0 , t);
plot(t,y)
-------------------------------------------

and adjust xdot to your real need.


reply via email to

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