Main Content

getequations

Return system of equations for model object

Syntax

equations = getequations(modelobj)
equations = getequations(modelobj,configsetobj,variantobj,doseobj)

Description

equations = getequations(modelobj) returns equations, a character vector containing the system of equations that represent modelobj, a model object. The function uses any active configset, active variants, and active doses, if any, and generates the system of equations. You must specify a deterministic solver.

equations = getequations(modelobj,configsetobj,variantobj,doseobj) returns the system of equations that represent the model specified by a Model object, Variant objects, and dose objects (RepeatDose or ScheduleDose). The function uses only the specified configset, doses, and variants to generate the equations. Any other configset, doses, and variants are ignored. You must specify a deterministic solver.

If you set csObj to [], then the function uses the active configset object.

If you set variantObj to [], then the function uses no variants.

If you set doseObj to [], then the function uses no doses.

Input Arguments

modelobj

Object of the Model class.

Note

If using modelobj as the only input argument, the active Configset object must specify a deterministic solver.

configsetobj

Object of the Configset class. This object must specify a deterministic solver.

Default: [] (Empty, which specifies the active Configset object for modelobj)

variantobj

Object or array of objects of the Variant class.

Default: [] (Empty, which specifies no variant object)

doseobj

Object or array of objects of the RepeatDose or ScheduleDose class.

Default: [] (Empty, which specifies no dose object)

Output Arguments

equations

Character vector containing the system of equations that represent a model. Equations for reactions, rules, events, variants, and doses are included.

Examples

collapse all

View system of equations that represent a simple model, containing only reactions.

Import the lotka model, included with SimBiology®, into a variable named model1:

model1 = sbmlimport('lotka');

View all equations that represent the model1 model and its active configset:

m1equations = getequations(model1)
m1equations =

ODEs:
d(y1)/dt = 1/unnamed*(ReactionFlux1 - ReactionFlux2)
d(y2)/dt = 1/unnamed*(ReactionFlux2 - ReactionFlux3)
d(z)/dt = 1/unnamed*(ReactionFlux3)

Fluxes:
ReactionFlux1 = c1*y1*x
ReactionFlux2 = c2*y1*y2
ReactionFlux3 = c3*y2

Parameter Values:
c1 = 10
c2 = 0.01
c3 = 10
unnamed = 1

Initial Conditions:
x = 1
y1 = 900
y2 = 900
z = 0

MATLAB® displays the ODEs, fluxes, parameter values, and initial conditions for the reactions in model1.

View system of equations that represent a model, containing only reactions, and a repeated dose.

Import the lotka model, included with SimBiology, into a variable named model1:

model1 = sbmlimport('lotka');

Add a repeated dose to the model:

doseObj1 =  adddose(model1,'dose1','repeat');

Set the properties of the dose to administer 3 mg, at a rate of 10 mg/hour, 6 times, at an interval of every 24 hours, to species y1:

doseObj1.Amount = 0.003;
doseObj1.AmountUnits = 'gram';
doseObj1.Rate = 0.010;
doseObj1.RateUnits = 'gram/hour';
doseObj1.Repeat = 6;
doseObj1.Interval = 24;
doseObj1.TimeUnits = 'hour';
doseObj1.TargetName = 'y1';

View all equations that represent the model1 model, its active configset, and the repeated dose:

m1_with_dose_equations = getequations (model1,[],[],doseObj1)
m1_with_dose_equations =

ODEs:
d(y1)/dt = 1/unnamed*(ReactionFlux1 - ReactionFlux2) + dose1
d(y2)/dt = 1/unnamed*(ReactionFlux2 - ReactionFlux3)
d(z)/dt = 1/unnamed*(ReactionFlux3)

Fluxes:
ReactionFlux1 = c1*y1*x
ReactionFlux2 = c2*y1*y2
ReactionFlux3 = c3*y2

Parameter Values:
c1 = 10
c2 = 0.01
c3 = 10
unnamed = 1

Initial Conditions:
y1 = 900
y2 = 900
z = 0
x = 1

Doses:
Variable                      Type                Units               
dose1                         repeatdose          gram    

MATLAB displays the ODEs, fluxes, parameter values, and initial conditions for the reactions and the dose in model1.

Tips

Use getequations to see the system of equations that represent a model for:

  • Publishing purposes

  • Model debugging