We take the series RLC block located in ’artemis/SSN/SSN Components/SSN Series RLC’ for our explanations.
The Series RLC state-space equations are well-known:
In the model, these matrices are built using Simulink:
Note: The order of the states (vC and iL) is inverted from the equations. Both representations are correct.
The continuous-time domain matrices Ac Bc Cc, with a null D matrix, are then discretized using both Trapezoidal and Backward Euler rule of integration. The resulting discrete A matrix Ad depends on the discretization method used. The same comment also applies to the discrete B matrix. C and D matrices are not affected by discretization. h is the discretization time step.
Trapezoidal
Backward Euler
This is done in the following subsystem, with Ts being the discretization time step.
In the model, this is again made using only Simulink blocks: