Scaling issue
#2
Hi Anjana,

This issue often occurs when the right hand side of a constraint is smaller than the feasibility tolerance of the solver, or the coefficient of a variable cannot be calculated within the precision of the CPU (e.g. coefficients such as 1/3,  0.1, 0.01, etc. can cause accuracy problems and numerical instability see https://en.wikipedia.org/wiki/Floating-p...y_problems) .  So, one remedy is to avoid having coefficients of variables that can result accuracy problems, if possible. 

Regarding the constraint tolerances: By default, the CPLEX solver satisfies a constraint with a precision of 1e-06. This is controlled via the cplex option "eprhs"  (see https://www.gams.com/latest/docs/S_CPLEX...CPLEXeprhs ). The following can be used to mitigate this effect, by assuming that you know how to set the CPLEX options in the cplex.opt file (otherwise, please look first here https://www.gams.com/latest/docs/S_CPLEX...TIONS_FILE):

1. Use the option datacheck=2 (see https://www.gams.com/latest/docs/S_CPLEX...Xdatacheck) to get from CPLEX a report regarding equations with right hand sides less than eprhs, as well as coefficients of variables that can cause numerical instability. The report is displayed in the command prompt, just after the CPLEX solver starts, by solving the model as usual.

2. Use the above information to alter the input data in the model, so that to ensure that right hand sides are lower than the eprhs tolerance, e.g. in the order of 1e-05. Also, use the report to correct variable coefficients that can cause accuracy issues. Repeat steps 1 and 2 until you get only a few messages from CPLEX regarding the violation of tolerances and problematic variable coefficients.

3. If the problem still persists, then increase the eprhs tolerance,e.g. 1e-09. This will risk that the solver reports the problem as infeasible, which is not so bad since it will indicate the constraint(s) that cannot be satisfied. To identify the constraint in an infeasible problem, you can use the option feasopt (https://www.gams.com/latest/docs/S_CPLEX...LEXfeasopt). This would also require to set in advance the GAMS statement, OPTION SOLPRINT=ON;  in the beginning of the run template file. The infeasible constraints are then reported in the .lst file (please look here if you do not know how to find in the .lst file infeasible constraints https://www.gams.com/latest/docs/UG_GAMS...ionListing , the infeasible EQU constraints will be indicated by an INFES on the right side of the report) 

4. By using the feasopt and the identified constraints try to modify the data of the model so that to make it feasible, by repeating steps 3 and 4.

5. If the problem still persists, then you may instruct CPLEX to solve the model with higher accuracy, if possible. This would need to use the options: scaind 1 (see https://www.gams.com/latest/docs/S_CPLEX...PLEXscaind), numericalemphasis 1 (see https://www.gams.com/latest/docs/S_CPLEX...alemphasis), and increase the Markowitz pivot tolerance epmrk to a value higher than 0.01, e.g. 0.9 (see https://www.gams.com/latest/docs/S_CPLEX...CPLEXepmrk). All these three options, scaind, numericalemphasis and epmrk, can also be used simultaneously. However, they tend to increase the solution time.

6. Other options, but applicable only when one uses the CPLEX/Barrier algorithm for solving the model, is to change the number of the dense columns reported during the solution phase of the model. If too many columns are eliminated then the Barrier solver can run into numerical instabilities. To control the number of the dense columns you may alter the option barcolnz (see https://www.gams.com/latest/docs/S_CPLEX...EXbarcolnz). One can also try to change the Barrier algorithm, via the option baralg (see https://www.gams.com/latest/docs/S_CPLEX...PLEXbaralg) , or change the starting point heuristic via barstartalg (see https://www.gams.com/latest/docs/S_CPLEX...arstartalg). You may also look at this presentation regarding the use and effect of some Barrier options  https://www.slideshare.net/IEA-ETSAP/imp...lexbarrier 

I hope the above help a bit. The remedy needs quite a lot of trial and error, depending on the severity of the problem. The above steps can also be applied when one gets the message "Solution available but not proven optimal due to numerical difficulties". 

For more information on numerical difficulties and possible ways to deal with them, you may also find at: https://www.ibm.com/support/knowledgecen...nfeas.html and in https://www.tu-chemnitz.de/mathematik/di...LPS33.html .
Reply


Messages In This Thread
Scaling issue - Anjana - 25-07-2019, 11:27 PM
RE: Scaling issue - Vangelis - 31-07-2019, 05:01 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)