Skip to content

Commit

Permalink
Merge pull request #33 from Welthulk/dev/0.4.13
Browse files Browse the repository at this point in the history
Dev/0.4.13
  • Loading branch information
scud-soptim authored Apr 10, 2024
2 parents 51791ef + 2f7898c commit 9e5fe4a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ausgabe.log
.VSCodeCounter
.vscode/settings.json
test/workshop.jl
test/workshop*.jl
data/mpower/case1888_rte.m
data/mpower/case30.m
data/mpower/cigre.m
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Sparlectra"
uuid = "31ce9bba-fd9d-44a1-b005-f5f509afda38"
authors = ["Udo Schmitz"]
description = "load flow calculation using newton-raphson"
version = "0.4.12"
version = "0.4.13"

[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Expand Down
28 changes: 7 additions & 21 deletions docs/src/branchmodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@ Network Branch Model
=============
Each branch is treated with the same four-terminal network model. It is a four-terminal network with an ideal transformer connected upstream. For power lines, the transmission ratio \(N\) is set to 1. For transformers, the transformation ratio \(N\) is given as a complex value. The admittance matrix \(Y\) looks like this:


\[
```math
Y_{br} = \begin{bmatrix}
\frac{1}{{\tau^2}} \cdot (y_s + j\frac{b_c}{2}) & -y_s \cdot \frac{1}{{\tau e^{-j\phi}}} \\
-y_s \cdot \frac{1}{{\tau e^{j\phi}}} & (y_s + j\frac{b_c}{2})
\end{bmatrix}
\]



```

where:
- \( y_s = \frac{1}{R + jX} \) is the series admittance,
- \( R \) is the resistance component, and
- \( X \) is the reactance component,
- \( b_c \) is the transverse admittance,
- \( N = \tau \cdot e^{j\phi}\) is a complex transformation factor (eg 1 for power lines)

- ``y_s = \frac{1}{R + jX}`` is the series admittance,
- ``R`` is the resistance component, and
- ``X`` is the reactance component,
- ``b_c`` is the transverse admittance,
- ``N = \tau \cdot e^{j\phi}`` is a complex transformation factor (eg 1 for power lines)


##### Circuit diagram
Expand All @@ -34,14 +29,5 @@ where:
N (complex number)
```
<!-- Dies ist ein auskommentierter Abschnitt -->
<!--
<! ┣
<! ┗
<! ┓
<! ┃
<! ┛
\( Y_{i0} \) fgfdgdfgfdg
-->


14 changes: 13 additions & 1 deletion docs/src/changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# Change Log

## Version 0.4.13 (2024-0x-0x)
### New Features
planned:
- transformer tap changer
- serialization of networks

### Enhancements


### Bug Fixes
- detection of lines in Matpowerfiles

## Version 0.4.12 (2024-04-08)
### New Features
- added functions to facilitate the modification of networks.
- documentation available at https://sparlectra.github.io/Sparlectra.jl.
- documentation available at https://welthulk.github.io/Sparlectra.jl/.

### Enhancements

Expand Down
10 changes: 8 additions & 2 deletions src/createnet_powermat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ function createNetFromMatPowerFile(filename, log::Bool = false)::Net

fbus = string(_fbus)
tbus = string(_tbus)

vn_kv_fromBus = get_bus_vn_kV(net = myNet, busName = fbus)
vn_kv_toBus = get_bus_vn_kV(net = myNet, busName = tbus)

hasBusInNet(net = myNet, busName = fbus) || (@warn("bus $(fbus) not found, branch ignored."); continue)
hasBusInNet(net = myNet, busName = tbus) || (@warn("bus $(tbus) not found, branch ignored."); continue)

Expand All @@ -140,8 +142,12 @@ function createNetFromMatPowerFile(filename, log::Bool = false)::Net
ratio = float(row[branchDict["ratio"]])
angle = float(row[branchDict["angle"]])
status = Int64(row[branchDict["status"]])
isLine = false
if (ratio == 1.0 && angle == 0.0 || ratio == 0.0) && vn_kv_fromBus == vn_kv_toBus
isLine = true
end

if ratio == 0.0 # line
if isLine
vn_kv = get_bus_vn_kV(net = myNet, busName = fbus)
z_base = (vn_kv^2) / baseMVA
r = r_pu * z_base
Expand Down
2 changes: 1 addition & 1 deletion src/run_acpflow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function run_acpflow(; max_ite::Int = 10, tol::Float64 = 1e-6, casefile::String,
println("Error: File $(in_path) not found")
return
end
myNet = createNetFromMatPowerFile(in_path)
myNet = createNetFromMatPowerFile(in_path, (verbose > 0))
else
println("Error: File extension $(ext) not supported!")
return
Expand Down

0 comments on commit 9e5fe4a

Please sign in to comment.