Linear Simulation Tool Problem
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I am trying to produce graphs showing me how my state-space model responds to a sine function.
Unfortunately when using the Linear Simulation Tool, importing the system G and trying a linear analysis with time t = [0:0.1:10] and signal u=sin(t).
The program tells me "None of the systems have a complete set of inputs." Is there a way to solve this?
Regards,
Maxence
Here is my code:
% A, B, C, D Matrices %
A = [0 0 0 1 0 0 0 0 0 0 0 0;
0 0 0 0 1 0 0 0 0 0 0 0;
0 0 0 0 0 1 0 0 0 0 0 0;
0 0 0 -0.0855 0 0 0 -9.81 0 0 0 0;
0 0 0 0 -0.0855 0 9.81 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 1 0 0;
0 0 0 0 0 0 0 0 0 0 1 0;
0 0 0 0 0 0 0 0 0 0 0 1;
0 0 0 0 0.7415 0 0 0 0 0 0 0;
0 0 0 0.7415 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0];
B = [0 0 0 0;
0 0 0 0;
0 0 0 0;
0 0 0 0;
0 0 0 0;
-0.01435 -0.01435 -0.01435 -0.01435;
0 0 0 0;
0 0 0 0;
0 0 0 0;
0 -124.4 0 124.4;
124.4 0 -124.4 0;
-0.01999 0.01999 -0.01999 0.01999];
C = [1 0 0 0 0 0 0 0 0 0 0 0;
0 1 0 0 0 0 0 0 0 0 0 0;
0 0 1 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 1 0 0 0];
D = 0;
G = ss(A, B, C, D);
I = tf(G);
댓글 수: 0
채택된 답변
Star Strider
2019년 3월 17일
This works for me:
t = 0:0.1:10;
u = ones(size(B,2),1)*sin(t);
y = lsim(G, u', t);
figure
plot(t, u, '--')
hold on
plot(t, y)
hold off
grid
Experiment to get the result you want.
댓글 수: 4
Star Strider
2019년 3월 29일
I have not done anything with Simulink in a long time, so I cannot help you with it.
If possible, do everything in state space. It is much easier. I have no idea how you are supposed to approach this problem, however pole placement, state feedback, and such in state space is preferable. With respect to the tf and ss2tf functions, tf accepts numerator and denominator polynomials to produce a system object defined initially by a transfer function. The ss2tf function converts a state space model to a transfer function model. You can find good descriptions of that process in all good modern control textbooks. (I prefer state space for many reasons, some of which I mentioned here. I do not remember much about classical control.)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Dynamic System Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!