Main

## Objective Variables

## Main.ObjectiveVariables History

Hide minor edits - Show changes to output

Changed line 25 from:

This obtains the current objective function value. An objective may consist of multiple objectives that are maximized or minimized. They are all converted to minimization functions and added together.

to:

This obtains the current objective function value with input arguments ''s=server'' and ''a=application name''. An objective may consist of multiple objectives that are maximized or minimized. They are all converted to minimization functions and added together.

Changed lines 17-21 from:

The %blue%A%red%P%black%Monitor objective is reported in the minimized form. Thus, a maximized objective with a result of +17 is reported as -17. ~~This~~ is retrieved as the parameter ''nlc.objfcnval'' in a programming script from the ''apm_tag'' function such as:

to:

The %blue%A%red%P%black%Monitor objective is reported in the minimized form. Thus, a maximized objective with a result of +17 is reported as -17.

!!! Retrieve Objective Function

The objective function is retrieved as the parameter ''nlc.objfcnval'' in a programming script from the ''apm_tag'' function such as:

!!! Retrieve Objective Function

The objective function is retrieved as the parameter ''nlc.objfcnval'' in a programming script from the ''apm_tag'' function such as:

Changed lines 7-8 from:

The objective function is always minimized with %blue%A%red%P%black%Monitor. ~~Objective function maximization~~ is accomplished by ~~defining a new variable that is the negative of the minimized~~ objective.

to:

The objective function is always minimized with %blue%A%red%P%black%Monitor. Maximizing an objective function is accomplished by minimizing the negative of the original objective.

! original objective

maximize z

The objective is modified by minimizing the negative of the original objective function.

! modified objective

minimize -z

The %blue%A%red%P%black%Monitor objective is reported in the minimized form. Thus, a maximized objective with a result of +17 is reported as -17. This is retrieved as the parameter ''nlc.objfcnval'' in a programming script from the ''apm_tag'' function such as:

obj = apm_tag(s,a,'nlc.objfcnval')

This obtains the current objective function value. An objective may consist of multiple objectives that are maximized or minimized. They are all converted to minimization functions and added together.

! original objective

maximize z

The objective is modified by minimizing the negative of the original objective function.

! modified objective

minimize -z

The %blue%A%red%P%black%Monitor objective is reported in the minimized form. Thus, a maximized objective with a result of +17 is reported as -17. This is retrieved as the parameter ''nlc.objfcnval'' in a programming script from the ''apm_tag'' function such as:

obj = apm_tag(s,a,'nlc.objfcnval')

This obtains the current objective function value. An objective may consist of multiple objectives that are maximized or minimized. They are all converted to minimization functions and added together.

Changed lines 27-41 from:

! Example model with an objective ~~function~~

Model example

~~ Parameters~~

~~p1 = 5~~

~~End Parameters~~

~~Variables~~

~~ objective~~

v1 > 6

End Variables

Equations

objective = (v1 -p1)^~~2~~

End Equations

End Model

Model example

v1 > 6

End Variables

Equations

objective = (v1 -

End Equations

End Model

to:

! Example model with an objective variable

Parameters

p1 = 5

Variables

objective

v1 > 6

Equations

objective = (v1 - p1)^2

Parameters

p1 = 5

Variables

objective

v1 > 6

Equations

objective = (v1 - p1)^2

Changed lines 36-51 from:

to:

! Equivalent model with a minimize objective statement

Parameters

p1 = 5

Variables

v1 > 6

Equations

minimize (v1 - p1)^2

(:cellnr:)

! Equivalent model with a maximize objective statement

Parameters

p1 = 5

Variables

v1 > 6

Equations

maximize -(v1 - p1)^2

(:cellnr:)

Parameters

p1 = 5

Variables

v1 > 6

Equations

minimize (v1 - p1)^2

(:cellnr:)

! Equivalent model with a maximize objective statement

Parameters

p1 = 5

Variables

v1 > 6

Equations

maximize -(v1 - p1)^2

(:cellnr:)

Deleted line 55:

Changed line 13 from:

(:table border=1 width=~~50~~% align=left bgcolor=#EEEEEE cellspacing=0:)

to:

(:table border=1 width=100% align=left bgcolor=#EEEEEE cellspacing=0:)

Added lines 1-36:

!! Objective Variables

Objective variables are defined to construct an objective function. The objective function is a summation of all variables that are designated as objective-type. Variables are defined as objective function contributions by starting with '''obj'''. Thus, the variables ''obj1'', ''objective'', ''object[1]'' would be included in the objective function summation.

Additionally, slack variables are included in the objective function. These variables begin with the key letters '''slk''' and are defined with a lower bound of zero.

!!! Minimize vs. Maximize

The objective function is always minimized with %blue%A%red%P%black%Monitor. Objective function maximization is accomplished by defining a new variable that is the negative of the minimized objective.

!!! Example

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:)

(:cellnr:)

! Example model with an objective function

Model example

Parameters

p1 = 5

End Parameters

Variables

objective

v1 > 6

End Variables

Equations

objective = (v1 - p1)^2

End Equations

End Model

Solution

p1 = 5

v1 = 6

objective = 1

(:tableend:)

Objective variables are defined to construct an objective function. The objective function is a summation of all variables that are designated as objective-type. Variables are defined as objective function contributions by starting with '''obj'''. Thus, the variables ''obj1'', ''objective'', ''object[1]'' would be included in the objective function summation.

Additionally, slack variables are included in the objective function. These variables begin with the key letters '''slk''' and are defined with a lower bound of zero.

!!! Minimize vs. Maximize

The objective function is always minimized with %blue%A%red%P%black%Monitor. Objective function maximization is accomplished by defining a new variable that is the negative of the minimized objective.

!!! Example

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:)

(:cellnr:)

! Example model with an objective function

Model example

Parameters

p1 = 5

End Parameters

Variables

objective

v1 > 6

End Variables

Equations

objective = (v1 - p1)^2

End Equations

End Model

Solution

p1 = 5

v1 = 6

objective = 1

(:tableend:)