[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] [ODE] GSL and Octave comparison
From: |
Marco Maggi |
Subject: |
[Help-gsl] [ODE] GSL and Octave comparison |
Date: |
Thu, 24 Aug 2006 21:24:58 +0200 |
Ciao,
running this with GNU Octave:
## ode.m --
1;
global tau E
tau = 0.2;
E = 100;
y0 = 2;
function dy_dt = func (y, t)
global tau E
dy_dt = -y/tau + E/tau;
endfunction
function df_dyt = jaco (y, t)
global tau
df_dyt(1) = -1/tau;
df_dyt(2) = 0;
endfunction
t = linspace(0, 1, 6)
y = lsode("func", y0, t)
y = lsode(["func"; "jaco"], y0, t)
### end of file
and then recomputing with GSL step function rk2
control function 'y' eps_abs = eps_rel = 0.001,
I get the following:
Octave 2.0 63.948 86.737 95.121 98.205 99.34
GSL 2.0 63.9515677057596
95.1300977711286
99.7654305379417
99.9982940106614
100.000868946582
They are different.
Trying with different GSL step and control functions
yields similar results. I can consider the two results
"equal" if a compare the two vectors, element by
element, with 'gsl_fcmp(...,..., 0.01)'.
I am still in the development stage, so I wonder if
there is on the Net a "tried and true" comparison
between GSL and Octave ODE solvers that I can take
to implement my test suite.
--
Marco Maggi
"They say jump!, you say how high?"
Rage Against the Machine - "Bullet in the Head"
- [Help-gsl] [ODE] GSL and Octave comparison,
Marco Maggi <=