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:
modelObj = sbmlimport('File.xml');
cs = getconfigset(modelObj);
cs.SolverType = 'ode15s';
cs.StopTime = 24;
[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