Hauptinhalt

getEquivalenceSet

R2026b

Get equivalence set containing quantity

Since R2026b

Description

eqSet = getEquivalenceSet(quantity) returns the top-level equivalence set that contains quantity, or an empty array if quantity does not belong to any equivalence set.

example

eqSet = getEquivalenceSet(quantity,modelScope) returns the equivalence set scoped to modelScope that contains quantity. Use this syntax to retrieve a subset of the equivalence set at a specific level in the model hierarchy.

example

Examples

collapse all

Query a species to find which equivalence set it belongs to.

Create a hierarchical model with two submodels and an equivalence set.

m = sbiomodel("PBPK");
brain = addmodel(m,"Brain");
heart = addmodel(m,"Heart");

organ_b = addcompartment(brain,"Central");
drug_b = addspecies(organ_b,"Drug");

organ_h = addcompartment(heart,"Central");
drug_h = addspecies(organ_h,"Drug");

eqs = addequivalence(m,[drug_b,drug_h]);

Get the equivalence set containing drug_b.

eqSet = getEquivalenceSet(drug_b)
eqSet =

  EquivalenceSet with properties:

          ModelScope: [1x1 SimBiology.Model]
          Quantities: [2x1 SimBiology.Species]
    ResolvedQuantity: [1x1 SimBiology.Species]
            SuperSet: []
             SubSets: [2x1 SimBiology.EquivalenceSet]
         TopLevelSet: [1x1 SimBiology.EquivalenceSet]

Get the equivalence set scoped to the Brain submodel.

eqSetBrain = getEquivalenceSet(drug_b,brain)
eqSetBrain =

  EquivalenceSet with properties:

          ModelScope: [1x1 SimBiology.Model]
          Quantities: [1x1 SimBiology.Species]
    ResolvedQuantity: [1x1 SimBiology.Species]
            SuperSet: [1x1 SimBiology.EquivalenceSet]
             SubSets: [0x1 SimBiology.EquivalenceSet]
         TopLevelSet: [1x1 SimBiology.EquivalenceSet]

Input Arguments

collapse all

Quantity to query, specified as a SimBiology.Species, SimBiology.Compartment, or SimBiology.Parameter object. The quantity must be scalar.

Model level at which to retrieve the equivalence set, specified as a SimBiology.Model object. modelScope must be in the same model hierarchy as quantity. When you specify modelScope, the function returns the equivalence set subset scoped to that model rather than the top-level equivalence set. If quantity does not participate in an equivalence set at the specified model level, the function returns an empty array.

Output Arguments

collapse all

Equivalence set containing the quantity, returned as a SimBiology.EquivalenceSet object. If quantity does not belong to any equivalence set, the function returns an empty array ([]).

Version History

Introduced in R2026b