rl-institut / multi-vector-simulator

Multi-vector Simulation Tool assessing and optimizing Local Energy Systems (LES) for the E-LAND project
GNU General Public License v2.0
21 stars 10 forks source link

Fix/multiple in out transformer #949

Closed NargesChinichian closed 1 year ago

NargesChinichian commented 1 year ago

fix #802, fix #799, fix #541, fix #599, fix #507

fix transformer_constant_efficiency_fix to accept multiple inputs OR multiple outputs.

Changes proposed in this pull request:

transformer_constant_efficiency_fix

transformer_constant_efficiency_optimize

The following steps were realized, as well (if applies):

For more information on how to contribute check the CONTRIBUTING.md.

Bachibouzouk commented 1 year ago

Multiple outputs and one input

mvs_tool -i tests/benchmark_test_inputs/Feature_output_flows_as_list -ext csv -f

t1 = solph.Transformer(
  label='diesel_generator',
  inputs={Electricity (diesel): solph.Flow(max=1, min=0)},
  outputs={Electricity: solph.Flow(variable_costs=0.3, max=1, nominal_value=1250, min=0), Heat: solph.Flow(variable_costs=0.5, max=1, nominal_value=1250, min=0)},
  conversion_factors={Electricity: [0.3], Heat: [0.5], Electricity (diesel): [1]},
)

Multiple inputs and one output

t1 = solph.Transformer(
  label='diesel_generator',
  inputs={Electricity (diesel): solph.Flow(min=0, max=1), Electricity: solph.Flow(min=0, variable_costs=0.15, max=1)},
  outputs={Electricity: solph.Flow(nominal_value=1250, min=0, max=1)},
  conversion_factors={Electricity (diesel): [0.6], Electricity: [1]},
)
Bachibouzouk commented 1 year ago

I only changed the changelog and the tests did not trigger, I will merge as the previous status was passing