Skip to content

Commit

Permalink
v0.3.8 bug fix reduce_tree! with Inputs{MultiPhase}
Browse files Browse the repository at this point in the history
  • Loading branch information
NLaws committed Aug 2, 2023
1 parent 0f5b1ee commit 0619513
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CommonOPF Changelog

## v0.3.8
- bug fix `reduce_tree!` with `Inputs{MultiPhase}`
- mishandling of combined impedance matrices

## v0.3.7
- add `reduce_tree!` for `Inputs{MultiPhase}`

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CommonOPF"
uuid = "dad7ea18-2b21-482e-81c1-e84414cc4b03"
authors = ["Nick Laws <[email protected]> and contributors"]
version = "0.3.7"
version = "0.3.8"

[deps]
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
Expand Down
6 changes: 5 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ function remove_bus!(j::String, p::Inputs{MultiPhase})
ij_idx, jk_idx = get_ij_idx(i, j, p), get_ij_idx(j, k, p)
ij_len, jk_len = p.linelengths[ij_idx], p.linelengths[jk_idx]
ij_linecode, jk_linecode = get_ijlinecode(i,j,p), get_ijlinecode(j,k,p)
r_ij, x_ij, r_jk, x_jk = rij(i,j,p)*p.Zbase, xij(i,j,p)*p.Zbase, rij(j,k,p)*p.Zbase, xij(j,k,p)*p.Zbase
# scale impedances by lengths s.t. we can make per length again using ik_len
r_ij, x_ij = p.Zdict[ij_linecode]["rmatrix"] * ij_len, p.Zdict[ij_linecode]["xmatrix"] * ij_len
r_jk, x_jk = p.Zdict[jk_linecode]["rmatrix"] * jk_len, p.Zdict[jk_linecode]["xmatrix"] * jk_len
# NOTE the r,x matrices can be 1D, 2D, or 3D; but we convert to 3D for use in model building
# (this is a vestige of OpenDSS that should be removed TODO)
phases = p.phases[ij_idx]
# make the new values
r_ik = r_ij .+ r_jk
Expand Down

2 comments on commit 0619513

@NLaws
Copy link
Owner Author

@NLaws NLaws commented on 0619513 Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/88845

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.8 -m "<description of version>" 06195130f5c592879ca45d984b8a2dce08222580
git push origin v0.3.8

Please sign in to comment.