How can I represent this state space in MATLAB Code?

5 次查看(过去 30 天)
% 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 ?

采纳的回答

Les Beckham
Les Beckham 2022-1-26
编辑:Les Beckham 2022-1-26
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 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by