addparameter (model, kineticlaw)
Create parameter object and add to model or kinetic law object
Syntax
parameterObj = addparameter(
Obj
,
'NameValue
')
parameterObj = addparameter(Obj,
'NameValue
', ValueValue
)
parameterObj = addparameter(...'PropertyName
', PropertyValue
...)
Arguments
| Model object or kineticlaw object . Enter a variable name for the
object. |
| Property for a parameter object. Enter a unique character vector. Since
objects can use this property to reference a parameter, a parameter
object must have a unique name at the level it is created. For example,
a kinetic law object cannot contain two parameter objects named For information on naming parameters,
see |
| Property for a parameter object. Enter a number. |
Description
parameterObj = addparameter(
creates
a parameter object and returns the object (Obj
,
'NameValue
') parameterObj
).
In the parameter object, this method assigns a value (
)
to the property NameValue
Name
, assigns a value 1
to
the property Value
, and assigns the model or kinetic
law object to the property Parent
. In the model
or kinetic law object, (Obj
), this method
assigns the parameter object to the property Parameters
.
A parameter object defines an assignment that a model or a kinetic law can use. The scope of the parameter is defined by the parameter parent. If a parameter is defined with a kinetic law object, then only the kinetic law object and objects within the kinetic law object can use the parameter. If a parameter object is defined with a model object as its parent, then all objects within the model (including all rules, events and kinetic laws) can use the parameter.
modelObj = sbiomodel('cell') parameterObj = addparameter(modelObj, 'TF1', 0.01)
modelObj = sbiomodel('cell') reactionObj = addreaction(modelObj, 'a -> b') kineticlawObj = addkineticlaw (reactionObj, 'MassAction') parameterObj = addparameter(kineticlawObj, 'K1_forward', 0.1)
parameterObj = addparameter(Obj,
'
creates
a parameter object, assigns a value (NameValue
', ValueValue
)
)
to the property NameValue
Name
, assigns the value (ValueValue
)
to the property Value
, and assigns the model object
or the kineticlaw object
to the property Parent
.
In the model or kinetic law object (Obj
), this
method assigns the parameter object to the property Parameters
,
and returns the parameter object to a variable (parameterObj
).
parameterObj = addparameter(...'
defines
optional property values. The name-value pairs can be in any format
supported by the function PropertyName
', PropertyValue
...)set
.
Scope of a parameter — A parameter can be scoped to either a model or a kinetic law.
When a kinetic law searches for a parameter in its expression, it first looks in the parameter list of the kinetic law. If the parameter isn’t found there, it moves to the model that the kinetic law object is in and looks in the model parameter list. If the parameter isn’t found there, it moves to the model parent.
When a rule searches for a parameter in its expression, it looks in the parameter list for the model. If the parameter isn’t found there, it moves to the model parent. A rule cannot use a parameter that is scoped to a kinetic law. So for a parameter to be used in both a reaction rate equation and a rule, the parameter should be scoped to a model.
Additional parameter object properties can be viewed with the
command. Additional parameter
object properties can be modified with the get
command. The parameters
of set
Obj
can be viewed with get(
Obj
,
'Parameters').
A SimBiology® parameter object can be copied to a SimBiology model
or kinetic law object with copyobj
.
A SimBiology parameter object can be removed from a SimBiology model
or kinetic law object with delete
.
Method Summary
Methods for parameter objects
copyobj | Copy SimBiology object and its children |
delete | Delete SimBiology object |
display | Display summary of SimBiology object |
findUsages | Find out how a species, parameter, or compartment is used in a model |
get | Get SimBiology object properties |
move | Move SimBiology species or parameter object to new parent |
rename | Rename object and update expressions |
set | Set SimBiology object properties |
Property Summary
Properties for parameter objects
Constant | Specify variable or constant species amount, parameter value, or compartment capacity |
ConstantValue | Specify variable or constant parameter value |
Name | Specify name of object |
Notes | HTML text describing SimBiology object |
Parent | Indicate parent object |
Tag | Specify label for SimBiology object |
Type | Display SimBiology object type |
Units | Units for species amount, parameter value, compartment capacity, observable expression |
UserData | Specify data to associate with object |
Value | Value of species, compartment, or parameter object |
ValueUnits | Parameter value units |
Example
Create a model object, and then add a reaction object.
modelObj = sbiomodel ('my_model'); reactionObj = addreaction (modelObj, 'a + b -> c + d');
Define a kinetic law for the reaction object.
kineticlawObj = addkineticlaw(reactionObj, 'MassAction');
Add a parameter and assign it to the kinetic law object (
kineticlawObj
); add another parameter and assign to the model object (modelObj
).% Add parameter to kinetic law object parameterObj1 = addparameter (kineticlawObj, 'K1'); get (kineticlawObj, 'Parameters')
MATLAB returns:
SimBiology Parameter Array Index: Name: Value: ValueUnits: 1 K1 1
MATLAB returns:% Add parameter with value 0.9 to model object parameterObj1 = addparameter (modelObj, 'K2', 0.9); get (modelObj, 'Parameters')
SimBiology Parameter Array Index: Name: Value: ValueUnits: 1 K2 1