Add lower bound constraint

This commit is contained in:
Enrico Lumetti 2021-08-13 13:59:18 +02:00
parent 3c7a6776d7
commit bc6fc0d63c
1 changed files with 4 additions and 1 deletions

View File

@ -37,7 +37,10 @@ opt = wcOptions('MussvOptions','m3'); % for better lower bound
resp_im = info_num.Bounds(:, 2) ./ info_den.Bounds(:, 1);
data_2 = frd(resp_im, w);
I_m_analytic_2 = tf(fitmagfrd(data_2, 2));
% constrain the uncertainty to stay above the magnitude data
Constraint.LowerBound = data_2;
Constraint.UpperBound = [];
I_m_analytic_2 = tf(fitmagfrd(data_2, 2, [], [], Constraint));
sigma(I_m, w); hold;
semilogx(w, 20*log10(info.Bounds(:, 2)), 'green');