Main Content

remove

R2026b

Remove quantities from equivalence set

Since R2026b

Description

remove(eqSet,quantities) removes one or more quantities from eqSet. If removing quantities leaves fewer than two quantities in eqSet, eqSet is deleted from the model. Removed quantities are no longer equivalent to the remaining quantities. To move quantities into a new equivalence set while maintaining equivalences among them, use split instead. If eqSet has supersets or subsets, the quantity is also removed from those sets.

example

eqSet = remove(eqSet,quantities) also returns eqSet after removing the quantities.

Examples

collapse all

Create a PBPK model with three organ submodels and an equivalence set for their Venous Blood compartments, then use remove to take one compartment out of the set.

Create a PBPK model with three 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");

Create an equivalence set grouping all Venous Blood compartments.

eqSet = addequivalence(pbpkModel,[gutVenous,liverVenous,lungVenous]);
eqSet.Quantities
ans = 
   SimBiology Compartment Array

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

Remove the Lung Venous Blood compartment from the equivalence set.

remove(eqSet,lungVenous);
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 remove quantities from, specified as a SimBiology.EquivalenceSet object.

Quantities to remove from the equivalence set eqSet, specified as a SimBiology.Compartment, SimBiology.Species, or SimBiology.Parameter object, or a vector of such objects. Each quantity must be a member of eqSet.

If the removed quantity is the resolved quantity, a new resolved quantity is selected 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

Updated equivalence set, returned as a SimBiology.EquivalenceSet object. The returned object is the same as the input eqSet.

If removing quantities leaves fewer than two quantities in eqSet, the function returns [] and eqSet is deleted from the model.

Version History

Introduced in R2026b