フィルターのクリア

different event functions for the same species

2 ビュー (過去 30 日間)
Day
Day 2024 年 4 月 29 日
コメント済み: Arthur Goldsipe 2024 年 4 月 30 日
Hi,
I developed a model in Simbiology in which Fw is a parameter as a function of mass. The mass varies with time.
I want to set two events as follows:
Trigger: mass>=Threshold_mass
event function: Fw = 0.1* mass
Trigger: mass<Threshold_mass
event function: Fw = 0.0003* mass
I received this error message:
"Invalid repeatedAssignment rule 'Rule_20'. The variable 'Fw_T' is also used by an event function.\n"
Could you please suggest any idea that may help?
Thanks
  3 件のコメント
Torsten
Torsten 2024 年 4 月 30 日
We need Arthur Goldsipe here :-)
Day
Day 2024 年 4 月 30 日
@Mann Baidi thank you for your note. I wrote here the second = by mistake.

サインインしてコメントする。

採用された回答

Arthur Goldsipe
Arthur Goldsipe 2024 年 4 月 30 日
編集済み: Arthur Goldsipe 2024 年 4 月 30 日
The problem is that you have two conflicting mathematical definitions of Fw. You are trying to set it with both a repeated assignment rule (which applies at all times during a simulation) and with an event (which modifies Fw when a condition is met). What is your intent? Perhaps you only meant for the rule to apply at time 0, in which case you should change it to an initial assignment. Then you can set it with an event at later times.
  6 件のコメント
Torsten
Torsten 2024 年 4 月 30 日
編集済み: Torsten 2024 年 4 月 30 日
Often, packages are that encapsulated that they lack the necessary flexibility for special requests. I don't know SimBiology, but there might be situations (not in this case) when a "quick-and-dirty" solution is better than no solution.
In case an ode solver would have been used directly for the above case, the event I would have chosen is when mass - Threshold_mass = 0 with a reset of Fw and restart after this event had happened. For me, this solution seems more natural than yours. But as said: since we are in the straitjacket of SimBiology, the internal possible options have to be respected.
Arthur Goldsipe
Arthur Goldsipe 2024 年 4 月 30 日
@Torsten you make a good point. I'll keep thinking about how we can loosen this stratjacket we find ourselves in. :-)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScan Parameter Ranges についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by