ExternalEquations: IMsModelList;
The ExternalEquations property returns the collection of external equation systems.
In the system of non-linear equations an external and internal equations can be used (models).
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. In this container the system of non-linear equations with the NON_LINEAR_MODEL identifier must be present, as well as two models (calculation method: linear regression (OLS estimation), non-linear regression (non-linear OLS estimation) or determinate equation with the EXT_MODEL_1 and EXT_MODEL_2 identifiers.
Sub Main;
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;
// Clean the system equation collection
ExternalEquations.Clear;
// Add the first equation to the system
Descript := mb.ItemByIdNamespace("EXT_MODEL_1", ModelCont.Key);
ExtModel := Descript.Bind As IMsModel;
ExternalEquations.Add(ExtModel);
// Add the second equation to the system
Descript := mb.ItemByIdNamespace("EXT_MODEL_2", ModelCont.Key);
ExtModel := Descript.Bind As IMsModel;
ExternalEquations.Add(ExtModel);
// Save the changes
(Model As IMetabaseObject).Save;
End Sub Main;
After executing the example the system of non-linear equations contains two external equations, that are presented by the models EXT_MODEL_1 and EXT_MODEL_2.
See also: