필터 지우기
필터 지우기

Retaining previously held values in simulink

조회 수: 12 (최근 30일)
Moein Sabounchi
Moein Sabounchi 2020년 2월 12일
댓글: Jonas 2020년 2월 14일
I have a simulink model that is run using a code in a loop in consecutive time-steps. However, there's a problem, that the model resets itself before each new time-step (loop). I was wondering if there is an option for the model to NOT RESET itself before new iteration, in other words, I want all signals to keep (retain) their last held values from previous iteration. Thanks.

답변 (1개)

Jonas
Jonas 2020년 2월 13일
편집: Jonas 2020년 2월 13일
It is not completely clear to me what your set-up looks like, but you may want to investigate 'Enabled Subsystems'. You can set each output to be 'held' or 'reset' when enabling.
  댓글 수: 2
Moein Sabounchi
Moein Sabounchi 2020년 2월 13일
It's a plant (simulink model) that is controlled with an adaptive controller (MPC). In each iteration the new control signal is applied to the plant, then the plant runs one iteration and updates the data in the code (controller) and so on and so forth. The problem here, is that the plant (simulink model), resets itself after each run.
If it was a small model, I could have used initial value set-up in integrators and other blocks to force the continuous performance, but it is not. So I have to find an option to make the plant retain values for the next run.
Jonas
Jonas 2020년 2월 14일
I assume that each iteration you do, is running the simulation model, stopping it, and starting it from stratch. What I would do is put the part that you want to iterate inside an Enabled Subsystem but the plant model not. Then you could enable and reset the iterative part that you DO want to reset with a certain clock or trigger. The plant model however just keeps running.
This means that instead of running, stopping and restarting your whole Simulink model, you run it once.
Hope this is somewhat clear and inspiring.

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

카테고리

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

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by