[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


  running this with GNU Octave:

## ode.m --

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;

function df_dyt = jaco (y, t)
  global tau
  df_dyt(1) = -1/tau;
  df_dyt(2) = 0;

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

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"

reply via email to

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