Can I trigger/activate a rule using an event in SimBiology?

1 回表示 (過去 30 日間)
Heather Cox
Heather Cox 2018 年 2 月 15 日
回答済み: Arthur Goldsipe 2018 年 2 月 15 日
I have created a repeated assignment rule in the SimBiology desktop which defines Species_Y as a function of Species_X (both are boundary conditions).
For my particular scenario (see figures below) I want to apply a maximum limit of 4 to Species_Y.
I think this could be achieved by activating the repeated assignment rule at a given time or Species_X concentration, using an Event. Please could you advise if this is possible and what I need to enter in the EventFcns command line or if there is another way of achieving this?
Thanks

採用された回答

Arthur Goldsipe
Arthur Goldsipe 2018 年 2 月 15 日
If I understand correctly, you could get the desired result by replacing the repeated assignment rule y = f(x) with y = min(f(x),4). As described here, I also suggest adding events to ensure the solution is accurate when there is a discontinuity in dy/dt. For example, the following two events would ensure the solver resets whenever f(x) crosses the value of 4 from either direction:
  1. Trigger f(x) >= 4, Event function x = x
  2. Trigger f(x) < 4, Event function x = x

その他の回答 (0 件)

コミュニティ

その他の回答  SimBiology コミュニティ

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by