- How do you decide whether a particular reaction is "in a compartment"? Do you mean that any reactions or products are in that compartment? Or do all reactants and products need to be in the compartment? What if no reactants or products are in that compartment, but the reaction rate references a species in that compartment? Do you care whether the reaction block in the model diagram is actually within the compartment?
- When you say that you want to switch off reactions, would it work to set the Active property to false for the reactions before starting your simulations?
Is it possible to deactivate all reactions within a compartment in SimBiology?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
emjey
am 6 Dez. 2022
Beantwortet: Arthur Goldsipe
am 7 Dez. 2022
I would like to test a selected submodule of my model, which amounts to switching off other unwanted compartments which contain computational heavy model parts. Additionally, I would like to be able to do it from command line (without manual deactivating reaction).
3 Kommentare
Arthur Goldsipe
am 7 Dez. 2022
I think it will be straightforward but perhaps a little tedious to write a function do do this. So I didn't want to go into all the details until I made sure I was going to answer the question you were actually asking. :-)
Akzeptierte Antwort
Arthur Goldsipe
am 7 Dez. 2022
I think the getBlock function will give you the information you need to determine whether a reaction is inside a compartment. It will return the position of blocks. In pseudocode, it might look something like this:
- Make sure the model is open in the Model Builder app.
- Use getBlock to find the boundaries of all compartments you want to disable the reaction in.
- For each reaction in the model
- Use getBlock to determine the boundaries of the reaction.
- See if those boundaries are within the boundaries of any compartment (perhaps using inpolygon).
- If so, set the reaction's Active property to false.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Extend Modeling Environment finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!