In Simulink, is it possible to calculate back one step depending on the conditions?

1 回表示 (過去 30 日間)
怜央 橋場
怜央 橋場 2023 年 12 月 27 日
回答済み: madhan ravi 2023 年 12 月 27 日
I am having a problem with a conditional expression in an If statement." The conditional expression compares "buoyvel(current timestep)" with "motorvel(information one step ahead calculated by the state equation)".
I would like to make this compare at the same time step." buoyvel" cannot get the information one step ahead. So, here is the algorithm I came up with.
1. assume that the If statement is False and advance one step.
2. Compare the obtained "buoyvel" and "motorvel".
3. If the "if" statement is True, go back one step and redo the calculation. "If" the statement is False, the step is proceeded.
Is there any suitable block or expression for this?

回答 (1 件)

madhan ravi
madhan ravi 2023 年 12 月 27 日
if you want to compare the previous timestep value you could use Unit Delay block

カテゴリ

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