Table Of Contents

ODE Linear (System » Numeric) (G Dataflow)

Last Modified: December 18, 2017

Solves an n-dimension, homogeneous linear system of differential equations with solutions in numeric form.

connector_pane_image
datatype_icon

A

An n-by-n matrix that describes the linear system.

Requirements for Input Matrices

This node works properly for almost all cases of real matrices that have repeated eigenvalues, complex conjugate eigenvalues, and so on. The exception is the case of a singular eigenvector matrix, that is, a matrix in which the eigenvectors do not span the whole space. If the eigenvector matrix is singular, this node returns an error of -23016.

datatype_icon

initial values

Vector of the initial values of the variables.

The components of initial values correspond to the components of x.

datatype_icon

start time

Start time for solving the differential equations.

Default: 0

datatype_icon

end time

End time for solving the differential equations.

Default: 1

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

time step

Interval, in seconds, between the times at which this node evaluates the model and updates the model output.

Default: 0.1

datatype_icon

times

Points of time at which the node solves the differential equations. The method yields equidistant time steps between start time and end time.

datatype_icon

x

Values of the variables over time. Each row of x contains the values evaluated at a particular time and each column contains a history of a particular value over time.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Algorithm for Solving a System of Linear Differential Equation

Linear systems can be described by

d x ( t ) d t = A x ( t ) x ( 0 ) = x 0

where

  • x(t) is a vector
  • A is an n-by-n real matrix.

This node solves the linear system by the determination of the eigenvalues and eigenvectors of A. Let S be the set of all eigenvectors spanning the whole n-dimensional space. The transformation y(t) = Sx(t) yields:

d y ( t ) d t = S A S 1 y ( t ) y ( 0 ) = S x 0

The matrix SAS-1 has diagonal form. The solution x(t) can be determined by back-transformation: x(t) = S-1y(t).

To solve the following system of linear differential equations:

[ d x 1 ( t ) d t d x 2 ( t ) d t d x 3 ( t ) d t d x 4 ( t ) d t ] = [ 7 6 4 1 6 2 1 2 4 1 0 2 1 2 2 7 ] [ x 1 ( t ) x 2 ( t ) x 3 ( t ) x 4 ( t ) ]

with x1(0) = 1, x2(0) = 2, x3(0) = 3, and x4(0) = 4.

Enter the following values:

  • A: [-7, -6, 4, 1; -6, 2, 1, -2; 4, 1, 0, 2; -1, -2, 2, -7]
  • initial values: [1, 2, 3, 4]
  • start time: 0.00
  • end time: 1.00

The solution of this equation is as follows:

+ 1.62 e ( 12.46 t ) 1.28 e ( 6.30 t ) + 0.63 e ( 1.34 t ) + 0.04 e ( 5.42 t ) + 0.84 e ( 12.46 t ) 0.29 e ( 6.30 t ) + 1.51 e ( 1.34 t ) + 0.06 e ( 5.42 t ) 0.73 e ( 12.46 t ) + 0.01 e ( 6.30 t ) + 3.69 e ( 1.34 t ) + 0.02 e ( 5.42 t ) + 0.87 e ( 12.46 t ) + 2.67 e ( 6.30 t ) + 0.45 e ( 1.34 t ) + 0.01 e ( 5.42 t )

The following illustration shows the four components of the solution of the linear differential equation:

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics