Table Of Contents

ODE Linear (N-Order » Numeric) (G Dataflow)

Version:
    Last Modified: March 15, 2017

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

    connector_pane_image
    datatype_icon

    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.

    datatype_icon

    initial values

    Vector of the initial values of the variables.

    The components of initial values corresponds 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 an N-Order Linear Differential Equation

    Consider the n-order linear homogeneous differential equation:

    x ( n ) + a n 1 x ( n 1 ) + + a 1 x ( 1 ) + a 0 x = 0

    with the following initial conditions:

    x ( 0 ) = x 00 x ( 1 ) ( 0 ) = x 10 x ( n 1 ) ( 0 ) = x ( n 1 ) 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 λ t , leading to:

    λ n + a n 1 λ n 1 + + a 1 λ + 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 λ 1 , , λ n , the general solution of the n-order differential equation can be expressed by
    x ( t ) = β 1 e λ 1 t + + β n e λ n t

    where β 1 , , β n are arbitrary constants and can be determined by the initial condition (t = 0).

    When t = 0,

    x ( 0 ) = β 1 + + β n x ( 1 ) ( 0 ) = β 1 λ 1 + + β n λ n x ( n 1 ) ( 0 ) = β 1 λ 1 n 1 + + β n λ n n 1
    spd-note-note
    Note  

    If λ 1 , , λ 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: This product does not support FPGA devices


    Recently Viewed Topics