# Non-convex PQ-curves in final simulation | | | |---|---| |License|yes| |Release version|| This functionality allows the use of an exact PQ-curve in the final simulation. The motivation and mathematical formulation is presented in {cite:ps}`Helseth_treating_2017`. The modelling of a nonconvex PQ-curve requires use of integer variables, and thus we need to change from an LP to a MIP solver. The current implementation uses the open source MIP-solver Coin Cbc. Although the final simulation uses an open source solver, one can still run the new functionality and use CPLEX for the optimization part. ## Using the functionality The functionality requires a license, which is included in the license file for those who have this license (if you use the old license control system: set the environmental variable LTM_PRODRISK_NCPQ to a corresponding password obtained from SINTEF). Set the setting attribute *useNonConvexPQCurve* to 1 in the API (or set PQValg = 2 in prodrisk.CPAR) to indicate that a final simulation with non-convex PQ-curves is desired. One will then simulate with explicit representation of the nonconvex PQ points. As an indication that the functionality has been successfully initiated, the following message will be printed to screen: ![](./images/nonconvex_logfile.png) Note that the computation time will be significantly higher than the default (LP) final simulation. No extra results are printed, and the result programs can be used as before. ## Control parameters to the solver (not available in the API) The user can define control parameters to the Coin Cbc MIP-solver through a file Cbc.env. The following 4 lines should be specified in the file: LogLevel 0 FlagSolved 0 MaxNodes 10000 MaxSeconds 10.0 The first value on a given row is a text string identifying the parameter. The second value is the numerical parameter value. The default values are indicated in the example above; These are the values to be used if the file Cbc.env is not specified. The two first lines are primarily meant for debug-purposes, i.e. to see the progress of the MIP solver. The parameters MaxNodes and MaxSeconds can be used to tune the computation time, indicating the maximum number of nodes to be visited and the maximum allowed time to be used by the MIP solver. If the file Cbc.env is not specified, the MIP solver will use the default parameters as indicated above.