[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] questions about using GSL's ODE solver?
From: |
Frank Hrebabetzky |
Subject: |
Re: [Help-gsl] questions about using GSL's ODE solver? |
Date: |
Wed, 06 Jun 2007 09:42:36 -0300 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20060911) |
Hi Michael,
There is a fundamental difference between an analytical and a numerical
solution of an ODE. The analytical solution is an equation which you
evaluate just at the points you want to know. The numerical way is like
sitting in a car, starting to a trip and calculating from the
speedometer where you are. If you see '10 mph' 1 s after the start, and
you would deduce that you will have gone 10 miles after one hour, you
would be completely wrong. The more often you look and sum up v * Dt,
the better you know how far you have gone. The ODE solver has to
calculate a lot of intermediate points between the initial conditions
and the final point. Matlab does nothing else internally. For
computation time it is irrelevant how many of them you store in a vector
to look them up them later.
If you start at 0 and are interested in the points 1, 2, 3, ..., then of
course you wouldn't calculate these points starting again and again from
0, but you would use each point as starting point for the next one.
Excuse me if I am telling trivialities to you, but I had the impression
that you are missing some fundamental stuff.
--
Frank Hrebabetzky +55 / 48 / 3235 1106
Florianopolis, Brazil
Michael wrote:
> 1. In Matlab, I can provide a vector of times, and Matlab will return
> a vector of solutions at these specified times. Is there a way to do
> this in GSL ODE solver? I couldn't find a good way to handle this. I
> want to solve the system of ODEs at 5, 7, 9, 11 seconds, and I only
> want solutions at these points. How to do that? I hope I don't need to
> repeat to run the solver for different time points, otherwise that's
> just too slow. Time is critical to me.