Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt docstring example of MultiInputMultiOutputConverter #9

Open
SabineHaas opened this issue Jul 16, 2024 · 0 comments
Open

Adapt docstring example of MultiInputMultiOutputConverter #9

SabineHaas opened this issue Jul 16, 2024 · 0 comments

Comments

@SabineHaas
Copy link
Collaborator

SabineHaas commented Jul 16, 2024

It's an example of a Converter

Defining a MIMO-converter:
>>> from oemof import solph
>>> bgas = solph.buses.Bus(label='natural_gas')
>>> bcoal = solph.buses.Bus(label='hard_coal')
>>> bel = solph.buses.Bus(label='electricity')
>>> bheat = solph.buses.Bus(label='heat')
>>> trsf = solph.components.Converter(
... label='pp_gas_1',
... inputs={bgas: solph.flows.Flow(), bcoal: solph.flows.Flow()},
... outputs={bel: solph.flows.Flow(), bheat: solph.flows.Flow()},
... conversion_factors={bel: 0.3, bheat: 0.5,
... bgas: 0.8, bcoal: 0.2})
>>> print(sorted([x[1][5] for x in trsf.conversion_factors.items()]))
[0.2, 0.3, 0.5, 0.8]
>>> type(trsf)
<class 'oemof.solph.components._converter.Converter'>
>>> sorted([str(i) for i in trsf.inputs])
['hard_coal', 'natural_gas']
>>> trsf_new = solph.components.Converter(
... label='pp_gas_2',
... inputs={bgas: solph.flows.Flow()},
... outputs={bel: solph.flows.Flow(), bheat: solph.flows.Flow()},
... conversion_factors={bel: 0.3, bheat: 0.5})
>>> trsf_new.conversion_factors[bgas][3]
1
Notes
-----
The following sets, variables, constraints and objective parts are created
* :py:class:`~oemof.solph.components.experimental._mimo_converter.
MultiInputMultiOutputConverterBlock`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant