Hi Elias,
no, the n.determine_network_topology() is sensible to have executed. It
will do that within n.lopf() as well.
You will have to calculate the BODF for each SubNetwork separately:
n.determine_network_topology()
for sn in network.sub_networks.obj:
sn.calculate_BODF()
print(sn.BODF) # or store it somewhere.
You can exclude line outages (if you do SCLOPF) e.g. for the cases you
describe with the branch_outages argument:
https://pypsa.readthedocs.io/en/latest/api_reference.html#pypsa.Network.sclopf
No need, to delete anything.
Best wishes,
Fabian N
On 13.01.22 11:56, Elias Althoff wrote:
> I think I can answer my own question... I dont need this part:
> network.determine_network_topology()
>
> When Im not using it I still get an error (RuntimeError: Factor is
> exactly singular), which is probably caused by the fact that some nodes
> in my network are connected to only one other node, so that a failure of
> the connecting line would result in an error.
>
> So I would have to delete all my nodes, that are connected to only one
> other node, to check the BODF. Can somebody confirm this?
>
> Elias Althoff schrieb am Donnerstag, 13. Januar 2022 um 11:04:07 UTC+1:
>
> Dear all,
>
> I am having trouble with the BODF function. Are there by any chance
> any examples on that? So far I am followin these explications:
>
https://pypsa.readthedocs.io/en/latest/contingency_analysis.html
> <
https://pypsa.readthedocs.io/en/latest/contingency_analysis.html>
>
https://pypsa.readthedocs.io/en/latest/api_reference.html#pypsa.SubNetwork.calculate_BODF
> <
https://pypsa.readthedocs.io/en/latest/api_reference.html#pypsa.SubNetwork.calculate_BODF>
>
> I am running my initial LOPF so that I have my power flow solution.
> After that, I add these lines, as described in the readthedocs:
>
> network.determine_network_topology()
> a = pypsa.SubNetwork(network)
> a.calculate_BODF()
> print(a.BODF)
>
> It does start the function, but it breaks while finding the slack bus:
>
> line 774, in find_slack_bus
> sub_network.slack_bus = sub_network.buses_i()[0]
> with the error: IndexError: index 0 is out of bounds for axis 0 with
> size 0
>
> Do I have to manually set the slack bus somehow? I dont see any
> input parameters for that function, so I dont really know what I
> could do differently. When I check the output of the Power Flow, the
> Slack buses are defined correctly.
>
> As always, help is much appreciated :)
>
> Best wishes,
> Elias
>
> --
> 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/821fdd67-73a0-45fe-b6d9-f481e6024c7fn%40googlegroups.com
> <
https://groups.google.com/d/msgid/pypsa/821fdd67-73a0-45fe-b6d9-f481e6024c7fn%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
Zoom:
https://tu-berlin.zoom.us/my/fneum
Schedule Meeting:
https://calendly.com/fneum
Visitor Address:
Einsteinufer 25 (TA 8)
10587 Berlin
My working hours may not be your working hours. Do not feel pressure to
reply to this email outside your working hours.