How to run the model in SBML file?

Hi All,
I have a differential equation model(kinetic model) in sbml file. I want to run this model using ode15s solver.
How someone explain me how this can be done?
I have imported the file using
modelObj = sbmlimport('File.xml')

 Accepted Answer

Dear Deepa,
there is two ways to simulate a model saved in a sbml file:
1. using the SimBiology App
You can open the SimBiology App from the App tab in MATLAB. Then in the 'Add Model' menu, select 'Load a model from a file' and choose your sbml file. One your model is loaded, select 'Simulate model' in the 'Add task' menu. ode15s is the default solver but you can select other in the 'Simulation settings'.
I recommend you to have a look at those short videos for a tutorial:
2. programmatically using SimBiology commands
Here is a code snippet to do this:
% Load model
modelObj = sbmlimport('File.xml');
% Define simulation settings
cs = getconfigset(modelObj);
cs.SolverType = 'ode15s'; % this is the default
cs.StopTime = 24; % to simulate 24 time units as specified by your model
% Simulate
[t, x, names] = sbiosimulate(modelObj);
plot(t, x)
xlabel('Time')
ylabel('States')
title('States vs Time')
legend(names)
I suggest you have a look at the documentation for an overview of the simulation settings:
However, here are some general remarks:
  • I recommend you to define all units in your model and turn on the unit conversion feature. This way you will be able to specify the simulation time in any unit you want (hour, day, minute,...). Otherwise, you will need to make sure that everything is consistent.
  • If your model is large and you wish to work on the command line, I recommend you to call sbiosimulate with a single output that will be a simData object. Then, you can select the state(s) you wish to plot:
sd = sbiosimulate(modelObj);
[t, x1] = selectbyname(sd, 'speciesNameToPlot');
plot(t, x1)
xlabel('Time')
ylabel('speciesNameToPlot')
  • There is a lot of great information in the doc that will help you get started. Starting by using the SimBiology App might be the easiest way. This page will explain you all the concepts: SimBiology App.
Best,
Jérémy

4 Comments

Thanks a lot for the detaile explanation.
I'd like to estimate 10 parameters present in my model containing 50 differential equation that govern change in concentration of 50 species.
The experimental data that I have is the steady state concentrations of all 50 species , measured in different experiments.i.e For a species, i, I have the concentration window that is
obtained from experiments at steady state. [ minimum concentration of i, maximum concetration of i]. Also, I have the initial values of the 10 parameters that I want to estimate.
I have a question regarding the parameter estimation
task, documented in this link
[k, result]= sbioparamestim(modelObj, tspan, xtarget, observed_array, estimated_array)
I want to use fmincon for minimizing the objective function as discussed in the suggestions received in my post here.
It is mentioned that xtarget,
n-by-m matrix, where n is the number of time samples and m is the number of states to match during the simulation. The number of rows in xtarget must equal the number of rows in tspan.
However, with the experimental data that is available , the number of rows of xtarget is not equal to n-by-m matrix. It's 1-by-m, where m is the number of species in my system.
Could you please suggest how to provide the input for xtarget in my case?
As suggested in the documentation, sbioparamestim will be removed in a future release. Please use sbiofit instead.
That being said, I recommend you to use the SimBiology App. There, you will see what needs to be defined to run the parameter estimation ('Add task' -> 'Fit data').
Please follow Steps 1 & 3 described here: (step 2 is the addition of a model but you already have one): Parameter estimation
You will be able to set parameter bounds, choose error models and choose one of several optimization methods in the fit task. fmincon will be in that list. But other methods accept also parameter bounds. The list is available here: Supported Methods for Parameter Estimation
Hi,
Thank you very much for the links and suggestions.Since my model is large, I prefer using the command line for now.I'll definetly have a look at the app too.
I've been going though the sbiofit options documented here,
fitResults = sbiofit(sm,grpData,responseMap,estiminfo)
In the contents that go into estiminfo(the following example is illustrated in the documentation),
paramsToEstimate = {'log(Central)','log(Cl_Central)'};
estimatedParams = estimatedInfo(paramsToEstimate,'InitialValue',[1 1],'Bounds',[1 5;0.5 2]);
Likewise, I'd like to choose the parameters from my model contained in the xml file.
I would like to know how parameters can be selected. Should I use libsbml to parse the parameters?
There is no disadvantage of using the App with large models over the command line.
Also, your model is now a SimBiology model. So, there is no need to use the sbml file anymore.
The App presents the huge advantage of displaying all model components, including the parameters. Also, the Fit task provides you a user interface to choose the parameters to estimate.
I strongly recommend you to have a look at it. And if you wish later on to do this on the command line, you can generate the MATLAB code associated with this fit task from the user interface:
Capture.PNG
On the command line, you can access the list parameters with:
modelObj.Parameters

Sign in to comment.

More Answers (0)

Communities

More Answers in the  SimBiology Community

Products

Tags

Community Treasure Hunt

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

Start Hunting!