quintel / refinery

Calculates node demands and edge shares for sparse energy graphs.
2 stars 0 forks source link

Fix elastic slots #38

Closed wmeyers closed 10 years ago

wmeyers commented 10 years ago

Just giving you an issue to mark off when done @antw !

See https://github.com/quintel/refinery/issues/21#issuecomment-22194114

antw commented 10 years ago

Implemented by quintel/refinery@49e0856b and quintel/atlas@79b88b3b.

The elastic slot must be a static attribute, even if the other conversions are specified as a query:

- output.electricity = 0.4
- output.loss = elastic

# - - - - - - - - - - - - - - - - - - - - - - - - - - - -

~ output.electricity = MAX(0.2 + 0.2, 0.3)
- output.loss = elastic
wouterterlouw commented 10 years ago

Works fine, however... some of the converters in industry does have the output.coupling_carrier. E.g. in energy_steel_blastfurnace_bat_transformation_cokes:

- use = energetic
- energy_balance_group = coal conversion
- output.coupling_carrier = 1.0
- co2_free = 0.0
- demand_expected_value = 0.0

~ input.coal = 0.391683437555641
~ input.cokes = 1 - 0.391683437555641
~ output.coal_gas = 0.400029027576197
~ output.loss = 1 - 0.400029027576197

Setting - output.loss = elastic does not work in this case!

wouterterlouw commented 10 years ago

When I define output.loss = elastic in the example above, I get the following message:

rake aborted!
nil can't be coerced into Float

However, if no output efficiencies are defined with a query, the problem does not occur. E.g.:

- use = energetic
- energy_balance_group = coal conversion
- output.coupling_carrier = 1.0
- output.loss = elastic
- output.steam_hot_water = 0.95
- co2_free = 0.0
- demand_expected_value = 0.0

~ input.coal = 1.0
~ input.torrified_biomass_pellets = 0.0
~ demand = 0.0

So it seems it is a problem of combining output.coupling_carrier, output.loss and a query specifying another efficiency.

antw commented 10 years ago

@wouterterlouw This should now be fixed. Please update Atlas with git up, and then bundle install to also update Refinery. Let me know if this causes you any more grief and I'll take another look. :smiley:

wouterterlouw commented 10 years ago

:+1: