PyPSA-Eur: Unexpected clustering behaviour when IT is included

28 views
Skip to first unread message

Tom Kra

unread,
Dec 17, 2025, 11:54:40 AM12/17/25
to pypsa
Dear PyPSA-Community,

for my research I want to build a power model of France and Germany and their neighbouring countries. For this, France and Germany should contain 5 nodes each and the neighbouring countries the least amount of nodes. As far as I know this should be 2 nodes for DK, ES, IT each and 1 for the remaining countries each. For the clustering I am using the focus weight option.

My problem is that in the final network, the nodes are not distributed as I defined. FR, DK, DE, IT in particular show discrepancies (base_21_no_IT/_2). You can see, as far as I remove IT from the model the model is built as expected (base_23). I could not find any question like this in this group so I want to ask you following questions:
  1. Did somebody face similar observations? Does somebody know how to get the expected behaviour?
  2. Has somebody an idea why corsica is only considered for custering when IT is? Is it because it is possibly only connected to the grid of IT?
Please bear with me if I have made any obvious mistakes; I am still quite new to the PyPSA-Eur universe. If you need any further information, please feel free to write to me and I will be happy to provide it. I am very grateful for any advice!  😊


Best regards and happy holidays!
Tom
base_21_no_IT_2.png
base_21_no_IT.png
base_23.png

Tom Kra

unread,
Jan 5, 2026, 3:00:05 AMJan 5
to pypsa
I am sorry as I see the naming of the images makes no sense... 
What you can see is that the image base_21_no_IT indeed does not include Italy and the other two does. And in these two you can see the discrepancies. Is there anyone who has a solution for my problem or has any hint to get to one? 😊

Best regards and happy new year!
Tom

Tom Kra

unread,
Jan 16, 2026, 8:47:39 AMJan 16
to pypsa
Dear interested person,

I found out that my problem was caused by the different subnetworks and the design of focus_weights. The only slution I found was just to adjust the cluster_network.py.I added a new IF statement that queried clusters_per_country, which was defined in config.yaml. 
To take the subnetworks into account, I divided the assigned number of clusters according to load weight among the individual subnetworks, ensuring that each subnetwork had at least one bus. The result is exactly what I wanted to build.

I hope that this will help anyone who has the same problems I had :)

Best regards
Tom
correct_base_23.png
Reply all
Reply to author
Forward
0 new messages