Simulink integrator block reset and integrate at single time step
Show older comments
Hello,
I am working on a system where I have two state variables, one of which is to be activated (becomes nonzero) in the middle of simulation.
I am using the "reset" feature of the integrator block to model the appearance of the state variable by feeding appropriate initial state value and triggering reset.
I noticed that when reset is triggered, the integrator block does only the reset part and skips integration, thus spending one timestep without integrating.
I was wondering whether it would be possible to do the reset and then integrate the variable all in one time step when reset is triggered.
Thank you!
---------This is additional information -------
I hope this is somewhat more helpful for understanding my situation.
Let's say I have a system with two modes. For each mode, the number of state variable is different. For example...
Mode 1 (only
is active)
where u is an external input.
Mode 2 (
and
are active)
The simulation would start at mode 1 in the beginning. Mode 2 is triggered with a condition
, with some threshold value. When mode 2 is triggered,
would get a very small value.
From mode 2, if a condition
is met, the system goes back to mode 1.
For this, what I am curious about is during mode 1 --> mode 2 transition, where I am turning
into existence and assigning a very small initial value, whether I could integrate it at the same time step.
As of now, when the transition is to happen, I would spend the timestep just to assign initial value to the newly activated state variable
and passing it to other subsystems. But, I feel like it would be more accurate for the simulation result, if I could assign initial value and integrate it based on the inputs/conditions of current timestep.
I am open to other creative solutions rather than sticking with the integrator block.
I appreciate your help.
2 Comments
madhan ravi
on 12 Dec 2023
Please illustrate with an example what you want to achieve and why is the current method different than the expected.
Jaewon Park
on 16 Dec 2023
Accepted Answer
More Answers (0)
Categories
Find more on General Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!