SImbiology: access "Initial Conditions" (not InitialValues)
3 次查看(过去 30 天)
显示 更早的评论
when I use the getequations command on a simbiology model object, I get a section titled "Initial Conditions" that reports the initial values for all the variables calculated after any initial assignment rule. How can I directly access these values (i.e. read or use them to define other variables in my code) without having to manually copy/pasting them from the output lines?
P.S. Notice that this "Initial Condition" is NOT the InitialValue specified for the variables: for several different reasons, I for example often assign a default value 0 to the InitialValue of all the variable and calculate the appropriate initial condition via an initial assignment rule. When I access the InitialValue property of the species (which I know how to do) I will always therefore get 0, but if I use the getequations command the output shows the right initial condition (the one calculated by the rule).
0 个评论
回答(1 个)
Arthur Goldsipe
2021-2-12
As you discovered, getequations is intended as a textual report and is not well suited for programmatic access to initial values. There is not currently a documented way to get these values programmatically, but I will add that to the SimBiology enhancement database. In the meantime, one workaround would be to perform a simulation with StopTime set to 0 and inspect the simulation results. This may also require you to update StatesToLog to ensure that the relevant components are reported in the simulation results.
1 个评论
Arthur Goldsipe
2021-2-12
Also, if the above workaround is not acceptable, please contact me directly. I may be able to privately share a prototype for programmatically accessing this data.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biotech and Pharmaceutical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!