# Discrete Varying State Space

Discrete-time state-space model with varying matrix values

• Library:
• Control System Toolbox / Linear Parameter Varying

## Description

Use this block to implement a discrete-time state-space model with varying matrices. Feed the instantaneous values of the state matrix A, input matrix B, output matrix C, and feedforward matrix D to the corresponding input ports. The system response is given by:

`$\begin{array}{c}{x}_{k+1}=A{x}_{k}+B{u}_{k}\\ {y}_{k}=C{x}_{k}+D{u}_{k},\end{array}$`

where uk is the system input, yk is the system output, xk is the current system state, and xk+1 is the system state at the next time step.

Use this block and the other blocks in the Linear Parameter Varying library to implement common control elements with variable parameters or coefficients. For more information, see Model Gain-Scheduled Control Systems in Simulink.

## Ports

### Input

expand all

System input signal.

State matrix of dimensions Nx-by-Nx, where Nx is the number of system states.

Input matrix of dimensions Nx-by-Nu, where Nu is the number of system inputs.

Output matrix Ny-by-Nx, where Ny is the number of system outputs.

Feedforward matrix of dimensions Ny-by-Nu.

### Output

expand all

System output signal.

Current state values.

#### Dependencies

To enable this port, select the Output states parameter.

State values at next time step.

#### Dependencies

To enable this port, select the Output state updates parameter.

## Parameters

expand all

Initial state values, specified as a scalar or a vector whose length is the number of system states.

Block sample time, specified as either –1 (inherited sample time) or a positive scalar value.

Select to enable the state values output port, x.

Select to enable the state updates output port, xk+1.