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
Memento.warn(_LOGGER, "calc_basic_decoupled_jacobian_matrices requires basic network data and given data may be incompatible. make_basic_network can be used to transform data into the appropriate form.")
402
-
end
403
-
num_bus =length(data["bus"])
404
-
v =calc_basic_bus_voltage(data)
405
-
vm, va =abs.(v), angle.(v)
406
-
Y =calc_basic_admittance_matrix(data)
407
-
neighbors = [Set{Int}([i]) for i in1:num_bus]
408
-
I, J, V =findnz(Y)
409
-
for nz ineachindex(V)
410
-
push!(neighbors[I[nz]], J[nz])
411
-
push!(neighbors[J[nz]], I[nz])
412
-
end
413
-
H0_I = Int64[]; H0_J = Int64[]; H0_V = Float64[];
414
-
L0_I = Int64[]; L0_J = Int64[]; L0_V = Float64[];
415
-
for i in1:num_bus
416
-
for j in neighbors[i]
417
-
push!(H0_I, i); push!(H0_J, j); push!(H0_V, 0.0)
418
-
push!(L0_I, i); push!(L0_J, j); push!(L0_V, 0.0)
419
-
end
420
-
end
421
-
H =sparse(H0_I, H0_J, H0_V)
422
-
L =sparse(L0_I, L0_J, L0_V)
423
-
for i in1:num_bus
424
-
for j in neighbors[i]
425
-
bus_type = data["bus"]["$(j)"]["bus_type"]
426
-
if bus_type ==1
427
-
if i == j
428
-
y_ii = Y[i,i]
429
-
H[i, j] =+ vm[i] *sum( -real(Y[i,k]) * vm[k] *sin(va[i] - va[k]) +imag(Y[i,k]) * vm[k] *cos(va[i] - va[k]) for k in neighbors[i] if k != i )
430
-
L[i, j] =-2*imag(y_ii)*vm[i] +sum( real(Y[i,k]) * vm[k] *sin(va[i] - va[k]) -imag(Y[i,k]) * vm[k] *cos(va[i] - va[k]) for k in neighbors[i] if k != i )
given a basic network data dict, returns a sparse real valued Jacobian matrix
@@ -465,6 +395,7 @@ function calc_basic_jacobian_matrix(data::Dict{String,<:Any})
465
395
if!get(data, "basic_network", false)
466
396
Memento.warn(_LOGGER, "calc_basic_jacobian_matrix requires basic network data and given data may be incompatible. make_basic_network can be used to transform data into the appropriate form.")
Memento.warn(_LOGGER, "compute_basic_ac_pf requires basic network data and given data may be incompatible. make_basic_network can be used to transform data into the appropriate form.")
78
78
end
@@ -104,16 +104,11 @@ function compute_basic_ac_pf!(data::Dict{String, Any}; decoupled=false)
104
104
if LinearAlgebra.normInf([delta_P; delta_Q]) < tol
105
105
break
106
106
end
107
+
107
108
# STEP 2 and 3: Compute the jacobian and update step
108
-
if!decoupled
109
-
J =calc_basic_jacobian_matrix(data)
110
-
x = J \ [delta_P; delta_Q]
111
-
else
112
-
H, L =calc_basic_decoupled_jacobian_matrices(data)
0 commit comments