fneum / data-science-for-esm

https://fneum.github.io/data-science-for-esm/intro.html
MIT License
66 stars 32 forks source link

update workshop 12 - sector coupling with multilink default #7

Closed pz-max closed 11 months ago

pz-max commented 1 year ago

Since the PR: https://github.com/PyPSA/PyPSA/pull/669, my feeling is that this code block is not necessary. I am happy to get assigned to this task and deal with it (as well as the Linopy workshop)

Some sector-coupling technologies have multiple ouputs (e.g. CHP plants producing heat and power). By default, PyPSA links have only one input (bus0) and one output (bus1) with a given efficieny (efficiency). Thus, we have to tell PyPSA that links can have multiple outputs by overriding the component attributes.

override_component_attrs = pypsa.descriptors.Dict(
    {k: v.copy() for k, v in pypsa.components.component_attrs.items()}
)

override_component_attrs["Link"].loc["bus2"] = [
    "string",
    np.nan,
    np.nan,
    "2nd bus",
    "Input (optional)",
]
override_component_attrs["Link"].loc["efficiency2"] = [
    "static or series",
    "per unit",
    1.0,
    "2nd bus efficiency",
    "Input (optional)",
]
override_component_attrs["Link"].loc["p2"] = [
    "series",
    "MW",
    0.0,
    "2nd bus output",
    "Output",
]
fneum commented 1 year ago

Yes, requires to set minimum PyPSA version in environment yaml.

pz-max commented 1 year ago

[like] Maximilian Parzen reacted to your message:


From: Fabian Neumann @.> Sent: Wednesday, September 27, 2023 7:55:04 PM To: fneum/data-science-for-esm @.> Cc: Maximilian Parzen @.>; Assign @.> Subject: Re: [fneum/data-science-for-esm] update workshop 12 - sector coupling with multilink default (Issue #7)

This email was sent to you by someone outside the University. You should only click on links or attachments if you are certain that the email is genuine and the content is safe.

Assigned #7https://github.com/fneum/data-science-for-esm/issues/7 to @pz-maxhttps://github.com/pz-max.

— Reply to this email directly, view it on GitHubhttps://github.com/fneum/data-science-for-esm/issues/7#event-10491612074, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOYZENNMSSH7NR36RU7UNQ3X4SABRANCNFSM6AAAAAA5J3O3BA. You are receiving this because you were assigned.Message ID: @.***>

The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.

pz-max commented 11 months ago

Nice! :+1: