## Modelica_LinearSystems2.Examples.DiscreteStateSpace

Package with examples to demonstrate the usage of the DiscreteStateSpace record

### Information

This package contains example function calls to demonstrate the usage of the functions of the DiscreteStateSpace record.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

### Package Content

Name | Description
--- | ---
analysisEigenvalues | Example to compute the eigenvalues of a discrete state space system
analysisTimeResponse | Compute time response of a discrete state space system
importFromModel | This example demonstrates how to generate a linear discrete state space system from a (nonlinear) Modelica moodel
plotBodeSISO | Bode plot of a discrete state space system

## Modelica_LinearSystems2.Examples.DiscreteStateSpace.analysisEigenvalues

Example to compute the eigenvalues of a discrete state space system

### Information

This example shows the computation of the poles and zeros of state space system.

### Inputs

Name | Description
--- | ---
ss |
Ts | Sample time [s]
method | Discretization method

## Modelica_LinearSystems2.Examples.DiscreteStateSpace.analysisTimeResponse

Compute time response of a discrete state space system

### Information

Computes the time response of the system

>          dss = DiscreteStateSpace( A=[0.99005, 0.00985;
>                                       0,       0.9802],
>           B=[0.01,0;
>              0,0.01],
>           C=[1,0; 0,1],
>           D=[0,0; 0,0],
>           Ts=0.01,
>           B2=[0,0; 0,0],
>           method=Modelica_LinearSystems2.Types.Method.StepExact),

sampled at Ts=0.01 with inititial state x0=[0;0] subject to the system input u = ones(300,2) (which results with Ts=0.01 in 3 sec).

### Inputs

Name | Description
--- | ---
u[:, 2] |

### Outputs

Name | Description
--- | ---
y[samples, 2] | System response (dimension: (input samples) x (number of outputs))
t[samples] | Time vector used for simulation
x[samples, 2] | State trajectories (dimension: (input samples) x (number of states)

## Modelica_LinearSystems2.Examples.DiscreteStateSpace.importFromModel

This example demonstrates how to generate a linear discrete state space system from a (nonlinear) Modelica moodel

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Name | Description
--- | ---
modelName |
Ts | [s]

### Outputs

Name | Description
--- | ---
dss |

## Modelica_LinearSystems2.Examples.DiscreteStateSpace.plotBodeSISO

Bode plot of a discrete state space system

### Information

This example demonstrates the construnction of a zeros-and-poles-transfer-function from a SISO state space representation and üplots the Bode diagrams with automatic determination of the frequency range to plot

### Inputs

Name | Description
--- | ---
dss |
iu | index of inout
iy | index of output

### Outputs

Name | Description
--- | ---
ok |