Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
* ![enhancement](https://img.shields.io/badge/PD-enhancement-%23a2eeef.svg) [Fourth Order Equation with Exciter, AVR and Governor](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/53)
* ![enhancement](https://img.shields.io/badge/PD-enhancement-%23a2eeef.svg) [`make` has now an `open-docs` target that builds the docs and then opens it](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/55)
* ![bugfix](https://img.shields.io/badge/PD-bugfix-%23d73a4a.svg) [removing accidentally added build file `.DS_Store`](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/49)
* ![enhancement](https://img.shields.io/badge/PD-enhancement-%23a2eeef.svg) [added RLC load model](https://github.com/JuliaEnergy/PowerDynBase.jl/pull/60)
39 changes: 39 additions & 0 deletions src/NodeDynamics/RLC-Load.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# (C) 2018 Potsdam Institute for Climate Impact Research, authors and contributors (see AUTHORS file)
# Licensed under GNU GPL v3 (see LICENSE file)

@doc doc"""
```Julia
RLCLoad(R,L,C)
```
A node type that represents the RLC load model according to
"Power Systems Electromagnetic Transients Simulation",
Neville Watson and Jos Arrillaga, IET 2007, p.59, eq. (3.47)

# Keyword Arguments
- `R`: resistance in [?]
- `L`: inductance in [?]
- `C`: capacitance in [?]


# Mathematical Representation
```math
\dfrac{du_C}{dt} = \frac{1}{C}i_L(t)\\
\dfrac{di_L}{dt} = -\frac{R}{L} i_L(t)+\frac{1}{L} u(t)
```

TODO: reference

"""
@DynamicNode RLCLoad(R,L,C) <: OrdinaryNodeDynamics() begin
@assert R > 0 "Resistance should be >0"
@assert L > 0 "Inductance should be >0"
@assert C > 0 "Capacitance should be >0"

end [[u_C, du_C],[i_L,di_L]] begin
i_L = i #?????
du_C = 1/C *i_L
di_L = R/L*i_L+1/L*u
du = du_C #????
end

export RLCLoad
2 changes: 2 additions & 0 deletions src/PowerDynBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ include("NodeDynamics/VoltageSourceInverterMinimal.jl")
include("NodeDynamics/VoltageSourceInverterVoltagePT1.jl")
include("NodeDynamics/CurrentSourceInverterMinimal.jl")
include("NodeDynamics/ExponentialRecovery.jl")
include("NodeDynamics/RLC-Load.jl")



# the structures building the grid dynamics from the node dynamics
Expand Down
12 changes: 12 additions & 0 deletions test/nodedynamics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,15 @@ de_c = de_d + 1im*de_q
@test expand(dint[6]) == expand((1 / T_sv) * (-P_sv + P - (1/R_d)*(((omega+(Ω*2PI))/(Ω*2PI))-1)))
@test expand(dint[7]) == expand((1 / T_ch) * (-P_m + P_sv))
end

@testset "RLC-Load" begin
@syms R L C positive=true
@syms du_C u_C di_L i_L real= true
RLCdyn = construct_node_dynamics(RLCLoad(R=R,L=L,C=C))
dint = [du_C,di_L]; int = [u_C,i_L];
du = RLCdyn.rhs(dint, u, i, int, t)
i_L=i
@test expand(dint[1])==expand(1/C *i_L)
@test expand(dint[1])==expand(du)
@test expand(dint[2])==expand(R/L*i_L+1/L*u)
end