I see you have an equation as plant in “state space” form, which you want to implement in Simulink or by codes. Here’s how you do this:
In Simulink:
1.) Launch Simulink and create a brand new model.
2.) Drag and drop the State-Space block from the Simulink Library Browser under Continuous.
3.) Now double click the block and in its “parameters dialog”, enter your matrices “A”, “B”, “C”, “D” in the respective slides.
A: Enter the state matrix (
). B: Enter the combined input matrix
if you want to handle multiple inputs. C: Enter the output matrix (
). D: Enter the direct transmission matrix
based on your system. 4.) For inputs like u, v and
, use “Inports” and for output like z, use “Outport”. 6.) Connect the input ports to the “State-Space block” and the output of the “State-Space block” to the output port.
7.) Lastly run the simulation and observe the system behaviour.
For implementing in MATLAB code, you can use the following code:
D = [Dzu, Dzw, zeros(size(Cz, 1), size(Bref, 2))];
[y, t, x] = lsim(sys, inputs, t);
title('State-Space System Output');
I used some example values for input and got this graph: