Runge-Kutta method for solving IVPs

  • Follow


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.


-- 
-- Philipp Emanuel Weidmann
0
Reply Philipp 7/13/2010 8:30:21 AM

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


On 13/07/2010 09:30, 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.
>
>

0
Reply Simon 7/13/2010 8:59:56 AM


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.


-- 
-- Philipp Emanuel Weidmann
0
Reply Philipp 7/13/2010 9:08:23 AM

You could try netlib :
http:://netlib.sandia.gov/ode/index.html

"lib: rksuite (tar)
alg: Runge-Kutta
for: initial value problem for first order ordinary differential equations A 
suite of codes for solving IVPs in ODEs. A choice of RK methods is 
available. Includes an error assessment facility and a sophisticated 
stiffness checker. Template programs and example results provided. 
Supersedes RKF45, DDERKF, D02PAF."

I found this reference using Google with    lang:fortran runge-kutta    in 
the search box
If you need other stuff it may help to cut down searches to use 
lang:fortran <search string(s)>
Les



"Philipp E. Weidmann" <philipp.weidmann@gmx.de> wrote in message 
news:i1hae9$el4$1@news.albasani.net...
> 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.
>
>
> -- 
> -- Philipp Emanuel Weidmann 

0
Reply Les 7/13/2010 10:10:20 AM

Les Neilson wrote:
> You could try netlib :
> http:://netlib.sandia.gov/ode/index.html
>
> "lib: rksuite (tar)
> alg: Runge-Kutta
> for: initial value problem for first order ordinary differential
> equations A suite of codes for solving IVPs in ODEs. A choice of RK
> methods is available. Includes an error assessment facility and a
> sophisticated stiffness checker. Template programs and example results
> provided. Supersedes RKF45, DDERKF, D02PAF."
>
> I found this reference using Google with lang:fortran runge-kutta in the
> search box
> If you need other stuff it may help to cut down searches to use
> lang:fortran <search string(s)>
> Les


Very helpful, thank you! I didn't know about the "lang:" modifier either.


-- 
-- Philipp Emanuel Weidmann
0
Reply Philipp 7/13/2010 10:20:26 AM

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
0
Reply mecej4 7/13/2010 3:01:57 PM

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.
0
Reply Gib 7/13/2010 8:39:51 PM

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
0
Reply Philipp 7/14/2010 9:58:34 AM

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
0
Reply Florian 7/14/2010 10:18:45 AM

> 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
0
Reply Arjan 7/14/2010 12:02:38 PM

On 13 jul, 10:30, "Philipp E. Weidmann" <philipp.weidm...@gmx.de>
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.
>
> --
> -- Philipp Emanuel Weidmann

ODEPACK and its predecessor (if I understand the history correctly)
LSODE
(both available on netlib) provide a wealth of methods to solve such
problems.
Chosing the most appropriate method is semi automated.

Regards,

Arjen
0
Reply Arjen 7/14/2010 12:18:21 PM

10 Replies
1024 Views

(page loaded in 0.078 seconds)

Similiar Articles:













7/20/2012 11:06:01 PM


Reply: