Conservation laws in Simbiology
2 views (last 30 days)
Show older comments
Is there any form of including explicitly conservation laws in simbiology models?
0 Comments
Answers (1)
Arthur Goldsipe
on 8 Jun 2015
Hi Debora,
I can (and will) tell you a way you can explicitly enforce conservation laws, but I think it's first worth asking why you want to do that. If it's because your simulation results don't obey a conservation law you expect, then you may have a larger problem. The first question to ask is whether the difference is acceptable. Some rounding errors are the result of numerically solving the ODEs. If you need more accurate answers, then you may need to tighten the ODE solver tolerances. But note that sometimes you never get exactly the results you expect, due to machine precision (for example, .3 - .1 - .2 is not quite 0).
If you just want to make sure that you've correctly written your model, then you can use the sbioconsmoiety function to identify conservation laws.
If you still think you need to enforce conservation laws you can use a repeated assignment. For example, if your model had a single reaction "x -> y", you could alternatively formulate the model as "x -> null" with a repeated assignment of the form "y = x0 + y0 - x". In both cases, "x + y" would be conserved (excepting the numerical issues I mentioned earlier).
If that doesn't clear things up or you have additional constraints, then I recommend posting a new question to MATLAB Answers with more details. (People will be much more likely to see and answer a brand new question, rather than adding more answers to this one.)
-Arthur
0 Comments
Communities
More Answers in the SimBiology Community
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!