GlobalConstraint

62 views
Skip to first unread message

Meritxell Domènech Monfort

unread,
Apr 6, 2022, 5:17:19 AM4/6/22
to pypsa
Dear Pypsa users,

I am trying to design a new technology that absorves co2. For that I am using stores and links (like in the example "Biomass, synthetic fuels and carbon management" or in pypsa-eur-sec).
Still I don't fully understand how the GlobalConstraint works.

When a GlobalConstraint is added to the system (e.g. in pypsa-eur or pypsa-eur-sec) how are the co2 emissions produced by the system calculated?
I understand that it considers all carriers which have co2_emissions associated but how does pypsa calculate those total co2_emissions so that they are smaller than the limit set in the config file? Is there any formula in the scripts?

    n.add("GlobalConstraint", "CO2Limit",
          carrier_attribute="co2_emissions", sense="<=",
          constant=co2limit * Nyears)

Kind regards,

Meritxell Domènech Monfort

Fabian Neumann

unread,
Apr 7, 2022, 4:50:26 AM4/7/22
to Meritxell Domènech Monfort, pypsa
Hi Meritxell,

yes, the GlobalConstraint component is translated into a mathematical
constraint in the optimisation problem in PyPSA. Here's the relevant
code bit:

https://github.com/PyPSA/PyPSA/blob/c522d09c0c924df38aa5acba0e8540cc7d16824c/pypsa/linopf.py#L766-L866

The co2_emissions are stored under n.carriers.co2_emissions.

The specific emissions are mapped to the PyPSA components by their
energy carrier. Electrical output of generators is divided by efficiency
to get thermal output first.

HTH,

Fabian N



On 06.04.22 11:17, Meritxell Domènech Monfort wrote:
> Dear Pypsa users,
>
> I am trying to design a new technology that absorves co2. For that I am
> using stores and links (like in the example "Biomass, synthetic fuels
> and carbon management" or in pypsa-eur-sec).
> Still I don't fully understand how the GlobalConstraint works.
>
> When a GlobalConstraint is added to the system (e.g. in pypsa-eur or
> pypsa-eur-sec) how are the co2 emissions produced by the system calculated?
> I understand that it considers all carriers which have co2_emissions
> associated but how does pypsa calculate those total co2_emissions so
> that they are smaller than the limit set in the config file? Is there
> any formula in the scripts?
>
>     n.add("GlobalConstraint", "CO2Limit",
> *carrier_attribute="co2_emissions"*, sense="<=",
>           constant=co2limit * Nyears)
>
> Kind regards,
>
> Meritxell Domènech Monfort
>
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pypsa+un...@googlegroups.com
> <mailto:pypsa+un...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pypsa/3e26dd6e-0760-416f-bbb5-01c31ddcc617n%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/3e26dd6e-0760-416f-bbb5-01c31ddcc617n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Dr.-Ing.
Fabian Neumann (he/him)
Postdoctoral Researcher

Department of Digital Transformation in Energy Systems
Institute of Energy Technology
Technische Universität Berlin

Group website: https://tub-ensys.github.io
Personal website: https://neumann.fyi

Zoom: https://tu-berlin.zoom.us/my/fneum
Schedule Meeting: https://calendly.com/fneum

Visitor Address:
Einsteinufer 25 (TA 8)
10587 Berlin

My working hours may not be your working hours. Do not feel pressure to
reply to this email outside your working hours.

Meritxell Domènech Monfort

unread,
Apr 7, 2022, 9:06:02 AM4/7/22
to pypsa
Okay, thanks for the reply. I will take a look into the code

El dia dijous, 7 d’abril de 2022 a les 10:50:26 UTC+2, Fabian Neumann va escriure:
Reply all
Reply to author
Forward
0 new messages