RK2:

Path: Math/Integration

% Second order Runge-Kutta. 
 Called function is of the form:

   Fun(x,{t,p1,p2,...})

 Accepts optional arguments that are passed through to Fun.
 Time is also optional.
 
--------------------------------------------------------------------------
   Form:
   x = RK2( Fun, x, h, t, varargin )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   Fun                Function    Fun(x,{t,...})
   x                  State (column vector)
   h                  Independent variable step
   t                  Current time
   varargin           Optional arguments

   -------
   Outputs
   -------
   x                  Updated state

--------------------------------------------------------------------------

Back to the Math Module page