RK_Strob - Runge-Kutta-Fehlberg integrator
(reusable Pascal unit)


The integrator (RKF order 4-5) for ordinary differential equations with abstract handler is able to fetch the integration data upon request at user-defined moments.
Written in Borland Pascal under DOS, so the graphics in examples is DOS/Borland-specific. The main integration unit, however, should be understood by a number of Pascal compilers.
From algorithmic point of view, doesn't contain anything special - just as robust and good as the RKF is known to be.

Below is the interface part of the integrator.


    {--------------------------------------------------------------}
 UNIT RK_Strob; 
 {
 Main part of the Runge-Kutta integration package in Pascal 
 with stroboscopic tracing.

 Authors:
  Yuri Sadov <yu@bibigon.msk.ru>,
  Sergey Sadov <sadov@math.mun.ca>,
  Margo Kondrat'eva <margo@math.mun.ca>
   1990-1996
 }
 
 INTERFACE
     Uses Gennum; {real type and constants (e.g. Pi) are defined}

     type
       vectortype=array[1..RK_MaxDim] of realtype;

       proctype=procedure(t:realtype; var x,f:vectortype);

       tracer=procedure(var x:vectortype; var end_mark: word);
           {end_mark: if the tracer procedure sets it
                      to $FFFF than integration terminates.
                 For example if x[1] is time, then the tracer
                 can contain the code:
                   if (x[1]<t_end) then end_mark:=0
                   else end_mark:=$FFFF;
            }

     procedure RKF_STROB(N_VAR: integer; var Y:vectortype;
                 RightHandSide: proctype; StrobHandler: tracer;
                 Integration_Time: realtype);
    {
       N_VAR: number of dependent variables;
       Y: vector of variables;
       RightHandSide: vector-valued function, RHS of the ODE system;
       StrobHandler:  checks vector Y at each integration step
         and performs a prescribed action. For example,
         puts a dot onto trajectory projection at specified times.
       Integration_Time: limits the duration of integration.
         However, StrobHandler can terminate it earlier (see above).    
    }
    {--------------------------------------------------------------}
  

Details   User Manual - plain text

Download   full code and examples   (18 Kb zipped)


Sergey Sadov's home page
Software page
sergey@math.mun.ca