Groups | Search | Server Info | Login | Register


Groups > comp.soft-sys.octave > #8

lsode can take parameters as argument, like Matlab

From Tao Chen <tc.tao.chen@gmail.com>
Newsgroups comp.soft-sys.octave
Subject lsode can take parameters as argument, like Matlab
Date 2011-08-04 05:40 -0700
Organization http://groups.google.com
Message-ID <ba5f444d-9545-4d03-86b9-625fce894644@q5g2000yqj.googlegroups.com> (permalink)

Show all headers | View raw


I have repeated what was mentioned in the following thread and found
that lsode can take parameters as argument, just like Matlab.

http://groups.google.com/group/comp.soft-sys.octave/browse_thread/thread/de216b549a3dfef2/6864cab852d8e694?lnk=gst&q=lsode#6864cab852d8e694

For example,

---
function xdot = f (x, t, r, k)

#r = 0.25;
#k = 1.4;
a = 1.5;
b = 0.16;
c = 0.9;
d = 0.8;

xdot(1) = r*x(1)*(1 - x(1)/k) - a*x(1)*x(2)/(1 + b*x(1));
xdot(2) = c*a*x(1)*x(2)/(1 + b*x(1)) - d*x(2);

endfunction
---

and

x0 = [1; 2];
t = linspace (0, 50, 200)';
r = 0.25;
k = 1.4;
fd = @(x,t)f(x,t,r,k);
x = lsode (fd, x0, t);


which worked.

Why is this not documented in Octave manual?

Back to comp.soft-sys.octave | Previous | NextNext in thread | Find similar


Thread

lsode can take parameters as argument, like Matlab Tao Chen <tc.tao.chen@gmail.com> - 2011-08-04 05:40 -0700
  Re: lsode can take parameters as argument, like Matlab swagat <swagat.kumar@gmail.com> - 2017-01-05 05:05 -0800
    Re: lsode can take parameters as argument, like Matlab srinath3142@gmail.com - 2018-06-10 18:42 -0700

csiph-web