Chang Lin
Chang Lin

Reputation: 1

Why does SDPT3 return NaN when solving an LMI with sdpvar matrix multiplications?

When solving an LMI problem using SDPT3 in MATLAB, the result is NaN when the LMI includes matrix multiplications involving sdpvar variables. How can this be resolved? The matlab code is given below:

clc; clear; close all;
% Define known matrices
Xi{1} = [2, 0; 0, 0];
Xi{2} = [2, 0; 0, 0];
Xi{3} = [0, 0; 0, 0];
Xi{4} = [0, 0; 0, 0];

Upsilon{1} = [-0.15, 0; 0, 0.52];
Upsilon{2} = [-0.15, 0; 0, 0.35];
Upsilon{3} = [0, 0; 0, 0.52];
Upsilon{4} = [0, 0; 0, 0.35];

Omega{1} = diag([1/0.1, 1/0.6118]);
Omega{2} = diag([1/0.1, 1/1]);
Omega{3} = diag([1/0.1, 1/0.6118]);
Omega{4} = diag([1/0.1, 1/1]);

rj = [2; 1];  % r_j vector

% Defining matrix dimensions
n = 2;  
M = 4;  

% Define optimization variables
Q = sdpvar(n, n, 'symmetric');
gamma = sdpvar(1);

% Define the 2x2 matrices U_p and Z_p
U_p = sdpvar(n, n, 'diagonal');  
G_p = sdpvar(n, n);  

Z_p = G_p * Q;  %This is the problem
% The system matrices A and G 
A = [-1, 0; 0, -1];  
G = [0, -1.3; -1, 0];

% LMI condition
LMI = [];

% LMI condition a:
LMI = [LMI, [1, gamma * rj'; gamma * rj, Q] >= 0];

% LMI condition b:
for p = 1:4
    Ap = A + G * Xi{p};  
    Bp = G * Upsilon{p};  
    Kp = Omega{p}; 
    He_ApQ_BpKpQ = (Ap * Q + Bp * Kp * Q) + (Ap * Q + Bp * Kp * Q)';
    LMI = [LMI, [He_ApQ_BpKpQ, -Bp * U_p + Z_p'; ...
                 -U_p * Bp' + Z_p, -2 * U_p] <= 0];
end

% LMI condition c:
for p = 1:4
    Kp = Omega{p};  % Kp
    for i = 1:n       
        LMI = [LMI, [1, Kp(i, :) * Q - Z_p(i, :);...
             Q * Kp(i, :)' - Z_p(i, :)', Q] >= 0];
    end
end

% Set the optimization objective: Maximize "gamma"
opts = sdpsettings('solver', 'sdpt3', 'verbose', 1, 'showprogress', 1);
optimize(LMI, -gamma, opts);

% Extracting solutions
Q_sol = value(Q);
gamma_sol = value(gamma);
U_p_sol = value(U_p);
G_p_sol = value(G_p);

% display
disp('Optimal Q:');
disp(Q_sol);
disp('Optimal gamma:');
disp(gamma_sol);
disp('Optimal U_p:');
disp(U_p_sol);
disp('Optimal G_p:');
disp(G_p_sol);

When I tried to write one of the two sdpvar variables as a constant matrix, the program had a solution. I was looking forward to figuring out why when my code added "Z_p = G_p * Q;" , the solver cannot solve this LMI problem.

Upvotes: 0

Views: 12

Answers (0)

Related Questions