How can I represent this state space in MATLAB Code?

5 Ansichten (letzte 30 Tage)
taleem mat
taleem mat am 26 Jan. 2022
Kommentiert: Les Beckham am 27 Jan. 2022
% Code
A=[ 0 1 0 0 ;
0 0 -7sin(0.05) 0;
0 0 0 1;
0 0 0 -38;];
B=[ 0 0 0 71]';
c=[1 0 0 0];
f=ss(A,B,C,D);
close loop=feedback(f,1)
Is this representation of the state space with sine in it is true ?

Akzeptierte Antwort

Les Beckham
Les Beckham am 26 Jan. 2022
Bearbeitet: Les Beckham am 26 Jan. 2022
You need to replace 7sin(0.05) with 7*sin(0.05).
Also, Matlab variable names can't have a space in them so close loop is not a valid variable name.
And your definition of C was in lower case.
And you didn't define D;
A = [ 0 1 0 0 ;
0 0 -7*sin(0.05) 0;
0 0 0 1;
0 0 0 -38;];
B = [0 0 0 71]';
C = [1 0 0 0];
D = 0; % Assuming no direct effect of the input on the output
f=ss(A,B,C,D);
closed_loop=feedback(f,1)
closed_loop = A = x1 x2 x3 x4 x1 0 1 0 0 x2 0 0 -0.3499 0 x3 0 0 0 1 x4 -71 0 0 -38 B = u1 x1 0 x2 0 x3 0 x4 71 C = x1 x2 x3 x4 y1 1 0 0 0 D = u1 y1 0 Continuous-time state-space model.
  8 Kommentare
taleem mat
taleem mat am 27 Jan. 2022
I will try to do it by ode45. I am so grateful.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by