Time varying marginal costs and locational marginal prices

151 views
Skip to first unread message

Rowan Tunnicliffe

unread,
Nov 1, 2022, 4:33:43 PM11/1/22
to pypsa
Hi all,

I'm a relatively new user of PyPSA (which from what I've seen so far is a fantastic piece of work!), and I'm trying to build a dispatch only model of the Irish market, using a single bus.

I have had some success pulling out marginal prices using the method described by Jonas Hörsch here: https://groups.google.com/g/pypsa/c/jdeQHeZljMs/m/LaE99ofMBAAJ 

However, this only worked when I was passing in fixed marginal costs for each unit via a generators.csv file.

In order to reflect underlying commodity prices, I am trying to put in time-dependent marginal costs for each unit. I have done this by putting in a csv titled 'generators-p_marginal_cost.csv' and I am fairly sure that it is pulling into the model correctly, as if I type the following, then I get a dataframe with the correct numbers in: nu.generators_t.p_marginal_cost

However, when I then try and solve the model, the marginal price at the bus seems to revert to 0 in every period, as does the overall objective of the model. Note that while I have put wind in at zero MC, this doesn't explain it as there is not enough MW of wind available in each period to match demand load and therefore be the marginal unit. It also still gives 0 values for price and objective if I set the wind MC to another value.

Would anyone be able to shed some light on what I might be doing wrong here?

Thanks,
Rowan

Fabian Neumann

unread,
Nov 2, 2022, 6:51:30 AM11/2/22
to pypsa
Hi Rowan,

the file should have a different name, which would then show up at the right location:

File name:

generators-marginal_cost.csv

In network object:

n.generators_t.marginal_cost

Currently, the time-varying marginal cost are neglected because they are in the wrong location. Then, PyPSA reverts to static default, which is 0.

Best wishes,

Fabian N

Rowan Tunnicliffe

unread,
Nov 2, 2022, 7:16:06 AM11/2/22
to pypsa
HI Fabian,

That works perfectly now - thank you!

Thanks,
Rowan
Reply all
Reply to author
Forward
0 new messages