Contenido principal

updateConfigsets

R2026b

Propagate solver type and compile options from parent model to submodels

Since R2026b

Description

updateConfigsets(parentModel) updates all active configuration sets on submodels under parentModel to have the same solver type and compile options as the active configuration set of parentModel. Use this function after moving or copying submodels to ensure consistent configuration across the hierarchy. Specify DryRun=true to preview changes without applying them.

example

updateConfigsets(parentModel,templateConfigset) updates all active configuration sets on parentModel and its submodels to have the same solver type and compile options as templateConfigset.

updateConfigsets(___,Name=Value) specifies additional options using one or more name-value arguments.

changes = updateConfigsets(___) also returns a table describing which properties were changed on which models for any of the previous input argument combinations.

Examples

collapse all

Create a PBPK model with organ submodels.

pbpkModel = sbiomodel("PBPK");
gutModel = addmodel(pbpkModel,"Gut submodel");
liverModel = addmodel(pbpkModel,"Liver submodel");

Enable unit conversion on the parent model.

csParent = getconfigset(pbpkModel);
csParent.CompileOptions.UnitConversion = true;

Verify that the submodels still have the default setting.

csGut = getconfigset(gutModel);
csLiver = getconfigset(liverModel);
csGut.CompileOptions.UnitConversion
ans = logical
   0

csLiver.CompileOptions.UnitConversion
ans = logical
   0

Propagate the compile options from the parent model to all submodels.

changes = updateConfigsets(pbpkModel)
changes = 2×4 table
            Model                Property        OriginalValue    NewValue
    _____________________    ________________    _____________    ________

    "PBPK.Gut submodel"      "UnitConversion"        {[0]}         {[1]}  
    "PBPK.Liver submodel"    "UnitConversion"        {[0]}         {[1]}  

Verify that the submodels now have unit conversion enabled.

csGut.CompileOptions.UnitConversion
ans = logical
   1

csLiver.CompileOptions.UnitConversion
ans = logical
   1

Input Arguments

collapse all

Model whose configuration to propagate, specified as a SimBiology.Model object. The function propagates the solver type and compile options from the active configuration set of parentModel to all submodels recursively.

Configuration set to use as source, specified as a SimBiology.Configset object. When you specify templateConfigset, the function updates all active configuration sets on parentModel and its submodels to match templateConfigset, instead of using the active configuration set of parentModel as the source.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: changes = updateConfigsets(parentModel,DryRun=true) reports which properties would be changed without actually modifying any configuration sets.

Flag to report changes without applying them, specified as a numeric or logical 1 (true) or 0 (false). When true, the function returns the changes table showing what would be updated without actually modifying any configuration sets.

Data Types: logical

Configuration set on parentModel to update, specified as a SimBiology.Configset object that belongs to parentModel. By default, the function updates the active configuration set. Use this argument to update a nonactive configuration set instead.

Output Arguments

collapse all

Summary of updated properties, returned as a table with these columns:

ColumnDescription
ModelFully qualified name of the model whose configuration set was updated
PropertyName of the property that was changed (for example, SolverType, UnitConversion, or DimensionalAnalysis)
OriginalValuePrevious value of the property
NewValueNew value applied from the source configuration set

If no properties needed updating, the table is empty.

Data Types: table

Version History

Introduced in R2026b