📜 ⬆️ ⬇️

An overview of the available libraries for the numerical solution of rigid ODEs



Creating supplements to the national mathematical program SMath Studio , I found a number of libraries in the network that could be used in my programs. I offer a small review of them.

A standard fixed-pitch RK45 can help in most cases, but there are tasks where this is not enough. To solve rigid systems, special solvers were invented, which we will consider from the point of view of their practical use.

Most of the functions presented below, unless otherwise specified, can be reduced to the same call format (similar to Mathcad):
')
ode_solver( init, x1, x2, intvls, D(t, x) ) 

Where:

1. Intel ODE Solvers Library


It contains the following functions: rkm9st (), mk52lfn (), mk52lfa (), rkm9mkn (), rkm9mka ().


The library is written in C with all the ensuing dependencies. The 32-bit and 64-bit versions of the library are available (libiode_ia32.lib and libiode_intel64.lib).

intel_ode.h
 /******************************************************************************* ! INTEL CONFIDENTIAL ! Copyright(C) 2007-2008 Intel Corporation. All Rights Reserved. ! The source code contained or described herein and all documents related to ! the source code ("Material") are owned by Intel Corporation or its suppliers ! or licensors. Title to the Material remains with Intel Corporation or its ! suppliers and licensors. The Material contains trade secrets and proprietary ! and confidential information of Intel or its suppliers and licensors. The ! Material is protected by worldwide copyright and trade secret laws and ! treaty provisions. No part of the Material may be used, copied, reproduced, ! modified, published, uploaded, posted, transmitted, distributed or disclosed ! in any way without Intel's prior express written permission. ! No license under any patent, copyright, trade secret or other intellectual ! property right is granted to or conferred upon you by disclosure or delivery ! of the Materials, either expressly, by implication, inducement, estoppel or ! otherwise. Any license under such intellectual property rights must be ! express and approved by Intel in writing. ! !****************************************************************************** ! ! Header file for Intel(R) ODE Solvers ! !*******************************************************************************/ #ifndef _INTEL_ODE_H_ #define _INTEL_ODE_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ void dodesol(int*,int*,double*,double*,double*,void*,void*,\ double*,double*,double*,double*,double*,int*,int*); void dodesol_rkm9st(int*,int*,double*,double*,double*,void*,\ double*,double*,double*,double*,double*,int*); void dodesol_mk52lfn(int*,int*,double*,double*,double*,void*,\ double*,double*,double*,double*,double*,int*,int*); void dodesol_mk52lfa(int*,int*,double*,double*,double*,void*,void*,\ double*,double*,double*,double*,double*,int*,int*); void dodesol_rkm9mkn(int*,int*,double*,double*,double*,void*,\ double*,double*,double*,double*,double*,int*,int*); void dodesol_rkm9mka(int*,int*,double*,double*,double*,void*,void*,\ double*,double*,double*,double*,double*,int*,int*); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _INTEL_ODE_H_ */ 

The ODE Solvers add-on demonstrates working with this library from c # code.

References:
1. Intel® Ordinary Differential Equations Solver Library .
2. Sources supplements ODESolvers .

2. GNU Scientific Library (GSL)


It contains the following functions: rk2 (), rk4 (), rkf45 (), rkck (), rk8pd (), rk1imp (), rk2imp (), rk4imp (), bsimp (), msadams (), msbdf ().

Some of them require additional parameters for work (Jacobian). Those that I managed to lead to a general view:

Solvers for Non-Stiff Systems:


Rest:


To work with functions, a universal interface is used , where a specific type of solver sets the step function. The GNUScientificLibrary add- on demonstrates working with this library from c # code.

Not so easy to build a library under Windows. I used the instructions from one site, which is now unavailable. However, in the add-on repository you can find 32- and 64-bit versions of the dll lib for GSL 1.16. The entire library is located there, not just the ODE solvers.

References:
1. GSL. Ordinary Differential Equations .
2. Sources of supplement GNUScientificLibrary .

3. Matlab C ++ Math Library 2.1 (Win32)


Yes, you can use this old version of run-time libraries for calculations. Moreover, it can be installed along relative paths, i.e. You can simply put the contents of the original distribution (~ 28 MB in expanded form) next to your program. However, when calling functions, you will have to use SetCurrentDirectory () with a direct reference to the location of the "bin \ win32". I do this in my supplement.

It contains the following functions: ode23 (), ode45 (), ode113 (), ode15s (), ode23s ().


The MatlabCppMathLibrary add- on demonstrates working with this library from c # code.

References:
1. Ordinary Differential Equations .
2. MATLAB C ++ Math Library. User's Guide. Version 2.1 (pdf).
3. MATLAB C ++ Math Library. Reference. Version 2 (pdf).
4. MatlabCppMathLibrary add-on sources .

4. Octave C ++ Math Library (Win32)


Approximately the same as Matlab C ++ Math Library, but with its own cockroaches. Unfortunately, I only partially overcame my work with this library. The OctaveCppMathLibrary add- on demonstrates working with this library from c # code.

References:
1. Ordinary Differential Equations .
2. The sources of the OctaveCppMathLibrary add- on .

5. DotNumerics


It contains the following functions: AdamsMoulton (), ExplicitRK45 (), ImplicitRK5 (), GearsBDF (). This library is ported to .Net from Fortran. I liked her the most. It works quite quickly.

Solvers for Non-Stiff Systems:


Solvers for Stiff Systems:


There are many overloads for various function call formats. DotNumerics add- on demonstrates working with this library.

References:
1. DotNumerics .
2. Sources supplement DotNumerics .

How does the amplitude detector model look like in SMath Studio when solving an ODE using the GearsBDF () function:

SMath Studio

Update (07/12/2014).


6. boost :: odeint


It contains the following algorithms:


Live did not try, I can not show an example of use.

References:
1. Boost.Numeric.Odeint .
2. Stepper overview .

7. SADEL (Sets of Algebraic and Differential Equations solvers Library)


Live did not try, I can not show an example of use.

References:
1. About the library SADEL .
2. Comparison of modern solvers of rigid systems of ordinary differential equations with the C solvers of the SADEL library .

8. Solver A. G. Limonov


Live did not try, I can not show an example of use.

References:
1. Thesis. Development of two-stage Rosenbrock schemes with complex coefficients and their application in problems of modeling the formation of periodic nanostructures, 2010 .

Source: https://habr.com/ru/post/229435/


All Articles