Is it possible to deactivate all reactions within a compartment in SimBiology?

1 回表示 (過去 30 日間)
emjey
emjey 2022 年 12 月 6 日
回答済み: Arthur Goldsipe 2022 年 12 月 7 日
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 件のコメント
emjey
emjey 2022 年 12 月 7 日
I might underestimate the complexity of this, but would not be possible to deactivate compartment-wide those reactions which are placed within the boundary of this compartment? The products/reactants might be elsewhere, they would not 'see' that particular reaction rate.
Setting Active property is an option but how to do it programatically for all reactions located within a given compartment? I can do it manualy but that not very practical.
The background: I have a compartmental PK model coupled with a PD compartment - I would like to test the PK part only, the PD being computationally heavy and makes it difficult to test/work with PK.
Arthur Goldsipe
Arthur Goldsipe 2022 年 12 月 7 日
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. :-)

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

採用された回答

Arthur Goldsipe
Arthur Goldsipe 2022 年 12 月 7 日
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 件)

カテゴリ

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

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by