-
Notifications
You must be signed in to change notification settings - Fork 70
/
EXAC1A.jl
231 lines (222 loc) · 9.4 KB
/
EXAC1A.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#=
This file is auto-generated. Do not edit.
=#
#! format: off
"""
mutable struct EXAC1A <: AVR
Tr::Float64
Tb::Float64
Tc::Float64
Ka::Float64
Ta::Float64
Va_lim::MinMax
Te::Float64
Kf::Float64
Tf::Float64
Kc::Float64
Kd::Float64
Ke::Float64
E_sat::Tuple{Float64, Float64}
Se::Tuple{Float64, Float64}
Vr_lim::MinMax
V_ref::Float64
saturation_coeffs::Tuple{Float64, Float64}
ext::Dict{String, Any}
states::Vector{Symbol}
n_states::Int
states_types::Vector{StateTypes}
internal::InfrastructureSystemsInternal
end
Modified ESAC1A. This excitation systems consists of an alternator main exciter feeding its output via non-controlled rectifiers.
The exciter does not employ self-excitation, and the voltage regulator power is taken from a source that is not affected by external transients.
Parameters of IEEE Std 421.5 Type AC1A Excitacion System. EXAC1A in PSSE and PSLF
# Arguments
- `Tr::Float64`: Regulator input filter time constant in s, validation range: `(0, 0.5)`, action if invalid: `warn`
- `Tb::Float64`: Regulator denominator (lag) time constant in s, validation range: `(0, 20)`, action if invalid: `warn`
- `Tc::Float64`: Regulator numerator (lead) time constant in s, validation range: `(0, 20)`, action if invalid: `warn`
- `Ka::Float64`: Regulator output gain, validation range: `(0, 1000)`, action if invalid: `warn`
- `Ta::Float64`: Regulator output time constant in s, validation range: `(0, 10)`
- `Va_lim::MinMax`: Limits for regulator output `(Va_min, Va_max)`
- `Te::Float64`: Exciter field time constant in s, validation range: `(eps(), 2)`, action if invalid: `error`
- `Kf::Float64`: Rate feedback excitation system stabilizer gain, validation range: `(0, 0.3)`, action if invalid: `warn`
- `Tf::Float64`: Rate feedback time constant, validation range: `(eps(), 1.5)`, action if invalid: `error`
- `Kc::Float64`: Rectifier loading factor proportional to commutating reactance, validation range: `(0, 1)`, action if invalid: `warn`
- `Kd::Float64`: Demagnetizing factor, function of exciter alternator reactances, validation range: `(0, 1)`, action if invalid: `warn`
- `Ke::Float64`: Exciter field proportional constant, validation range: `(0, 1)`
- `E_sat::Tuple{Float64, Float64}`: Exciter output voltage for saturation factor: (E1, E2)
- `Se::Tuple{Float64, Float64}`: Exciter saturation factor at exciter output voltage: (Se(E1), Se(E2))
- `Vr_lim::MinMax`: Limits for exciter field voltage: `(Vr_min, Vr_max)`
- `V_ref::Float64`: Reference Voltage Set-point, validation range: `(0, nothing)`
- `saturation_coeffs::Tuple{Float64, Float64}`: Coefficients (A,B) of the function: Se(x) = B(x - A)^2/x
- `ext::Dict{String, Any}`
- `states::Vector{Symbol}`: The states are:
Vm: Sensed terminal voltage,
Vr1: Lead-lag state,
Vr2: Regulator output state,
Ve: Integrator output state,
Vr3: Feedback output state
- `n_states::Int`: EXAC1A has 5 states
- `states_types::Vector{StateTypes}`: EXAC1A has 5 states
- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify
"""
mutable struct EXAC1A <: AVR
"Regulator input filter time constant in s"
Tr::Float64
"Regulator denominator (lag) time constant in s"
Tb::Float64
"Regulator numerator (lead) time constant in s"
Tc::Float64
"Regulator output gain"
Ka::Float64
"Regulator output time constant in s"
Ta::Float64
"Limits for regulator output `(Va_min, Va_max)`"
Va_lim::MinMax
"Exciter field time constant in s"
Te::Float64
"Rate feedback excitation system stabilizer gain"
Kf::Float64
"Rate feedback time constant"
Tf::Float64
"Rectifier loading factor proportional to commutating reactance"
Kc::Float64
"Demagnetizing factor, function of exciter alternator reactances"
Kd::Float64
"Exciter field proportional constant"
Ke::Float64
"Exciter output voltage for saturation factor: (E1, E2)"
E_sat::Tuple{Float64, Float64}
"Exciter saturation factor at exciter output voltage: (Se(E1), Se(E2))"
Se::Tuple{Float64, Float64}
"Limits for exciter field voltage: `(Vr_min, Vr_max)`"
Vr_lim::MinMax
"Reference Voltage Set-point"
V_ref::Float64
"Coefficients (A,B) of the function: Se(x) = B(x - A)^2/x"
saturation_coeffs::Tuple{Float64, Float64}
ext::Dict{String, Any}
"The states are:
Vm: Sensed terminal voltage,
Vr1: Lead-lag state,
Vr2: Regulator output state,
Ve: Integrator output state,
Vr3: Feedback output state"
states::Vector{Symbol}
"EXAC1A has 5 states"
n_states::Int
"EXAC1A has 5 states"
states_types::Vector{StateTypes}
"power system internal reference, do not modify"
internal::InfrastructureSystemsInternal
end
function EXAC1A(Tr, Tb, Tc, Ka, Ta, Va_lim, Te, Kf, Tf, Kc, Kd, Ke, E_sat, Se, Vr_lim, V_ref=1.0, saturation_coeffs=PowerSystems.get_avr_saturation(E_sat, Se), ext=Dict{String, Any}(), )
EXAC1A(Tr, Tb, Tc, Ka, Ta, Va_lim, Te, Kf, Tf, Kc, Kd, Ke, E_sat, Se, Vr_lim, V_ref, saturation_coeffs, ext, [:Vm, :Vr1, :Vr2, :Ve, :Vr3], 5, [StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Differential, StateTypes.Differential], InfrastructureSystemsInternal(), )
end
function EXAC1A(; Tr, Tb, Tc, Ka, Ta, Va_lim, Te, Kf, Tf, Kc, Kd, Ke, E_sat, Se, Vr_lim, V_ref=1.0, saturation_coeffs=PowerSystems.get_avr_saturation(E_sat, Se), ext=Dict{String, Any}(), states=[:Vm, :Vr1, :Vr2, :Ve, :Vr3], n_states=5, states_types=[StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Differential, StateTypes.Differential], internal=InfrastructureSystemsInternal(), )
EXAC1A(Tr, Tb, Tc, Ka, Ta, Va_lim, Te, Kf, Tf, Kc, Kd, Ke, E_sat, Se, Vr_lim, V_ref, saturation_coeffs, ext, states, n_states, states_types, internal, )
end
# Constructor for demo purposes; non-functional.
function EXAC1A(::Nothing)
EXAC1A(;
Tr=0,
Tb=0,
Tc=0,
Ka=0,
Ta=0,
Va_lim=(min=0.0, max=0.0),
Te=0,
Kf=0,
Tf=0,
Kc=0,
Kd=0,
Ke=0,
E_sat=(0.0, 0.0),
Se=(0.0, 0.0),
Vr_lim=(min=0.0, max=0.0),
V_ref=0,
saturation_coeffs=(0.0, 0.0),
ext=Dict{String, Any}(),
)
end
"""Get [`EXAC1A`](@ref) `Tr`."""
get_Tr(value::EXAC1A) = value.Tr
"""Get [`EXAC1A`](@ref) `Tb`."""
get_Tb(value::EXAC1A) = value.Tb
"""Get [`EXAC1A`](@ref) `Tc`."""
get_Tc(value::EXAC1A) = value.Tc
"""Get [`EXAC1A`](@ref) `Ka`."""
get_Ka(value::EXAC1A) = value.Ka
"""Get [`EXAC1A`](@ref) `Ta`."""
get_Ta(value::EXAC1A) = value.Ta
"""Get [`EXAC1A`](@ref) `Va_lim`."""
get_Va_lim(value::EXAC1A) = value.Va_lim
"""Get [`EXAC1A`](@ref) `Te`."""
get_Te(value::EXAC1A) = value.Te
"""Get [`EXAC1A`](@ref) `Kf`."""
get_Kf(value::EXAC1A) = value.Kf
"""Get [`EXAC1A`](@ref) `Tf`."""
get_Tf(value::EXAC1A) = value.Tf
"""Get [`EXAC1A`](@ref) `Kc`."""
get_Kc(value::EXAC1A) = value.Kc
"""Get [`EXAC1A`](@ref) `Kd`."""
get_Kd(value::EXAC1A) = value.Kd
"""Get [`EXAC1A`](@ref) `Ke`."""
get_Ke(value::EXAC1A) = value.Ke
"""Get [`EXAC1A`](@ref) `E_sat`."""
get_E_sat(value::EXAC1A) = value.E_sat
"""Get [`EXAC1A`](@ref) `Se`."""
get_Se(value::EXAC1A) = value.Se
"""Get [`EXAC1A`](@ref) `Vr_lim`."""
get_Vr_lim(value::EXAC1A) = value.Vr_lim
"""Get [`EXAC1A`](@ref) `V_ref`."""
get_V_ref(value::EXAC1A) = value.V_ref
"""Get [`EXAC1A`](@ref) `saturation_coeffs`."""
get_saturation_coeffs(value::EXAC1A) = value.saturation_coeffs
"""Get [`EXAC1A`](@ref) `ext`."""
get_ext(value::EXAC1A) = value.ext
"""Get [`EXAC1A`](@ref) `states`."""
get_states(value::EXAC1A) = value.states
"""Get [`EXAC1A`](@ref) `n_states`."""
get_n_states(value::EXAC1A) = value.n_states
"""Get [`EXAC1A`](@ref) `states_types`."""
get_states_types(value::EXAC1A) = value.states_types
"""Get [`EXAC1A`](@ref) `internal`."""
get_internal(value::EXAC1A) = value.internal
"""Set [`EXAC1A`](@ref) `Tr`."""
set_Tr!(value::EXAC1A, val) = value.Tr = val
"""Set [`EXAC1A`](@ref) `Tb`."""
set_Tb!(value::EXAC1A, val) = value.Tb = val
"""Set [`EXAC1A`](@ref) `Tc`."""
set_Tc!(value::EXAC1A, val) = value.Tc = val
"""Set [`EXAC1A`](@ref) `Ka`."""
set_Ka!(value::EXAC1A, val) = value.Ka = val
"""Set [`EXAC1A`](@ref) `Ta`."""
set_Ta!(value::EXAC1A, val) = value.Ta = val
"""Set [`EXAC1A`](@ref) `Va_lim`."""
set_Va_lim!(value::EXAC1A, val) = value.Va_lim = val
"""Set [`EXAC1A`](@ref) `Te`."""
set_Te!(value::EXAC1A, val) = value.Te = val
"""Set [`EXAC1A`](@ref) `Kf`."""
set_Kf!(value::EXAC1A, val) = value.Kf = val
"""Set [`EXAC1A`](@ref) `Tf`."""
set_Tf!(value::EXAC1A, val) = value.Tf = val
"""Set [`EXAC1A`](@ref) `Kc`."""
set_Kc!(value::EXAC1A, val) = value.Kc = val
"""Set [`EXAC1A`](@ref) `Kd`."""
set_Kd!(value::EXAC1A, val) = value.Kd = val
"""Set [`EXAC1A`](@ref) `Ke`."""
set_Ke!(value::EXAC1A, val) = value.Ke = val
"""Set [`EXAC1A`](@ref) `E_sat`."""
set_E_sat!(value::EXAC1A, val) = value.E_sat = val
"""Set [`EXAC1A`](@ref) `Se`."""
set_Se!(value::EXAC1A, val) = value.Se = val
"""Set [`EXAC1A`](@ref) `Vr_lim`."""
set_Vr_lim!(value::EXAC1A, val) = value.Vr_lim = val
"""Set [`EXAC1A`](@ref) `V_ref`."""
set_V_ref!(value::EXAC1A, val) = value.V_ref = val
"""Set [`EXAC1A`](@ref) `saturation_coeffs`."""
set_saturation_coeffs!(value::EXAC1A, val) = value.saturation_coeffs = val
"""Set [`EXAC1A`](@ref) `ext`."""
set_ext!(value::EXAC1A, val) = value.ext = val
"""Set [`EXAC1A`](@ref) `states_types`."""
set_states_types!(value::EXAC1A, val) = value.states_types = val