Main Content

export (model)

Export SimBiology models for deployment and standalone applications

Description

exportedModel = export(model) returns a SimBiology.export.Model object, exportedModel, from a SimBiology model object, model including all doses which are editable in the exported model. In addition, if the model has any active variants, they are automatically applied to determine the default initial values in the exported model. By default, all species, parameters, compartments, and doses are editable in the exported model. When you simulate the exported model, you can specify different initial values or different dose conditions.

exportedModel = export(model,editobjs) specifies editobjs, which is a species, parameter, compartment, or vector of these objects that are editable in the exported model. All doses are exported and are editable in the exported model. If the model has any active variants, they are automatically applied to determine the default initial values in the exported model. When you simulate the exported model, you can specify different initial values for editobjs or different dose conditions.

exportedModel = export(model,editobjs,modifiers) additionally specifies modifiers which is a dose, variant, vector of these objects or an empty array [].

exportedModel = export(model,editobjs,editdoses,variants) additionally specifies editdoses, a dose object or vector of dose objects and variants, a variant object or vector of variant objects.

Method Summary

Methods for exported model objects

acceleratePrepare exported SimBiology model for acceleration
getIndexGet indices into ValueInfo and InitialValues properties
getdoseReturn exported SimBiology model dose object
isAcceleratedDetermine whether an exported SimBiology model is accelerated
simulateSimulate exported SimBiology model

Input Arguments

collapse all

SimBiology model, specified as a SimBiology model object.

Editable model quantities in the exported model, specified as a species, parameter, or compartment object or a vector of these objects.

Model modifiers, specified as a dose or variant object, a vector of these objects, or an empty array [].

If modifiers is a vector of dose objects, then only these doses are editable in the exported model.

If modifiers is an empty array [], then no doses are editable in the exported model, and all active variants are applied to determine the default initial values of model quantities in the exported model.

If modifiers is a vector of variant objects, then specified variants are applied to determine the default initial values. All doses in the model are exported.

When you simulate the exported model, you can specify different initial values for editobjs or different dose conditions for editable doses.

Editable doses, specified as a dose object or vector of dose objects. The specified dose objects are editable in the exported model.

Variants, specified as a variant object or a vector of objects. The specified variant objects are applied to determine the default initial values in the exported model.

Output Arguments

collapse all

Exported model, specified as a SimBiology.export.Model object.

Examples

collapse all

Export a SimBiology model object.

modelObj = sbmlimport('lotka');
exportedModel = export(modelObj)
exportedModel = 
  Model with properties:

           Name: 'lotka'
     ExportTime: '20-Jul-2024 13:43:49'
    ExportNotes: ''

Display the editable values (compartments, species, and parameters) information for the exported model object.

{exportedModel.ValueInfo.Name}
ans = 1x8 cell
    {'unnamed'}    {'x'}    {'y1'}    {'y2'}    {'z'}    {'c1'}    {'c2'}    {'c3'}

There are 8 editable values in the exported model. Export the model again, allowing only the parameters (c1, c2, and c3) to be editable.

parameters = sbioselect(modelObj,'Type','parameter');
exportedModelParam = export(modelObj,parameters);
{exportedModelParam.ValueInfo.Name}
ans = 1x3 cell
    {'c1'}    {'c2'}    {'c3'}

Export the model a third time, allowing the parameters and species to be editable.

PS = sbioselect(modelObj,'Type',{'species','parameter'});
exportedModelPS = export(modelObj,PS);
{exportedModelPS.ValueInfo.Name}
ans = 1x7 cell
    {'x'}    {'y1'}    {'y2'}    {'z'}    {'c1'}    {'c2'}    {'c3'}

Open a sample SimBiology model project, and export the included model object.

sbioloadproject('AntibacterialPKPD')
em = export(m1);

Get the editable doses from the exported model object.

doses = getdose(em)
doses=1×4 RepeatDose array with properties:
    Interval
    RepeatCount
    StartTime
    TimeUnits
    Amount
    AmountUnits
    DurationParameterName
    LagParameterName
    Name
    Notes
    Parent
    Rate
    RateUnits
    TargetName

The exported model has 4 repeated dose objects.

Display the 3rd dose object from the exported model object.

doses(3)
ans = 
  RepeatDose with properties:

                 Interval: 12
              RepeatCount: 27
                StartTime: 0
                TimeUnits: 'hour'
                   Amount: 500
              AmountUnits: 'milligram'
    DurationParameterName: 'TDose'
         LagParameterName: ''
                     Name: '500 mg bid'
                    Notes: ''
                   Parent: 'Antibacterial'
                     Rate: 0
                RateUnits: ''
               TargetName: 'Central.Drug'

Change the dosing amount for this dose object.

doses(3).Amount = 600;
doses(3)
ans = 
  RepeatDose with properties:

                 Interval: 12
              RepeatCount: 27
                StartTime: 0
                TimeUnits: 'hour'
                   Amount: 600
              AmountUnits: 'milligram'
    DurationParameterName: 'TDose'
         LagParameterName: ''
                     Name: '500 mg bid'
                    Notes: ''
                   Parent: 'Antibacterial'
                     Rate: 0
                RateUnits: ''
               TargetName: 'Central.Drug'

Version History

Introduced in R2012b