# TOMVIEW  
# REGISTER (TOMVIEW)
# LOGIN  
# myTOMVIEW
TOMLAB LOGO

« Previous « Start » Next »

7  TOMVIEW Utility Functions

The solvers in the TOMVIEW /SOL (MINOS, NLSSOL, SNOPT and NPSOL) package makes it possible to check the derivatives provided by the gradient and Jacobian routines.

The sizes and validity is automatically checked by TOMVIEW.

7.1  tomRun

Purpose
General multi-solver driver routine for TOMVIEW.

Description of Inputs
 
Solver The name of the solver that should be used to optimize the problem.
 
Prob Problem reference, see Table 11.
 




Description of Outputs
Result Structure with result from optimization, see Table 17.




Description
The driver routine tomRun from the block diagram.

7.2  probInit

Purpose
General routine for creating a problem from the test sets.







Description of Inputs
 
Problem Type The problems set to create a problem from.
 
Problem Number Problem number from the test set.
 




Description of Outputs
Problem Reference to the Problem object.




Description
The probInit routines is used to access the extensive test sets that are part of the TOMVIEW Base Module.

7.3  Modify

After initializing a problem with TOMVIEW it is possible to modify parts of it. There are modify, replace, add and remove functions that act on the problem data. With the modify functions parts of the problem input may be adjusted, while the replace functions completely overwrites existing inputs. The add/remove functions make it possible to add/remove linear constraints.

7.3.1  modify_b_L

Purpose
Modifies lower bounds for the linear constraints, b_L.

Description of Inputs
b_L_part A value vector with the new elements in b_L.
 
idx An integer vector with the indices in b_L to modify. The indices must be non-negative integers.

7.3.2  modify_b_U

Purpose
Modifies the upper bound of the linear constraints, b_U.

Description of Inputs
b_U_part A value vector with the new elements in b_U.
 
idx An integer vector with the indices in b_U to modify. The indices must be non-negative integers.

7.3.3  modify_c_L

Purpose
Modifies lower bounds for the nonlinear constraints, c_L.

Description of Inputs
c_L_part A value vector with the new elements in c_L.
 
idx An integer vector with the indices in c_L to modify. The indices must be non-negative integers.

7.3.4  modify_c_U

Purpose
Modifies upper bounds for the nonlinear constraints, c_U.

Description of Inputs
c_U_part A value vector with the new elements in c_U.
 
idx An integer vector with the indices in c_U to modify. The indices must be non-negative integers.

7.3.5  modify_x_0

Purpose
Modifies start values for the decision variables x, x_0.

Description of Inputs
x_0_part A value vector with the new elements in x_0.
 
idx An integer vector with the indices in x_0 to modify. The indices must be non-negative integers.

7.3.6  modify_x_L

Purpose
Modifies lower bounds for the decision variables x, x_L.

Description of Inputs
x_L_part A value vector with the new elements in x_L.
 
idx An integer vector with the indices in x_L to modify. The indices must be non-negative integers.

7.3.7  modify_x_U

Purpose
Modifies lower bounds for the decision variables x, x_U.

Description of Inputs
x_U_part A value vector with the new elements in x_U.
 
idx An integer vector with the indices in x_U to modify. The indices must be non-negative integers.

7.3.8  replace_A

Purpose
Replaces the linear constraints matrix, A.

Description of Inputs
A Matrix containing the new linear constraints.
 
b_L (optional) Vector containing lower bound of the new linear constraints.
 
b_U (optional) Vector containing upper bound of the new linear constraints.

7.3.9  replace_b_L

Purpose
Replaces the lower bounds for the linear constraints, b_L.

Description of Inputs
b_L A vector with lower bounds for the linear constraints.

7.3.10  replace_b_U

Purpose
Replaces the upper bounds for the linear constraints, b_U.

Description of Inputs
b_U A vector with upper bounds for the linear constraints.

7.3.11  replace_c_L

Purpose
Replaces the lower bounds for the nonlinear constraints, c_L.

Description of Inputs
c_L A vector with lower bounds for the nonlinear constraints.

7.3.12  replace_c_U

Purpose
Replaces the upper bounds for the nonlinear constraints, c_U.

Description of Inputs
c_U A vector with upper bounds for the nonlinear constraints.

7.3.13  replace_x_0

Purpose
Replaces the start value vector for the decision variables x, x_0.

Description of Inputs
x_0 A vector with the new start values.

7.3.14  replace_x_L

Purpose
Replaces the lower bound to the decision variables x, x_L.

Description of Inputs
x_L A vector with the lower bounds.

7.3.15  replace_x_U

Purpose
Replaces the upper bound to the decision variables x, x_U.

Description of Inputs
x_U_part A vector with the upper bounds.

7.3.16  add_A

Purpose
Adds linear constraints to the problem.

Description of Inputs
A_add A matrix containing the additional linear constraints.
 
b_L_add A vector with the additional lower bounds for the linear constraints. If b_L is not defined as input a default vector with values −∞ is used.
 
b_U_add A vector with the additional upper bounds for the linear constraints. If b_U is not defined as input a default vector with values ∞ is used

7.3.17  remove_A

Purpose
Removes linear constraints from the problem.

Description of Inputs
idx An integer vector with the row indices for the linear constraints to remove.

7.3.18  change_NumDiff

Purpose
Changes the problem flag Prob.NumDiff. If set to 1 numerical differentiation will be used for for the gradient g (done automatically if not given).

Description of Inputs
NumDiff An integer either 0 or 1. NumDiff=1 for numerical differentiation and NumDiff=0 for default (use analytical g if given).

See 8 for more documentation.

7.3.19  change_ConsDiff

Purpose
Changes the problem flag Prob.ConsDiff. If set to 1 numerical differentiation will be used for for the constraint Jacobian J (done automatically if not given).

Description of Inputs
ConsDiff An integer either 0 or 1. ConsDiff=1 for numerical differentiation and ConsDiff=0 for default (use analytical dc if given).

See 8 for more documentation.

7.4  Example of TOMVIEW Modify

The following example illustrates how to modify an already existing problem in LabVIEW. The example is a continuation of the example problem in section 4.1.1. For example, one might want to add upper bounds for the decision variable x after initializing the problem. One can achieve this by using the TOMVIEW replace functions. See the Block Diagram in the following figure.



Figure 9: Modification of example problem.


pngs/tomview008.png

In the replace block upper bounds are set for x. In the next figure the Front Panel is displayed.



Figure 10: Modification of example problem, Front Panel.


pngs/tomview009.png

In the Front Panel the new variable xU is defined. As shown the new problem has a different solution compared to the same problem without the upper bounds xU (the upper bounds were +∞ before).

In a similar way one can replace already existing variables. For example the matrix A or the profit vector c.

« Previous « Start » Next »