メインコンテンツ

addequivalence

R2026b

Create equivalence set for quantities across submodels

Since R2026b

Description

addequivalence(parentModel,quantities) creates an equivalence set that declares the specified quantities from different submodels of parentModel as equivalent. One quantity in the set is designated as the resolved quantity, which the software uses in place of all other quantities in the set during simulation. For details, see SimBiology.EquivalenceSet.

example

eqSet = addequivalence(parentModel,quantities) also returns the equivalence set eqSet, which is a SimBiology.EquivalenceSet object.

example

Examples

collapse all

Create a parent model with three organ submodels.

parentModel = sbiomodel("PBPK");
liverModel = addmodel(parentModel,"Liver submodel");
kidneyModel = addmodel(parentModel,"Kidney submodel");
brainModel = addmodel(parentModel,"Brain submodel");

Add a |Venous Blood| compartment with a |Drug| species to each submodel.

c1 = addcompartment(liverModel,"Venous Blood");
c2 = addcompartment(kidneyModel,"Venous Blood");
c3 = addcompartment(brainModel,"Venous Blood");
addspecies(c1,"Drug");
addspecies(c2,"Drug");
addspecies(c3,"Drug");

Create an equivalence set grouping the |Venous Blood| compartments.

venousComps = sbioselect(parentModel,"Name","Venous Blood","Type","compartment");
eqVenous = addequivalence(parentModel,venousComps);
eqVenous.Quantities
ans = 
   SimBiology Compartment Array

   Index:    Name:           Value:    Units:    ParentModel:   
   1         Venous Blood    1                   Liver submodel 
   2         Venous Blood    1                   Kidney submodel
   3         Venous Blood    1                   Brain submodel 

Check which quantity is the resolved quantity.

eqVenous.ResolvedQuantity
ans = 
   SimBiology Compartment - Venous Blood 

   Compartment Components:
     Value:             1
     Units:             
     Compartments:      0
     Constant:          true
     Owner:             
     Species:           1
     ParentModel:       Liver submodel

Create a separate equivalence set for the |Drug| species. Making compartments equivalent does not automatically make their species equivalent.

drugSpecies = sbioselect(parentModel,"Name","Drug","Type","species");
eqDrug = addequivalence(parentModel,drugSpecies);
eqDrug.Quantities
ans = 
   SimBiology Species Array

   Index:    Compartment:    Name:    Value:    Units:    ParentModel:   
   1         Venous Blood    Drug     0                   Liver submodel 
   2         Venous Blood    Drug     0                   Kidney submodel
   3         Venous Blood    Drug     0                   Brain submodel 

Verify that the model now has two equivalence sets.

parentModel.EquivalenceSets
ans = 
  2×1 EquivalenceSet array with properties:

    ModelScope
    Quantities
    ResolvedQuantity
    SuperSet
    SubSets
    TopLevelSet

Input Arguments

collapse all

Model that owns the equivalence set, specified as a SimBiology.Model object. The new equivalence set appears in the EquivalenceSets property of parentModel.

Quantities to group into an equivalence set, specified as a vector of SimBiology.Compartment, SimBiology.Species, or SimBiology.Parameter objects. The vector must contain at least two quantities. All quantities must be in a different model within the parentModel hierarchy and must have the same type.

Reaction-scoped parameters are not supported.

Output Arguments

collapse all

New equivalence set, returned as a SimBiology.EquivalenceSet object.

Version History

Introduced in R2026b