help-octave
[Top][All Lists]
Advanced

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

Re: Integration code


From: Doug Stewart
Subject: Re: Integration code
Date: Wed, 15 Apr 2020 10:06:52 -0400



On Wed, Apr 15, 2020 at 9:57 AM 이태훈 <address@hidden> wrote:
Hi.
I am relatively new to Octave and my problem is most likely rather trivial, so I apologise in advance.
I made a code for integrating a function. 
function x dot  =f(x,t)


this should be

function xdot= F(x,t)
   D  =1.1
    ka =3;
   z  =10
   umax=0.08
   km =3
   I0 =1
   xdot(1)= (-x(1).*(D)).+((umax.*((I0.*2.717^(-ka.*x(1)*z))./((I0.*(2.717^(-ka.*x(1)*z))).+km))).*x(1))
endfunction
>> x0=[1;2];
>> t= linspace (0,50,100)';
>> x= lsode ("f",x0,t);

But error appears:
warning: lsode: passing function body as a string is obsolete; please use anonymous functions
error: 'f' undefined near line 1 column 43
error: lsode: evaluation of user-supplied function failed
error: called from
    __lsode_fcn__to__ at line 1 column 41

Do you know what should I do for the anonymous function  ??? 
And how I define “f" ??? 
I tried to look the script on Octave, but couldn’t understand it. 
It would be nice if you show me some examples 
Best regards 
Tae hoon lee 



--
DASCertificate for 206392


reply via email to

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