Compartment object
Object containing compartment information
Description
The SimBiology® compartment object represents a container for species in a model. Compartment size can vary or remain constant during a simulation. All models must have at least one compartment and all species in a model must be assigned to a compartment. Compartment names must be unique within a model.
Compartments allow you to define the size (Capacity
) of physically
isolated regions that may affect simulation, and associate pools of species within those
regions. You can specify or change Capacity
using rules, events, and
variants, similar to species amounts or parameter values.
The model object stores compartments as a flat list. Each compartment stores
information on its own organization; in other words a compartment has information on
which compartment it lives within (Owner
) and who it contains
(Compartments
).
The flat list of compartments in the model object lets you vary the way compartments are organized in your model without invalidating any expressions.
To add species that participate in reactions, add the reaction to the model using the
addreaction
method. When you define
a reaction with a new species:
If no compartment objects exist in the model, the
addreaction
method creates a compartment object (called'
) in the model and adds the newly created species to that compartment.unnamed
'If only one compartment object exists in the model, the method creates a species object in that compartment.
If there is more than one compartment object in the model, you must qualify the species name with the compartment name.
For example,
cell.glucose
denotes that you want to put the species namedglucose
into a compartment namedcell
. Additionally, if the compartment namedcell
does not exist, the process of adding the reaction creates the compartment and names itcell
.
Alternatively, create and add a species object to a compartment object, using the
addspecies
method at the command
line.
When you use the SimBiology desktop to create a new model, it adds an empty compartment
(unnamed
), to which you can add species.
You can specify reactions that cross compartments using the syntax
–>
compartment1Name
.species1Name
.
If you add a reaction that contains species from different compartments, and the
reaction rate dimensions are concentration/time, all reactants should be from the same
compartment.compartment2Name
.species2Name
In addition, if the reaction is reversible then there are two cases:
If the kinetic law is
MassAction
, and the reaction rate reaction rate dimensions are concentration/time, then the products must be from the same compartment.If the kinetic law is not
MassAction
, then both reactants and products must be in the same compartment.
See Property Summary for links to compartment property reference pages.
Properties define the characteristics of an object. Use the
and
get
commands to list
object properties and change their values at the command line. You can graphically
change object properties in the graphical user interface. set
Constructor Summary
addcompartment (model, compartment) | Create compartment object |
Method Summary
Methods for compartment objects
addcompartment (model, compartment) | Create compartment object |
addspecies (model, compartment) | Create species object and add to compartment object within model object |
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 compartment object to new owner |
rename | Rename object and update expressions |
reorder (model, compartment, kinetic law) | Reorder component lists |
set | Set SimBiology object properties |
Property Summary
Properties for compartment objects
Capacity | Compartment capacity |
CapacityUnits | Compartment capacity units |
Compartments | Array of compartments in model or compartment |
Constant | Specify variable or constant species amount, parameter value, or compartment capacity |
ConstantCapacity | Specify variable or constant compartment capacity |
Name | Specify name of object |
Notes | HTML text describing SimBiology object |
Owner | Owning compartment |
Parent | Indicate parent object |
Species | Array of species in compartment 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 |
See Also
AbstractKineticLaw object
, Configset object
, KineticLaw object
, Model object
, Parameter object
, Reaction object
, Root object
, Rule object
Version History
Introduced in R2008a