主要内容

split

R2026b

Split quantities into a new equivalence set

Since R2026b

Description

newSet = split(eqSet,quantities) splits the specified quantities out of eqSet and into a new equivalence set newSet, maintaining equivalences among the split-off quantities. Both eqSet and newSet must contain at least two quantities after splitting. To remove quantities without maintaining equivalences among them, use remove instead.

example

Examples

collapse all

Create a PBPK model with four organ submodels and a single equivalence set, then use split to move some compartments into a new equivalence set.

Create a PBPK model with four organ submodels, each containing a Venous Blood compartment.

pbpkModel = sbiomodel("PBPK");

gutModel = addmodel(pbpkModel,"Gut");
gutVenous = addcompartment(gutModel,"Venous Blood",3000,Units="milliliter");

liverModel = addmodel(pbpkModel,"Liver");
liverVenous = addcompartment(liverModel,"Venous Blood",3000,Units="milliliter");

lungModel = addmodel(pbpkModel,"Lung");
lungVenous = addcompartment(lungModel,"Venous Blood",3000,Units="milliliter");

heartModel = addmodel(pbpkModel,"Heart");
heartVenous = addcompartment(heartModel,"Venous Blood",3000,Units="milliliter");

Create an equivalence set grouping all Venous Blood compartments.

eqSet = addequivalence(pbpkModel,[gutVenous,liverVenous,lungVenous,heartVenous]);

Split the Lung and Heart compartments into a separate equivalence set.

newSet = split(eqSet,[lungVenous,heartVenous])
newSet = 
  EquivalenceSet with properties:

          ModelScope: [1×1 SimBiology.Model]
          Quantities: [2×1 SimBiology.Compartment]
    ResolvedQuantity: [1×1 SimBiology.Compartment]
            SuperSet: []
             SubSets: [2×1 SimBiology.EquivalenceSet]
         TopLevelSet: [1×1 SimBiology.EquivalenceSet]

Verify the original set now contains only Gut and Liver.

eqSet.Quantities
ans = 
   SimBiology Compartment Array

   Index:    Name:           Value:    Units:        ParentModel:
   1         Venous Blood    3000      milliliter    Gut         
   2         Venous Blood    3000      milliliter    Liver       

Input Arguments

collapse all

Equivalence set to split, specified as a SimBiology.EquivalenceSet object.

After splitting, eqSet retains only the quantities not moved to the new set. If the equivalence set has supersets or subsets, the quantities are also split from those sets.

Quantities to split into the new equivalence set, specified as a vector of SimBiology.Compartment, SimBiology.Species, or SimBiology.Parameter objects. Each quantity must be a member of eqSet. The vector must contain at least two quantities, and at least two quantities must remain in eqSet.

If the resolved quantity is split off, it remains the resolved quantity in the new set, and the original set selects a new resolved quantity as follows. If the model that owns eqSet has a quantity that is contained in the set, that quantity becomes the resolved quantity. Otherwise, the resolved quantity of the first child model that has a quantity remaining in the set is used.

Output Arguments

collapse all

New equivalence set containing the split quantities, returned as a SimBiology.EquivalenceSet object.

Version History

Introduced in R2026b