Initializing help system before first use

setinitval

setinitval


Purpose
Set an initial value (start value) for a variable.
Synopsis
procedure setinitval(x:mpvar, val:real)
Arguments
A decision variable
val 
A real number to be used as initial value
Example
The following sets an initial value of 0 for variable x. For y its solution from the preceding optimization is set as its new initial value.
uses "mmnl"
declarations
 x,y: mpvar
end-declarations
setinitval(x, 0)
setinitval(y, getsol(y))
Further information
This procedure sets an initial value for a decision variable. Initial values are used by nonlinear solvers as a (good) starting point for the search. It is in general not required that the initial values be part of a feasible solution to the optimization problem. All previously set initial values can be removed by calling clearinitvals. The procedure copysoltoinit can be used to turn the solution of a previous optimization run into initial values for the next run.
Related topics
Module