Scaling issue - Printable Version +- IEA-ETSAP Forum ( https://iea-etsap.org/forum)+-- Forum: Model Generators ( https://iea-etsap.org/forum/forumdisplay.php?fid=2)+--- Forum: TIMES ( https://iea-etsap.org/forum/forumdisplay.php?fid=8)+--- Thread: Scaling issue ( /showthread.php?tid=162) |

Scaling issue - Anjana - 25-07-2019
Dear All, while solving a problem I got this message Optimal solution found, but with infeasibilities after unscaling. Simplex iterations after crossover: 2205 Objective : 189480.108883 I checked the internet, and it says one useful remedy is to turn scaling off, then invoke the appropriate simplex method for which the basis remains feasible. Please kindly let me know if this is the remedy and if so, in which file this scaling option is available and I can turn it off. Please let me know how can I tackle this in VEDA RE: Scaling issue - Vangelis - 31-07-2019
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-point_arithmetic#Accuracy_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.html#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.html#CPLEX_THE_GAMS_CPLEX_OPTIONS_FILE): 1. Use the option datacheck=2 (see https://www.gams.com/latest/docs/S_CPLEX.html#CPLEXdatacheck) 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.html#CPLEXfeasopt). 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_GAMSOutput.html#UG_GAMSOutput_TheSolutionListing , 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.html#CPLEXscaind), numericalemphasis 1 (see https://www.gams.com/latest/docs/S_CPLEX.html#CPLEXnumericalemphasis), 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.html#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.html#CPLEXbarcolnz). One can also try to change the Barrier algorithm, via the option baralg (see https://www.gams.com/latest/docs/S_CPLEX.html#CPLEXbaralg) , or change the starting point heuristic via barstartalg (see https://www.gams.com/latest/docs/S_CPLEX.html#CPLEXbarstartalg). You may also look at this presentation regarding the use and effect of some Barrier options https://www.slideshare.net/IEA-ETSAP/improving-the-solution-time-of-times-by-playing-with-cplexbarrier 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/knowledgecenter/SSSA5P_12.6.2/ilog.odms.cplex.help/CPLEX/UsrMan/topics/cont_optim/simplex/23_ill_conditioned_or_unscaled_infeas.html and in https://www.tu-chemnitz.de/mathematik/discrete/manuals/cplex/doc/userman/html/solveLPS33.html . |