Modelling state space equation from simulink file

I need help modelling the above simulink model in state space form
I have attached the simulink file with transfer functions .
drillstring model =(2.618s+6.233)/(9.898s+8.917)
stick slip disturbance =(-6.7323s-0.45)/(2.342s^2+3.22s+1)
motor = 8.917/(0.42s+1)
Can I please get some help
Thanks.

 Accepted Answer

The following script allows you to convert the system transfer function into the state-space model in controllable canonical form. After that, use the State-Space block to implements the system accordingly.
s = tf('s');
Gp = (2.618*s + 6.233)/(9.898*s + 8.917) % drillstring model (plant)
Ga = 8.917/(0.42*s + 1) % motor (actuator)
Gd = (-6.7323*s - 0.45)/(2.342*s^2 + 3.22*s + 1) % stick slip disturbance
Gap = Ga*Gp
G = Gap + Gd; % assumed ++ Sum block is used
G = minreal(G) % system transfer function
[Gnum, Gden] = tfdata(G, 'v');
[a, b, c, d] = tf2ss(Gnum, Gden);
sys = ss(a, b, c, d);
csys = canon(sys, 'companion');
A = csys.A';
B = csys.C';
C = csys.B';
D = csys.D;
csys = ss(A, B, C, D) % display state-space model in controllable canonical form
csys =
A =
x1 x2 x3 x4
x1 0 1 0 0
x2 0 0 1 0
x3 0 0 0 1
x4 -0.9159 -4.35 -7.084 -4.657
B =
u1
x1 2.741
x2 -1.3
x3 0.6176
x4 -0.2972
C =
x1 x2 x3 x4
y1 1 0 0 0
D =
u1
y1 0
Continuous-time state-space model.
Suggest you to find the book "Modern Control Systems", 14e, by Richard C. Dorf and Robert H. Bishop.

More Answers (0)

Categories

Products

Release

R2021b

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!