UseUpperBound: Boolean;
The UseUpperBound property determines whether to take into account upper constraint for the controlling variable.
Available values:
True. Upper constraint of controlling variable is taken into account. To set constraint value, use the IMsNonLinearControlFormulaTerm.UpperBound property.
False. Default value. Upper constraint of controlling variable is not taken into account.
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(0) As 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.
See also: