Skip to content

Commit 1305e8a

Browse files
committed
option to target relative gamma in hinfsyn
1 parent 19bcf55 commit 1305e8a

4 files changed

Lines changed: 24 additions & 9 deletions

File tree

examples/hinf_example_DC.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ P = hinfpartition(G, WS, WU, WT)
4141
flag = hinfassumptions(P)
4242

4343
# Synthesize the H-infinity optimal controller
44-
flag, C, γ = hinfsynthesize(P)
44+
flag, C, γ = hinfsynthesize(P, γrel=1)
4545

4646
# Extract the transfer functions defining some signals of interest
4747
Pcl, S, CS, T = hinfsignals(P, G, C)

examples/hinf_example_MIT.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ P = hinfpartition(G, WS, WU, WT)
3636
flag = hinfassumptions(P)
3737

3838
# Synthesize the H-infinity optimal controller
39-
flag, C, γ = hinfsynthesize(P)
39+
flag, C, γ = hinfsynthesize(P, γrel=1)
4040

4141
# Extract the transfer functions defining some signals of interest
4242
Pcl, S, CS, T = hinfsignals(P, G, C)

src/hinfinity_design.jl

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ function hinfassumptions(P::ExtendedStateSpace; verbose = true)
4444
# Check assumption A2
4545
if rank(D12) < size(D12, 2)
4646
verbose &&
47-
@warn("The matrix D12 does not have full rank, ", "violation of assumption A2.")
47+
@warn("The matrix D12 does not have full rank, ", "violation of assumption A2. The full control signal must have nonzero penalty at infinite frequency.")
4848
return false
4949
end
5050
if rank(D21) < size(D21, 1)
5151
verbose &&
52-
@warn("The matrix D21 does not have full rank, ", "violation of assumption A2.")
52+
@warn("The matrix D21 does not have full rank, ", "violation of assumption A2. The whole measurement vector y must be corrupted by noise at infinite frequency.")
5353
return false
5454
end
5555

@@ -110,20 +110,29 @@ function _detectable(A::AbstractMatrix, C::AbstractMatrix)
110110
end
111111

112112
"""
113-
flag, K, γ, mats = hinfsynthesize(P::ExtendedStateSpace; maxIter=20, interval=(2/3,20), verbose=true)
113+
flag, K, γ, mats = hinfsynthesize(P::ExtendedStateSpace; maxIter = 20, interval = (2 / 3, 20), verbose = false, tolerance = 1.0e-10, γrel = 1.01)
114114
115115
Computes an H-infinity optimal controller K for an extended plant P such that
116-
||F_l(P, K)||∞ < γ for the largest possible γ given P. The routine is
116+
||F_l(P, K)||∞ < γ for the smallest possible γ given P. The routine is
117117
known as the γ-iteration, and is based on the paper "State-space formulae for
118118
all stabilizing controllers that satisfy an H∞-norm bound and relations to
119-
risk sensitivity" by Glover and Doyle. See the Bib-entry below [1] above.
119+
risk sensitivity" by Glover and Doyle.
120+
121+
122+
# Arguments:
123+
- `maxIter`: Maximum number of γ iterations
124+
- `interval`: The starting interval for the bisection.
125+
- `verbose`: Print progress?
126+
- `tolerance`: Stop when the interval is this small.
127+
- `γrel`: If `γrel > 1`, the optimal γ will be found by γ iteration after which a controller will be designed for `γ = γopt * γrel`. It is often a good idea to design a slightly suboptimal controller, both for numerical reasons, but also since the optimal controller may contain very fast dynamics. If `γrel → ∞`, the computed controller will approach the 𝑯₂ optimal controller. Getting a mix between 𝑯∞ and 𝑯₂ properties is another reason to choose `γrel > 1`.
120128
"""
121129
function hinfsynthesize(
122130
P::ExtendedStateSpace;
123131
maxIter = 20,
124132
interval = (2 / 3, 20),
125133
verbose = false,
126134
tolerance = 1e-10,
135+
γrel = 1.01,
127136
)
128137

129138
# Transform the system into a suitable form
@@ -136,6 +145,12 @@ function hinfsynthesize(
136145

137146
if !isempty(γFeasible)
138147
# Synthesize the controller and trnasform it back into the original coordinates
148+
149+
if γrel > 1
150+
γFeasible *= γrel
151+
X∞Feasible, Y∞Feasible, F∞Feasible, H∞Feasible = _solvematrixequations(P̄, γFeasible)
152+
end
153+
139154
K = _synthesizecontroller(
140155
P̄,
141156
X∞Feasible,

src/plotting.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ specificationplot
4848
xscale --> :log10
4949
yscale --> ControlSystems._PlotScaleFunc
5050
linestyle --> :solid
51-
linecolor --> colors[mod(index - 1, 3)+1]
51+
color --> colors[mod(index - 1, 3)+1]
5252
label --> (i == 1 ? s_labels[mod(index - 1, 3)+1] : "")
5353
w ./ (hz ? 2pi : 1), singval[:, i]
5454
end
@@ -73,7 +73,7 @@ specificationplot
7373
xscale --> :log10
7474
yscale --> ControlSystems._PlotScaleFunc
7575
linestyle --> :dash
76-
linecolor --> colors[mod(index - 1, 3)+1]
76+
color --> colors[mod(index - 1, 3)+1]
7777
linewidth --> 2
7878
label --> (i == 1 ? w_labels[mod(index - 1, 3)+1] : "")
7979
w ./ (hz ? 2pi : 1), singval[:, i]

0 commit comments

Comments
 (0)