Export initial conditions of parameters/compartments/species into workspace
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Justine
am 4 Jan. 2024
Bearbeitet: Jeremy Huard
am 10 Jan. 2024
Hello,
I have built a PBPK on Simbiology (2023b), with numerous parameters and compartments whose values are mostly defined by initial assignements. I nicely see the initial conditions in the model builder app after activating the initial conditions button in the toolbox. I usually have 1 by default in the value column and my calculated value based on the initial assignements in the initial conditions column.
However, when exporting the model to MATLAB Workspace (via Model tab > Export > Export Model to MATLAB Workspace), I cannot retrieve the initial values, but only the default 1 values appear.
Is there a way to access the initial values in the MATLAB workspace to do some calculations? (both for parameters and compartments)
Or, maybe even better, is there a way to transfer the initial conditions to values, as they remain constant ?
Thank you very much in advance!
0 Kommentare
Akzeptierte Antwort
Jeremy Huard
am 4 Jan. 2024
Bearbeitet: Jeremy Huard
am 10 Jan. 2024
there is currently no built-in command line interface to get the initial conditions.
However, you could simulate the model with StopTime=0 to get these values.
I have attached an implementation of this approach (sbiogetInitialValues.m) that returns both a table and a variant with the computed initial values.
Here is an example:
s = sbioloadproject('lotka.sbproj');
modelObj = s.m1;
modelObj.Species
% let's now add initial assignments and check the initial values
addrule(modelObj,'x = z','initialAssignment');
addrule(modelObj,'z = 100','initialAssignment');
[tableOut, variantOut] = sbiogetInitialValues(modelObj)
I hope this helps.
Best regards,
Jérémy
0 Kommentare
Weitere Antworten (0)
Communitys
Weitere Antworten in SimBiology Community
Siehe auch
Kategorien
Mehr zu Import Data finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!