Question on specifying input to sbiosimulate

2 views (last 30 days)
Deepa Maheshvare
Deepa Maheshvare on 27 Apr 2019
Commented: Jeremy Huard on 2 May 2019
I'm using sbiosimulate to solver the model loaded from an xml file
[t, x, names] = sbiosimulate(modelObj);
modelObj has the following
Model Components:
Compartments: 3
Events: 0
Parameters: 193
Reactions: 40
Rules: 5
Species: 60
I want to change the values of 10 parameters present in modelObj while calling sbiosimulate.
Could someone suggest how this can be done?
For example,
While using ode15s I can easily do this using
ode45(@(t,z)model(t,z,c), tSpan, z0);
Where c is the vector containing the values of the 10 parameters.
Any suggestions?

Answers (2)

Jeremy Huard
Jeremy Huard on 29 Apr 2019
Edited: Jeremy Huard on 29 Apr 2019
There is multiple ways to do this:
1- if you want to run multiple simulations, I recommend to use a SimFunction that will take a matrix of parameter values as input. Please refer to this post: Tips and Tricks: Use SimFunction for easy and fast model simulations in scripts
2- if you run a single simulation, you can create a variant with sbiovariant, add content to it with addcontent and pass it to sbiosimulate. When you pass this variant to sbiosimulate, the values in this variant will be used for simulation instead of the values stored in the model.
An easier way to create it is to use the App.
3- you can modify parameter values in the model itself. For this, you can use sbioselect to select the object corresponding to your parameter and change its value with the dot notation (parObj.Value). However, I don't recommend this method because this change will persist for the rest of your analysis, which might not be what you want.
Deepa Maheshvare
Deepa Maheshvare on 30 Apr 2019
Hi ,
I used the App , uploaded the dataset as advised by you.
I get the following message after performing sbiofit,
"The right-hand side of the system of SimBiology ODEs results in infinite or NaN values. This usually indicates a modeling error and can lead to solver integration errors"
However,I could successfully obtain steady state solution prior to performing paarmeter estimation task . My system is stable with negative eigen values.
I'm not sure how to interpret the above message.
Any suggestions?

Sign in to comment.

Jeremy Huard
Jeremy Huard on 2 May 2019
Hi Deepa,
there might be different reasons to get this error message. A typical one is when one of the fluxes becomes Inf or NaN, for instance when it contains a division by 0. Another reason could be that you use a proportional error model for data that gets close to 0. If this is the case, you can try whith a constant error model.
Checking the valus of fluxes might be tedious. Maybe I can help if you can share your SimBiology file.
Jeremy Huard
Jeremy Huard on 2 May 2019
Hi Deepa,
please send your model to jhuard at the domain of this website.

Sign in to comment.


More Answers in the  SimBiology Community



Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by