SODE

Methods and Properties

{Defined in UNIT SODE.PAS} Example


This package contains a number of numerical ordinary differential equation solvers. Although its proper use is not trivial, it is probably easier than coding your own Runge Kutta numerical method or deriving an analytical solution.

In order to use a STools ODE sover you must do the following.

1) Code your ODE as a system of coupled first order functions of the form: rate_of_Variable:=Function(Variables);

2) Declare objects of type T_ODE and FuncArray.

3) Create and initialize the T_ODE object in the code. This is usually done in the FormCreate method.

4) Set the initial conditions for the variables and the T_ODE parameters such as maximum permissible error.

5) Call the appropriate T_ODE’s step function.

Every time the step method it called the variables will be advanced by one step. The T_ODE does not remember the past dynamics of the system. It is up to your program to save and display this dynamics—usually using an SGraph.

The tolerance property for variable step size ODE methods such as RK4V determines the accuracy of the solution. The default value is 1.0 E - 5. In addition, you must specify an error type . A constant absolute error type requires that the estimated error be less than 1.0 E-5 per step while a relative error requires that the estimated error divided by the norm of the variable be less then 1.0 e -5 (except close to a zero crossing where the norm of the variable is increased by approximately one step.) Example.