irena-flextool / flextool

IRENA FlexTool is an energy and power systems model for understanding the role of variable power generation in future energy systems.
https://www.irena.org/energytransition/Energy-System-Models-and-Data/IRENA-FlexTool
Other
21 stars 5 forks source link

Infeasibility HiGHS #169

Closed e-zaline closed 5 months ago

e-zaline commented 5 months ago

Hello, I want to run a quite big model (for now I'm just testing for a timeblockset of 1 day), but I encounter an infeasibility error. I am not able to understand from the message what could be the problem. Is it possible to have more info somehow? Could it be that the model is too big? Thank you


# Running python flextoolrunner.py
2024-01-19 11:34:21 WARNING: No solver defined for solve_p2040. Defaulting to highs.
GLPSOL: GLPK LP/MIP Solver, v4.65
Parameter(s) specified in the command line:
 --check --model flexModel3.mod -d FlexTool3_base_sets.dat --wfreemps flexModel3.mps
Reading model section from flexModel3.mod...
4862 lines were read
Reading data section from FlexTool3_base_sets.dat...
211 lines were read
Display statement at line 15
datetime0 = 1705660461
Reading data...
Display statement at line 771
setup1 = 14
Checking if the sign of new peak inflow is the same as the sign of the peak inflow in the original inflow time series
Checking (line 925)...
Display statement at line 1055
w_calc_slope = 0
Checking: Eff. data for 1 variable conversions directly from source to sink (and possibly back)
Checking (line 1413)...
Checking: Efficiency data for 1-way conversions with an online variable
Checking (line 1416)...
Checking: Efficiency data for 2-way linear conversions without online variables
Checking (line 1419)...
Checking: Invalid combinations between conversion/transfer methods and the startup method
Checking (line 1422)...
Checking: Is there a timeline connected to a timeblockset
Checking (line 1425)...
Checking: Are discount factors set in models with investments and multiple periods
Checking (line 1428)...
Checking: Does a node with has_storage also have has_balance set to yes
Checking (line 1431)...
Checking: Availability conflicts with storage constraints
Checking (line 1434)...
Checking (line 1436)...
Checking (line 1439)...
Checking (line 1442)...
Checking (line 1446)...
Checking (line 1452)...
Checking (line 1458)...
Checking: transfer_method no_losses_no_variable_cost
is not allowed to a group with non-synchronous constraint
Checking (line 1469)...
Checking: transfer_method no_losses_no_variable_cost
is not allowed to have other_operational_cost
Checking (line 1477)...
Checking: node not in more than one loss of load sharing group
Checking (line 1481)...
Display statement at line 1485
setup2 = 0
Generating total_cost...
Display statement at line 1617
w_total_cost = 178
Generating nodeBalance_eq...
Display statement at line 1656
balance = 1
Generating reserveBalance_timeseries_eq...
Generating reserveBalance_dynamic_eq...
Generating reserveBalance_up_n_1_eq...
Generating reserveBalance_down_n_1_eq...
Display statement at line 1784
reserves = 0
Generating conversion_indirect...
Display statement at line 1805
indirect = 0
Generating profile_flow_upper_limit...
Generating profile_flow_lower_limit...
Generating profile_flow_fixed...
Generating profile_state_upper_limit...
Generating profile_state_lower_limit...
Generating profile_state_fixed...
Generating storage_state_roll_continue...
Generating storage_state_start...
Generating storage_state_end...
Generating node_balance_fix_quantity_eq_lower...
Generating node_balance_fix_price_eq_lower...
Generating storage_state_solve_horizon_reference_value...
Generating constraint_greater_than...
Generating process_constraint_less_than...
Generating process_constraint_equal...
Generating maxState...
Generating maxToSink...
Generating minToSink...
Generating maxFromSource...
Generating minFromSource...
Generating minToSink_1var...
Generating maxToSource...
Generating minToSource...
Generating maxOnline...
Generating online__startup_linear...
Generating online__startup_integer...
Generating maxStartup...
Generating online__shutdown_linear...
Generating online__shutdown_integer...
Generating maxShutdown...
Generating ramp_up_variable...
Generating ramp_source_up_constraint...
Generating ramp_sink_up_constraint...
Generating ramp_source_down_constraint...
Generating ramp_sink_down_constraint...
Generating reserve_process_upward...
Generating reserve_process_downward...
Generating maxInvestGroup_entity_period...
Generating maxDivestGroup_entity_period...
Generating minInvestGroup_entity_period...
Generating minDivestGroup_entity_period...
Generating maxInvestGroup_entity_total...
Generating maxDivestGroup_entity_total...
Generating minInvestGroup_entity_total...
Generating minDivestGroup_entity_total...
Generating maxInvest_entity_period...
Generating maxDivest_entity_period...
Generating minInvest_entity_period...
Generating minDivest_entity_period...
Generating maxInvest_entity_total...
Generating maxDivest_entity_total...
Generating minInvest_entity_total...
Generating minDivest_entity_total...
Generating maxCumulative_flow_solve...
Generating minCumulative_flow_solve...
Generating maxCumulative_flow_period...
Generating minCumulative_flow_period...
Generating maxInstant_flow...
Generating minInstant_flow...
Generating inertia_constraint...
Generating co2_max_period...
Generating co2_max_total...
Generating non_sync_constraint...
Generating capacityMargin...
Generating group_loss_share_constraint...
Display statement at line 2827
rest = 8
Model has been successfully generated
Writing problem data to 'flexModel3.mps'...
314428 records were written
--- Problem Characteristics ---
Number of rows               =    95545
Number of columns            =    49776
Number of non-zeros (matrix) =   204678
Number of non-zeros (objrow) =    24312
GLPSOL wrote the problem as MPS file

Running HiGHS 1.5.3 [date: 2023-09-18, git hash: n/a]
Copyright (c) 2023 HiGHS under MIT licence terms
Number of MI entries in BOUNDS section is 34632
LP   flexModel3 has 95544 rows; 49776 cols; 180366 nonzeros
Presolving model
Problem status detected on presolve: Infeasible
Model   status      : Infeasible
Objective value     :  0.0000000000e+00
HiGHS run time      :          0.04
Writing the solution to flexModel3.sol
HiGHS solved the problem

2024-01-19 11:37:44 ERROR: The model is infeasible. Check the constraints.
Kernel died (×_×)
e-zaline commented 5 months ago

Ok, found it, I had a negative capacity for one of my units.