Skip to Main Content Skip to Search
Product Documentation

Discrete State-Space - Implement discrete state-space system

Library

Discrete

Description

Block Behavior for Non-Empty Matrices

The Discrete State-Space block implements the system described by

where u is the input, x is the state, and y is the output. The matrix coefficients must have these characteristics, as illustrated in the following diagram:

The block accepts one input and generates one output. The width of the input vector is the number of columns in the B and D matrices. The width of the output vector is the number of rows in the C and D matrices. To define the initial state vector, use the Initial conditions parameter.

To specify a vector or matrix of zeros for A, B, C, D, or Initial conditions, use the zeros function.

Block Behavior for Empty Matrices

When the matrices A, B, and C are empty (for example, []), the functionality of the block becomes y(n) = Du(n). If the Initial conditions vector is also empty, the block uses an initial state vector of zeros.

Data Type Support

The Discrete State Space block accepts and outputs a real signal of type single or double. For more information, see Data Types Supported by Simulink in the Simulink documentation.

Parameters and Dialog Box

The Main tab of the Discrete State-Space block dialog box appears as follows:

A, B, C, D

Specify the matrix coefficients, as defined in the Description section.

Initial conditions

Specify the initial state vector. The default value is 0. Simulink does not allow the initial states of this block to be inf or NaN.

Sample time (–1 for inherited)

Specify the time interval between samples. See How to Specify the Sample Time in the Simulink documentation.

The State Attributes tab of the Discrete State-Space block dialog box appears as follows:

State name

Use this parameter to assign a unique name to the block state. The default is ' '. When this field is blank, no name is assigned. Consider the following when using this parameter:

  • A valid identifier starts with an alphabetic or underscore character, followed by alphanumeric or underscore characters.

  • The state name applies only to the selected block.

This parameter enables State name must resolve to Simulink signal object when you click Apply.

For more information, see States in the Simulink Coder documentation.

State name must resolve to Simulink signal object

Select this check box to require that the state name resolve to a Simulink signal object. This check box is cleared by default.

State name enables this parameter.

Selecting this check box disables Code generation storage class.

Package

Select a package that defines the custom storage class you want to apply. If you have defined any packages of your own, click Refresh. This action adds all user-defined packages on your search path to the package list.

Code generation storage class

From the list, select a state storage class.

Auto

Auto is the storage class to use for states that do not need to interface to external code.

ExportedGlobal

The state is stored in a global variable.

ImportedExtern

model_private.h declares the state as an extern variable.

ImportedExternPointer

model_private.h declares the state as an extern pointer.

State name enables this parameter.

Setting this parameter to ExportedGlobal, ImportedExtern, or ImportedExternPointer enables Code generation storage type qualifier.

Code generation storage type qualifier

Specify a Simulink Coder storage type qualifier. The default is ' '. When this field is blank, no qualifier is assigned.

The Simulink Coder product does not check this string for errors; what you enter appears automatically in the variable declaration.

Setting Code generation storage class to ExportedGlobal, ImportedExtern, or ImportedExternPointer enables this parameter.

During simulation, the block uses the following values:

For more information, see States in the Simulink Coder documentation.

Characteristics

Direct Feedthrough

Only if D ≠ 0

Sample Time

Specified in the Sample time parameter

Scalar Expansion

Yes, of the initial conditions

States

Determined by the size of A

Dimensionalized

Yes

Zero-Crossing Detection

No

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS