quintel / etmodel

Professional interface of the Energy Transition model.
https://energytransitionmodel.com/
MIT License
33 stars 14 forks source link

Merit order prices should not contain 'infinity' #2076

Closed ChaelKruip closed 8 years ago

ChaelKruip commented 8 years ago

Downloading prices with standard scenario gives a CSV containing "infinity" on most lines:

price_282810_csv

grdw commented 8 years ago

Looks like there's somewhere in the code where x > 0 / 0.0 is happening.

In irb:

irb(main):007:0> 0.1 / 0.0
=> Infinity
ChaelKruip commented 8 years ago

@grdw what is the status of this issue?

jorisberkhout commented 8 years ago

Technically not a merit order chart issue, but very related, so adding the milestone 'merit order charts' :smile:

grdw commented 8 years ago

It's a bit odd. ETModel's CSV Export returns Infinity, but when you run: MERIT_PRICE_CURVE() in ETEngine, it returns - at the location where Infinity is suppose to be in the CSV - 40.58150729979275 ...

I need to investigate a little further.

grdw commented 8 years ago

Allright after some peeling of the layers of Merit and diving deep into a Merit I found this.

Can't it just be that the marginal_costs for certain producers is Infinity and it therefor will remain Infinity since anything added or multiplied by Infinity will always be Infinity?

The only producer I can see for which marginal costs are Infinity is: energy_power_ultra_supercritical_cofiring_coal households_water_heater_fuel_cell_chp_network_gas households_water_heater_micro_chp_network_gas energy_power_combined_cycle_ccs_coal energy_power_combined_cycle_ccs_network_gas energy_power_engine_diesel energy_power_engine_network_gas energy_power_hydro_mountain energy_power_nuclear_gen3_uranium_oxide energy_power_turbine_network_gas

This is when I put a log line here with

if @cost == Float::INFINITY
  puts "#{ producer } -> #{ @cost }"
end

@antw could this make any sense or am I searching for a solution in all the all the wrong places?