Can I set simbiology repeat assignment rule state to active or inactive using variants?

2 ビュー (過去 30 日間)
Using the paradigm similar to that in Dr. Goldspie's insulindemo example, I'm using two rules to set a variable parameter. Let's call the parameter "state_used". In the model, an ODE is used to calculate the species "ODE_state". And I have a function of time calculated to generate "forced_state". One rule sets "state_used" to "ODE_state". The other sets "state_used" to "forced_state". By setting one (and only one) or the other, I can have the model generate the state values, or I can force the state values. For all calculations, the model uses "state_used".
Can I have a variant set a repeat assignment rule to active or inactive?
Or, must I use a MATLAB script to "set" the .Active property to 0 or 1?
An alternate approach would be to have a single assignment rule "ODE_switch" such that
state_used = ODE_switch*ODE_state + (1-ODE_switch)*forced_state
in which case the ODE_switch parameter could be set via variants.
Thanks.

採用された回答

Arthur Goldsipe
Arthur Goldsipe 2018 年 3 月 30 日
You cannot currently use variants to set the Active property of a Rule (or any other object). I agree this is an obvious extension to variants, and we've heard about similar use cases before. Until SimBiology gets such functionality, I recommend either of the alternatives you've already mentioned: setting Active via a script or recasting the rule into something that can be controlled via a variant.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeExtend Modeling Environment についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by