Robust Control: dksyn example

Hi everybody,
currently I try to get familiar with the robust control toolbox. I tried to understand the dksyn command example:
if true
%Uncertain plant Gpert
G = tf(1,[1 -1]);
Wu = 0.25*tf([1/2 1],[1/32 1]);
InputUnc = ultidyn('InputUnc',[1 1]);
Gpert = G*(1+InputUnc*Wu);
%Performance Weight
Wp = tf([1/4 0.6],[1 0.006]);
%Plant P/Pi
P = [Wp; 1 ]*[1 Gpert];
P2=[Wp,Wp*Gpert;
1,Gpert];
[K,clp,bnd] = dksyn(P,1,1);
[K2,clp2,bnd2] = dksyn(P2,1,1);
end
I don't understand, why the dksyn command is able to calculate a controller for P, but not for P2?! P and P2 are equal, are'nt they? Help is really appreciated. Thank you very much!
best regards
Martin

Answers (2)

Huajing Zhao
Huajing Zhao on 8 May 2017
Well, the ss matrices created for P and P2 are actually different in dimensions... I tested it with matlab, and it appears that P.A is 6*6 while P2.A is 3*3. For B, C, D they are also different
Paul
Paul on 9 Mar 2026 at 2:02
Edited: Paul about 2 hours ago
I believe the issue here is that:
the plant is unstable,
the construction of P2 duplicates all of the states in the generalized plant,
the duplicated unstable state is not stabilizable, not detectable, or both,
and therefore the very first step of the DK iteration in musyn (which has replaced dksyn), which I believe is a call to hinfsyn, will fail.
Define the system elements
G = tf(1,[1 -1]);
Wu = 0.25*tf([1/2 1],[1/32 1]);
InputUnc = ultidyn('InputUnc',[1 1]);
Gpert = G*(1+InputUnc*Wu);
%Performance Weight
Wp = tf([1/4 0.6],[1 0.006]);
%Plant P/Pi
Construct the generalized plant with the recommended approach using block connections. P1 has only 3 states (one each from the plant, the uncertainty scaling, and the performance scaling) and 1 occurence of the uncertain parameter.
P1 = [Wp; 1 ]*[1 Gpert]
Uncertain continuous-time state-space model with 2 outputs, 2 inputs, 3 states. The model uncertainty consists of the following blocks: InputUnc: Uncertain 1x1 LTI, peak gain = 1, 1 occurrences Type "P1.NominalValue" to see the nominal value and "P1.Uncertainty" to interact with the uncertain elements.
The generalized plant poles are as expected
pole(P1)
ans = 3×1
-0.0060 1.0000 -32.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
and musyn converges.
[K1,clp1,bnd1] = musyn(P1,1,1);
D-K ITERATION SUMMARY: ----------------------------------------------------------------- Robust performance Fit order ----------------------------------------------------------------- Iter K Step Peak MU D Fit D 1 1.455 1.455 1.469 8 2 0.8399 0.8378 0.8424 4 3 0.712 0.712 0.7198 6 4 0.6898 0.6898 0.6924 6 5 0.6831 0.683 0.6835 4 6 0.6805 0.6805 0.6865 6 7 0.6809 0.6809 0.6809 2 Best achieved robust performance: 0.68
Constructing P2 in the not-recommended way results in a generalized plant with 6 states, and a twice-repeated occurrence of the uncertain parameter (see Preventing State Duplication in System Interconnections - MATLAB & Simulink Example)
P2=[Wp,Wp*Gpert;
1,Gpert]
Uncertain continuous-time state-space model with 2 outputs, 2 inputs, 6 states. The model uncertainty consists of the following blocks: InputUnc: Uncertain 1x1 LTI, peak gain = 1, 2 occurrences Type "P2.NominalValue" to see the nominal value and "P2.Uncertainty" to interact with the uncertain elements.
All of the poles of P1 are duplicated in P2
pole(P2)
ans = 6×1
-0.0060 -0.0060 1.0000 1.0000 -32.0000 -32.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
and musyn fails (it would be nice if there was a message explaining why it fails)
[K2,clp2,bnd2] = musyn(P2,1,1);
D-K ITERATION SUMMARY: ----------------------------------------------------------------- Robust performance Fit order ----------------------------------------------------------------- Iter K Step Peak MU D Fit D 1 Inf Inf Inf NaN Best achieved robust performance: Inf
hinfsyn also fails (perhaps it could give a hint as to why)
K = hinfsyn(P2,1,1)
K = []
Unlike musyn, hinfsyn does list requirements on the system. We saw that P2 has a repeated, unstable pole at s = 1.
The pair (M.A,M.B2) is not controllable
M = lftdata(P2);
rank(ctrb(M.A,M.B(:,4)))
ans = 3
and that one of the poles at s = 1 is immovable under state feedback, hence not stabilizable, which I believe is why hinfsyn fails on step 1 of musyn.
rng(100)
eig(M.A-M.B(:,4)*rand(1,6))
ans =
-32.0000 + 0.0000i -39.8116 + 0.0000i 0.3228 + 0.3401i 0.3228 - 0.3401i 1.0000 + 0.0000i -0.0060 + 0.0000i
A reasonable question is if P2 can be manipulated into the form of P1. We can try simplify
simplify(P2,'full')
Uncertain continuous-time state-space model with 2 outputs, 2 inputs, 6 states. The model uncertainty consists of the following blocks: InputUnc: Uncertain 1x1 LTI, peak gain = 1, 2 occurrences Type "ans.NominalValue" to see the nominal value and "ans.Uncertainty" to interact with the uncertain elements.
But that doesn't seem to do much in this case. But, using minreal first
P3 = simplify(minreal(P2),'full')
2 states removed. Uncertain continuous-time state-space model with 2 outputs, 2 inputs, 4 states. The model uncertainty consists of the following blocks: InputUnc: Uncertain 1x1 LTI, peak gain = 1, 1 occurrences Type "P3.NominalValue" to see the nominal value and "P3.Uncertainty" to interact with the uncertain elements.
eliminates 2 states and reduces the uncertainty to one occurence. So we're close to P1, but not quite.
Show that P1, P2, and P3 have the same I/O responses.
figure
rng(100); P1s = usample(P1,20);
rng(100); P2s = usample(P2,20);
rng(100); P3s = usample(P3,20);
bode(P1s,P2s,P3s)
Unfortunately, simplify() did not eliminate the unstable pole at s = 1
pole(P3)
ans = 4×1
-32.0000 -0.0060 1.0000 1.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
and musyn fails again.
[K3,clp3,bnd3] = musyn(P3,1,1);
D-K ITERATION SUMMARY: ----------------------------------------------------------------- Robust performance Fit order ----------------------------------------------------------------- Iter K Step Peak MU D Fit D 1 Inf Inf Inf NaN Best achieved robust performance: Inf
I don't know why simplify can't eliminate that additional pole at s = 1 (or if doing so is even feasible based on how P2 was constructed).
If the plant is stable and we construct the generalized plant using the not-recommended method
G = tf(1,[1 1]);
Gpert = G*(1+InputUnc*Wu);
P4=[Wp,Wp*Gpert;
1,Gpert]
Uncertain continuous-time state-space model with 2 outputs, 2 inputs, 6 states. The model uncertainty consists of the following blocks: InputUnc: Uncertain 1x1 LTI, peak gain = 1, 2 occurrences Type "P4.NominalValue" to see the nominal value and "P4.Uncertainty" to interact with the uncertain elements.
muysn converges, though the optimization doesn't work as well as one might hope with that final Peak MU of 5.38.
[K4,clp4,bnd4] = musyn(P4,1,1);
D-K ITERATION SUMMARY: ----------------------------------------------------------------- Robust performance Fit order ----------------------------------------------------------------- Iter K Step Peak MU D Fit D 1 122.5 50.27 50.76 4 2 12 5.988 6.033 8 3 5.59 5.417 5.429 12 4 5.401 5.385 5.396 12 5 5.393 5.382 5.392 12 Best achieved robust performance: 5.38
Interestingly enough, if we minreal and simplify
P5 = simplify(minreal(P4),'full');
2 states removed.
then musyn works much better, even though P5 and P4 conceptually represent the same, uncertain system.
[K5,clp5,bnd5] = musyn(P5,1,1);
D-K ITERATION SUMMARY: ----------------------------------------------------------------- Robust performance Fit order ----------------------------------------------------------------- Iter K Step Peak MU D Fit D 1 0.6718 0.6718 0.6785 10 2 0.538 0.538 0.5429 10 3 0.5217 0.5217 0.5226 4 4 0.5165 0.5165 0.5174 2 5 0.5121 0.5121 0.5175 6 6 0.5136 0.5135 0.5144 2 Best achieved robust performance: 0.512
Constructing the generalized plant using the recommended approach
P6 = [Wp; 1 ]*[1 Gpert];
yields a similar optimization as measured by the peak MU
[K6,clp6,bnd6] = musyn(P6,1,1);
D-K ITERATION SUMMARY: ----------------------------------------------------------------- Robust performance Fit order ----------------------------------------------------------------- Iter K Step Peak MU D Fit D 1 0.7092 0.7092 0.7097 2 2 0.585 0.585 0.5911 10 3 0.533 0.533 0.5335 4 4 0.5179 0.5179 0.5179 2 5 0.5131 0.5129 0.5179 8 6 0.5135 0.5135 0.5136 6 Best achieved robust performance: 0.513
K5 and K6 yield very similar closed-loop responses.
figure
rng(100);CL5 = usample(lft(P5,K5),20);
rng(100);CL6 = usample(lft(P6,K6),20);
figure
bode(CL5,CL6);
Summary: Use model connection functions to construct the MIMO system directly instead of constructing each element of the MIMO system as individual SISO systems and then combining those.

Asked:

on 15 Apr 2015

Edited:

on 12 Mar 2026 at 12:03

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!