Discrete State-Space Function

Simulation VI and Function

Discrete State-Space Function

Owning Palette: Discrete Linear Systems Functions

Installed With: Control Design and Simulation Module

Implements a system model in discrete state-space form. You define the system model by specifying the input, output, state, and direct transmission matrices.

Details  Example

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs
 Place on the block diagram  Find on the Functions palette

Dialog Box Options

ParameterDescription
Polymorphic instanceSpecifies whether this function is single-input single-output (SISO) or multiple-input multiple-output (MIMO). The default value is SISO.
FeedthroughConfigures the function to be either a Direct or Indirect feedthrough function. Enable this control by selecting a parameter from the Parameters list and then selecting Terminal from the Parameter source pull-down menu. If you select Configuration Dialog Box from the Parameter source pull-down menu, LabVIEW disables this control and calculates the feedthrough behavior automatically.

Refer to the Details section for a description of the parameters that determine the feedthrough behavior of this function.
ParametersLists all the parameters associated with this function. Select a parameter from this list to configure the parameter. When you select a parameter, the parameter and its associated Parameter source control appear in the Parameter Information section of the configuration dialog box.
PreviewDisplays a graphical preview, if available, of the function output or configuration.
Parameter InformationContains the parameters you can configure for this function. You must select a parameter from the Parameters list to make that parameter and its associated Parameter source control visible in the Parameter Information section of the configuration dialog box.
Parameter sourceSpecifies whether you configure this parameter using the Configuration Dialog Box or a Terminal on the simulation diagram. The default value is Configuration Dialog Box. If you select Terminal, LabVIEW displays an input for that parameter on the simulation diagram, and you can wire values to that input to configure this function programmatically. If you select Configuration Dialog Box, LabVIEW removes that input from the simulation diagram. You then must set the value for this parameter inside the configuration dialog box.
State-SpaceSpecifies the state-space model.
  • Load Model—Loads model information from a data file.
  • Save Model—Saves model information to a data file. This file is compatible with the Control Design VIs and functions.
  • Copy to Clipboard—Copies the current model definition to the clipboard. From the clipboard, you can paste the model on the block diagram or into another configuration dialog box of the same model form.
  • Paste from Clipboard—Pastes model information from the clipboard to the configuration dialog box.
  • Model Dimensions—Use this section to specify the number of inputs, states, and outputs of the system model.
    • Inputs—Specifies the number of model inputs.
    • States—Specifies the number of model states.
    • Outputs—Specifies the number of model outputs.
  • A—Specifies the n × n state matrix of the given system.
  • B—Specifies the n × m input matrix of the given system.
  • C—Specifies the r × n output matrix of the given system.
  • D—Specifies the r × m direct transmission matrix of the given system.
    wherem is the number of inputs
    n is the number of states
    r is the number of outputs
sample period (s)Specifies the length of the discrete time step, in seconds, of this function. The default value is –1.

If you enter a value of –1, this function inherits the discrete time step you specify for the simulation diagram. Otherwise, the value of sample period (s) must be a multiple of the discrete time step you specify for the simulation diagram.



This parameter is valid only when you place this function inside a Simulation Loop.
sample skew (s)Specifies the length of time by which you want to delay the execution of this function. The default value is 0.

The value of this parameter must satisfy the following relationship:



0 ≤ sample skew (s)sample period (s)

This parameter is valid only when you place this function inside a Simulation Loop.

initial state (x0)Specifies a vector of initial states for the system. This vector must be of length n, where n is the number of states.
reset?Sets the model state(s) to the values you specify in reset state (xr), when TRUE.
reset state (xr)Specifies the values to which to set the model state(s) when reset? is TRUE. The default is 0.

Block Diagram Inputs

ParameterDescription
sample period (s)Specifies the length of the discrete time step, in seconds, of this function. The default value is –1.

If you enter a value of –1, this function inherits the discrete time step you specify for the simulation diagram. Otherwise, the value of sample period (s) must be a multiple of the discrete time step you specify for the simulation diagram.



This parameter is valid only when you place this function inside a Simulation Loop.
sample skew (s)Specifies the length of time by which you want to delay the execution of this function. The default value is 0.

The value of this parameter must satisfy the following relationship:



0 ≤ sample skew (s)sample period (s)

This parameter is valid only when you place this function inside a Simulation Loop.

initial state (x0)Specifies a vector of initial states for the system. This vector must be of length n, where n is the number of states.
reset?Sets the model state(s) to the values you specify in reset state (xr), when TRUE.
reset state (xr)Specifies the values to which to set the model state(s) when reset? is TRUE. The default is 0.
input u(k)Specifies the input to the system. input u(k) must be a vector of length m, where m is the number of inputs.
State-SpaceSpecifies a state-space model. This input accepts either a block diagram constant or a model you created using the Control Design VIs and functions.

Block Diagram Outputs

ParameterDescription
state x(k+1)Returns the values of the model state(s) at time k + 1. The length of this vector is equal to the number of model states.
output y(k)Returns the current output of the system. This vector must be of length r, where r is the number of outputs.
state x(k)Returns a one-dimensional array that specifies the internal states. This array must be of length n, where n is the number of states. Each element of the array represents x[n].

Discrete State-Space Details

The following equations define the state-space system.

whereu is the input vector
y is the output vector
x is the state vector
Φ, Γ, C, D are the state-space matrices. Refer to the State-Space parameter help for more information about these matrices.

If you place this function outside a Simulation Loop, tk = k * Sampling Time (s), for k = 0, 1, 2, ….

If you place this function inside a Simulation Loop, tk = initial time + sample skew (s) + k * sample period (s), for k = 0, 1, 2, …

Feedthrough Behavior

The value you specify for the D matrix of the State-Space parameter determines the feedthrough behavior of this function.

  • If the D matrix is nonzero, all input/output pairs have direct feedthrough behavior.
  • If the D matrix is zero, the following input/output pairs have indirect feedthrough behavior.
    • input u(k)output y(k)
    • input u(k)state x(k)
    The remaining input/output pairs have direct feedthrough behavior.

When you use the configuration dialog box to configure the D matrix, LabVIEW verifies that the feedthrough behavior is correct. For example, if you set the Feedthrough parameter to Indirect, and you set the D matrix to nonzero, LabVIEW changes the Feedthrough parameter to Direct.

If you specify the value of the D matrix programmatically by wiring a value to the parameter terminal, LabVIEW does not adjust the feedthrough behavior for you. You must ensure that you specify the proper feedthrough behavior for the value of the D matrix that you specify.

Example

Refer to the SimEx discrete state space VI in the labview\examples\Control and Simulation\Simulation\Discrete Linear directory for an example of using the Discrete State-Space VI.

 Open example  Browse related examples