Skip to Main Content Skip to Search
Product Documentation

RuleType - Specify type of rule for rule object

Description

The RuleType property indicates the type of rule defined by the rule object. A Rule object defines how certain species, parameters, and compartments should interact with one another. For example, a rule could state that the total number of species A and species B must be some value. Rule is a MATLAB expression that defines the change in the species object quantity or a parameter object Value when the rule is evaluated.

You can add a rule to a model object with the addrule method and remove the rule with the delete method. For more information on rules, see addrule.

The types of rules in SimBiology are as follows:

Constraints on Varying Species Using a Rate Rule

If the model has a species defined in concentration, being varied by a rate rule, and it is in a compartment with varying volume, you can only use rate or initialAssignment rules to vary the compartment volume.

Conversely, if you are varying a compartment's volume using a repeatedAssignment or algebraic rules, then you cannot vary a species (defined in concentration) within that compartment, with a rate rule.

The reason for these constraints is that, if a species is defined in concentration and it is in a compartment with varying volume, the time derivative of that species is a function of the compartment's rate of change. For compartments varied by rate rules, the solver has that information.

Note that if you specify the species in amounts there are no constraints.

Characteristics

Applies toObject: rule
Data typechar string
Data values'initialAssignment', 'repeatedAssignment''algebraic', 'rate'. Default value is 'initialAssignment'.
AccessRead/write

Examples

  1. Create a model object, and then add a reaction object.

    modelObj = sbiomodel ('my_model');
    reactionObj = addreaction (modelObj, 'a -> b');
  2. Add a rule that specifies the quantity of a species c. In the rule expression, k is the rate constant for a -> b.

    ruleObj = addrule(modelObj, 'c = k*(a+b)')
  3. Change the RuleType from the default ('algebraic') to 'rate' and verify it using the get command.

    set(ruleObj, 'RuleType', 'rate');
    get(ruleObj)

    MATLAB returns all the properties for the rule object.

        Active: 1
    Annotation: ''
          Name: ''
         Notes: ''
        Parent: [1x1 SimBiology.Model]
          Rule: 'c = k*(a+b)'
      RuleType: 'rate'
           Tag: ''
          Type: 'rule'
      UserData: []

See Also

Rule Object in the SimBiology User's Guide, addrule, delete

  


Free Computational Biology Interactive Kit

See how to analyze, visualize, and model biological data and systems using MathWorks products.

Get free kit

Trials Available

Try the latest computational biology products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS