Error using 2 multilinks delivering the same 2 energy outputs

36 views
Skip to first unread message

Carlos Olmos Alonso

unread,
Mar 27, 2025, 2:52:42 PMMar 27
to pypsa
Hello PyPsa Team,

I am working in minimal Combined Heat Power Model. But I get an "infeasible error" when using 2 multi-links delivering both electricity and heat.  

Curious that the error dissapears only if I remove one output from the second multlink (transforming it into a single-output link: nuclearSMR_as_multi = False) , so it seems I am doing something wrong with managing multiple-outputs with various multi-links. 

¿Is it posible to use this with PyPSA? I would be gratefull if you could give me a hint to solve this error (I have tried to replicate in a similar way the biomass example but it continues giving me the infeasible error). 

¡Thank you very much!




SMR_multilink.ipynb

Jonas Blomberg Ghini

unread,
Mar 28, 2025, 2:12:21 AMMar 28
to pypsa
Hi,

Haven't looked at the notebook you added, but my gut feeling is that you're basically trying to push too much energy into the loads you have defined. The link component does not change the relationship between the two outputs even if there is no demand for one of them, which in turn means the energy balance at the receiving buses is broken, giving an infeasibility. 

Jonas

Carlos Olmos Alonso

unread,
Mar 28, 2025, 8:53:08 AMMar 28
to pypsa
Hi, 
You are right!  I’ve adjusted power Load and store values, and if they match exactly, there is no infeasible error.
But then, ¿Do you think it is a good choice to optimize an energy cogeneration model based on multilinks and stores? It don't seems to be a very flexible design, I would appreciate any advice,
Thankyou again!   

Jonas Blomberg Ghini

unread,
Mar 28, 2025, 9:39:54 AMMar 28
to Carlos Olmos Alonso, pypsa
Hi,

Well, I think what we as users need to keep in mind is that pypsa doesn't really "do anything". It is the solver in the backend that does the math. And if there is no energy balance, then mathematically, the problem is infeasible. 

The solution is to just add a place to dump the overflow energy. In most real systems waste heat goes in some form of cooler or another anyway, and waste electricity isn't really a thing in the sense that electricity tends to be so valuable that a system only produces exactly as much as it needs.

I run optimizations on systems where links have at least two outputs all the time, and a couple of my projects have had three outputs without issue.

Jonas

--
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/EcxhXFa0-18/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pypsa+un...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pypsa/b53a1354-a7d0-4eca-93d4-e2e07d8d69adn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages