Info

This question is closed. Reopen it to edit or answer.

Unexpected behavior using "If Action Subsystems" whenever the second transition occurs between if and else.

1 view (last 30 days)
I am trying to understand the use of "If Action Subsystem" and "If" blocks for an upcoming project so I put together a simple model for a system that has different behavior based on whether or not a position is >=0. The model itself is arbitrary, in this case it is a ball that when submerged accelerates upwards, and accelerates downwards when above water level (0).
However when I run the simulation, the velocity changes sign through every in every time step AFTER the second transition. It doesn't matter which state the model started in (>0 or <0), the logic error always happens starting at the second transition.
Could anyone let me know what I am doing incorrectly or any documentation that would? I am not even sure if this use of integrators is valid.
I have attached the .slx file in a .zip archive.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!