Stateflow flow logic questions

8 次查看(过去 30 天)
My question is if x < 8 then y should increase slowly till 3000. And if x > 8 then y should decrease slowly from 3000.

回答(1 个)

Walter Roberson
Walter Roberson 2022-11-4
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

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by