# I am trying to plot an input function u(t) along a time interval [0,1] but I keep getting errors when i try to plot. Can anyone help me fix the code so it can plot?

조회 수: 1(최근 30일)
Royson Ollivierre 2022년 5월 1일
댓글: Royson Ollivierre 2022년 5월 1일
syms s t
A= [0,1,1,0;0,0,-2,1;0,0,0,1;0,0,3,-2];
B= [0;1;2;1];
C= [1,1,0,0];
x0= [0;2;0;1];
SI= [s,0,0,0;0,s,0,0;0,0,s,0;0,0,0,s];
e= SI-A;
F= inv(e);
k= ilaplace(F);
IT= transpose(k);
BT= transpose(B);
x= k*B*BT*IT;
W= int(x, 0, t)
WI= inv(W)
u= (-BT)*IT*WI*x0
t= 0:0.1:1;
plot(t,u)

댓글을 달려면 로그인하십시오.

### 채택된 답변

Paul 2022년 5월 1일
Hello Royson,
Looks like some sort of control problem involving the controllability Gramian? Maybe this is what you're looking for?
syms s t
A= [0,1,1,0;0,0,-2,1;0,0,0,1;0,0,3,-2];
B= [0;1;2;1];
C= [1,1,0,0];
x0= [0;2;0;1];
SI= [s,0,0,0;0,s,0,0;0,0,s,0;0,0,0,s];
e= SI-A;
F= inv(e);
k= ilaplace(F);
IT= transpose(k);
BT= transpose(B);
x= k*B*BT*IT;
W= int(x, 0, t);
WI= inv(W);
u = (-BT)*IT*WI*x0;
u = simplify(u,100)
u =
% exp(t) - 1 in the denominator, can't evaluate at t = 0
tval = .1:.1:1;
plot(tval,subs(u,t,tval))
##### 댓글 수: 1표시숨기기 없음
Royson Ollivierre 2022년 5월 1일
Thank you very much, you were a big help.

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

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

Start Hunting!

Translated by