de solvers and richardson extrapolation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

de solvers and richardson extrapolation

Sashan Govender
Hi

I downloaded quantlib and had a look at the euler solver
(expliciteuler.hpp) but all I can find is the interface to the class.
I can't find the implementation, the code that does f(x + h) = h*f'(x)
+ f(x). I've implemented some numercial ode solvers in some work I did at
university in physically based animation and am curious about applications in
financial mathematics.

I had a look at the todo list and it mentioned richardson
extrapolation. I have rough plan for implementing this so that it can
handle any solver (ie. Euler, RK4 etc...). The basic idea is that the
solver classes define methods that return the value of the
approximation A (see
http://en.wikipedia.org/wiki/Richardson_extrapolation for definition)
and the class that performs Richardson's extrapolation defines a
method to apply the recurrance relation (defined in the above link)
for a single time step. Since the approximation A differs depending on
the type of the solver used this approach will not constrict the class
that implements the Richardson extrapolation to a specific ODE solver.

I can detail this approach with some C++ code hopefully sometime soon.

--
sashan
http://sashang.orcon.net.nz


Reply | Threaded
Open this post in threaded view
|

Re: de solvers and richardson extrapolation

Luigi Ballabio
On Wed, 2007-01-03 at 15:10 +1300, Sashan Govender wrote:
> I downloaded quantlib and had a look at the euler solver
> (expliciteuler.hpp) but all I can find is the interface to the class.
> I can't find the implementation, the code that does f(x + h) = h*f'(x)
> + f(x).

Hi Sashan,
        explicit and implicit Euler schemes are degenerate cases of the mixed
implicit/explicit scheme implemented in mixedscheme.hpp. The only thing
that the explicit-Euler class does is inherit from MixedScheme and
forward its parameters to the base class constructor.


> I had a look at the todo list and it mentioned richardson
> extrapolation. I have rough plan for implementing this so that it can
> handle any solver (ie. Euler, RK4 etc...).
[snipped]
> I can detail this approach with some C++ code hopefully sometime soon.

Yes, please do.

Later,
        Luigi


----------------------------------------

Prediction is very difficult, especially if it's about the future.
-- Niels Bohr




Reply | Threaded
Open this post in threaded view
|

Re: de solvers and richardson extrapolation

Sashan Govender
On 1/4/07, Luigi Ballabio <[hidden email]> wrote:

> On Wed, 2007-01-03 at 15:10 +1300, Sashan Govender wrote:
> > I downloaded quantlib and had a look at the euler solver
> > (expliciteuler.hpp) but all I can find is the interface to the class.
> > I can't find the implementation, the code that does f(x + h) = h*f'(x)
> > + f(x).
>
> Hi Sashan,
>         explicit and implicit Euler schemes are degenerate cases of the mixed
> implicit/explicit scheme implemented in mixedscheme.hpp. The only thing
> that the explicit-Euler class does is inherit from MixedScheme and
> forward its parameters to the base class constructor.
>
>

Hi Luigi

Been looking at the code but I'm lost. How can I for example write
code that uses a forward euler method to approximate the solution the
ode y=y'. I've grepped the test-suite for an explicit euler example
but found none.

Thanks