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

Import the lotka model.

m1 = sbmlimport("lotka.xml");

View all equations that represent the model. The function returns the ODEs, fluxes, parameter values, and initial conditions for the reactions.

m1Equations = getequations(m1)
m1Equations = 
    'ODEs:
     d(y1)/dt = 1/unnamed*(Reaction1 - Reaction2)
     d(y2)/dt = 1/unnamed*(Reaction2 - Reaction3)
     d(z)/dt = 1/unnamed*(Reaction3)
     
     Fluxes:
     Reaction1 = c1*y1*x
     Reaction2 = c2*y1*y2
     Reaction3 = c3*y2
     
     Parameter Values:
     c1 = 10
     c2 = 0.01
     c3 = 10
     unnamed = 1
     
     Initial Conditions:
     y1 = 900
     y2 = 900
     z = 0
     x = 1
     
     '

Add a repeated dose to the model.

d1 =  adddose(m1,'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.

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

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

m1_with_dose_equations = getequations (m1,[],[],d1)
m1_with_dose_equations = 
    'ODEs:
     d(y1)/dt = 1/unnamed*(Reaction1 - Reaction2) + dose1
     d(y2)/dt = 1/unnamed*(Reaction2 - Reaction3)
     d(z)/dt = 1/unnamed*(Reaction3)
     
     Fluxes:
     Reaction1 = c1*y1*x
     Reaction2 = c2*y1*y2
     Reaction3 = 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               
     y1                            	repeatdose          	gram                
     
     '

Tips

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

  • Publishing purposes

  • Model debugging