How to output concentrations if species dimension is 'substance'.
3 views (last 30 days)
Show older comments
Colin Phipps
on 15 Nov 2016
Edited: Arthur Goldsipe
on 16 Nov 2016
I have a huge model where 'DefaultSpeciesDimension' is set to 'substance'. I coded in terms of substance amounts, because it was easier that way. If I want to output concentrations when I simulate the model, will I have to define concentrations (with rules), or is there some easy way to switch plots to concentrations using the user interface?
0 Comments
Accepted Answer
Arthur Goldsipe
on 16 Nov 2016
Edited: Arthur Goldsipe
on 16 Nov 2016
Hi Colin,
Today (as of R2016b), you must decide to represent a species either in amount or in concentration. There is no direct way to refer to both the amount and concentration of a species in the same model.
As you've already discovered, one workaround would be to add a repeated assignment rule to calculate the concentration.
I can think of another possible workaround within the SimBiology Desktop. If you want the concentrations to appear on the "Live Plots" within a simulation task, then you can add a calculated value to a plot. You can read more about in the documentation (search for Define Math). To summarize that, you'd need to add a plot entry for the species amount, another for the compartment volume, and then add math along the lines of SpeciesAmount./CompartmentVolume, where SpeciesAmount is the legend name for the species amount and CompartmentVolume is the legend name for the compartment.
Feel free to contact me directly if you have additional questions, since I don't get notified of any additional comments you post here.
-Arthur
0 Comments
More Answers (0)
See Also
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!