Saving a model after UnitConversion in SimBiology

15 views (last 30 days)
Hi,
I was wondering if it was possible to save (and export to SBML) a model after UnitConversion? I cannot directly export to SBML a model that requires UnitConversion prior to simulation (conversion works fine, but simulations obviously do not). Can the converted model be manipulated though?
Thanks.

Accepted Answer

Arthur Goldsipe
Arthur Goldsipe on 27 Jan 2017
Based on your reply, I now understand that you'd like to update a model in SimBiology, so that you can simulate it correctly with UnitConversion disabled. This will allow you to export the model to SBML so that you can also simulate it correctly in a tool that does not support unit conversion.
You should be able to automate much of the conversion process. However, the exact details will depend on your model and how you want to make the units consistent. At a high level, you will need to convert all species, compartments, and parameters to consistent units and update their values accordingly. The function sbioconvertunits can be quite helpful in this process. For example, you can update all species in model m1 so that units and values are in mole/liter with the code sbioconvertunits(m1.Species, 'mole/liter').
Good luck,
-Arthur
  1 Comment
Zebulon
Zebulon on 6 Feb 2017
Thank you Arthur. Indeed, to export an SBML model and make it work in other software that do not do unit conversions, I had to convert all "molarity" units to "mole/liter" and keep volume consistently as liter for all compartments. Then the model was running in MATLAB without UnitConversion activated, and in external programs. Thanks.

Sign in to comment.

More Answers (1)

Arthur Goldsipe
Arthur Goldsipe on 27 Jan 2017
Hi,
I'd like to make sure I understand your question. Tell me if this is accurate: When you simulate your model in SimBiology, you must use UnitConversion to get the correct answer. You also want to export this model to SBML. You want to make sure that the SBML file will be correct.
If you'd like to know what features of SimBiology can be exported to SBML, then read this documentation. With regard to unit conversion, SimBiology will include the units in the SBML file. If you import the SBML file into SimBiology and enable UnitConversion, you should get the same unit conversion behavior as you did before exporting the model.
That said, if you need to use that SBML file with another tool, you will need to make sure that the tool understands how to perform the necessary unit conversions. If you need to use the model with a tool that does not support unit conversion, you will probably need to SimBiology model so that it works correctly with UnitConversion disabled. Specifically, you need to make sure that all math expressions have consistent units.
If you add a comment and don't get a prompt reply, contact me directly. I don't get notified when there are updates to a question.
Good luck!
-Arthur
  2 Comments
Zebulon
Zebulon on 27 Jan 2017
Dear Arthur,
Thanks for your answer. You are correct, I wish to use the model in an external application, which does not support UnitConversion. From MATLAB, SBML export works fine, but in this external application, simulations give the same result than if I were using the model in MATLAB without enabling UnitConversion, as expected.
I was wondering if there was a possibility to manipulate a converted model in MATLAB, and possibly export it, without having to manually convert units oneself?
Thanks.
Arthur Goldsipe
Arthur Goldsipe on 27 Jan 2017
Ah, now that I understand your question more clearly, I'll post another answer that more clearly addresses it.

Sign in to comment.

Categories

Find more on Scan Parameter Ranges 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!