Documentation Center

  • Trial Software
  • Product Updates

SimData object

Simulation data storage

Description

The SimBiology® SimData object contains simulation data. The output from the sbiosimulate function, is stored in the SimData object which holds time and state data as well as metadata, such as the types and names for the logged states or the configuration set used during simulation.

You can also store data from multiple simulation runs as an array of SimData objects. Thus, the output of sbioensemblerun is an array of SimData objects. You can use any SimData method on an array of SimData objects.

You can access the time, data, and metadata stored in the SimData object through the properties in Property Summary. Properties define the characteristics of an object. Use the get and set commands to list object properties and change their values at the command line.

Methods you can use to query the SimData object are listed in Method Summary.

Constructor Summary

sbioensemblerunMultiple stochastic ensemble runs of SimBiology model
sbiosimulateSimulate SimBiology model

Method Summary

delete (any object)Delete SimBiology object
display (any object)Display summary of SimBiology object
get (any object)Get object properties
getdata (SimData)Get data from SimData object array
getsensmatrix (SimData)Get 3-D sensitivity matrix from SimData array
resample (SimData)Resample SimData object array onto new time vector
select (SimData)Select data from SimData object
selectbyname (SimData)Select data by name from SimData object array
set (any object)Set object properties

Property Summary

DataStore simulation data
DataCountNumbers of species, parameters, sensitivities
DataInfoMetadata labels for simulation data
DataNamesShow names in SimData object
ModelNameName of model simulated
NameSpecify name of object
NotesHTML text describing SimBiology object
RunInfoInformation about simulation
TimeSimulation time steps or schedule dose times
TimeUnitsShow time units for dosing and simulation
UserDataSpecify data to associate with object

Examples

Return simulation results to a SimData object and plot the results.

sbioloadproject('radiodecay', 'm1');
simDataObj = sbiosimulate(m1);
sbioplot(simDataObj)

Get simulation data at specific time points using the resample method.

% Load 'radiodecay' and set the initial amount of species 'x'.
sbioloadproject('radiodecay', 'm1');
x = sbioselect(m1, 'Type', 'species', 'Name', 'x');
x.InitialAmount = 100;
% Change the solver type to a stochastic solver.
cs = m1.getconfigset;
cs.SolverType = 'ssa';
% Simulate the model.
simDataObj = sbiosimulate(m1);
% This result could be misinterpreted as containing fractional molecules.
sbioplot(simDataObj);
title('Simulation Results Before Resampling');
%Resample the data using the zero-order hold method to obtain the correct
%number of molecules at intermediate time steps.
newsimDataObj = resample(simDataObj, linspace(0, 10, 1e4), 'zoh');
sbioplot(newsimDataObj);
title('Simulation Results After Resampling');

Initialize a simulation using results from a previous simulation.

% Load 'radiodecay'. 
sbioloadproject('radiodecay', 'm1');
m1.Species
simDataObj = sbiosimulate(m1);
% Use the Data property to get the states at the final time point.
% Data is an m x n array, where m is the number of time steps in 
% the simulation and n is the number of quantities logged.
finaldata = simDataObj.Data(end,:);
% Use the DataInfo property to get names of states.
info = simDataObj.DataInfo;
% Loop through the states (species) and set their initial amounts.
numSpecies = length(info);
for c = 1:numSpecies
compObj = sbioselect(m1,'type','compartment','Name',info{c}.Compartment);
speciesObj = sbioselect(compObj,'type','species','Name',info{c}.Name);
speciesObj.InitialAmount = finaldata(c);
end
% Verify species initial amounts.
m1.Species
Was this topic helpful?