PF in AC-DC-Meshed Network

111 views
Skip to first unread message

Elias Althoff

unread,
Dec 16, 2021, 9:31:35 AM12/16/21
to pypsa
Dear all,

I recently added DC-Links to my network. I simply used the direct links, connecting 2 AC-Busses by a link. This works fine for the LOPF and the LPF. But when I try to run a PF on the results, the DC-Links dont show any power-flow. Do I have to take the detour by creating DC Busses, connecting them to the AC Busses via Link and connect the DC busses by a DC-line? Whats the difference between the PF and the LPF here?

Best wishes,
Elias

Fabian Neumann

unread,
Dec 17, 2021, 11:14:50 AM12/17/21
to Elias Althoff, pypsa
Hi Elias,

links connecting AC buses directly shouldn't be a problem. For the PF,
do you set n.links_t.p_set? Generally, this has to be done for all
controllable components.

https://github.com/fneum/power-flow-models/blob/2470ab59ff6ed382caca369bc7f611169c398c2f/scripts/power_flow.py#L31-L38

When I do or do not set the p_set, the behaviour for LPF and PF is the
same. No flows in n.links_t.p0 if not set, set flows if set.

--
> --
> 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/24926810-4a68-4cd7-b439-31c4646f98a4n%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/24926810-4a68-4cd7-b439-31c4646f98a4n%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

Visitor Address:
Einsteinufer 25 (TA 8)
10587 Berlin

Elias Althoff

unread,
Dec 18, 2021, 5:34:29 AM12/18/21
to pypsa
Hey Fabian,

thanks for the answer. Its weird though, because it behaves differently for me. 

You were right, I did not set a p_set, only p_nom. The LOPF used it like a line and sent whatever was optimal through it. The links were "ignored" in the PF - no power flow. Now, that I set the p_set, there is a power flow of whatever I set in p_set in the PF. In the LOPF, the power flow still varies.  
I actually prefer it to be variable. I dont want to force a specific number through the link. I want it to be done by the system. Is that possible as well? I mean it seems to me like this is whats happening in the LOPF in my case.

Best wishes,
Elias

Elias Althoff

unread,
Dec 18, 2021, 5:38:28 AM12/18/21
to pypsa
I just had a look into the documentation and for p_set it says: " The dispatch set point for p0 of the link in PF." 

So there seems to be a difference. That makes it very complicated to run a PF on my LOPF results, because the DC links will behave differently.



Fabian Neumann

unread,
Dec 18, 2021, 6:13:26 AM12/18/21
to py...@googlegroups.com
Hi Elias,

the PF (and LPF) will always depend on the set points of all the
controllable components (obtained either through LOPF or set manually).

The HVDC links belong to this category of components for which we can
control the power flow and for which their flow is not governed by KVL.

Just like generators and loads, links contribute to the net power
injections at each bus which serves as input to PF. PF is not suitable
to determine the flow in links, that's the job of LOPF like for
generator dispatch.

Not sure I understood the second e-mail. The point of the p_set is that
the flows in the DC links are consistent across LOPF outputs and PF inputs.

Best wishes,

Fabian N

On 18.12.21 11:38, Elias Althoff wrote:
> I just had a look into the documentation and for p_set it says: " The
> dispatch set point for p0 of the link *in PF*."
> <https://groups.google.com/d/msgid/pypsa/24926810-4a68-4cd7-b439-31c4646f98a4n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pypsa/24926810-4a68-4cd7-b439-31c4646f98a4n%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
> <https://tub-ensys.github.io>
> Personal website: https://neumann.fyi <https://neumann.fyi>
>
> Visitor Address:
> Einsteinufer 25 (TA 8)
> 10587 Berlin
>
> --
> 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/2a520546-8f8b-41fb-ae0d-ccc28d54f90dn%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/2a520546-8f8b-41fb-ae0d-ccc28d54f90dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Elias Althoff

unread,
Dec 18, 2021, 1:08:10 PM12/18/21
to pypsa
Hi Fabian,

thanks again. I checked your code and solved it accordingly. It is working now for both LPF and PF. While having a look at your code I wondered about another thing we were talking about in another post - updating the line attributes when extending the grid. you solved it using this bit:

if lines_ext_untyped_b.any():

for attr in ("r", "x"):

n.lines.loc[lines_ext_untyped_b, attr] = lines[attr].multiply(

lines["s_nom"] / n.lines["s_nom_opt"]


In my case I used the 'type' column to specify my cable type, so by definition the r and x values get overwritten. ("Name of line standard type. If this is not an empty string “”, then the line standard type impedance parameters are multiplied with the line length and divided/multiplied by num_parallel to compute x, r, etc. This will override any values set in r, x, and b. If the string is empty, PyPSA will simply read r, x, etc.")

So that for loop would not solve that problem for me, would it?

Best wishes,
Elias

Fabian Neumann

unread,
Dec 19, 2021, 3:22:16 PM12/19/21
to py...@googlegroups.com
Hi Elias,

this code block is only for the untyped lines (where type == ''). Below
that is a code block where the num_parallels are updated for typed lines:

https://github.com/fneum/power-flow-models/blob/2470ab59ff6ed382caca369bc7f611169c398c2f/scripts/solve_network.py#L103-L115

Then make sure to run n.calculate_dependent_values() based on the
updated num_parallel values before resolving.

Best wishes,

Fabian N
> <https://groups.google.com/d/msgid/pypsa/2a520546-8f8b-41fb-ae0d-ccc28d54f90dn%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pypsa/2a520546-8f8b-41fb-ae0d-ccc28d54f90dn%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
> <https://tub-ensys.github.io>
> Personal website: https://neumann.fyi <https://neumann.fyi>
>
> Visitor Address:
> Einsteinufer 25 (TA 8)
> 10587 Berlin
>
> --
> 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/fd8b1d51-0ab2-4c77-baac-e380651efc0fn%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/fd8b1d51-0ab2-4c77-baac-e380651efc0fn%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages