Stateflow flow logic questions

2 views (last 30 days)
sudarshan Kanse on 4 Nov 2022
Commented: sudarshan Kanse on 7 Nov 2022
My question is if x < 8 then y should increase slowly till 3000. And if x > 8 then y should decrease slowly from 3000.

Walter Roberson on 4 Nov 2022
Okay, suppose you start and at time 0, x is (say) 25. So y should jump to 3000 (because of the "from 3000" requirement), and then it should start decreasing (at what rate? Is there any lower limit?)
consider the next time step, say 0.00025 . x is still 25, and following the rules, "y should decrease slowly from 3000". So lower value that y reached in the previous time step, it should jump back up to 3000, and start decreasing again. And this jump-up-and-decrease behaviour should happen every time step until something happens to change x to be less than 8.
But this is all having to happen every time step, and there is no time for y to decrease because decreasing would take time to happen, but you have to decrease y from 3000 every time .
Conclusion: if x ever becomes > 8 then y should jump to 3000 and stay there unchanging until something happens to make x < 8
sudarshan Kanse on 7 Nov 2022
Thank You ! For your valuble response

Categories

Find more on Complex Logic 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!

Translated by