-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathload_growth.py
44 lines (33 loc) · 1.04 KB
/
load_growth.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*-
# @Time : 5/10/2022 11:14 AM
# @Author : Paulo Radatz
# @Email : [email protected]
# @File : load_growth.py
# @Software: PyCharm
import py_dss_interface
import os
import pathlib
script_path = os.path.dirname(os.path.abspath(__file__))
dss_file = pathlib.Path(script_path).joinpath("feeders", "123Bus", "IEEE123Master.dss")
dss = py_dss_interface.DSS()
dss.text(f"compile [{dss_file}]")
dss.text("edit vsource.source pu=1.045")
dss.text("New EnergyMeter.Feeder Line.L115 1")
dss.text("set controlmode=off")
under_voltage = False
i = 0
while not under_voltage and i < 100:
i = i + 1
load_mult = 1 + i / 100
dss.text(f"set loadmult={load_mult}")
dss.text("solve")
if min(dss.circuit.buses_vmag_pu) < 0.95:
under_voltage = True
load_mult = 1 + (i - 1) / 100
if under_voltage:
print(f"The max loadmult: {load_mult}")
dss.text(f"set loadmult={load_mult}")
dss.text("solve")
else:
print(f"No problem with max loadmult of: {load_mult}")
dss.text("plot profile phases=all")