# doc-cache created by Octave 4.0.0
# name: cache
# type: cell
# rows: 3
# columns: 8
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
ode23


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3561

 ode23 (v1.14) Integrates a system of ordinary differential equations using
 2nd & 3rd order Runge-Kutta formulas.  This particular 3rd-order method reduces
 to Simpson's 1/3 rule and uses the 3rd order estimate for xout.

 3rd-order accurate RK methods have local and global errors of O(h^4) and O(h^3),
 respectively and yield exact results when the solution is a cubic.

 The order of the RK method is the order of the local *truncation* error, d,
 which is the principle error term in the portion of the Taylor series
 expansion that gets dropped, or intentionally truncated.  This is different
 from the local error which is the difference between the estimated solution
 and the actual, or true solution.  The local error is used in stepsize
 selection and may be approximated by the difference between two estimates of
 different order, l(h) = x_(O(h+1)) - x_(O(h)).  With this definition, the
 local error will be as large as the error in the lower order method.
 The local truncation error is within the group of terms that gets multipled
 by h when solving for a solution from the general RK method.  Therefore, the
 order-p solution created by the RK method will be roughly accurate to O(h^(p+1))
 since the local truncation error shows up in the solution as h*d, which is
 h times an O(h^(p)) term, or rather O(h^(p+1)).
 Summary:   For an order-p accurate RK method,
            - the local truncation error is O(h^p)
            - the local error used for stepsize adjustment and that
              is actually realized in a solution is O(h^(p+1))

 This requires 3 function evaluations per integration step.

 Relevant discussion on step size choice can be found on pp.90,91 in
 U.M. Ascher, L.R. Petzold, Computer Methods for  Ordinary Differential Equations
 and Differential-Agebraic Equations, Society for Industrial and Applied Mathematics
 (SIAM), Philadelphia, 1998

 The error estimate formula and slopes are from
 Numerical Methods for Engineers, 2nd Ed., Chapra & Canale, McGraw-Hill, 1985

 Usage:
         [tout, xout] = ode23(FUN,tspan,x0,ode_fcn_format,tol,trace,count,hmax)

 INPUT:
 FUN   - String containing name of user-supplied problem description.
         Call: xprime = fun(t,x) where FUN = 'fun'.
         t      - Time (scalar).
         x      - Solution column-vector.
         xprime - Returned derivative COLUMN-vector; xprime(i) = dx(i)/dt.
 tspan - [ tstart, tfinal ]
 x0    - Initial value COLUMN-vector.
 ode_fcn_format - this specifies if the user-defined ode function is in
         the form:     xprime = fun(t,x)   (ode_fcn_format=0, default)
         or:           xprime = fun(x,t)   (ode_fcn_format=1)
         Matlab's solvers comply with ode_fcn_format=0 while
         Octave's lsode() and sdirk4() solvers comply with ode_fcn_format=1.
 tol   - The desired accuracy. (optional, default: tol = 1.e-6).
 trace - If nonzero, each step is printed. (optional, default: trace = 0).
 count - if nonzero, variable 'rhs_counter' is initalized, made global
         and counts the number of state-dot function evaluations
         'rhs_counter' is incremented in here, not in the state-dot file
         simply make 'rhs_counter' global in the file that calls ode23
 hmax  - limit the maximum stepsize to be less than or equal to hmax

 OUTPUT:
 tout  - Returned integration time points (column-vector).
 xout  - Returned solution, one solution column-vector per tout-value.

 The result can be displayed by: plot(tout, xout).

 Marc Compere
 CompereM@asme.org
 created : 06 October 1999
 modified: 27 June 2001



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80

 ode23 (v1.14) Integrates a system of ordinary differential equations using
 2n



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
ode45


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4672
 ode45 (v1.15) integrates a system of ordinary differential equations using
 4th & 5th order embedded formulas from Dormand & Prince or Fehlberg.

 The Fehlberg 4(5) pair is established and works well, however, the
 Dormand-Prince 4(5) pair minimizes the local truncation error in the
 5th-order estimate which is what is used to step forward (local extrapolation.)
 Generally it produces more accurate results and costs roughly the same
 computationally.  The Dormand-Prince pair is the default.

 This is a 4th-order accurate integrator therefore the local error normally
 expected is O(h^5).  However, because this particular implementation
 uses the 5th-order estimate for x_out (i.e. local extrapolation) moving
 forward with the 5th-order estimate should yield local error of O(h^6).

 The order of the RK method is the order of the local *truncation* error, d,
 which is the principle error term in the portion of the Taylor series
 expansion that gets dropped, or intentionally truncated.  This is different
 from the local error which is the difference between the estimated solution
 and the actual, or true solution.  The local error is used in stepsize
 selection and may be approximated by the difference between two estimates of
 different order, l(h) = x_(O(h+1)) - x_(O(h)).  With this definition, the
 local error will be as large as the error in the lower order method.
 The local truncation error is within the group of terms that gets multipled
 by h when solving for a solution from the general RK method.  Therefore, the
 order-p solution created by the RK method will be roughly accurate to O(h^(p+1))
 since the local truncation error shows up in the solution as h*d, which is
 h times an O(h^(p)) term, or rather O(h^(p+1)).
 Summary:   For an order-p accurate RK method,
            - the local truncation error is O(h^p)
            - the local error used for stepsize adjustment and that
              is actually realized in a solution is O(h^(p+1))

 This requires 6 function evaluations per integration step.

 Both the Dormand-Prince and Fehlberg 4(5) coefficients are from a tableu in
 U.M. Ascher, L.R. Petzold, Computer Methods for  Ordinary Differential Equations
 and Differential-Agebraic Equations, Society for Industrial and Applied Mathematics
 (SIAM), Philadelphia, 1998

 The error estimate formula and slopes are from
 Numerical Methods for Engineers, 2nd Ed., Chappra & Cannle, McGraw-Hill, 1985

 Usage:
         [t_out, x_out] = ode45(FUN,tspan,x0,pair,ode_fcn_format,tol,trace,count,hmax)

 INPUTS:
    FUN   - String containing name of user-supplied problem description.
            Call: xprime = fun(t,x) where FUN = 'fun'.
            t      - Time (scalar).
            x      - Solution column-vector.
            xprime - Returned derivative COLUMN-vector; xprime(i) = dx(i)/dt.
    tspan - [ tstart, tfinal ]
    x0    - Initial value COLUMN-vector.
    pair  - flag specifying which integrator coefficients to use:
               0 --> use Dormand-Prince 4(5) pair (default)
               1 --> use Fehlberg pair 4(5) pair
    ode_fcn_format - this specifies if the user-defined ode function is in
            the form:     xprime = fun(t,x)   (ode_fcn_format=0, default)
            or:           xprime = fun(x,t)   (ode_fcn_format=1)
            Matlab's solvers comply with ode_fcn_format=0 while
            Octave's lsode() and sdirk4() solvers comply with ode_fcn_format=1.
    tol   - The desired accuracy. (optional, default: tol = 1.e-6).
    trace - If nonzero, each step is printed. (optional, default: trace = 0).
    count - if nonzero, variable 'rhs_counter' is initalized, made global
            and counts the number of state-dot function evaluations
            'rhs_counter' is incremented in here, not in the state-dot file
            simply make 'rhs_counter' global in the file that calls ode45
    hmax  - limit the maximum stepsize to be less than or equal to hmax
    N_est_acc_steps - an estimate of how many accepted steps there may be;
                      used to preallocate memory for the [t_out,x_out] solutions

 OUTPUTS:
    t_out  - array of discretized times points (an Nsteps_acc by 1 column-vector).
    x_out  - solution, one solution row-vector per t_out-value (an Nsteps_acc by Nstates matrix)
    Nsteps_acc - total number of accepted integration steps + 1
    Nsteps_rej - total number of rejected integration steps

 The result can be displayed by: plot(t_out, x_out).

 The following relationship should hold after a completed run:
    rhs_counter == (Nsteps_acc-1+Nsteps_rej)*6+1

 Marc Compere
 CompereM@asme.org
 created : 06 October 1999
 modified: 03 July 2001



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 ode45 (v1.15) integrates a system of ordinary differential equations using
 4th



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
ode78


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3632
 ode78 (v1.14) Integrates a system of ordinary differential equations using
 7th order formulas.

 This is a 7th-order accurate integrator therefore the local error normally
 expected is O(h^8).  However, because this particular implementation
 uses the 8th-order estimate for xout (i.e. local extrapolation) moving
 forward with the 8th-order estimate will yield errors on the order of O(h^9).

 The order of the RK method is the order of the local *truncation* error, d,
 which is the principle error term in the portion of the Taylor series
 expansion that gets dropped, or intentionally truncated.  This is different
 from the local error which is the difference between the estimated solution
 and the actual, or true solution.  The local error is used in stepsize
 selection and may be approximated by the difference between two estimates of
 different order, l(h) = x_(O(h+1)) - x_(O(h)).  With this definition, the
 local error will be as large as the error in the lower order method.
 The local truncation error is within the group of terms that gets multipled
 by h when solving for a solution from the general RK method.  Therefore, the
 order-p solution created by the RK method will be roughly accurate to O(h^(p+1))
 since the local truncation error shows up in the solution as h*d, which is
 h times an O(h^(p)) term, or rather O(h^(p+1)).
 Summary:   For an order-p accurate RK method,
            - the local truncation error is O(h^p)
            - the local error used for stepsize adjustment and that
              is actually realized in a solution is O(h^(p+1))

 This requires 13 function evaluations per integration step.

 Relevant discussion on step size choice can be found on pp.90,91 in
 U.M. Ascher, L.R. Petzold, Computer Methods for  Ordinary Differential Equations
 and Differential-Agebraic Equations, Society for Industrial and Applied Mathematics
 (SIAM), Philadelphia, 1998

 More may be found in the original author's text containing numerous
 applications on ordinary and partial differential equations using Matlab:

     Howard Wilson and Louis Turcotte, 'Advanced Mathematics and 
     Mechanics Applications Using MATLAB', 2nd Ed, CRC Press, 1997


 [tout, xout] = ode78(FUN,tspan,x0,ode_fcn_format,tol,trace,count,hmax)

 INPUT:
 FUN   - String containing name of user-supplied problem description.
         Call: xprime = fun(t,x) where FUN = 'fun'.
         t      - Time (scalar).
         x      - Solution column-vector.
         xprime - Returned derivative COLUMN-vector; xprime(i) = dx(i)/dt.
 tspan - [ tstart, tfinal ]
 x0    - Initial value COLUMN-vector.
 ode_fcn_format - this specifies if the user-defined ode function is in
         the form:     xprime = fun(t,x)   (ode_fcn_format=0, default)
         or:           xprime = fun(x,t)   (ode_fcn_format=1)
         Matlab's solvers comply with ode_fcn_format=0 while
         Octave's lsode() and sdirk4() solvers comply with ode_fcn_format=1.
 tol   - The desired accuracy. (optional, default: tol = 1.e-6).
 trace - If nonzero, each step is printed. (optional, default: trace = 0).
 count - if nonzero, variable 'rhs_counter' is initalized, made global
         and counts the number of state-dot function evaluations
         'rhs_counter' is incremented in here, not in the state-dot file
         simply make 'rhs_counter' global in the file that calls ode78
 hmax  - limit the maximum stepsize to be less than or equal to hmax

 OUTPUT:
 tout  - Returned integration time points (row-vector).
 xout  - Returned solution, one solution column-vector per tout-value.

 The result can be displayed by: plot(tout, xout).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 ode78 (v1.14) Integrates a system of ordinary differential equations using
 7th



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
penddot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1033
 This is an example derivative function file that works
 with Octave or Matlab.
 The equations represent motion of a simple pendulum with damping.

 The plots created by pendulum.m show the angular position and velocity
 trajectories created by each different integrator.
 Position is the trace that reaches steady state at 0(rad)
 because of the gravity term, -m*g*l/2*sin(x(1)).
 Velocity reaches a steady state of zero because of the
 damping term, -b*x(2).

 Use ode45 to integrate these ODE's
 like this:
    [t,x] = ode45('penddot',tspan,IC);

 x is the state column vector and meant to be used only within this m-file
 This function is meant to return the derivatives of the state variable
 given the state vector and time.

 Structure:	xdot = [ x1dot, x2dot, ..., xNdot ]'

 eg.  ml^2*thetadd + b*thetad + m*g*l*sin(theta) = 0

	x(1) = theta
	x(2) = thetad 	( = x(1)dot )

 Convention: the lowest order states are first columnwise

 Marc Compere
 compere@mail.utexas.edu
 created : 06 October 1999
 modified: 23 October 2001



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 79
 This is an example derivative function file that works
 with Octave or Matlab.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
pendulum


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 458
 This integrates a set of ordinary differential equations (ODE) using 6 different
 ODE solvers.  The equations represent the dynamics of a simple pendulum.

 The integrators ode78.m, ode45.m, ode23.m, rk8fixed.m, rk4fixed.m, and rk2fixed.m
 all produce column vector output similar to Matlab.

 All integrators work in octave 2.1.32 and Matlab 5.3 with no modification.

 Marc Compere
 CompereM@asme.org
 created : 06 October 1999
 modified: 23 October 2001



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 This integrates a set of ordinary differential equations (ODE) using 6 differen



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
rk2fixed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1977
 rk2fixed (v1.14) integrates a system of ordinary differential equations using a
 2nd order Runge-Kutta formula called Ralston's method.
 This choice of 2nd order coefficients provides a minimum bound on truncation error.
 For more, see Ralston & Rabinowitz (1978) or 
 Numerical Methods for Engineers, 2nd Ed., Chappra & Cannle, McGraw-Hill, 1985

 2nd-order accurate RK methods have a local error estimate of O(h^3).

 rk2fixed() requires 2 function evaluations per integration step.

 Usage:
         [tout, xout] = rk2fixed(FUN, tspan, x0, Nsteps, ode_fcn_format, trace, count)

 INPUT:
 FUN    - String containing name of user-supplied problem derivatives.
          Call: xprime = fun(t,x) where FUN = 'fun'.
          t      - Time (scalar).
          x      - Solution column-vector.
          xprime - Returned derivative COLUMN-vector; xprime(i) = dx(i)/dt.
 tspan  - [ tstart, tfinal ]
 x0     - Initial value COLUMN-vector.
 Nsteps - number of steps used to span [ tstart, tfinal ]
 ode_fcn_format - this specifies if the user-defined ode function is in
          the form:     xprime = fun(t,x)   (ode_fcn_format=0, default)
          or:           xprime = fun(x,t)   (ode_fcn_format=1)
          Matlab's solvers comply with ode_fcn_format=0 while
          Octave's lsode() and sdirk4() solvers comply with ode_fcn_format=1.
 trace  - If nonzero, each step is printed. (optional, default: trace = 0).
 count  - if nonzero, variable 'rhs_counter' is initalized, made global
          and counts the number of state-dot function evaluations
          'rhs_counter' is incremented in here, not in the state-dot file
          simply make 'rhs_counter' global in the file that calls rk2fixed

 OUTPUT:
 tout  - Returned integration time points (row-vector).
 xout  - Returned solution, one solution column-vector per tout-value.

 The result can be displayed by: plot(tout, xout).

 Marc Compere
 CompereM@asme.org
 created : 06 October 1999
 modified: 19 May 2001



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 rk2fixed (v1.14) integrates a system of ordinary differential equations using a



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
rk4fixed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1709
 rk4fixed (v1.14) is a 4th order Runge-Kutta numerical integration routine.
 It requires 4 function evaluations per step.

 4th-order accurate RK methods have a local error estimate of O(h^5).


 Usage:
         [tout, xout] = rk4fixed(FUN, tspan, x0, Nsteps, ode_fcn_format, trace, count)

 INPUT:
 FUN    - String containing name of user-supplied problem derivatives.
          Call: xprime = fun(t,x) where FUN = 'fun'.
          t      - Time or independent variable (scalar).
          x      - Solution column-vector.
          xprime - Returned derivative COLUMN-vector; xprime(i) = dx(i)/dt.
 tspan  - [ tstart, tfinal ]
 x0     - Initial value COLUMN-vector.
 Nsteps - number of steps used to span [ tstart, tfinal ]
 ode_fcn_format - this specifies if the user-defined ode function is in
          the form:     xprime = fun(t,x)   (ode_fcn_format=0, default)
          or:           xprime = fun(x,t)   (ode_fcn_format=1)
          Matlab's solvers comply with ode_fcn_format=0 while
          Octave's lsode() and sdirk4() solvers comply with ode_fcn_format=1.
 trace  - If nonzero, each step is printed. (optional, default: trace = 0).
 count  - if nonzero, variable 'rhs_counter' is initalized, made global
          and counts the number of state-dot function evaluations
          'rhs_counter' is incremented in here, not in the state-dot file
          simply make 'rhs_counter' global in the file that calls rk4fixed

 OUTPUT:
 tout  - Returned integration time points (row-vector).
 xout  - Returned solution, one solution column-vector per tout-value.

 The result can be displayed by: plot(tout, xout).

 Marc Compere
 CompereM@asme.org
 created : 06 October 1999
 modified: 19 May 2001



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
 rk4fixed (v1.14) is a 4th order Runge-Kutta numerical integration routine.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
rk8fixed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1839
 rk8fixed (v1.14) is an 8th order Runge-Kutta numerical integration routine.
 It requires 13 function evaluations per step.  This is not the most
 efficient 8th order implementation.  It was just the easiest to put
 together as a variant from ode78.m.

 8th-order accurate RK methods have a local error estimate of O(h^9).


 Usage:
         [tout, xout] = rk8fixed(FUN, tspan, x0, Nsteps, ode_fcn_format, trace, count)

 INPUT:
 FUN    - String containing name of user-supplied problem derivatives.
          Call: xprime = fun(t,x) where FUN = 'fun'.
          t      - Time or independent variable (scalar).
          x      - Solution column-vector.
          xprime - Returned derivative COLUMN-vector; xprime(i) = dx(i)/dt.
 tspan  - [ tstart, tfinal ]
 x0     - Initial value COLUMN-vector.
 Nsteps - number of steps used to span [ tstart, tfinal ]
 ode_fcn_format - this specifies if the user-defined ode function is in
          the form:     xprime = fun(t,x)   (ode_fcn_format=0, default)
          or:           xprime = fun(x,t)   (ode_fcn_format=1)
          Matlab's solvers comply with ode_fcn_format=0 while
          Octave's lsode() and sdirk4() solvers comply with ode_fcn_format=1.
 trace  - If nonzero, each step is printed. (optional, default: trace = 0).
 count  - if nonzero, variable 'rhs_counter' is initalized, made global
          and counts the number of state-dot function evaluations
          'rhs_counter' is incremented in here, not in the state-dot file
          simply make 'rhs_counter' global in the file that calls rk4fixed

 OUTPUT:
 tout  - Returned integration time points (row-vector).
 xout  - Returned solution, one solution column-vector per tout-value.

 The result can be displayed by: plot(tout, xout).

 Marc Compere
 CompereM@asme.org
 created : 06 October 1999
 modified: 19 May 2001



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
 rk8fixed (v1.14) is an 8th order Runge-Kutta numerical integration routine.





