Skip to content

Commit 09d3a82

Browse files
committed
misc fixes
1 parent 701cbb6 commit 09d3a82

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "RobustAndOptimalControl"
22
uuid = "21fd56a4-db03-40ee-82ee-a87907bee541"
33
authors = ["Fredrik Bagge Carlson", "Marcus Greiff"]
4-
version = "0.3.1"
4+
version = "0.3.2"
55

66
[deps]
77
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/hinfinity_design.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ function _solvehamiltonianare(H)#::AbstractMatrix{<:LinearAlgebra.BlasFloat})
408408
U11 = S.Z[1:div(m, 2), 1:div(n, 2)]
409409
U21 = S.Z[div(m, 2)+1:m, 1:div(n, 2)]
410410

411-
return U21 * pinv(U11), S.values
411+
return U21 / (U11), S.values # Note: if pinv is used, BigFloats may fail
412412
end
413413

414414
"""

src/plotting.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ using Printf
55
specificationplot([S,CS,T], [WS,WU,WT])
66
77
This function visualizes the control synthesis using the hInf_synthesize with
8-
the three weighting functions \${W_S(s), W_U(s), W_T(s)}\$ inverted and scaled by γ,
9-
against the corresponding transfer functions \${S(s), C(s)S(s), T(s)}\$, to
8+
the three weighting functions \$W_S(s), W_U(s), W_T(s)\$ inverted and scaled by γ,
9+
against the corresponding transfer functions \$S(s), C(s)S(s), T(s)\$, to
1010
verify visually that the specifications are met. This may be run using both MIMO
1111
and SISO systems.
1212
"""
@@ -73,7 +73,11 @@ specificationplot
7373
elseif W == []
7474
continue
7575
end
76-
singval = sigma/ W, w)[1]
76+
if W isa AbstractStateSpace && !isfinite(cond(W.D)) # Non-invertible weight
77+
singval = sigma* fudge_inv(W, 1e-6), w)[1]
78+
else
79+
singval = sigma/ W, w)[1]
80+
end
7781
if ControlSystems._PlotScale == "dB"
7882
singval = 20 * log10.(singval)
7983
end

0 commit comments

Comments
 (0)