# LMIs in Control/pages/H inf Aircraft Optimization

LMIs in Control/pages/H inf Aircraft Optimization


Robust ${\displaystyle H_{\infty }}$ Aircraft Dynamics

## The Optimization Problem

This Optimization problem involves the use of optimizing aircraft dynamics using the regulator framework, and optimizing the given aircraft parameters using the following set of aircraft dynamics. these aircraft dynamics are given non-dimensional characteristics defined by various parameters of the aircraft being tested. By making these characteristics non-dimensional, it allows for the problem to be scaled to larger porportions. For instance the longitudinal dynamics for an aircraft system are defined as suchː

{\displaystyle {\begin{aligned}A_{p}={\begin{bmatrix}X_{u}&X_{w}&0&-g_{0}\cos(\vartheta _{0})\\{\frac {Z_{u}}{1-Z_{\dot {w}}}}&{\frac {Z_{w}}{1-Z_{\dot {w}}}}&{\frac {u_{0}+Z_{q}}{1-Z_{\dot {w}}}}&{\frac {-g_{0}\sin(\vartheta _{0})}{1-Z_{dot{w}}}}\\M_{u}+{\frac {M_{\dot {w}}Z_{u}}{1-Z_{\dot {w}}}}&M_{w}+{\frac {M_{\dot {w}}Z_{w}}{1-Z_{\dot {w}}}}&M_{w}+{\frac {(u_{0}+Z_{q})M_{\dot {w}}}{1-Z_{dot{w}}}}&{\frac {-M_{\dot {w}}g_{0}\sin(\vartheta _{0})}{1-Z_{dot{w}}}}\\0&0&1&0\\\end{bmatrix}}\\B_{p}={\begin{bmatrix}X_{\delta _{e}}&X_{\delta _{T}}\\{\frac {Z_{\delta _{e}}}{1-Z_{\dot {w}}}}&{\frac {Z_{\delta _{T}}}{1-Z_{\dot {w}}}}\\M_{\delta _{e}}+{\frac {M_{\dot {w}}Z_{\delta _{e}}}{1-Z_{\dot {w}}}}&M_{\delta _{T}}+{\frac {M_{\dot {w}}Z_{\delta _{T}}}{1-Z_{\dot {w}}}}\\0&0\\\end{bmatrix}}\\C_{p}=I\\D_{p}=0\\\end{aligned}}}

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 a robust ${\displaystyle H_{\infty }}$  optimization.

## 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: Robust ${\displaystyle H_{\infty }}$ Optimal Aircraft Dynamics Control

There exists the scalar, ${\displaystyle \gamma }$ , along with the matrices ${\displaystyle S>0}$ , and ${\displaystyle R}$  where:

{\displaystyle {\begin{aligned}{\begin{bmatrix}N_{R}&0\\0&I\\\end{bmatrix}}^{T}{\begin{bmatrix}AR+RA^{T}&RC_{1}^{T}&B_{1}\\C_{1}R&-\gamma I&D_{11}\\B_{1}^{T}&D_{11}^{T}&-\gamma I\\\end{bmatrix}}{\begin{bmatrix}N_{R}&0\\0&I\\\end{bmatrix}}<0\\{\begin{bmatrix}N_{S}&0\\0&I\\\end{bmatrix}}^{T}{\begin{bmatrix}A^{T}S+SA&SB_{1}&C_{1}^{T}\\B_{1}^{T}S&-\gamma I&D_{11}^{T}\\C_{1}&D_{11}&-\gamma I\\\end{bmatrix}}{\begin{bmatrix}N_{S}&0\\0&I\\\end{bmatrix}}<0\\{\begin{bmatrix}R&I\\I&S\\\end{bmatrix}}\geq 0\end{aligned}}}

Where the optimized controller matrices are defined as followsː

{\displaystyle {\begin{aligned}A_{K}=-N[A^{T}+S(A+B_{2}F+LC_{2})R+1/\gamma S(B_{1}+LD_{21})B_{1}^{T}+1/\gamma C_{1}^{T}(C_{1}+D_{12}F)R]M^{T}\\\\B_{K}=N^{-1}SL\\\\C_{K}=FRM^{-T}\\\\D_{K}=0;\end{aligned}}}

Where:

{\displaystyle {\begin{aligned}N=S\\\\M=S^{-1}-R\\\\F=-(D_{12}^{T}D_{12})^{-1}(\gamma B_{2}^{T}R^{-1}+D_{12}^{T}C_{1})\\\\L=-(\gamma S^{-1}C_{2}^{T}+B_{1}D_{21}^{T})(D_{21}D_{21}^{T})^{-1}\\\\\end{aligned}}}

## Conclusion:

The results from this LMI give a controller that is a robust ${\displaystyle H_{\infty }}$ , optimization which would be capable of stabilizing various aircraft Dynamics.

## Implementation

%clears all variables
clear; clc; close all;

%Time interval end (20 s)
time = 20;

%Error term
eta = 1E-5;

%NOTE: THE F16 DOES INCLUDE A POW TERM IN THE EQUATION
%THRUST IS A PART OF THE DYNAMICS OF AIRCRAFT
Ac = [-0.0829 -23.6803 -4.6523 -32.1740  0.3440;
-0.0014  -0.3303  0.0168  -0.0000 -0.0007;
0.0000  -0.6972 -0.5711   0.0     0.0   ;
0.0      0.0     1.0      0.0     0.0   ;
0.0      0.0     0.0      0.0    -1.0   ];

Bc =  [ 0.0  -0.0606;
1.0  -0.0008;
0.0  -0.0295;
0.0   0.0   ;
64.94  0.0   ];

Cc = eye(2,5);

Dc = zeros(2,2);

%PLACING INTO TRACKING FRAMEWORK
% Making zero matrices
Zb= zeros(5,2);
Zc= zeros(2,5);
Zd= zeros(2,2);

%Making Identity Matrices
I = eye(5,5);
Ie= eye(2,2);
Id= eye(2,2);

%creation of plant
Po = [Ac Bc; Cc Dc];

%9 Matrix representation
%9 Matrix representation
A   = Ac;
B1  = [Bc Zb];
B2  = Bc;
C1  = [Cc; Zc];
C2  = Cc;
D11 = [Zd Zd; Zd Zd];
D12 = [Dc; Id];
D21 = [Dc  Id];
D22 = Dc;

P = [A B1 B2; C1 D11 D12; C2 D21 D22];

%Finding Nr and Ns
Nr = null([B2' D12']);
Ns = null([C2 D21]);

%Creating LMI
R = sdpvar(5,5);
S = sdpvar(5,5);
gamma = sdpvar(1);

%Matrices for LMI
M1 = [A*R + R*A' R*C1'        B1           ;
C1*R      -gamma*eye(4) D11          ;
B1'        D11'        -gamma*eye(4)];

Mr = [Nr zeros(9,6); zeros(4,7) eye(4,6)];

M2 = [A'*S + S*A  S*B1          C1'         ;
B1'*S      -gamma*eye(4)  D11'        ;
C1          D11          -gamma*eye(4)];

Ms = [Ns zeros(9,6); zeros(4,7) eye(4,6)];

M3 = [R eye(5); eye(5) S];

%objective function
obj = gamma;

%Constraints
Fc = (M3 >= eta*eye(10));
Fc = [Fc; Ms'*M2*Ms <= 0];
Fc = [Fc; Mr'*M1*Mr <= 0];

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

%Optimization
optimize(Fc,obj,opt)

fprintf('\n\nHinf for Robust Hinf optimal state-feedback problem is: ')
display(value(gamma))

%Stuff that needs to be calculated for
S = value(S);
R = value(R);
gamma = value(gamma);
N = S;
M = S^(-1) - R;
F = -(D12'*D12)^(-1)*(gamma*B2'*R^(-1)+D12'*C1);
L = -(gamma*S^(-1)*C2'+B1*D21')*(D21*D21')^(-1);

%Calculated stuff
Ak = -N*(A'+S*(A+B2*F+L*C2)*R+1/gamma*S*(B1+L*D21)*B1'...
+1/gamma*C1'*(C1+D12*F)*R)*M';

Bk = N^(-1)*S*L;
Ck = F*R*(M')^(-1);
Dk = 0;