How to step through a discrete model simulation one step at a time

조회 수: 4 (최근 30일)
Bill Tubbs
Bill Tubbs 2020년 3월 29일
댓글: Bill Tubbs 2020년 4월 4일
I have a discrete-time ARX model that I want to use to represent the plant in a simulation:
Ts = 1;
sigma = 0.01;
d = 3;
sys = idpoly([1 -2.4 1.9 -0.5],[0.01 0.001 -0.007],[],[],[],sigma^2,Ts,'IOdelay',d);
How do I simulate this system one timestep at a time in a for loop with my control algorithm?
N = 10;
u = zeros(N,1);
y = zeros(N,1);
for k=1:N
u[k] = rand()*2 - 1;
y[k] = sys ...?
end
(I know how to simulate a whole trajectory):
u = rand(N,1)*2 -1;
y = sim(sys,u);

채택된 답변

Navya Seelam
Navya Seelam 2020년 4월 3일
sim function doesn't support onetime step simulation as of now. I have brought this issue to the concerned people and it might be considered in any future release.
  댓글 수: 1
Bill Tubbs
Bill Tubbs 2020년 4월 4일
That would be nice. Especially for those working with adaptive control schemes.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Nonlinear Control에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by