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일)
이전 댓글 표시
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)
댓글 수: 0
채택된 답변
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)
% exp(t) - 1 in the denominator, can't evaluate at t = 0
tval = .1:.1:1;
plot(tval,subs(u,t,tval))
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!