From: mecej4 on
On 7/13/2010 4:08 AM, Philipp E. Weidmann wrote:
> Simon wrote:
>> I don't know about 'the best' but I do know that NAG provide very good
>> and well respected libraries. If you're in a university then it's likely
>> that you'll already have access to the library, otherwise as far as I
>> know it'll cost you; it isn't free software.
>>
>> Simon
>
>
> Indeed I have the NAG libraries, but they do much more than I actually
> need. Also, to make use of their Runge-Kutta implementation, you have to
> include not only the driver file D02BJF but also D02AGF and other
> dependencies. Since all I really need is a simple Runge-Kutta
> implementation, I'd prefer to use simpler code as well.
>
>
The standard RK4 algorithm, expressed in Butcher Tableau form, is

0 |
1/2 | 1/2
1/2 | 0 1/2
1 | 0 0 1
________________________________
1/6 1/3 1/3 1/6

As such, if you do not want features such as step-size control, which is
a reasonable thing to skip if the dependent variables have modest ranges
over the interval of integration, RK4 can be implemented in about ten to
twenty lines of code.

You can run the code twice, changing the step size and, if the two sets
of results agree to within your accuracy needs, you can call it a day.

-- mecej4
From: Gib Bogle on
Philipp E. Weidmann wrote:
> What is the best FORTRAN library for solving initial value problems (low
> number of dimensions, <10) based on ordinary differential equations
> using the Runge-Kutta method? The faster the discretization works the
> better, but besides that I don't have a lot of requirements. Any
> standard Runge-Kutta implementation should suffice.
>
> I welcome any suggestions and experiences.
>
>

I use rkf45, which seems to work well for my not-very-demanding requirements.
From: Philipp E. Weidmann on
Gib Bogle wrote:
> Philipp E. Weidmann wrote:
>> What is the best FORTRAN library for solving initial value problems
>> (low number of dimensions, <10) based on ordinary differential
>> equations using the Runge-Kutta method? The faster the discretization
>> works the better, but besides that I don't have a lot of requirements.
>> Any standard Runge-Kutta implementation should suffice.
>>
>> I welcome any suggestions and experiences.
>>
>>
>
> I use rkf45, which seems to work well for my not-very-demanding
> requirements.


Thank you, I'll have a look at it.

--
-- Philipp Emanuel Weidmann
From: Florian Buerzle on
Philipp E. Weidmann wrote:

> What is the best FORTRAN library for solving initial value problems (low
> number of dimensions, <10) based on ordinary differential equations
> using the Runge-Kutta method? The faster the discretization works the
> better, but besides that I don't have a lot of requirements. Any
> standard Runge-Kutta implementation should suffice.
>
> I welcome any suggestions and experiences.
>
>

You might consider also the collection on Ernst Hairer's homepage:

http://www.unige.ch/~hairer/software.html

There are lots of implementations, also for rather special problems.

Cheers,
FLorian
From: Arjan on
> Also, to make use of their Runge-Kutta implementation, you have to
> include not only the driver file D02BJF but also D02AGF and other
> dependencies.

No need to mess around with source-files:
Add "-lnag" to your compile-statement (assuming the compiler knows
where to find libnag.a,
otherwise add the path with "-L<pathname>).


> Since all I really need is a simple Runge-Kutta
> implementation, I'd prefer to use simpler code as well.

First try the example that is provided with NAG. Generally you only
have to
change a few lines to adapt it to your purpose.


Arjan
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: MR&C chp 14
Next: Cheap Wholesale A&F Long Sleeve