Clear Filters
Clear Filters

Why do AnalysisPoints change the results of systune optimization?

1 view (last 30 days)
Hello there!
I am wondering why additional analysis points change the outcome of the optimization with the systune command. The results are quite similar, but I would have expected identical results, since - as far as I understood - analysis points should not affect the system dynamics. See example below.
% Define Laplace variable
s = tf('s');
% Define all single transfer functions
k12 = 0.5;
k21 = -0.1;
G11 = 2/(s^2 + 3*s + 2);
G12 = k12/(s+1);
G21 = k21/(s^2 + 2*s + 1);
G22 = 6/(s^2 + 5*s + 6);
% Concatenate MIMO system
G = [G11, G12; G21, G22];
% Create tunable state-space system
C = tunableSS('C', 4, 2, 2);
% Define some analysi points
X = AnalysisPoint('X', 2);
E = AnalysisPoint('E', 2);
U = AnalysisPoint('U', 2);
% Closed loop WITH analysis points
Gw1 = feedback(E*C*U*G, X, -1);
Gw1.InputName = 'w';
Gw1.OutputName = 'y';
% Closed loop WITHOUT analysi points
Gw2 = feedback(C*G, X, -1);
Gw2.InputName = 'w';
Gw2.OutputName = 'y';
% Make sure the bode plots are identical before the optimiziation with
% systune
figure; bode(Gw1, Gw2); legend;
% Specify tuning goal
Rtrack = TuningGoal.StepTracking('w', 'y', 0.5/3);
% Tune both closed loop systems with the same tuning goal
CL1 = systune(Gw1, Rtrack);
CL2 = systune(Gw2, Rtrack);
% Review bode plots of the optimization results
figure; bode(CL1, CL2); legend;

Accepted Answer

Carla
Carla on 30 Sep 2019
Hello there. The addition of analysis points does not change the system dynamics, but it does change the underlying LFT model. This introduces slight numerical discrepancies that accumulate to create a visible difference here.
systune has computation options that you can play with to minimize that difference. First, notice that when you run systune, both runs terminate at 500 iterations. That means they are reaching the default maximum iteration limit before they converge. Try extending that limit with the MaxIter option to get a smaller gap between the two answers. Second, systune starts its optimization from random parameter values, which means it can fall into different optimization minima depending on where it starts. The RandomStart option causes systune to try multiple different starting points and return the best optimization it finds.
opts = systuneOptions('MaxIter',2000,'RandomStart',5);
CL1 = systune(Gw1, Rtrack, opts);
CL2 = systune(Gw2, Rtrack, opts);
There is still a small difference between the two resulting systems, but it's below -60dB, which is the requested accuracy on the final value. You can reduce that even further using the SoftTol option.
opts.SoftTol = 1e-6;
CL1 = systune(Gw1, Rtrack, opts);
CL2 = systune(Gw2, Rtrack, opts);
% examine the difference between the resulting tuned systems
sigma(ss(CL1) - ss(CL2))

More Answers (0)

Community Treasure Hunt

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

Start Hunting!