IMsNonLinearControlFormulaTerm.UseUpperBound

Fore Syntax

UseUpperBound: Boolean;

Fore.NET Syntax

UseUpperBound: boolean;

Description

The UseUpperBound property determines whether to take into account upper constraint for the controlling variable.

Comments

Available values:

Fore Example

Executing the example requires that the repository contains a modeling container with the MS identifier. This container must include an optimal control problem with the CONTROL_PROBLEM identifier that is calculated by the quadratic programming method. Controlling variables must be set for the problem.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    ms: IMetabaseObjectDescriptor;
    probl: IMsProblem;
    controlProbl: IMsControlProblem;
    controlTerm: IMsNonLinearControlFormulaTerm;
Begin
    // Get current repository
    mb := MetabaseClass.Active;
    // Get modeling container
    ms := mb.ItemById("MS");
    // Get modeling problem
    probl := mb.ItemByIdNamespace("CONTROL_PROBLEM", ms.Key).Edit As IMsProblem;
    controlProbl := probl.Details As IMsControlProblem;
    // Get the first controlling variable
    controlTerm := controlProbl.ControlVariables.Item(0As IMsNonLinearControlFormulaTerm;
    // Set controlling variable limit values
    controlTerm.UseLowerBound := True;
    controlTerm.LowerBound := -1;
    controlTerm.UseUpperBound := True;
    controlTerm.UpperBound := 1;
    // Save changes
    (probl As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the values of the lower and upper constraints are determined for the first controlling variable.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Ms;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    ms: IMetabaseObjectDescriptor;
    probl: IMsProblem;
    controlProbl: IMsControlProblem;
    controlTerm: IMsNonLinearControlFormulaTerm;
Begin
    // Get current repository
    mb := Params.Metabase;
    // Get modeling container
    ms := mb.ItemById["MS"];
    // Get modeling problem
    probl := mb.ItemByIdNamespace["CONTROL_PROBLEM", ms.Key].Edit() As IMsProblem;
    controlProbl := probl.Details As IMsControlProblem;
    // Get the first controlling variable
    controlTerm := controlProbl.ControlVariables.Item[0As IMsNonLinearControlFormulaTerm;
    // Set controlling variable limit values
    controlTerm.UseLowerBound := True;
    controlTerm.LowerBound := -1;
    controlTerm.UseUpperBound := True;
    controlTerm.UpperBound := 1;
    // Save changes
    (probl As IMetabaseObject).Save();
End Sub;

See also:

IMsNonLinearControlFormulaTerm