## A two-mass-one-spring system - Fourth Step

**Fourth Step -Estimate the L2-gain**

The last step of the analysis is to execute the optimizer to estimate the L2-gain from [w1; w2] to x2. This is done by the M-function iqc_gain_tbx.m.

>> g=iqc_gain_tbx([w1;w2],x2)

The execution of iqc_gain_tbx trigger the following events: first, the IQC Toolbox scripts input between the commands abst_init_iqc and g=iqc_gain_tbx([w1;w2],x2) are collected and processed to form an optimization problem which corresponds to the worst-case L2-gain estimation problem. The optimization problem is in the form of the semi-definite program (SDP). Secondly, the genetic SDP solver coming with the MATLAB LMI Control Toolbox is called to solve the optimization problem.

More precisely, an attempt will be made to choose the variable parameters (M and g in this case, where g is defined inside the M-function iqc_gain_tbx.m) so that

$$ \int_{0}^{\infty} (g(w_{1}^{2}+w_{2}^{2})-x_{2}^{2})dt > \int_{0}^{\infty} M(a^{2}v^{2}-w_{3}^{2})dt$$

holds for all non-zero L2 signals \(w_{1}\), \(w_{2}\), \(w_{3}\). In fact, the attempt to minimize g will also be made, and the SDP solver will try to find the smallest possible value of g.

If the system of LMIs will be found infeasible, the output g will be empty. Otherwise, an upper bound of g will be produced. The optimization will also produce some “optimal” value of M. This value can be displayed by typing

>> value_iqc(M)

Note that if the LMIs are found infeasible, execution of the command value_iqc(M) will result in an error message.