Contenuto principale

Descriptor State-Space

Model continuous linear system as system of implicit state-space equations

  • Descriptor State-Space block

Libraries:
Simulink / Continuous

Description

The Descriptor State-Space block models a continuous linear system as a system of differential equations expressed in the implicit form:

Ex˙=Ax+Buy=Cx+Du

where:

  • x is the state vector.

  • u is the input vector.

  • y is the output vector.

  • The matrices E, A, B, C, and D contain the coefficients of the terms in the system equations.

You can use the Descriptor State-Space block to model both time invariant and time variant linear implicit systems.

  • To model time invariant systems, specify the E, A, B, C, and D parameters as constant matrices.

  • To model time variant systems, tune the A, B, C, D, and E parameters during simulation. (since R2026a)

Specify System Matrices

To model your system, specify the system matrices using the E, A, B, C, and D parameters. You can specify either sparse or full matrices. By default, MATLAB® creates full matrices.

  • To convert a full matrix to a sparse matrix, use the sparse function.

  • To convert a sparse matrix to a full matrix, use the full function.

  • To determine whether a matrix is sparse, use the issparse function.

For more information, see Constructing Sparse Matrices.

The number of states, inputs, and outputs in the system determine the dimensions of the system matrices.

  • En-by-n, where n is the number of states in the system.

  • An-by-n, where n is the number of states in the system.

  • Bn-by-m, where:

    • n is the number of states in the system.

    • m is the number of system inputs.

  • Cr-by-n, where:

    • r is the number of system outputs.

    • n is the number of states in the system.

  • Dr-by-m, where:

    • r is the number of system outputs.

    • m is the number of system inputs.

Examples

Ports

Input

expand all

Input values must be real. The dimensions of the input signal must match the number of system inputs.

  • When the system has one input, connect a scalar signal.

  • When the system has multiple inputs, connect a vector signal that contains an element for each system input.

This port has direct feedthrough when:

  • You set the Direct Feedthrough parameter to True.

  • You set the Direct Feedthrough parameter to Auto and the software determines that the block has direct feedthrough.

Data Types: double

Output

expand all

The dimensions of the output signal match the number of system outputs.

  • When the system has one output, the block produces a scalar signal.

  • When the system has multiple outputs, the block produces a vector signal that contains an element for each system output.

Data Types: double

Parameters

expand all

Specify a matrix that:

  • Contains only real values.

  • Has dimensions n-by-n, where n is the number of states in the system.

The mass matrix can be singular or nonsingular.

  • When the mass matrix is singular, model the system using the Descriptor State-Space block. Because the mass matrix is not invertible, you cannot express the system equations in the explicit form.

  • When the mass matrix is nonsingular, you can model the system using either the Descriptor State-Space block or the State-Space block. Because the mass matrix is invertible, you can express the system equations in the explicit form, x˙=E1Ax+E1Bu.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: E
Values: '1' (default) | scalar | matrix
Data Types: string | char

Example: set_param("MyModel/Descriptor State-Space",E="[1 2;3 4]")

Specify a matrix that:

  • Contains only real values.

  • Has dimensions n-by-n, where n is the number of states in the system.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: A
Values: '1' (default) | scalar | vector | matrix
Data Types: string | char

Example: set_param("MyModel/Descriptor State-Space",A="[1 2;3 4]")

Specify a matrix that:

  • Contains only real values.

  • Has dimensions n-by-m, where n is the number of states in the system, and m is the number of system inputs.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: B
Values: '1' (default) | scalar | vector | matrix
Data Types: string | char

Example: set_param("MyModel/Descriptor State-Space",B="[1 2]")

Specify a matrix that:

  • Contains only real values.

  • Has dimensions r-by-n, where r is the number of system outputs, and n is the number of states in the system.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: C
Values: '1' (default) | scalar | vector | matrix
Data Types: string | char

Example: set_param("MyModel/Descriptor State-Space",C="[3 4]")

Specify a matrix that:

  • Contains only real values.

  • Has dimensions r-by-m, where r is the number of system outputs, and m is the number of system inputs.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: D
Values: '1' (default) | scalar | vector | matrix
Data Types: string | char

Example: set_param("MyModel/Descriptor State-Space",D="5")

To initialize the system, specify the initial values of states in the system. States cannot have Inf or NaN values.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: InitialCondition
Values: '0' (default) | scalar | vector | matrix
Data Types: string | char

Example: set_param("MyModel/Descriptor State-Space",InitialCondition="[2 3]")

Alternatively, use X0.

When the block implements a system with more than 500 continuous states, specifying whether the system has direct feedthrough can speed up block execution during simulation. A system has direct feedthrough if the value of at least one output signal directly depends on at least one input signal value.

  • True — The system has direct feedthrough.

  • False — The system does not have direct feedthrough.

  • Auto — The software determines whether the system has direct feedthrough based on the characteristics of the specified matrices.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: DirectFeedthrough
Values: 'True' (default) | "False" | "Auto"

Example: set_param("MyModel/Descriptor State-Space",DirectFeedthrough="False")

This parameter specifies how the software linearizes the system when you linearize the model that contains the block.

  • on — System linearized to sparse system

  • off — System linearized to nonsparse explicit state-space system

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: LinearizeToSparse
Values: 'off' (default) | "on"

Example: set_param("MyModel/Descriptor State-Space",LinearizeToSparse="on")

To model time variant systems, you can tune the system matrix parameters during simulation. This parameter specifies how the software represents the system matrix parameters in the compiled model or the simulation target for accelerator and rapid accelerator simulations.

  • Auto — The software determines how to represent tunable parameters by analyzing the system matrices.

  • Optimized — The software optimizes the parameter representation for simulation execution.

    This option improves performance but places additional restrictions on the values you can specify when you tune the parameters during simulation.

  • Unconstrained — The software does not optimize the parameter representation for simulation execution.

    This option places the fewest restrictions on the values you can specify when you tune the parameters during simulation.

The pattern of the mass matrix must remain fixed. When you tune the E parameter during simulation, only elements that have nonzero values in the initial matrix are tunable.

The values you can specify when you tune the A, B, C, and D parameters depend on whether you specify the initial value as a sparse or full matrix and the value of this parameter.

Initial Matrix Parameter ValueOptimized Parameter TunabilityUnconstrained Parameter Tunability
Sparse matrix

Matrix pattern is fixed. Only elements with nonzero values in the initial matrix are tunable.

The matrix pattern can change, but the number of nonzero elements in the matrix cannot increase.

Full matrix

The matrix pattern can change, but the number of nonzero elements in the matrix cannot increase.

All elements of the matrix can change.

Dependencies

To tune the system matrices using the Parameter Writer block, specify the parameters as full matrices.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: ParameterTunability
Values: 'Auto' (default) | "Optimized" | "Unconstrained"

Example: set_param("MyModel/Descriptor State-Space",ParameterTunability="Optimized")

Variable-step solvers use absolute and relative tolerances to determine whether the error in state calculations is acceptable when choosing the step size. This parameter specifies the absolute tolerance to use for states in the system implemented by this block.

  • auto — Use the absolute tolerance specified by the Absolute tolerance configuration parameter.

  • Real, positive, scalar — Use the specified value as the absolute tolerance for all states.

  • Real, positive vector — Specify an absolute tolerance for each state. The number of elements in the vector must be the same as the number of states in the system.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: AbsoluteTolerance
Values: 'auto' (default) | "-1" | positive real scalar | positive real vector
Data Types: string | char

Example: set_param("MyModel/Descriptor State-Space",AbsoluteTolerance="-1")

If you do not specify a custom name for every state in the system:

  • Each specified name is used for more than one state.

  • The number of states must be evenly divisible by the number of specified names.

For example, if the system has four states, you must specify one, two, or four names. If you specify two names, the first two states use the first name and the last two states use the second name.

To specify a single custom state name using the Property Inspector or the Block Parameters dialog box, include single quotes ('') around the name. For example, to specify the name position, enter 'position'. If you omit the single quotes, the software interprets the value as the name of a MATLAB variable.

To use default state names, specify this parameter as an empty character vector ('').

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: ContinuousStateAttributes
Values: '' (default)
Data Types: char | cell

Example: set_param("MyModel/Descriptor State-Space",ContinuousStateAttributes={'position','velocity'})

Block Characteristics

Data Types

double

Direct Feedthrough

noa

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

a Direct feedthrough characteristics for this block depend on block parameter values.

Extended Capabilities

expand all

Version History

Introduced in R2018b

expand all