Main Content

sbioaddtolibrary

Add to user-defined library

Syntax

sbioaddtolibrary (abstkineticlawObj)
sbioaddtolibrary (unitObj)
sbioaddtolibrary (unitprefixObj)

Arguments

abstkineticlawObjSpecify the abstract kinetic law object that holds the kinetic law definition. The Name of the kinetic law must be unique in the user-defined kinetic law library. Name is referenced by kineticlawObj. For more information about creating kineticlawObj, see sbioabstractkineticlaw.
unitObjSpecify the user-defined unit to add to the library. For more information about creating unitObj, see sbiounit.
unitprefixObjSpecify the user-defined unit prefix to add to the library. For more information about creating unitprefixObj, see sbiounitprefix.

Description

The function sbioaddtolibrary adds kinetic law definitions, units, and unit prefixes to the user-defined library.

sbioaddtolibrary (abstkineticlawObj) adds the abstract kinetic law object (abstkineticlawObj) to the user-defined library.

sbioaddtolibrary (unitObj) adds the user-defined unit (unitObj) to the user-defined library.

sbioaddtolibrary (unitprefixObj) adds the user-defined unit prefix (unitprefixObj) to the user-defined library.

The sbioaddtolibrary function adds any kinetic law definition, unit, or unit prefix to the root object's UserDefinedLibrary property. These library components become available automatically in future MATLAB® sessions.

Use the kinetic law definitions in the built-in and user-defined library to construct a kinetic law object with the method addkineticlaw.

To get a component of the built-in and user-defined libraries, use the commands get(sbioroot, 'BuiltInLibrary') and (get(sbioroot, 'UserDefinedLibrary')).

To remove the library component from the user-defined library, use the function sbioremovefromlibrary. You cannot remove a kinetic law definition being used by a reaction.

Examples

This example shows how to create a kinetic law definition and add it to the user-defined library.

  1. Create a kinetic law definition.

    abstkineticlawObj = sbioabstractkineticlaw('ex_mylaw1', '(k1*s)/(k2+k1+s)');
  2. Assign the parameter and species variables in the expression.

    set (abstkineticlawObj, 'SpeciesVariables', {'s'});
    set (abstkineticlawObj, 'ParameterVariables', {'k1', 'k2'});
  3. Add the new kinetic law definition to the user-defined library.

    sbioaddtolibrary(abstkineticlawObj);

    The function adds the kinetic law definition to the user-defined library. You can verify this using sbiowhos.

    sbiowhos -kineticlaw -userdefined
    
    SimBiology Abstract Kinetic Law Array
    
    Index:    Library:       Name:     Expression:
    1         UserDefined    mylaw1    (k1*s)/(k2+k1+s)  
  4. Use the new kinetic law definition when defining a reaction's kinetic law.

    modelObj = sbiomodel('cell');
    reactionObj = addreaction(modelObj, 'A + B <-> B + C');
    kineticlawObj = addkineticlaw(reactionObj, 'ex_mylaw1');

    Note

    Remember to specify the SpeciesVariableNames and the ParameterVariableNames in kineticlawObj to fully define the ReactionRate of the reaction.

Version History

Introduced in R2006a