IMsNonLinearEquationsTransform.InitApproximation

Syntax

InitApproximation: Array;

Description

The InitApproximation property determines initial values of the required variables.

Comments

The values are set as the array, where each element determines the value that corresponds by index, the searched variable from the IMsNonLinearEquationsTransform.OutputOperands collection.

If the InitApproximation property is set to Null, the initial values of searched variables are determined automatically.

By default as initial value for each point the value calculated in the previous point are taken. If the previous point has not been calculated, the previous point value is taken. Thus, the values until the first sample point are analyzed. If in the first point the value is absent, the initial approximation is equal to one.

Example

Executing the example requires a modeling container with the CONT_MODEL identifier and a model of the System of Non-linear Equations type with the NON_LINEAR identifier.

Sub main;

Var

ActiveMetabase: IMetabase;

ModelCont: IMetabaseObjectDescriptor;

Descript: IMetabaseObjectDescriptor;

Obj: IMetabaseObject;

Model: IMsModel;

Eq: IMsNonLinearEquationsTransform;

Appr: Array Of Double;

Transform: IMsFormulaTransform;

Begin

ActiveMetabase := MetabaseClass.Active;

ModelCont := ActiveMetabase.ItemById("CONT_MODEL");

Descript := ActiveMetabase.ItemByIdNamespace("NON_LINEAR", ModelCont.Key);

Obj := Descript.Edit;

Model := Obj As IMsModel;

Model.TreatNullsAsZeros := True;

Transform := Model.Transform;

Eq := Transform.EquationsFormula.Method As IMsNonLinearEquationsTransform;

Eq.MethodType := NonLinearEquationsType.NewtonMethod;

Eq.DerivativeShift := 2.1;

Appr := New Double[2];

Appr[0] := 100;

Appr[1] := 200;

Eq.InitApproximation := Appr;

Obj.Save;

End Sub main;

After executing the example the initial value of first required variable is 100, the second is 200.

See also:

IMsNonLinearEquationsTransform