ExternalEquations: IMsModelList;
The ExternalEquations property returns the collection of external equation systems.
In the system of non-linear equations one can use external and internal equations.
The systems that have only internal or external equations can be modified in the modeling container interface. The systems that have only internal or external equations cannot be modified in the modeling container interface.
Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. This container must include a system of non-linear equations with the NON_LINEAR_MODEL identifier and two models with the EXT_MODEL_1 and EXT_MODEL_2 identifiers, which calculation methods are: linear regression, non-linear regression, or determinate equation.
Sub UserProc;
Var
mb: IMetabase;
ModelCont: IMetabaseObjectDescriptor;
Model: IMsModel;
Trans: IMsFormulaTransform;
Formula: IMsFormula;
Equations: IMsNonLinearEquationsTransform;
Descript: IMetabaseObjectDescriptor;
ExtModel: IMsModel;
ExternalEquations: IMsModelList;
Begin
mb := MetabaseClass.Active;
ModelCont := mb.ItemById("CONT_MODEL");
Descript := mb.ItemByIdNamespace("NON_LINEAR_MODEL", ModelCont.Key);
Model := Descript.Edit As IMsModel;
Trans := Model.Transform;
Formula := Trans.EquationsFormula;
Equations := Formula.Method As IMsNonLinearEquationsTransform;
ExternalEquations := Equations.ExternalEquations;
// Clear collection of system equations
ExternalEquations.Clear;
// Add the first equation to system
Descript := mb.ItemByIdNamespace("EXT_MODEL_1", ModelCont.Key);
ExtModel := Descript.Bind As IMsModel;
ExternalEquations.Add(ExtModel);
// Add the second equation to system
Descript := mb.ItemByIdNamespace("EXT_MODEL_2", ModelCont.Key);
ExtModel := Descript.Bind As IMsModel;
ExternalEquations.Add(ExtModel);
// Save changes
(Model As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the system of non-linear equations contains two external equations presented by the models EXT_MODEL_1 and EXT_MODEL_2.
See also: