lsim with nonzero initial condition
22 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (3)
Fangjun Jiang
el 3 de En. de 2012
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)
0 comentarios
Mostafa M Naseri
el 3 de En. de 2012
1 comentario
Fangjun Jiang
el 3 de En. de 2012
You are right about lsim(A, B, C, D, ...). See update in my answer.
Walter Roberson
el 3 de En. de 2012
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.
0 comentarios
Ver también
Categorías
Más información sobre Robust Control Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!