# LMIs in Control/pages/Mixed H2 Hinf optimal state feedback control

LMIs in Control/pages/Mixed H2 Hinf optimal state feedback control

Mixed ${\displaystyle H_{\infty }/H_{2}}$ Optimal State Feedback Control

## The Optimization Problem

This Optimization problem involves the same process used on the full-feedback control design; however, instead of optimizing the full output-feedback design of the Optimal output-feedback control design. This is done by defining the 9-matrix plant as such: ${\displaystyle A\in \mathbb {R} ^{m\times m}}$ , ${\displaystyle B_{1}\in \mathbb {R} ^{m\times n}}$ , ${\displaystyle B_{2}\in \mathbb {R} ^{m\times p}}$ , ${\displaystyle C_{1}\in \mathbb {R} ^{n\times m}}$ , ${\displaystyle D_{11}\in \mathbb {R} ^{n\times n}}$ , ${\displaystyle D_{12}\in \mathbb {R} ^{n\times p}}$ , ${\displaystyle C_{2}=I}$ , ${\displaystyle D_{21}=0}$ , and ${\displaystyle D_{22}=0}$ . Using this type of optimization allows for stacking of optimization LMIs in order to achieve the controller synthesis for both ${\displaystyle H_{\infty }}$  and ${\displaystyle H_{2}}$ .

## The Data

The data is dependent on the type the state-space representation of the 9-matrix plant; therefore the following must be known for this LMI to be calculated: ${\displaystyle A\in \mathbb {R} ^{m\times m}}$ , ${\displaystyle B_{1}\in \mathbb {R} ^{m\times n}}$ , ${\displaystyle B_{2}\in \mathbb {R} ^{m\times p}}$ , ${\displaystyle C_{1}\in \mathbb {R} ^{n\times m}}$ , ${\displaystyle D_{11}\in \mathbb {R} ^{n\times n}}$ , ${\displaystyle D_{12}\in \mathbb {R} ^{n\times p}}$ , ${\displaystyle C_{2}=I}$ , ${\displaystyle D_{21}=0}$ , and ${\displaystyle D_{22}=0}$ .

## The LMI: Mixed ${\displaystyle H_{\infty }/H_{2}}$ Optimal State Feedback Control

There exists the scalars ${\displaystyle \gamma _{1}}$ , ${\displaystyle \gamma _{2}}$ , along with the matrices ${\displaystyle X>0}$ , ${\displaystyle W}$  and ${\displaystyle Z}$  where:

{\displaystyle {\begin{aligned}||S(P,K(0,0,0,F))||_{H_{\infty }}^{2}+||S(P,K(0,0,0,F))||_{H_{2}}^{2}\leq \gamma _{1}+\gamma _{2}\\\\{\begin{bmatrix}XA^{T}+Z^{T}B_{2}^{T}+AX+B_{2}Z&B_{1}&XC_{1}^{T}+Z^{T}D_{12}^{T}\\B1_{1}^{T}&-I&D_{11}^{T}\\C_{1}X+D_{12}Z&D_{11}&-\gamma _{1}I\end{bmatrix}}&<0\\\\\\traceW<\gamma _{2}\\\\AX+XA^{T}+B_{2}Z+Z'B_{2}'+B_{1}B_{1}^{T}<0\\\\{\begin{bmatrix}X&(C_{1}X+D_{12}Z)^{T}\\C_{1}X+D_{12}Z&W\\\end{bmatrix}}&>0\\\end{aligned}}}

Where ${\displaystyle F=ZX^{-1}}$  is the controller matrix.

## Conclusion:

The results from this LMI give a controller that is a mixed optimization of both an ${\displaystyle H_{\infty }}$ , and ${\displaystyle H_{2}}$  optimization.

## Implementation

% Mixed Hinf/H2 state feedback optimization
% -- EXAMPLE --

clear; clc; close all;

%Given
A  = [ 1  1  0  1  0  1;
-1 -1 -1  0  0  1;
1  0  1 -1  1  1;
-1  1 -1 -1  0  0;
-1 -1  1  1  1 -1;
0 -1  0  0 -1 -1];

B1 = [ 0 -1 -1;
0  0  0;
-1  1  1;
-1  0  0;
0  0  1;
-1  1  1];

B2 = [ 0  0  0;
-1  0  1;
-1  1  0;
1 -1  0;
-1  0 -1;
0  1  1];

C1 = [ 0  1  0 -1 -1 -1;
0  0  0 -1  0  0;
1  0  0  0 -1  0];

D12= [ 1    1    1;
0    0    0;
0.1  0.2  0.4];

D11= [ 1  2  3;
0  0  0;
0  0  0];

%Error
eta = 1E-4;

%sizes of matrices
numa  = size(A,1);    %states
numb2 = size(B2,2);  %actuators
numb1 = size(B1,2);   %external inputs
numc1 = size(C1,1);   %regulated outputs

%variables
gam1= sdpvar(1);
gam2= sdpvar(1);
Y   = sdpvar(numa);
Z   = sdpvar(numb2,numa,'full');
W   = sdpvar(numc1);

%Matrix for LMI optimization
M1  = Y*A'+A*Y+B2*Z+Z'*B2'+B1*B1';
M2  = [Y            (C1*Y+D12*Z)'  ;
C1*Y+D12*Z   W              ];
M3  = [Y*A'+A*Y+Z'*B2'+B2*Z     B1              Y*C1'+Z'*D12';
B1'                      -eye(numb1)      D11';
C1*Y+D12*Z                D11            -gam1*eye(numc1)];

%Constraints
Fc = (M1 <= 0);
Fc = [Fc; M3 <= 0];
Fc = [Fc; trace(W) <= gam2];
Fc = [Fc; Y  >= eta*eye(numa)];
Fc = [Fc; M2 >= zeros(numa+numc1)];

opt = sdpsettings('solver','sedumi');

%Objective function
obj = gam1 + gam2;

%Optimizing given constraints
optimize(Fc,obj,opt);

F = value(Z)*inv(value(Y)); %#ok<MINV>

fprintf('\n\nState-Feedback controller F matrix')
display(F)