Hello everyone, I can 't solve the problem, LMI 3X3 does not want to work and gives errors, but 2X2 works

3Х3

clc

cvx_begin sdp

variable Y(2, 2, N) symmetric

variable Z(1,2, N-1)

variable gamma_squared

minimize(gamma_squared)

for k = 1: N - 1

```
Y(:, :, 1) >= R;
[ Y(:,:,k) (A*Y(:,:,k) + B_u*Z(1,:,k))' 0
A*Y(:,:,k) + B_u*Z(1,:,k) Y(:,:,k+1) B_v
0 B_v' I ] >= 0;
[ Y(:,:,k) (C_1*Y(:,:,k)+D(1)*Z(1,:, k))' 0
C_1*Y(:,:,k)+D(1)*Z(1,:,k) gamma_squared*I 0
0 0 0] >= 0;
[ Y(:,:,k+0) (C_1*Y(:,:,k+0)+D(1)*Z(1,:, k+0))' 0
C_1*Y(:,:,k+0)+D(1)*Z(1,:,k+0) gamma_squared*I 0
0 0 0 ] >= 0;
```

end

cvx_end

for i=1: N-1

teta_nc(:,i) = Z(1,:,i) * inv(Y(:,:,i));

A_t_nc(:,:,i) = A + B_v * teta_nc(:,i)’;

end

Error using cvx/cat (line 40)

All dimensions but the one being concatenated (2) must be equal.

Error in cvx/horzcat (line 2)

y = cat( 2, varargin{:} );

Error in teta_no_control (line 15)

[ Y(:,:,k) (A*Y(:,:,k) + B_u*Z(1,:,k))’ 0

2Х2

clc

cvx_begin sdp

variable Y(2, 2, N) symmetric

variable Z(1,2, N-1)

variable gamma_squared

minimize(gamma_squared)

for k = 1: N - 1

```
Y(:, :, 1) == R;
Y(:,:,k+1) - Y(:,:,k) - h*(A*Y(:,:,k) + Y(:,:,k)*A' + B_u*Z(1,:,k) + Z(1,:,k)'*B_u' + B_v*B_v') == 0;
[ Y(:,:,k) (C_1*Y(:,:,k)+D(1)*Z(1,:, k))'
C_1*Y(:,:,k)+D(1)*Z(1,:,k) alph(1)^2*gamma_squared*I ] >= 0;
```

end

cvx_end

for i=1: N-1

teta_nc(:,i) = Z(1,:,i) * inv(Y(:,:,i));

A_t_nc(:,:,i) = A + B_v * teta_nc(:,i)’;

end

Status: Solved

Optimal value (cvx_optval): +4

task

clc

clear

beta = -0.1;

A = [0 1

-1 beta];

B_u = [0 1]’;

B_v = [0 1]’;

C_1 = [1 0];

C_2 = [-1 -beta];

D = [0 1];

T_0 = 20;

N = 20;

h = T_0 / N;

I = 1;

R = eye(2);

alph(1) = 0.5;

alph(2) = 1 - alph(1);