Main Content

SimBiology.Parameter

Parameter and scope information

Description

The SimBiology.Parameter object represents a parameter, which is a quantity that can change or can be constant. SimBiology® parameters are generally used to define rate constants. You can add parameter objects to a model object or a kinetic law object. The scope of a parameter depends on where you add the parameter object: If you add the parameter object to a model object, the parameter is available to all reactions in the model and the Parent property of the parameter object is SimBiology.Model. If you add the parameter object to a kinetic law object, the parameter is available only to the reaction for which you are using the kinetic law object and the Parent property of the parameter object is SimBiology.KineticLaw.

Use dot notation to query the object properties or change properties that are not read-only. You can also use the get and set commands.

The SimBiology Model Builder app also enables you to add reactions and parameters to your model and edit them. For an example, see Incorporate Inhibitor PK by Adding and Configuring Reactions.

Creation

Use addparameter to create and add a parameter to a SimBiology model.

Properties

expand all

Flag to set a parameter value as a constant, specified as a numeric or logical 1 (true) or 0 (false). Constant is identical to ConstantValue.

In other words, the Constant property indicates whether the value of a parameter can change during a simulation.

You can allow the value of the parameter to change during a simulation by specifying a rule that changes the Value property of the parameter object.

As an example, consider feedback inhibition of an enzyme such as aspartate kinase by threonine. Aspartate kinase has three isozymes that are independently inhibited by the products of downstream reactions (threonine, homoserine, and lysine). Although threonine is made through a series of reactions in the synthesis pathway, for illustration, the reactions are simplified as follows:

Aspartic acid aspartate kinaseβAspartylphosphateβAspartylphosphate Threonine

To model inhibition of aspartate kinase by threonine, you could use a rule like the algebraic rule, such as k_aspartate_kinase - (1/threonine), to vary the rate of the above reaction and simulate inhibition. In the rule, the rate constant for the above reaction is denoted by k_aspartate_kinase and the quantity of threonine is threonine.

Data Types: double | logical

Flag to set the parameter value as a constant, specified as a numeric or logical 1 (true) or 0 (false). ConstantValue is identical to Constant.

Data Types: double | logical

SimBiology.Parameter object name, specified as a character vector or string.

For details on requirements and recommendations for naming SimBiology components, see Guidelines for Naming Model Components.

Data Types: char | string

Additional information that you can add for SimBiology.Parameter, specified as a character vector or string.

Data Types: char | string

This property is read-only.

Parent object, specified as a SimBiology.Model or SimBiology.KineticLaw object.

Object label, specified as a character vector or string.

Tip

Use this property to group objects and then use sbioselect to retrieve. For example, use the Tag property of reaction objects to group synthesis or degradation reactions. You can then retrieve all synthesis reactions using sbioselect. Similarly, for species objects you can enter and store classification information, for example, membrane protein, transcription factor, enzyme classifications, or whether a species is an independent variable. You can also enter the full form of the name of the species.

Data Types: char | string

This property is read-only.

Object type, specified as 'parameter'. When you create a SimBiology object, the value of Type is automatically defined.

Data Types: char

Units for the parameter value, specified as a character vector or string scalar.

The Units property indicates the unit definition of the Value property of a parameter object. Units is identical to ValueUnits.

The default value (empty character array) means an unspecified unit. Unspecified units are permitted during dimensional analysis, but not during unit conversion. Use 'dimensionless' to specify dimensionless units.

Units can be one of the built-in units or you can create your own units. To get a list of the built-in units, use sbioshowunits. To create a custom unit, use sbiounit. If Units changes from one unit definition to another, the Value property does not automatically convert to the new units. sbioconvertunits does this conversion.

Note

SimBiology uses units including empty units in association with DimensionalAnalysis and UnitConversion features.

  • When DimensionalAnalysis and UnitConversion are both false, units are not used. However, SimBiology still performs a minimum level of dimensional analysis to decide whether a reaction rate is in dimensions of amount/time or concentration/time.

  • When DimensionalAnalysis is true and UnitConversion is false, units (if not empty) must have consistent dimensions so that SimBiology can perform dimensional analysis. However, the units are not converted.

  • When UnitConversion is set to true (which requires DimensionalAnalysis to be true), SimBiology performs a dimensional analysis and converts everything to consistent units. Hence, you must specify consistent units, and no units can be empty. If you have a dimensionless parameter, you must still set its unit to dimensionless.

Example: '1/second'

Data Types: char | string

Data to associate with the object, specified as a numeric scalar, vector, string, or any other MATLAB data type.

The object does not use this data directly, but you can access it using dot notation or get.

Parameter value, specified as a nonnegative scalar.

Data Types: double

Units for the parameter value, specified as a character vector or string scalar. This property is identical to Units.

Data Types: char | string

Object Functions

copyobjCopy SimBiology object and its children
deleteDelete SimBiology object
displayDisplay summary of SimBiology object
findUsagesFind out how a species, parameter, or compartment is used in a model
getGet SimBiology object properties
moveMove SimBiology species or parameter object to new parent
renameRename SimBiology model component and update expressions
setSet SimBiology object properties

Examples

collapse all

This example shows you how to construct a simple model with two species (A and B) and a reaction. The reaction is A -> B, which follows mass action kinetics with the forward rate parameter k. Hence the rate of change is dA/dt=-k*A.

Create a SimBiology model named simpleModel.

m1 = sbiomodel('simpleModel');

Add a reaction that involves two species A and B, where A is converted to B.

r1 = addreaction(m1,'A -> B');

SimBiology automatically add species A and B to the model.

m1.species
ans = 
   SimBiology Species Array

   Index:    Compartment:    Name:    Value:    Units:
   1         unnamed         A        0               
   2         unnamed         B        0               

Set the initial amount of the first species (A) to 10.

m1.species(1).InitialAmount = 10;

Define the kinetic law of the reaction to follow mass action kinetics. You can achieve this by adding a kinetic law object to the reaction r1.

kineticLaw = addkineticlaw(r1,'MassAction');

Add a rate constant parameter to the mass action kinetic law. You must set the ParameterVariableNames property of the kinetic law object to the name of the parameter 'k' so that the reaction rate can be determined.

p1 = addparameter(kineticLaw,'k',0.5);
kineticLaw.ParameterVariableNames = 'k';

Simulate the model.

sd = sbiosimulate(m1);

Plot the simulation results.

sbioplot(sd);

Figure contains an axes object. The axes object with title States versus Time, xlabel Time, ylabel States contains 2 objects of type line. These objects represent A, B.

This example shows how to change the amount of a species similar to a first-order reaction using the first-order rate rule. For example, suppose the species x decays exponentially. The rate of change of species x is:

dx/dt=-k*x

The analytical solution is:

Ct=C0*e-kt

where Ct is the amount of species at time t, and C0 is the initial amount. Use the following commands to set up a SimBiology model accordingly and simulate it.

m = sbiomodel('m');
c = addcompartment(m,'comp');
s = addspecies(m,'x','InitialAmount',2);
p = addparameter(m,'k','Value',1);
r = addrule(m,'x = -k * x','RuleType','rate');
[t,sd,species] = sbiosimulate(m);
plot(t,sd);
legend(species);
xlabel('Time');
ylabel('Species Amount');

Figure contains an axes object. The axes object with xlabel Time, ylabel Species Amount contains an object of type line. This object represents x.

If the amount of a species x is determined by a rate rule and x is also in a reaction, x must have its BoundaryCodition property set to true. For example, with a reaction a -> x and a rate rule dxdt=k*x, set the BoundaryCodition property of species x to true so that a differential rate term is not created from the reaction. The amount of x is determined solely by a differential rate term from the rate rule. If the BoundaryCodition property is set to false, you will get the following error message such as Invalid rule variable 'x' in rate rule or reaction.

This example shows how to create a rate rule where a species from one reaction can determine the rate of another reaction if it is in the second reaction rate equation. Similarly, a species from a reaction can determine the rate of another species if it is in the rate rule that defines that other species. Suppose you have a SimBiology model with three species (a, b, and c), one reaction (a -> b), and two parameters (k1 and k2). The rate equation is defined as b=-k1*a, and rate rule is dc/dt=k2*a. The solution for the species in the reaction are:

a=aoe-k1t, b=ao(1-e-k1t).

Since the rate rule dc/dt=k2*a is dependent on the reaction, dc/dt=k2(aoe-k1t). The solution is:

c=co+k2ao/k1(1-e-k1t)

Enter the following commands to set up a SimBiology model accordingly and simulate it.

m = sbiomodel('m');
c = addcompartment(m,'comp');
s1 = addspecies(m,'a','InitialAmount',10,'InitialAmountUnits','mole');
s2 = addspecies(m,'b','InitialAmount',0,'InitialAmountUnits','mole');
s3 = addspecies(m,'c','InitialAmount',5,'InitialAmountUnits','mole');
rxn = addreaction(m,'a -> b');
kl = addkineticlaw(rxn,'MassAction');
p1 = addparameter(kl,'k1','Value',1,'ValueUnits','1/second');
rule = addrule(m,'c = k2 * a','RuleType','rate');
kl.ParameterVariableNames = 'k1';
p2 = addparameter(m,'k2','Value',1,'ValueUnits','1/second');
[t,sd,species] = sbiosimulate(m);
plot(t,sd);
legend(species);
xlabel('Time');
ylabel('Species Amount');

Figure contains an axes object. The axes object with xlabel Time, ylabel Species Amount contains 3 objects of type line. These objects represent a, b, c.

Version History

Introduced in R2006b

expand all