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

[question] direction of getting the optimal capacity of a transformer #248

Open SabineHaas opened 4 years ago

SabineHaas commented 4 years ago

How is the optimal capacity of a transformer derived?

max(heat_demand) / COP or max(electricity_demand) ?

smartie2076 commented 4 years ago

I do not quite understand this question.

Here is the part where the optimized capacity is extracted from the oemof results:

    if "optimizeCap" in dict_asset:
        if dict_asset["optimizeCap"]["value"] == True:
            if direction == "input":
                optimal_capacity = bus["scalars"][
                    ((bus_name, dict_asset["label"]), "invest")
                ]
            elif direction == "output":
                optimal_capacity = bus["scalars"][
                    ((dict_asset["label"], bus_name), "invest")
                ]
            else:
                logging.error(
                    "Function get_optimal_cap has invalid value of parameter direction."
                )

Ie. if there is an inflow direction (transfomers, sinks) the capacity will be determined based on the inflow into the asset. The transformer has also an output, but as that is checked only secondary, the loop is already exited with the first test passing at "input". Incase of, eg. a PV plant with only an output flow, the output flow would determine the capacity (there is some more calculation going on in that case, see below).

SabineHaas commented 4 years ago

In our discussion we weren't sure whether the optimal capacity will be determined based on inputs or outputs. Thanks @smartie2076 that answers my question and is the behaviour I expected.

SabineHaas commented 4 years ago

Sorry I need to reopen this. This is where get_optimal_cap is executed and where direction is defined:

# definie capacities. Check if the component has multiple input or output busses
    if "output_bus_name" in dict_asset and "input_bus_name" in dict_asset:
        if not isinstance(output_name, list):
            get_optimal_cap(bus_data[output_name], dict_asset, output_name, "output")
        else:
            for bus in output_name:
                get_optimal_cap(bus_data[bus], dict_asset, bus, "output")

So if there is an inflow and outflow the outflow will be used, right?

For example for a diesel generator it makes sense to determine the optimal capacity on the outflow (electricity). I checked a heat pump data information: there they give the heat and cooling capacity as well as the power input for both, heating and cooling mode. I assume, it's fine to determine the optimal capacity via the output flows.

smartie2076 commented 4 years ago

So if there is an inflow and outflow the outflow will be used, right?

Yes, I would say so.

For example for a diesel generator it makes sense to determine the optimal capacity on the outflow (electricity). I checked a heat pump data information: there they give the heat and cooling capacity as well as the power input for both, heating and cooling mode. I assume, it's fine to determine the optimal capacity via the output flows.

Okay. I am actually not quite sure how the capacity determination is handled when we have multiple outputs, and if the get_optimal_cap even works in that case. We will have to see, as soon as it comes up.

smartie2076 commented 3 years ago

Relates to #451