Skip to content

Commit

Permalink
address failing test on windows (#93)
Browse files Browse the repository at this point in the history
* try setting output type

* remove the lines that break windows tests

* Update legacy_pf.jl

remove unused code

---------

Co-authored-by: Roman Bolgaryn <[email protected]>
  • Loading branch information
rbolgaryn and Roman Bolgaryn authored Feb 7, 2025
1 parent 04dfb74 commit a19e646
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/test_utils/legacy_pf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ struct LUACPowerFlow <: ACPowerFlowSolverType end # Only for testing, a basic i
function _legacy_dSbus_dV(
V::Vector{Complex{Float64}},
Ybus::SparseMatrixCSC{Complex{Float64}, Int64},
)
diagV = LinearAlgebra.Diagonal(V)
diagVnorm = LinearAlgebra.Diagonal(V ./ abs.(V))
diagIbus = LinearAlgebra.Diagonal(Ybus * V)
)::Tuple{SparseMatrixCSC{Complex{Float64}, Int64}, SparseMatrixCSC{Complex{Float64}, Int64}}
diagV = SparseArrays.spdiagm(0 => V)
diagVnorm = SparseArrays.spdiagm(0 => V ./ abs.(V))
diagIbus = SparseArrays.spdiagm(0 => Ybus * V)
dSbus_dVm = diagV * conj.(Ybus * diagVnorm) + conj.(diagIbus) * diagVnorm
dSbus_dVa = 1im * diagV * conj.(diagIbus - Ybus * diagV)
return dSbus_dVa, dSbus_dVm
Expand Down Expand Up @@ -127,9 +127,6 @@ function _newton_powerflow(
@error("The powerflow solver with KLU did not converge after $i iterations")
else
Sbus_result = V .* conj(Ybus * V)
aux_variables.J = J
aux_variables.dSbus_dV_ref =
[vec(real.(dSbus_dVa[ref, :][:, pvpq])); vec(real.(dSbus_dVm[ref, :][:, pq]))]
@info("The powerflow solver with KLU converged after $i iterations")
end
return (converged, V, Sbus_result)
Expand Down

0 comments on commit a19e646

Please sign in to comment.