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

1 次查看(过去 30 天)
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