# ODE Linear (N-Order » Symbolic) (G Dataflow)

Version:

Solves an nth order, homogeneous linear differential equation with solutions in symbolic form.

## A

Vector of coefficients of the different derivatives of a function x(t), starting with the coefficient of the lowest order term. The node assumes the coefficient of the highest order derivative to be equal to 1.

## initial values

Vector of the initial values of the variables.

## 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

## formula

Symbolic solution of the differential equation.

## 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 an N-Order Linear Differential Equation

Consider the n-order linear homogeneous differential equation:

${x}^{\left(n\right)}+{a}_{n-1}{x}^{\left(n-1\right)}+\dots +{a}_{1}{x}^{\left(1\right)}+{a}_{0}x=0$

with the following initial conditions:

$x\left(0\right)={x}_{00}\phantom{\rule{0ex}{0ex}}{x}^{\left(1\right)}\left(0\right)={x}_{10}\phantom{\rule{0ex}{0ex}}⋮\phantom{\rule{0ex}{0ex}}{x}^{\left(n-1\right)}\left(0\right)={x}_{\left(n-1\right)0}$

where

• a is the constant coefficient of the differential equation
• n is the highest order of the differential equation
• 0 is the start time of the ODE solver. x00 represents the value of x(t) when t=0. x(n-1)0 represents the (n-1)th derivative of x(t) when t = 0.

To solve the differential equation, let $x={e}^{\lambda t}$, leading to:

${\lambda }^{n}+{a}_{n-1}{\lambda }^{n-1}+\dots +{a}_{1}\lambda +{a}_{0}=0$
The n zeros of the above equation determine the structure of the solution of the ODE. If we have n distinct complex zeros ${\lambda }_{1},\dots {,\lambda }_{n}$, the general solution of the n-order differential equation can be expressed by
$x\left(t\right)={\beta }_{1}{e}^{{\lambda }_{1}t}+\dots +{\beta }_{n}{e}^{{\lambda }_{n}t}$

where ${\beta }_{1},\dots ,{\beta }_{n}$ are arbitrary constants and can be determined by the initial condition (t = 0).

When t = 0,

$x\left(0\right)={\beta }_{1}+\dots +{\beta }_{n}\phantom{\rule{0ex}{0ex}}{x}^{\left(1\right)}\left(0\right)={\beta }_{1}{\lambda }_{1}+\dots +{\beta }_{n}{\lambda }_{n}\phantom{\rule{0ex}{0ex}}⋮\phantom{\rule{0ex}{0ex}}{x}^{\left(n-1\right)}\left(0\right)={\beta }_{1}{{\lambda }_{1}}^{n-1}+\dots +{\beta }_{n}{{\lambda }_{n}}^{n-1}$
Note

If ${\lambda }_{1},\dots {,\lambda }_{n}$ are repeated eigenvalues, this node returns an error code of -23017.

To solve the differential equation x'' - 3x' + 2x = 0 with the initial conditions of x(0) = 2 and x'(0) = 3, enter A = [2, -3] and initial values = [2, 3].

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

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