You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/multinode/multinode.jl
+16-3Lines changed: 16 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -752,11 +752,24 @@ function add_bus_voltage_violation_to_the_model(pm, Multinode_Inputs)
752
752
for PMD_time_step in PMD_time_steps
753
753
for bus_name in bus_names
754
754
index = BusInfo[bus_name]["index"]
755
-
voltage_squared = [PMD.var(pm, PMD_time_step, :w, index)[terminal] for terminal in BusInfo[bus_name]["terminals"]]#TODO: check that this will work if a bus is on phase 2 and 3 (and not phase 1)
755
+
voltage_squared = [PMD.var(pm, PMD_time_step, :w, index)[terminal] for terminal in BusInfo[bus_name]["terminals"]]
756
756
757
+
#=
758
+
# Optional: print out information to understand the approach in the code:
759
+
print("\n For bus $(bus_name) the terminals are: ")
760
+
print(BusInfo[bus_name]["terminals"])
761
+
print("\n")
762
+
print("\n For bus $(bus_name) the voltage_squared variable is: ")
print("The index in voltage_squared for terminal $(BusInfo[bus_name]["terminals"][1]) is $(index_temp) ")
767
+
=#
768
+
757
769
for terminal in BusInfo[bus_name]["terminals"]
758
-
@constraint(model, voltage_squared[terminal] <= (Multinode_Inputs.bus_per_unit_voltage_target_upper_bound^2) + model[:binBusVoltageViolation][bus_name, PMD_time_step] *100) # multiply by 100 to make the possible voltage very large
759
-
@constraint(model, voltage_squared[terminal] >= (Multinode_Inputs.bus_per_unit_voltage_target_lower_bound^2) * (1- model[:binBusVoltageViolation][bus_name, PMD_time_step])) # If the binary is one, then the voltage squared can go to zero
@constraint(model, voltage_squared[terminal_index] <= (Multinode_Inputs.bus_per_unit_voltage_target_upper_bound^2) + model[:binBusVoltageViolation][bus_name, PMD_time_step] *100) # multiply by 100 to make the possible voltage very large
772
+
@constraint(model, voltage_squared[terminal_index] >= (Multinode_Inputs.bus_per_unit_voltage_target_lower_bound^2) * (1- model[:binBusVoltageViolation][bus_name, PMD_time_step])) # If the binary is one, then the voltage squared can go to zero
Copy file name to clipboardExpand all lines: src/multinode/multinode_results_processing.jl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ function Results_Processing_REopt_PMD_Model(m, results, data_math_mn, REoptInput
60
60
ActivePowerFlow_line_temp = []
61
61
ReactivePowerFlow_line_temp = []
62
62
for i in1:length(sol_eng["nw"])
63
-
push!(ActivePowerFlow_line_temp, sum(sol_eng["nw"][string(i)]["line"][line][pf_name][Phase] for Phase inkeys(sol_eng["nw"][string(i)]["line"][line][pf_name])) )
63
+
push!(ActivePowerFlow_line_temp, sum(sol_eng["nw"][string(i)]["line"][line][pf_name][Phase] for Phase inkeys(sol_eng["nw"][string(i)]["line"][line][pf_name])) )# The "for Phase in keys(..." sums the power across the phases
64
64
push!(ReactivePowerFlow_line_temp, sum(sol_eng["nw"][string(i)]["line"][line][qf_name][Phase] for Phase inkeys(sol_eng["nw"][string(i)]["line"][line][qf_name])) )
0 commit comments