Can I set simbiology repeat assignment rule state to active or inactive using variants?
1 view (last 30 days)
Show older comments
Jim Bosley
on 29 Mar 2018
Answered: Arthur Goldsipe
on 30 Mar 2018
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.
0 Comments
Accepted Answer
Arthur Goldsipe
on 30 Mar 2018
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 Comments
More Answers (0)
See Also
Categories
Find more on Extend Modeling Environment in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!