|
From: | 이태훈 |
Subject: | Integration code |
Date: | Wed, 15 Apr 2020 15:57:08 +0200 |
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. I use the code https://octave.org/doc/v5.2.0/Simple-Examples.html#Integrating-Differential-Equations from here. function x dot =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 |
[Prev in Thread] | Current Thread | [Next in Thread] |