lsim with nonzero initial condition

22 次查看(过去 30 天)
i have a reactor with initial temprature=90 and i have a optimal temrature trajectory as a set point . i use lsim with initial condition like this :
X0 = [90 90 90 90 90 90]; [y]=lsim(A, B, C, D, u, t , X0) plot(t,y)
but the plot is start from y( in my example is temprature) =0 how can i set my initail temprature equal to 90 in t=0?

回答(3 个)

Fangjun Jiang
Fangjun Jiang 2012-1-3
You can't use lsim(A,B,C,D,...). You need to use
Sys=ss(A,B,C,D);
y=lsim(Sys,u,t,X0);
UPDATE: You can't arbitrarily set your initial y. Once you get it right, Y0 should be reflected by y=Cx+Du.
It looks like lsim(A,B,C,D,...) works too. I started dislike this feature, especially it was not mentioned in the document.
Sys=rss(2);
X0=[1 1];
u=rand(101,1);
t=0:0.01:1;
y=lsim(Sys,u,t,X0);
figure(1);plot(t,y);
y2=lsim(Sys.a,Sys.b,Sys.c,Sys.d,u,t,X0);
figure(2);plot(t,y2)

Mostafa M Naseri
Mostafa M Naseri 2012-1-3
thanx for your answer .both of them are true, you can write like something i wrote: [y]=lsim(A, B, C, D, u, t , X0) but it doesnt solve my problem , I asked about initial condition

Walter Roberson
Walter Roberson 2012-1-3
Mostafa, where do you see documented any ability to write lsim(A, B, C, D, u, t, X0) ? The lsim documentation appears to show that the first argument to lsim must be an LTI model.
To change the plot so that it does not start at y = 0, you could (somehow) determine the figure number of the plot, findobj() the axis for it, get() the axis YLim property, replace the lower bound of the ylim with 90, and set() that as the new axis YLim property.

类别

Help CenterFile Exchange 中查找有关 Robust Control Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by