Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ced2625b authored by HALITIM Kouds's avatar HALITIM Kouds
Browse files

Add new file

parent f066953e
No related branches found
No related tags found
No related merge requests found
% Author: Olivier Sename
% Aug 2024
%
% Description
% Function that compute the state feedback Hinf controller solving the LMI problem.
% To use this function one have to create the
% generalized plant P such that:
% Xdot A Bw Bu X
% Z = Cz Dzw Dzu W
%
% Input
% listP : list of plants
% ncon : number of control signals
% nstate : number of state variables
% sp : the controller is striclty proper (1=>yes, 0=>no)
% percentage : percentage added to the gamma optimal to conditionate the
% controller
% Output
% listK : list of controller (state space)
% listCL : list of closed loop (state space)
% gopt : optimal gamma
%
% [listK,listCL,gopt] = lmiHinfPolytope(listP,nmeas,ncon,sp,percentage,solver)
function [F,X] = lmiHinfStateFeedbackRobust_expstab(listP,nstate,ncon,beta,solver)
%%% Size of the generalized plant
sizeX = size(listP{1}.a,1);
sizeU = ncon;
%%% To tackle with some strict inequalities problems not well implemented
%%% in Yalmip
epsi = 1e-6; % it was 1e-6
%%% Cut the system
for i = 1:size(listP,2)
A{i} = listP{i}.a(1:sizeX,1:sizeX);
Bu{i} = listP{i}.b(1:sizeX,1:sizeU);
end;
% %%% Create variables matrix
Y = sdpvar(sizeU,sizeX,'full')
X = sdpvar(sizeX,sizeX,'symmetric');
%%% LMIs definition of the Hinf problem
LMI=[X>=epsi];
%F = set(H0>eps,'X and Y constraint');
for i = 1:size(listP,2)
H1{i}=A{i}*X+X*A{i}'+Bu{i}*Y+(Bu{i}*Y)'+2*beta*X;
LMI = [LMI,H1{i}<=-epsi];
end;
%F
%%% Find feasible solution minimizing gamma
%solver='sedumi';
ops = sdpsettings('solver',solver);
solution = optimize(LMI,[],ops);
% % %%% Extract numerical solution
Y=double(Y);
X = double(X);
F= Y*inv(X);
%%% Some verifications
VPx = eig(X)
for i=1:size(X,1)
if (VPx(i) <= 0)
disp('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
disp('Error, Lyapunov function are non positive definite')
disp('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
end;
end;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment