@deftypefn  {Command} {[@var{}] =} odebda (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{sol}] =} odebda (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{t}, @var{y}, [@var{xe}, @var{ye}, @var{ie}]] =} odebda (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])

This function file can be used to solve a set of stiff ordinary differential equations (ODEs) and stiff differential algebraic equations (DAEs). @code{odebda} is a wrapper file that uses Jeff Cash's Fortran solver @file{mebdfdae.f}. It uses an extended backward differentiation formula.

@var{fun} is a function handle, inline function, or string containing the name of the function that defines the ODE: @code{y' = f(t,y)}. The function must accept two inputs where the first is time @var{t} and the second is a column vector of unknowns @var{y}.

@var{trange} specifies the time interval over which the ODE will be evaluated, @var{init} contains the initial values of the states.

The optional fourth argument @var{ode_opt} specifies non-default options to the ODE solver. It is a structure generated by @code{odeset}.

If this function is called with no return argument then it plots the solution over time in a figure window while solving the set of IDEs that are defined in a function and specified by the function handle @var{fun}.

The function typically returns two outputs. Variable @var{t} is a column vector and contains the times where the solution was computed. The output @var{y} is a matrix in which each column refers to a different unknown of the problem and each row corresponds to a time in @var{t}. If @var{trange} specifies intermediate time steps, only those will be returned.

The output can also be returned as a structure @var{solution} which has a field @var{x} containing a row vector of times where the solution was evaluated and a field @var{y} containing the solution matrix such that each column corresponds to a time in @var{x}.

For example,
@example
function y = odepkg_equations_lorenz (t, x)
  y = [10 * (x(2) - x(1));
       x(1) * (28 - x(3));
       x(1) * x(2) - 8/3 * x(3)];
endfunction

vopt = odeset ("InitialStep", 1e-3, "MaxStep", 1e-1, \
               "OutputFcn", @@odephas3, "Refine", 5);
odebda (@@odepkg_equations_lorenz, [0, 25], [3 15 1], vopt);
@end example
@c @seealso{odepkg}
@end deftypefn

@deftypefn  {Command} {[@var{}] =} odebdi (@var{fun}, @var{trange}, @var{y0}, @var{dy0}, [@var{ode_opt}], [@var{P1}, @var{P2}, @dots{}])
@deftypefnx {Command} {[@var{sol}] =} odebdi (@var{fun}, @var{trange}, @var{y0}, @var{dy0}, [@var{ode_opt}], [@var{P1}, @var{P2}, @dots{}])
@deftypefnx {Command} {[@var{t}, @var{y}, [@var{xe}, @var{ye}, @var{ie}]] =} odebdi (@var{fun}, @var{trange}, @var{y0}, @var{dy0}, [@var{ode_opt}], [@var{P1}, @var{P2}, @dots{}])

This function file can be used to solve a set of stiff implicit differential equations (IDEs). @code{odekdi} is a wrapper file that uses Jeff Cash's Fortran solver @file{mebdfi.f}.

@var{fun} is a function handle, inline function, or string containing the name of the function that defines the ODE: @code{y' = f(t,y)}. The function must accept two inputs where the first is time @var{t} and the second is a column vector of unknowns @var{y}.

@var{trange} specifies the time interval over which the ODE will be evaluated, @var{y0} contains the initial values of the states, @var{dy0} contains the initial values of the derivatives.

The optional fourth argument @var{ode_opt} specifies non-default options to the ODE solver. It is a structure generated by @code{odeset}.

If this function is called with no return argument then it plots the solution over time in a figure window while solving the set of IDEs that are defined in a function and specified by the function handle @var{fun}.

The function typically returns two outputs. Variable @var{t} is a column vector and contains the times where the solution was computed. The output @var{y} is a matrix in which each column refers to a different unknown of the problem and each row corresponds to a time in @var{t}. If @var{trange} specifies intermediate time steps, only those will be returned.

The output can also be returned as a structure @var{solution} which has a field @var{x} containing a row vector of times where the solution was evaluated and a field @var{y} containing the solution matrix such that each column corresponds to a time in @var{x}.

For example,
@example
function res = odepkg_equations_ilorenz (t, y, yd)
  res = [10 * (y(2) - y(1)) - yd(1);
         y(1) * (28 - y(3)) - yd(2);
         y(1) * y(2) - 8/3 * y(3) - yd(3)];
endfunction

vopt = odeset ("InitialStep", 1e-3, "MaxStep", 1e-1, \
               "OutputFcn", @@odephas3, "Refine", 5);
odebdi (@@odepkg_equations_ilorenz, [0, 25], [3 15 1], \
        [120 81 42.333333], vopt);
@end example
@c @seealso{odekdi}
@end deftypefn

@deftypefn  {Command} {[@var{}] =} odekdi (@var{fun}, @var{trange}, @var{y0}, @var{dy0}, [@var{ode_opt}], [@var{P1}, @var{P2}, @dots{}])
@deftypefnx {Command} {[@var{sol}] =} odekdi (@var{fun}, @var{trange}, @var{y0}, @var{dy0}, [@var{ode_opt}], [@var{P1}, @var{P2}, @dots{}])
@deftypefnx {Command} {[@var{t}, @var{y}, [@var{xe}, @var{ye}, @var{ie}]] =} odekdi (@var{fun}, @var{trange}, @var{y0}, @var{dy0}, [@var{ode_opt}], [@var{P1}, @var{P2}, @dots{}])

This function file can be used to solve a set of stiff implicit differential equations (IDEs). @code{odekdi} is a wrapper file that uses the direct method (not the Krylov method) of Petzold's, Brown's, Hindmarsh's and Ulrich's Fortran solver @file{ddaskr.f}.

@var{fun} is a function handle, inline function, or string containing the name of the function that defines the ODE: @code{y' = f(t,y)}. The function must accept two inputs where the first is time @var{t} and the second is a column vector of unknowns @var{y}.

@var{trange} specifies the time interval over which the ODE will be evaluated, @var{y0} contains the initial values of the states, @var{dy0} contains the initial values of the derivatives.

The optional fourth argument @var{ode_opt} specifies non-default options to the ODE solver. It is a structure generated by @code{odeset}.

If this function is called with no return argument then it plots the solution over time in a figure window while solving the set of IDEs that are defined in a function and specified by the function handle @var{fun}.

The function typically returns two outputs. Variable @var{t} is a column vector and contains the times where the solution was computed. The output @var{y} is a matrix in which each column refers to a different unknown of the problem and each row corresponds to a time in @var{t}. If @var{trange} specifies intermediate time steps, only those will be returned.

The output can also be returned as a structure @var{solution} which has a field @var{x} containing a row vector of times where the solution was evaluated and a field @var{y} containing the solution matrix such that each column corresponds to a time in @var{x}.

For example,
@example
function res = odepkg_equations_ilorenz (t, y, yd)
  res = [10 * (y(2) - y(1)) - yd(1);
         y(1) * (28 - y(3)) - yd(2);
         y(1) * y(2) - 8/3 * y(3) - yd(3)];
endfunction

vopt = odeset ("InitialStep", 1e-3, "MaxStep", 1e-1, \
               "OutputFcn", @@odephas3, "Refine", 5);
odekdi (@@odepkg_equations_ilorenz, [0, 25], [3 15 1], \
        [120 81 42.333333], vopt);
@end example
@c @seealso{odebdi}
@end deftypefn

@deftypefn  {Command} {[@var{}] =} ode2r (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{sol}] =} ode2r (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{t}, @var{y}, [@var{xe}, @var{ye}, @var{ie}]] =} ode2r (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])

This function file can be used to solve a set of stiff ordinary differential equations (ODEs) and stiff differential algebraic equations (DAEs). This function file is a wrapper to Hairer's and Wanner's Fortran solver @file{radau.f}.

@var{fun} is a function handle, inline function, or string containing the name of the function that defines the ODE: @code{y' = f(t,y)}. The function must accept two inputs where the first is time @var{t} and the second is a column vector of unknowns @var{y}.

@var{trange} specifies the time interval over which the ODE will be evaluated, @var{y0} contains the initial values of the states.

The optional fourth argument @var{ode_opt} specifies non-default options to the ODE solver. It is a structure generated by @code{odeset}.

If this function is called with no return argument then it plots the solution over time in a figure window while solving the set of IDEs that are defined in a function and specified by the function handle @var{fun}.

The function typically returns two outputs. Variable @var{t} is a column vector and contains the times where the solution was computed. The output @var{y} is a matrix in which each column refers to a different unknown of the problem and each row corresponds to a time in @var{t}. If @var{trange} specifies intermediate time steps, only those will be returned.

The output can also be returned as a structure @var{solution} which has a field @var{x} containing a row vector of times where the solution was evaluated and a field @var{y} containing the solution matrix such that each column corresponds to a time in @var{x}.

For example,
@example
function y = odepkg_equations_lorenz (t, x)
  y = [10 * (x(2) - x(1));
       x(1) * (28 - x(3));
       x(1) * x(2) - 8/3 * x(3)];
endfunction

vopt = odeset ("InitialStep", 1e-3, "MaxStep", 1e-1, \
               "OutputFcn", @@odephas3, "Refine", 5);
ode2r (@@odepkg_equations_lorenz, [0, 25], [3 15 1], vopt);
@end example
@c @seealso{odepkg}
@end deftypefn

@deftypefn  {Command} {[@var{}] =} ode5r (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{sol}] =} ode5r (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{t}, @var{y}, [@var{xe}, @var{ye}, @var{ie}]] =} ode5r (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])

This function file can be used to solve a set of stiff ordinary differential equations (ODEs) and stiff differential algebraic equations (DAEs). @code{ode5r} is a wrapper to Hairer's and Wanner's Fortran solver @file{radau5.f}. The method is based on the 3-stage Radau collocation method. It solves DAEs of the form @code{Mx' = f(t,y)}, where @code{M} is a constant, square matrix which may be singular. The code is applicable to problems of index 1,2,3. The higher-index variables must be identified by the user.

@var{fun} is a function handle, inline function, or string containing the name of the function that defines the ODE: @code{y' = f(t,y)}. The function must accept two inputs where the first is time @var{t} and the second is a column vector of unknowns @var{y}.

@var{trange} specifies the time interval over which the ODE will be evaluated, @var{y0} contains the initial values of the states, @var{dy0} contains the initial values of the derivatives.

The optional fourth argument @var{ode_opt} specifies non-default options to the ODE solver. It is a structure generated by @code{odeset}.

If this function is called with no return argument then it plots the solution over time in a figure window while solving the set of IDEs that are defined in a function and specified by the function handle @var{fun}.

The function typically returns two outputs. Variable @var{t} is a column vector and contains the times where the solution was computed. The output @var{y} is a matrix in which each column refers to a different unknown of the problem and each row corresponds to a time in @var{t}. If @var{trange} specifies intermediate time steps, only those will be returned.

The output can also be returned as a structure @var{solution} which has a field @var{x} containing a row vector of times where the solution was evaluated and a field @var{y} containing the solution matrix such that each column corresponds to a time in @var{x}.

For example,
@example
function y = odepkg_equations_lorenz (t, x)
  y = [10 * (x(2) - x(1));
       x(1) * (28 - x(3));
       x(1) * x(2) - 8/3 * x(3)];
endfunction

vopt = odeset ("InitialStep", 1e-3, "MaxStep", 1e-1, \
               "OutputFcn", @@odephas3, "Refine", 5);
ode5r (@@odepkg_equations_lorenz, [0, 25], [3 15 1], vopt);
@end example
@c @seealso{odepkg}
@end deftypefn

@deftypefn  {Loadable Function} {[@var{}] =} oders (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{sol}] =} oders (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{t}, @var{y}, [@var{xe}, @var{ye}, @var{ie}]] =} oders (@var{fun}, @var{trange}, @var{init}, [@var{ode_opt}], [@var{par1}, @var{par2}, @dots{}])

This function file can be used to solve a set of stiff ordinary differential equations (ODEs) and stiff differential algebraic equations (DAEs). This function file is a wrapper to Hairer's and Wanner's Fortran solver @file{rodas.f}. The algorithm uses a Rosenbrock method of order 4(3).

@var{fun} is a function handle, inline function, or string containing the name of the function that defines the ODE: @code{y' = f(t,y)}. The function must accept two inputs where the first is time @var{t} and the second is a column vector of unknowns @var{y}.

@var{trange} specifies the time interval over which the ODE will be evaluated, @var{y0} contains the initial values of the states, @var{dy0} contains the initial values of the derivatives.

The optional fourth argument @var{ode_opt} specifies non-default options to the ODE solver. It is a structure generated by @code{odeset}.

If this function is called with no return argument then it plots the solution over time in a figure window while solving the set of IDEs that are defined in a function and specified by the function handle @var{fun}.

The function typically returns two outputs. Variable @var{t} is a column vector and contains the times where the solution was computed. The output @var{y} is a matrix in which each column refers to a different unknown of the problem and each row corresponds to a time in @var{t}. If @var{trange} specifies intermediate time steps, only those will be returned.

The output can also be returned as a structure @var{solution} which has a field @var{x} containing a row vector of times where the solution was evaluated and a field @var{y} containing the solution matrix such that each column corresponds to a time in @var{x}.

For example,
@example
function y = odepkg_equations_lorenz (t, x)
  y = [10 * (x(2) - x(1));
       x(1) * (28 - x(3));
       x(1) * x(2) - 8/3 * x(3)];
endfunction

vopt = odeset ("InitialStep", 1e-3, "MaxStep", 1e-1, \
               "OutputFcn", @@odephas3, "Refine", 5);
oders (@@odepkg_equations_lorenz, [0, 25], [3 15 1], vopt);
@end example
@c @seealso{odepkg}
@end deftypefn

@deftypefn  {Command} {[@var{}] =} odesx (@var{@@fun}, @var{slot}, @var{init}, [@var{opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{sol}] =} odesx (@var{@@fun}, @var{slot}, @var{init}, [@var{opt}], [@var{par1}, @var{par2}, @dots{}])
@deftypefnx {Command} {[@var{t}, @var{y}, [@var{xe}, @var{ye}, @var{ie}]] =} odesx (@var{@@fun}, @var{slot}, @var{init}, [@var{opt}], [@var{par1}, @var{par2}, @dots{}])

This function file can be used to solve a set of stiff ordinary differential equations (ODEs) and stiff differential algebraic equations (DAEs). This function file is a wrapper to Hairer's and Wanner's Fortran solver @file{seulex.f}. Extrapolation method based on linearly implicit Euler for problems of the form @code{My' = f(t,y)} with possibly singular matrix @code{M}.

@var{fun} is a function handle, inline function, or string containing the name of the function that defines the ODE: @code{y' = f(t,y)}. The function must accept two inputs where the first is time @var{t} and the second is a column vector of unknowns @var{y}.

@var{trange} specifies the time interval over which the ODE will be evaluated, @var{y0} contains the initial values of the states.

The optional fourth argument @var{ode_opt} specifies non-default options to the ODE solver. It is a structure generated by @code{odeset}.

If this function is called with no return argument then it plots the solution over time in a figure window while solving the set of IDEs that are defined in a function and specified by the function handle @var{fun}.

The function typically returns two outputs. Variable @var{t} is a column vector and contains the times where the solution was computed. The output @var{y} is a matrix in which each column refers to a different unknown of the problem and each row corresponds to a time in @var{t}. If @var{trange} specifies intermediate time steps, only those will be returned.

The output can also be returned as a structure @var{solution} which has a field @var{x} containing a row vector of times where the solution was evaluated and a field @var{y} containing the solution matrix such that each column corresponds to a time in @var{x}.

For example,
@example
function y = odepkg_equations_lorenz (t, x)
  y = [10 * (x(2) - x(1));
       x(1) * (28 - x(3));
       x(1) * x(2) - 8/3 * x(3)];
endfunction

vopt = odeset ("InitialStep", 1e-3, "MaxStep", 1e-1, \
               "OutputFcn", @@odephas3, "Refine", 5);
odesx (@@odepkg_equations_lorenz, [0, 25], [3 15 1], vopt);
@end example
@c @seealso{odepkg}
@end deftypefn

