lsim with nonzero initial condition

조회 수: 13 (최근 30일)
Mostafa M Naseri
Mostafa M Naseri 2012년 1월 3일
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
  댓글 수: 1
Fangjun Jiang
Fangjun Jiang 2012년 1월 3일
You are right about lsim(A, B, C, D, ...). See update in my answer.

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


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