PyPSA uses for modelling specific hybrid projects from the perspective of a developer

485 views
Skip to first unread message

Matthew Smith

unread,
Apr 17, 2023, 3:11:29 AM4/17/23
to pypsa

Hello,

I’m looking to use PyPSA to find the optimal project configuration (capacity expansion) for a hypothetical PPA auction. Unlike most PyPSA use cases, I don’t need to optimise the total system cost to meet 100% of demand, but rather I want the configuration which maximises the investment return, considering the ‘soft constraints’ of penalties if we don’t meet the specified % of total annual demand. In short, I’m trying to use PyPSA as an investment analysis tool for renewable energy developers who are looking to develop hybrid plants to deliver more firm energy.

Below are a few examples with some questions on how I might best use PyPSA to solve this.

I have been working with a modified version of the example show here – many many thanks to Fabian for producing this amazing course, and to the whole community for their tireless efforts in supporting the usage of this tool.

Example

A PPA requires the developer to meet 80% of a 100 MW baseload load over a full year with only renewable energy and storage. Any shortfall below 80% (e.g. RE generation below 80% * 100 MW * 8760) incurs a penalty.

I could model the requirement to only meet 80% by creating a ‘free’ generator (“Free_Gen_20%”) with no variable costs, fixing capacity at 100 MW, and setting the CO2 intensity to 1 tonne per MWh. Then I could set a global constraint to CO2 emissions at (20% * 100 MW * 8760), so that the ‘free’ hours are limited to 20% of the year.

Question 1: Is there a less hacky way to model this?

 

The RE & storage generators will have two revenue streams. One would be the tariff paid by the baseload PPA provider; the maximum generation which can be sold in one time period would be 100 MW. Any generation above 100 MW in that period would be sold at an excess power tariff; this might be fixed or set per period as per a market price forecast.

Question 2: Is there a way to model these two revenue streams? Or more importantly, is there any way to optimise the model to consider the value of excess power in its capacity planning? I’m guessing not, as PyPSA only optimises to reduce the whole system costs, and can’t optimise for profit, right? Could excess generation revenues be summed and subtracted from the whole system costs, and so considered in the optimisation function?

 

To model the ability to go below the 80% annual requirement by paying the penalty, I could create a second generator (“Penalty_gen_Annual_shortfall”), with 0 CO2 emissions, fixing capacity at 100 MW, and setting the marginal cost to the penalty amount we want to model.

Question 3: Is this the best way to model a ‘soft constraint’ on the annual load requirement?

 

Some PPA auctions will specify a penalty for not meeting the load in certain specified hours. E.g. you need to meet X% of the baseload amount between the hours of 1000 – 1200 and 1700 – 1900 every day, otherwise you need to pay a penalty of $X/MWh.

Question 4: to model this penalty, is there a way to 1) restrict “Free_Gen_20%” and “Penalty_gen_Annual_shortfall”, so that they cannot generate in the specified hours, and 2) Create a third generator to simulate the penalty amounts that can only run during the specified hours?

 

Thanks very much for any hints or guidance which you can give!

 

Best regards,
Matt

Fabian Neumann

unread,
Apr 18, 2023, 2:26:36 AM4/18/23
to pypsa
Hi Matt,

Iegor is our PPA expert and did some analysis in this repository:

https://github.com/PyPSA/247-cfe

This may have some answers you are looking for. I might come back to your specific questions when I have more time.

Best wishes,

Fabian

Martin Klein

unread,
Apr 18, 2023, 10:47:59 AM4/18/23
to pypsa
Hi Matt, 

concerning your second question - I was working on a similar problem recently. What I did was to implement a "grid bus" that I linked to the system that I wanted to optimise with one unidirectional link towards my system and one unidirectional link towards the grid bus. The grid bus had a very large generator and a very large load (but smaller than the generator), both at marginal cost of 0. This way you can always buy and always sell energy if needed. The marginal costs of the links were the prices to buy and sell energy from and to the market. Not sure if this is the gold standard to do it but that gave the right parameters in my case.

Best regards
Martin

Matthew Smith

unread,
Apr 20, 2023, 4:19:59 AM4/20/23
to pypsa
Hi Martin,

Thanks for your response, it is helpful. I sketched out the below - does this reflect what you did? I adjusted it a little so that the 0 MC generator always faces the MC of the link, as otherwise the 'market' load would always be fulfilled by the 0 MC generator and there would not be an opportunity for the RE system to sell to the grid. But then thinking more, when would the RE plants ever be able to out-complete the 0 MC generator and sell to the grid load? Wouldn't the 0 MC generator always be cheaper or the same cost, as they face the same grid costs? Or was there a spread between the buy and sell prices?

Best regards,
Matt
network sketch.jpg

Matthew Smith

unread,
Apr 20, 2023, 4:34:05 AM4/20/23
to pypsa
Hi Fabian,

Thanks for this. I've been looking through the code on the github repository and it is quite informative. I had read this study previously - it's how I found PyPSa! Great study.

I wasn't able to find the exact answers, though it does show how PyPSa can optimise different sub-systems within the overall network (in this case the C&I loads). 

Would welcome any thoughts you have on the specific questions whenever you end up getting time. Thanks again.

Best regards,
Matt

Martin Klein

unread,
Apr 22, 2023, 5:40:43 AM4/22/23
to Matthew Smith, pypsa
Hi Matt, 

Almost, what I meant was the following:


The link from system to grid would have a negative marginal cost (i.e. a revenue). I think it would be vital that the purchasing price from the grid would be higher than what you can sell your electricity for (hence the + x), be it grid fees, etc., otherwise there is no incentive to serve the local load. Does that make sense for your application?

best regards 
Martin



--
You received this message because you are subscribed to a topic in the Google Groups "pypsa" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pypsa/su1vXYfRL-U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pypsa+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pypsa/3d11cb13-7489-4906-88a8-eeb7bda6a4cen%40googlegroups.com.
--

Matthew Smith

unread,
Nov 20, 2023, 11:23:47 PM11/20/23
to pypsa
Hi Martin,

Coming back to this post many months later. I now have a nifty PyPSA model which works for simulating 'round the clock' auctions and helping find optimal configurations for hybrid RE plants.

I initially used your good solution of simulating excess purchase and sale of electricity through an oversized generator and load. I eventually removed the 'excess load' and replaced it with a negative generator as per the example here. I'm not sure if the optimiser treats this differently, but the behaviour seems fine. 

While PyPSA doesn't solve for a tariff, so to speak, we can simulate the optimal solution for a specific tariff by giving the link to the 'PPA bus' a negative marginal cost equivalent to the tariff. This greatly changes the optimisation outcome. So far, I still need to enter the outputs from PyPSA into an excel based financial model to get an IRR; I don't think that there would be a way around this.

Overall I'm loving the PyPSA tool and looking forward to continuing to learn more. 

Best regards,
Matt
Reply all
Reply to author
Forward
0 new messages