How can I make my simulation stop when my graph hits 0? (Simulink)

2 ビュー (過去 30 日間)
Sepehr Khosravi
Sepehr Khosravi 2021 年 5 月 4 日
回答済み: Andy Bartlett 2021 年 5 月 4 日
I looked everywhere and I just can't figure out how to do this. I have graph that is an upside down porabola that starts from 0. I want the simulation to stop when it hits 0 the second time. I'm not sure what blocks I should use to achieve this. I tried solving it with an if block and a stop block but wasn't able to get it to work. Any help would be appreciated. Thanks

回答 (1 件)

Andy Bartlett
Andy Bartlett 2021 年 5 月 4 日
You can build a solution using the Stop Block.
You'll need to build the logic that feeds the Stop Block input using
relational operators or "detect blocks"
and use blocks with state to keep track of the counts.
The state needs can be managed with unit delays and switch blocks
or you can use the discrete integrator block configured to Accumulator mode (which does not multiply inputs by sample time).

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by