-
Notifications
You must be signed in to change notification settings - Fork 70
/
IEEEST.jl
242 lines (233 loc) · 8.89 KB
/
IEEEST.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
232
233
234
235
236
237
238
239
240
241
242
#=
This file is auto-generated. Do not edit.
=#
#! format: off
"""
mutable struct IEEEST <: PSS
input_code::Int
remote_bus_control::Int
A1::Float64
A2::Float64
A3::Float64
A4::Float64
A5::Float64
A6::Float64
T1::Float64
T2::Float64
T3::Float64
T4::Float64
T5::Float64
T6::Float64
Ks::Float64
Ls_lim::Tuple{Float64, Float64}
Vcu::Float64
Vcl::Float64
ext::Dict{String, Any}
states::Vector{Symbol}
n_states::Int
states_types::Vector{StateTypes}
internal::InfrastructureSystemsInternal
end
IEEE Stabilizing Model PSS.
# Arguments
- `input_code::Int`: Code input for stabilizer, validation range: `(1, 6)`, action if invalid: `error`
- `remote_bus_control::Int`: Remote Bus number for control.
- `A1::Float64`: Filter coefficient, validation range: `(0, nothing)`, action if invalid: `warn`
- `A2::Float64`: Filter coefficient, validation range: `(0, nothing)`, action if invalid: `warn`
- `A3::Float64`: Filter coefficient, validation range: `(0, nothing)`
- `A4::Float64`: Filter coefficient, validation range: `(0, nothing)`, action if invalid: `warn`
- `A5::Float64`: Filter coefficient, validation range: `(0, nothing)`, action if invalid: `warn`
- `A6::Float64`: Filter coefficient, validation range: `(0, nothing)`, action if invalid: `warn`
- `T1::Float64`: Time constant, validation range: `(0, 10)`, action if invalid: `warn`
- `T2::Float64`: Time constant, validation range: `(0, 10)`, action if invalid: `warn`
- `T3::Float64`: Time constant, validation range: `(0, 10)`, action if invalid: `warn`
- `T4::Float64`: Time constant, validation range: `(0, 10)`, action if invalid: `warn`
- `T5::Float64`: Time constant, validation range: `(0, 10)`, action if invalid: `warn`
- `T6::Float64`: Time constant, validation range: `(eps(), 2.0)`, action if invalid: `error`
- `Ks::Float64`: Proportional gain, validation range: `(0, nothing)`, action if invalid: `warn`
- `Ls_lim::Tuple{Float64, Float64}`: PSS output limits for regulator output `(Ls_min, Ls_max)`
- `Vcu::Float64`: Cutoff limiter upper bound, validation range: `(0, 1.25)`, action if invalid: `warn`
- `Vcl::Float64`: Cutoff limiter lower bound, validation range: `(0, 1.0)`, action if invalid: `warn`
- `ext::Dict{String, Any}`
- `states::Vector{Symbol}`: The states are:
x_p1: 1st filter integration,
x_p2: 2nd filter integration,
x_p3: 3rd filter integration,
x_p4: 4rd filter integration,
x_p5: T1/T2 lead-lag integrator,
x_p6: T3/T4 lead-lag integrator,
:x_p7 last integer,
- `n_states::Int`: IEEEST has 7 states
- `states_types::Vector{StateTypes}`: IEEEST has 7 differential states
- `internal::InfrastructureSystemsInternal`: power system internal reference, do not modify
"""
mutable struct IEEEST <: PSS
"Code input for stabilizer"
input_code::Int
"Remote Bus number for control."
remote_bus_control::Int
"Filter coefficient"
A1::Float64
"Filter coefficient"
A2::Float64
"Filter coefficient"
A3::Float64
"Filter coefficient"
A4::Float64
"Filter coefficient"
A5::Float64
"Filter coefficient"
A6::Float64
"Time constant"
T1::Float64
"Time constant"
T2::Float64
"Time constant"
T3::Float64
"Time constant"
T4::Float64
"Time constant"
T5::Float64
"Time constant"
T6::Float64
"Proportional gain"
Ks::Float64
"PSS output limits for regulator output `(Ls_min, Ls_max)`"
Ls_lim::Tuple{Float64, Float64}
"Cutoff limiter upper bound"
Vcu::Float64
"Cutoff limiter lower bound"
Vcl::Float64
ext::Dict{String, Any}
"The states are:
x_p1: 1st filter integration,
x_p2: 2nd filter integration,
x_p3: 3rd filter integration,
x_p4: 4rd filter integration,
x_p5: T1/T2 lead-lag integrator,
x_p6: T3/T4 lead-lag integrator,
:x_p7 last integer,"
states::Vector{Symbol}
"IEEEST has 7 states"
n_states::Int
"IEEEST has 7 differential states"
states_types::Vector{StateTypes}
"power system internal reference, do not modify"
internal::InfrastructureSystemsInternal
end
function IEEEST(input_code, remote_bus_control, A1, A2, A3, A4, A5, A6, T1, T2, T3, T4, T5, T6, Ks, Ls_lim, Vcu, Vcl, ext=Dict{String, Any}(), )
IEEEST(input_code, remote_bus_control, A1, A2, A3, A4, A5, A6, T1, T2, T3, T4, T5, T6, Ks, Ls_lim, Vcu, Vcl, ext, [:x_p1, :x_p2, :x_p3, :x_p4, :x_p5, :x_p6, :x_p7], 7, [StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Differential], InfrastructureSystemsInternal(), )
end
function IEEEST(; input_code, remote_bus_control, A1, A2, A3, A4, A5, A6, T1, T2, T3, T4, T5, T6, Ks, Ls_lim, Vcu, Vcl, ext=Dict{String, Any}(), states=[:x_p1, :x_p2, :x_p3, :x_p4, :x_p5, :x_p6, :x_p7], n_states=7, states_types=[StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Hybrid, StateTypes.Differential], internal=InfrastructureSystemsInternal(), )
IEEEST(input_code, remote_bus_control, A1, A2, A3, A4, A5, A6, T1, T2, T3, T4, T5, T6, Ks, Ls_lim, Vcu, Vcl, ext, states, n_states, states_types, internal, )
end
# Constructor for demo purposes; non-functional.
function IEEEST(::Nothing)
IEEEST(;
input_code=1,
remote_bus_control=0,
A1=0,
A2=0,
A3=0,
A4=0,
A5=0,
A6=0,
T1=0,
T2=0,
T3=0,
T4=0,
T5=0,
T6=0,
Ks=0,
Ls_lim=(0.0, 0.0),
Vcu=0,
Vcl=0,
ext=Dict{String, Any}(),
)
end
"""Get [`IEEEST`](@ref) `input_code`."""
get_input_code(value::IEEEST) = value.input_code
"""Get [`IEEEST`](@ref) `remote_bus_control`."""
get_remote_bus_control(value::IEEEST) = value.remote_bus_control
"""Get [`IEEEST`](@ref) `A1`."""
get_A1(value::IEEEST) = value.A1
"""Get [`IEEEST`](@ref) `A2`."""
get_A2(value::IEEEST) = value.A2
"""Get [`IEEEST`](@ref) `A3`."""
get_A3(value::IEEEST) = value.A3
"""Get [`IEEEST`](@ref) `A4`."""
get_A4(value::IEEEST) = value.A4
"""Get [`IEEEST`](@ref) `A5`."""
get_A5(value::IEEEST) = value.A5
"""Get [`IEEEST`](@ref) `A6`."""
get_A6(value::IEEEST) = value.A6
"""Get [`IEEEST`](@ref) `T1`."""
get_T1(value::IEEEST) = value.T1
"""Get [`IEEEST`](@ref) `T2`."""
get_T2(value::IEEEST) = value.T2
"""Get [`IEEEST`](@ref) `T3`."""
get_T3(value::IEEEST) = value.T3
"""Get [`IEEEST`](@ref) `T4`."""
get_T4(value::IEEEST) = value.T4
"""Get [`IEEEST`](@ref) `T5`."""
get_T5(value::IEEEST) = value.T5
"""Get [`IEEEST`](@ref) `T6`."""
get_T6(value::IEEEST) = value.T6
"""Get [`IEEEST`](@ref) `Ks`."""
get_Ks(value::IEEEST) = value.Ks
"""Get [`IEEEST`](@ref) `Ls_lim`."""
get_Ls_lim(value::IEEEST) = value.Ls_lim
"""Get [`IEEEST`](@ref) `Vcu`."""
get_Vcu(value::IEEEST) = value.Vcu
"""Get [`IEEEST`](@ref) `Vcl`."""
get_Vcl(value::IEEEST) = value.Vcl
"""Get [`IEEEST`](@ref) `ext`."""
get_ext(value::IEEEST) = value.ext
"""Get [`IEEEST`](@ref) `states`."""
get_states(value::IEEEST) = value.states
"""Get [`IEEEST`](@ref) `n_states`."""
get_n_states(value::IEEEST) = value.n_states
"""Get [`IEEEST`](@ref) `states_types`."""
get_states_types(value::IEEEST) = value.states_types
"""Get [`IEEEST`](@ref) `internal`."""
get_internal(value::IEEEST) = value.internal
"""Set [`IEEEST`](@ref) `input_code`."""
set_input_code!(value::IEEEST, val) = value.input_code = val
"""Set [`IEEEST`](@ref) `remote_bus_control`."""
set_remote_bus_control!(value::IEEEST, val) = value.remote_bus_control = val
"""Set [`IEEEST`](@ref) `A1`."""
set_A1!(value::IEEEST, val) = value.A1 = val
"""Set [`IEEEST`](@ref) `A2`."""
set_A2!(value::IEEEST, val) = value.A2 = val
"""Set [`IEEEST`](@ref) `A3`."""
set_A3!(value::IEEEST, val) = value.A3 = val
"""Set [`IEEEST`](@ref) `A4`."""
set_A4!(value::IEEEST, val) = value.A4 = val
"""Set [`IEEEST`](@ref) `A5`."""
set_A5!(value::IEEEST, val) = value.A5 = val
"""Set [`IEEEST`](@ref) `A6`."""
set_A6!(value::IEEEST, val) = value.A6 = val
"""Set [`IEEEST`](@ref) `T1`."""
set_T1!(value::IEEEST, val) = value.T1 = val
"""Set [`IEEEST`](@ref) `T2`."""
set_T2!(value::IEEEST, val) = value.T2 = val
"""Set [`IEEEST`](@ref) `T3`."""
set_T3!(value::IEEEST, val) = value.T3 = val
"""Set [`IEEEST`](@ref) `T4`."""
set_T4!(value::IEEEST, val) = value.T4 = val
"""Set [`IEEEST`](@ref) `T5`."""
set_T5!(value::IEEEST, val) = value.T5 = val
"""Set [`IEEEST`](@ref) `T6`."""
set_T6!(value::IEEEST, val) = value.T6 = val
"""Set [`IEEEST`](@ref) `Ks`."""
set_Ks!(value::IEEEST, val) = value.Ks = val
"""Set [`IEEEST`](@ref) `Ls_lim`."""
set_Ls_lim!(value::IEEEST, val) = value.Ls_lim = val
"""Set [`IEEEST`](@ref) `Vcu`."""
set_Vcu!(value::IEEEST, val) = value.Vcu = val
"""Set [`IEEEST`](@ref) `Vcl`."""
set_Vcl!(value::IEEEST, val) = value.Vcl = val
"""Set [`IEEEST`](@ref) `ext`."""
set_ext!(value::IEEEST, val) = value.ext = val
"""Set [`IEEEST`](@ref) `states_types`."""
set_states_types!(value::IEEEST, val) = value.states_types = val