Closed JesseJenkins closed 1 year ago
@sambuddhac how about we fix this after merging my most recent PR? Because I added a bunched of new tags in the configure_settings(). https://github.com/GenXProject/GenX/pull/216
@xuqingyu testing PR #216 currently. Will merge and close this issue.
What default settings are you using @sambuddhac? Please share here.
This is the current configure_settings(), with some clarification I added. @sambuddhac You should base on the following code to change the example file.
# Optional settings parameters ############################################
#Write the model formulation as an output; 0 = active; 1 = not active
set_default_if_absent!(settings, "PrintModel", 0)
# Transmission network expansionl; 0 = not active; 1 = active systemwide
set_default_if_absent!(settings, "NetworkExpansion", 0)
# Number of segments used in piecewise linear approximation of transmission losses; 1 = linear, >2 = piecewise quadratic
set_default_if_absent!(settings, "Trans_Loss_Segments", 1)
# Regulation (primary) and operating (secondary) reserves; 0 = not active, 1 = active systemwide
set_default_if_absent!(settings, "Reserves", 0)
# If there is any energy share requirement; 0 = no; 1 = yes
set_default_if_absent!(settings, "EnergyShareRequirement", 0)
# If there is any capacity reserve margin constraints; 0 = no; 1 = yes
set_default_if_absent!(settings, "CapacityReserveMargin", 0)
# CO2 mass-based emissions cap; 0 = not active; 1 = active;
set_default_if_absent!(settings, "CO2Cap", 0)
# CO2 loadrate-based emissions cap; 0 = not active; 1 = active;
set_default_if_absent!(settings, "CO2LoadRateCap", 0)
# CO2 generation rate-based emissions cap; 0 = not active; 1 = active;
set_default_if_absent!(settings, "CO2GenRateCap", 0)
# CO2 tax; 0 = not active; 1 = active;
set_default_if_absent!(settings, "CO2Tax", 0)
# Energy Share Requirement and CO2 constraints account for energy losses of storage; 0 = not active (DO NOT account for energy lost); 1 = active systemwide (DO account for energy lost)
set_default_if_absent!(settings, "StorageLosses", 1)
# Energy Share Requirement and CO2 constraints account for energy losses of transmission; 0 = not active (DO NOT account for energy lost); 1 = active systemwide (DO account for energy lost)
set_default_if_absent!(settings, "PolicyTransmissionLossCoverage", 0)
# Activate minimum technology carveout constraints; 0 = not active; 1 = active
set_default_if_absent!(settings, "MinCapReq", 0)
# Activate maximum technology limit constraints; 0 = not active; 1 = active
set_default_if_absent!(settings, "MaxCapReq", 0)
# Available solvers: Gurobi, CPLEX, CLPs
set_default_if_absent!(settings, "Solver", "Gurobi")
# Turn on parameter scaling wherein load, capacity and power variables are defined in GW rather than MW. 0 = not active; 1 = active systemwide
set_default_if_absent!(settings, "ParameterScale", 0)
# Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
set_default_if_absent!(settings, "WriteShadowPrices", 0)
# Unit committment of thermal power plants; 0 = not active; 1 = active using integer clestering; 2 = active using linearized clustering
set_default_if_absent!(settings, "UCommit", 0)
# Sets temporal resolution of the model; 0 = single period to represent the full year, with first-last time step linked; 1 = multiple representative periods
set_default_if_absent!(settings, "OperationWrapping", 0)
# Directory name where results from time domain reduction will be saved. If results already exist here, these will be used without running time domain reduction script again.
set_default_if_absent!(settings, "TimeDomainReductionFolder", "TDR_Results")
# Time domain reduce (i.e. cluster) inputs based on Load_data.csv, Generators_variability.csv, and Fuels_data.csv; 0 = not active (use input data as provided); 0 = active (cluster input data, or use data that has already been clustered)
set_default_if_absent!(settings, "TimeDomainReduction", 0)
# Modeling to generate alternatives; 0 = not active; 1 = active. Note: produces a single solution as output
set_default_if_absent!(settings, "ModelingToGenerateAlternatives", 0)
# Slack value as a fraction of least-cost objective in budget constraint used for evaluating alternative model solutions; positive float value
set_default_if_absent!(settings, "ModelingtoGenerateAlternativeSlack", 0.1)
# Multistage expansion; 0 = Single-stage GenX; 1 = Multi-stage GenX
set_default_if_absent!(settings, "MultiStage", 0)
# CO2 carbon capture and sequestration; 0 = not active; 1 = active, co2 capture will be modeled, cost and caputred emission will be printed;
set_default_if_absent!(settings, "CO2Capture", 0)
# CO2 capture credit; 0 = not active; 1 = active;
set_default_if_absent!(settings, "CO2Credit", 0)
# Piecewise Heat Rate; 0 = not activate; 1 = active
set_default_if_absent!(settings, "PieceWiseHeatRate", 0)
# Twenty-four Seven Module; 0 = not activate; 1 = active
set_default_if_absent!(settings, "TFS", 0)
These are GenX settings @xuqingyu rather than solver settings. I was asking about how we're setting up default settings for Gurobi or Cplex. As in we should set it to barrier, no crossover, tolerance of 10^-3 or 10^4 not default tolerance of 10^-6 with crossover on, etc.
@JesseJenkins @xuqingyu these are the ones for CPLEX:
# CPLEX Solver Parameters
Feasib_Tol: 1.0e-06 # Constraint (primal) feasibility tolerances.
Optimal_Tol: 1e-4 # Dual feasibility tolerances.
Pre_Solve: 1 # Controls presolve level.
#AggFill: # Allowed fill during presolve aggregation.
#PreDual: # Presolve dualization.
TimeLimit: 110000 # Limits total time solver.
MIPGap: 1e-4 # Relative (p.u. of optimal) mixed integer optimality tolerance for MIP problems (ignored otherwise).
Method: 2 #-1 # Algorithm used to solve continuous models (including MIP root relaxation).
BarConvTol: 1.0e-08 # Barrier convergence tolerance (determines when barrier terminates).
NumericFocus: 0 # Numerical precision emphasis.
#BarObjRng: # Sets the maximum absolute value of the objective function.
SolutionType: 2 # Solution type for LP or QP.
And these are for Gurobi:
# Gurobi Solver Parameters
# Common solver settings
Feasib_Tol: 1.0e-06 # Constraint (primal) feasibility tolerances.
Optimal_Tol: 1e-6 # Dual feasibility tolerances.
TimeLimit: 110000 # Limits total time solver.
Pre_Solve: 1 # Controls presolve level.
Method: 2 # Algorithm used to solve continuous models (including MIP root relaxation).
#Gurobi-specific solver settings
MIPGap: 1e-4 # Relative (p.u. of optimal) mixed integer optimality tolerance for MIP problems (ignored otherwise).
BarConvTol: 1.0e-08 # Barrier convergence tolerance (determines when barrier terminates).
NumericFocus: 0 # Numerical precision emphasis.
Crossover: 1 # Barrier crossver strategy.
BarObjRng: 1e+75 # Sets the maximum absolute value of the objective function
PreDual: 0 # Decides whether presolve should pass the primal or dual linear programming problem to the LP optimization algorithm.
AggFill: 10 # Allowed fill during presolve aggregation.
So, for Gurobi, the Crossover is turned on, but nothing explicitly mentioned for CPLEX .... In CPLEX the Method setting is set to 2 (Algorithm used to solve continuous models (including MIP root relaxation)
Ok those are not ideal for GenX. @sambuddhac please adjust the default settings to what I recommended. @xuqingyu and @nspatank can help you ensure they are correct for both Gurobi and Cplex. Sam, you should also explore similar/parallel settings options for Cbc/Clp if that is the default open source solver still (and for SCIP). Please implement these as part of this week's weekly dev integration. Make sure you or someone else updates the solver documentation pages accordingly https://genxproject.github.io/GenX/dev/solver_configuration/
I would also say the default MIP gap should be 1e-3 (0.1%) which is pretty tight.
This is fixed to the correct settings right before we released 0.3.1 patch when we agreed upon the solver setting default values. Good to close now?
We should update solver settings example files to include all options showing default values (copied from the relevant configure_solver/ .jl files for each solve) but with all commented out. And provide commented instructions that if a user wishes to modify these settings, they can uncomment and modify the parameter value. If they do not wish to modify, they can leave them commented out and the default settings will be used.
@nspatank or @sambuddhac please make this update. Thanks.