ODE Solver VI

Owning Palette: Ordinary Differential Equations VIs

Requires: Full Development System

Solves ordinary differential equations with initial conditions of the following form: X'=F(X,t). You must manually select the polymorphic instance to use.

Use the pull-down menu to select an instance of this VI.

 Add to the block diagram  Find on the palette

ODE Solver main

data is a variant that you can use to pass arbitrary values to the ODE F(X,t) VI.
ODE F(X,t) is a strictly typed reference to the VI that implements the right-hand side of an ordinary differential equation dX/dt=F(X,t). Create this VI by starting from the VI template located in labview\vi.lib\gmath\ode.llb\ODE rhs.vit.

 Open template
x0 is the vector of initial values of the ODE states.
simulation parameters specifies the set of parameters used to configure the numerical solution of the differential equation.
Initial Time specifies the time at which to start the ordinary differential equation (ODE) solver. The default is 0.
Final Time is the time at which the ODE solver stops.
Time Step is the interval between the times at which the ODE solver evaluates the model and updates the model output, in seconds. LabVIEW uses this parameter only if you select a fixed step-size ODE solver.
Absolute Tolerance specifies the absolute tolerance the ODE solver uses to control the error.

For y' = f(y), the ODE solver maintains error ≈ |y| * relative tolerance + absolute tolerance.

LabVIEW uses this parameter only if you select a variable step-size solver. Variable step-size solvers use this error to adjust the step size. If the error is too large, the variable step-size solver reduces the step size. If the error is too small, the variable step-size solver increases the step size. Absolute tolerance is most significant when y is small.
Relative Tolerance specifies the relative tolerance the ODE solver uses to control the error.

For y' = f(y), the ODE solver maintains error ≈ |y| * relative tolerance + absolute tolerance.

LabVIEW uses this parameter only if you select a variable step-size solver. Variable step-size solvers use this error to adjust the step size. If the error is too large, the variable step-size solver reduces the step size. If the error is too small, the variable step-size solver increases the step size. Relative tolerance is most significant when y is large.
Continuous Solver is the type of ODE solver used to evaluate the simulation diagram. The default is Runge-Kutta 45 (variable).

0Runge-Kutta 1 (Euler)
1Runge-Kutta 2
2Runge-Kutta 3
3Runge-Kutta 4
4Runge-Kutta 23 (variable)
5Runge-Kutta 45 (variable)
6BDF (variable)
7Adams-Moulton (variable)
8Rosenbrock (variable)
9Discrete States Only
Minimum Time Step specifies the smallest time step size the ODE solver can use to evaluate the simulation diagram. LabVIEW uses this parameter only if you select a variable step-size solver.
Maximum Time Step specifies the largest time step size the ODE solver can use to evaluate the simulation diagram. LabVIEW uses this parameter only if you select a variable step-size solver.
Initial Time Step specifies the time step size for the first time step of the simulation diagram evaluation. LabVIEW uses this parameter only if you select a variable step-size solver.
Discrete Time Step specifies the base time step to use for discrete functions, in seconds. The ODE solver might not evaluate a discrete function every Discrete Time Step. The ODE solver evaluates the discrete function and updates the function output every n discrete time steps, where n is the sample rate divisor parameter you specify for that function.
Note  If you select a fixed step-size solver, the Discrete Time Step must be an integer multiple of the Time Step. If you specify a Discrete Time Step that is not an integer multiple of the Time Step, LabVIEW displays a run-time error when you attempt to run the simulation.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
times is the array of points in time at which the differential equation solver stepped or was evaluated. If you select a fixed step-size solver, then times contains evenly spaced values.
outputs is a two-dimensional array of y values. Each row corresponds to the vector of y-values evaluated at a particular time. Each column is history of a particular y-value over time.
error out contains error information. This output provides standard error out functionality.

ODE Solver formula string

ODE RHS is a cluster of formula strings and variable strings that implements the right-hand-side of an ordinary differential equation X'=F(X,t).
F(X,t) is a 1D array of strings representing the right sides of the differential equations. The formulas can contain any number of valid variables.
X is an array of strings of variables. When naming these variables, you must use either one character only or one character and one number.
time is the string denoting the time variable. The default variable is t.
x0 is the vector of initial values of the ODE states.
simulation parameters specifies the set of parameters used to configure the numerical solution of the differential equation.
Initial Time specifies the time at which to start the ordinary differential equation (ODE) solver. The default is 0.
Final Time is the time at which the ODE solver stops.
Time Step is the interval between the times at which the ODE solver evaluates the model and updates the model output, in seconds. LabVIEW uses this parameter only if you select a fixed step-size ODE solver.
Absolute Tolerance specifies the absolute tolerance the ODE solver uses to control the error.

For y' = f(y), the ODE solver maintains error ≈ |y| * relative tolerance + absolute tolerance.

LabVIEW uses this parameter only if you select a variable step-size solver. Variable step-size solvers use this error to adjust the step size. If the error is too large, the variable step-size solver reduces the step size. If the error is too small, the variable step-size solver increases the step size. Absolute tolerance is most significant when y is small.
Relative Tolerance specifies the relative tolerance the ODE solver uses to control the error.

For y' = f(y), the ODE solver maintains error ≈ |y| * relative tolerance + absolute tolerance.

LabVIEW uses this parameter only if you select a variable step-size solver. Variable step-size solvers use this error to adjust the step size. If the error is too large, the variable step-size solver reduces the step size. If the error is too small, the variable step-size solver increases the step size. Relative tolerance is most significant when y is large.
Continuous Solver is the type of ODE solver used to evaluate the simulation diagram. The default is Runge-Kutta 45 (variable).

0Runge-Kutta 1 (Euler)
1Runge-Kutta 2
2Runge-Kutta 3
3Runge-Kutta 4
4Runge-Kutta 23 (variable)
5Runge-Kutta 45 (variable)
6BDF (variable)
7Adams-Moulton (variable)
8Rosenbrock (variable)
9Discrete States Only
Minimum Time Step specifies the smallest time step size the ODE solver can use to evaluate the simulation diagram. LabVIEW uses this parameter only if you select a variable step-size solver.
Maximum Time Step specifies the largest time step size the ODE solver can use to evaluate the simulation diagram. LabVIEW uses this parameter only if you select a variable step-size solver.
Initial Time Step specifies the time step size for the first time step of the simulation diagram evaluation. LabVIEW uses this parameter only if you select a variable step-size solver.
Discrete Time Step specifies the base time step to use for discrete functions, in seconds. The ODE solver might not evaluate a discrete function every Discrete Time Step. The ODE solver evaluates the discrete function and updates the function output every n discrete time steps, where n is the sample rate divisor parameter you specify for that function.
Note  If you select a fixed step-size solver, the Discrete Time Step must be an integer multiple of the Time Step. If you specify a Discrete Time Step that is not an integer multiple of the Time Step, LabVIEW displays a run-time error when you attempt to run the simulation.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
times is the array of points in time at which the differential equation solver stepped or was evaluated. If you select a fixed step-size solver, then times contains evenly spaced values.
outputs is a two-dimensional array of y values. Each row corresponds to the vector of y-values evaluated at a particular time. Each column is history of a particular y-value over time.
error out contains error information. This output provides standard error out functionality.