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)

采纳的回答

Paul
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))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by