How to go back a time step and recalculate it again in Simulink

조회 수: 1 (최근 30일)
Teodor Dikov
Teodor Dikov 2016년 3월 16일
편집: Ced 2016년 3월 16일
Basically I am trying to detect when the value of a signal A exceeds a certain preset limit and, using feedback, change another signal B that brings the value of signal A down. Is there a way that I can go back and recalculate the time-step at which the limit was exceeded? Currently the feedback is working but there are still instances where signal A goes above the limit. Another way that I can achieve the same result will be to be able to predict the value of signal A for a given value of signal B but I don't know if that's possible without running the whole simulation for every time-step. Thanks very much in advance

답변 (1개)

Ced
Ced 2016년 3월 16일
편집: Ced 2016년 3월 16일
How are you checking it at the moment?
Maybe this would work:
The integrators in simulink have an inbuilt "condition check". When this is violated, you get a signal from an additional output port of the integrator (you can switch this on in the integrator block). You can also get the initial value of the integration externally.
Now, if this value is violated at a particular time step, it should not have been violated one time step earlier. Hence, keep a version of the delayed signal ( e.g. with a memory block ), and use this as initial value for the integration.
Like this, every time your limit is violated, you go back one time step and recompute the signal from there. Note however that this only resets this particular signal and not the whole system, depends what you want.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by