Skip to content

Commit 19f724f

Browse files
committed
support PowerFlows 0.9
1 parent 593cb08 commit 19f724f

9 files changed

Lines changed: 19 additions & 11 deletions

Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ ForwardDiff = "~v0.10"
3131
InfrastructureSystems = "2"
3232
NLsolve = "4"
3333
PowerSystems = "4"
34-
PowerFlows = "^0.7"
35-
PowerNetworkMatrices = "^0.11"
34+
PowerFlows = "^0.9"
3635
PrettyTables = "1, 2"
3736
SciMLBase = "2"
3837
TimerOutputs = "~0.5"

docs/src/tutorials/tutorial_continuation_pf.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ for p in P_range
7777
q_power = power * tan(acos(load_pf))
7878
set_reactive_power!(load, q_power)
7979
# Run Power Flow
80-
status = solve_ac_powerflow!(sys_static)
80+
pf = ACPowerFlow()
81+
status = solve_powerflow!(pf, sys_static)
8182
if !status
8283
# Finish the loop if the power flow fails
8384
print("Power Flow failed at p = $(power)")
@@ -143,7 +144,8 @@ for p in P_range
143144
q_power = power * tan(acos(load_pf))
144145
set_reactive_power!(load, q_power)
145146
# Run Power Flow
146-
status = solve_ac_powerflow!(sys_static)
147+
pf = ACPowerFlow()
148+
status = solve_powerflow!(pf, sys_static)
147149
if !status
148150
# Finish the loop if the power flow fails
149151
print("Power Flow failed at p = $(power)")

src/base/simulation_initialization.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ function power_flow_solution!(
1111
sys::PSY.System,
1212
inputs::SimulationInputs,
1313
)
14-
res = PF.solve_ac_powerflow!(sys)
14+
pf = PF.ACPowerFlow()
15+
res = PF._newton_powerflow!(pf, sys)
1516
if !res
1617
@error("PowerFlow failed to solve")
1718
return BUILD_FAILED

test/test_case_5shaft.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ The fault disconnects a circuit between buses 1 and 2, doubling its impedance.
1111
##################################################
1212

1313
threebus_sys = build_system(PSIDTestSystems, "psid_test_threebus_5shaft")
14-
solve_ac_powerflow!(threebus_sys)
14+
pf = ACPowerFlow()
15+
solve_powerflow!(pf, threebus_sys)
1516
Ybus_fault = get_ybus_fault_threebus_sys(threebus_sys)
1617

1718
##################################################

test/test_case_anderson.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and the generator located in bus 3.
1010
##################################################
1111

1212
threebus_sys = build_system(PSIDTestSystems, "psid_test_threebus_anderson")
13-
solve_ac_powerflow!(threebus_sys)
13+
pf = ACPowerFlow()
14+
solve_powerflow!(pf, threebus_sys)
1415
Ybus_fault = get_ybus_fault_threebus_sys(threebus_sys)
1516

1617
##################################################

test/test_case_marconato.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and the generator located in bus 3.
1010
##################################################
1111

1212
threebus_sys = build_system(PSIDTestSystems, "psid_test_threebus_marconato")
13-
solve_ac_powerflow!(threebus_sys)
13+
pf = ACPowerFlow()
14+
solve_powerflow!(pf, threebus_sys)
1415
Ybus_fault = get_ybus_fault_threebus_sys(threebus_sys)
1516

1617
##################################################

test/test_case_oneDoneQ.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and the generator located in bus 3.
1010
##################################################
1111

1212
threebus_sys = build_system(PSIDTestSystems, "psid_test_threebus_oneDoneQ")
13-
solve_ac_powerflow!(threebus_sys)
13+
pf = ACPowerFlow()
14+
solve_powerflow!(pf, threebus_sys)
1415
Ybus_fault = get_ybus_fault_threebus_sys(threebus_sys)
1516

1617
##################################################

test/test_case_simple_anderson.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and the generator located in bus 3.
1010
##################################################
1111

1212
threebus_sys = build_system(PSIDTestSystems, "psid_test_threebus_simple_anderson")
13-
solve_ac_powerflow!(threebus_sys)
13+
pf = ACPowerFlow()
14+
solve_powerflow!(pf, threebus_sys)
1415
Ybus_fault = get_ybus_fault_threebus_sys(threebus_sys)
1516

1617
##################################################

test/test_case_simple_marconato.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ and the generator located in bus 3.
1010
##################################################
1111

1212
threebus_sys = build_system(PSIDTestSystems, "psid_test_threebus_simple_marconato")
13-
solve_ac_powerflow!(threebus_sys)
13+
pf = ACPowerFlow()
14+
solve_powerflow!(pf, threebus_sys)
1415
Ybus_fault = get_ybus_fault_threebus_sys(threebus_sys)
1516

1617
##################################################

0 commit comments

Comments
 (0)