Linear Simulation Tool Problem

조회 수: 1 (최근 30일)
Maxence Luneau
Maxence Luneau 2019년 3월 17일
댓글: Star Strider 2019년 3월 29일
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);

채택된 답변

Star Strider
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
Maxence Luneau
Maxence Luneau 2019년 3월 28일
Hello again,
I'm stil a struggling a bit with Matlab and Simulink trying to combine both to implement a PID Controller to my state space model.
Using the same matrices A, B, C, D to give me a 4x4 state space model which I can transform into a series of transfer functions. I understand that for my PID controller analysis I need to decouple my model to be able to select 1 dimension, 1 control input of motion to give me 1 output for me to analyse this with a PID controller.
Another difficulty is how do I define the error and gains I need to render my model stable: which is the objective of this exercice. I have found some values of static gain although I do not know how they connect to my model and where I should implement these after.
On another note, I am confused between the difference between the tf and ss2tf functions.
Coming back to simulink, how do I simplify my model for it to hold true and facilitate a Simulink analysis?
If you could elaborate, or give me any advice/information, I would be extremely grateful!
Cheers
Star Strider
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 CenterFile Exchange에서 Dynamic System Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by