Problem in matrix partition for uncertain system: how to find matrices A, B1, B2, C1, C2, D11, D12, D21, D22?

19 ビュー (過去 30 日間)
Hi everybody!
I have obtained my uncertain system using this code:
a1 = ureal('a1',p_p2, 'Range' , [p_p2-0.0070 p_p2+0.0070]);
a2 = ureal('a2',p_p3, 'Range' , [p_p3-0.0128 p_p3+0.0128]);
b0 = ureal('b0',p_z1, 'Range' , [p_z1-0.0019 p_z1+0.0019]);
b1 = ureal('b1',p_z2, 'Range' , [p_z2-0.0145 p_z2+0.0145]);
A = [0 1; -a2 -a1];
B = [0; 1];
C = [b1 b0];
sys = ss(A,B,C,0);
sys.InputGroup.ActualIn = 1;
sys.OutputGroup.ActualOut = 1;
[Msys,Delta] = lftdata(sys);
(Of course p_p2, p_p3, p_z1, p_z2 have a value, but I am omitting the equations for the sake of simplicity)
So Msys has the form:
But I am searching a way to partition A, B, C, D to get A, B1, B2, C1, C2, D11, D12, D21, D22, as in this form:
What I know is that A should be the same and D22 should be 0, but how to implement this partitioning?
Thanks to anyone can help me.
Francesco
  2 件のコメント
Paul
Paul 2021 年 2 月 1 日
It's unclear what the goal is. Are you starting from A,B,C,D and trying to figure out what the partitions are based on know dimensions of w, u, z, and y? Or are you starting from the partitions and trying to form an ss object that represents the partitioned system? It's hard to tell from the example becuase sys is SISO, and so there really isn't any partitioning to speak of.
Francesco
Francesco 2021 年 2 月 1 日
Thank you Paul for your reply, I’m sorry, I will try to make it clearer. Msys is already the system with uncertainty that I have built using the functions ureal and then ss, but it is formed by matrices A, B, C, D. These matrices are formed by the matrices I am searching, so for example B1 and B2 are obtained by splitting matrix B into parts, and the same is happening for C and D. What I’m asking is the rule on how to split A, B, C and D that compose Msys to get A, B1, B2, C1, C2, D11, D12, D21, D22 (or a function eventually, for the job), because these are the matrices I need for my project for H infinite control.
Thank you in advance!

サインインしてコメントする。

採用された回答

Paul
Paul 2021 年 2 月 2 日
Suppose you have a model
xdot = A*x + B1*w + B2*u
z = C1*x + D11*w + D12*u
y = C2*x + D21*w + D22*u
This system can be rewritten as:
xdot = A*x + [B1 B2]*[w;u] = A*x + B*[w;u]
[z;y]= [C1;C2]*x + [D11 D12;D21 D22]*[w;u] = C*x + D*[w;u];
Assume you have n states, and w is a vector of nw inputs, and u is vector of nu inputs, and z is vector of nz outputs, y is vector of ny outputs. Then we must have
B1 = B(:,1:nw);
B2 = B(:,nw+1:nw+nu); % or B(:,nw+1:end)
C1 = C(1:nz,:);
C2 = C(nz+1:nz+ny,:); % or C(nz+1:end,:);
D11 = D(1:nz,1:nw);
D12 = D(1:nz,nw+1:nw+nu); % or D(1:nz,nw+1:end)
D21 = D(nz+1:nz+ny,1:nw); % or D(nz+1:end,1:nw)
D22 = D(nz+1:nz+ny,nw+1:nw+nu); % or D(nz+1:end,nw+1:end)
The dimensions of w, u, z, and y must be known to determine the partitions of A,B,C,D of compatible dimensions.
  7 件のコメント
Mohammed Yakoob
Mohammed Yakoob 2022 年 2 月 17 日
clc
close all
clear
%% Plant Paramiters
Ts= 0.0005;
f= 60;
Wo= 2*pi*f;
Vdc= 300;
C_st= ureal('C_st',15*10^-6,'Percentage',[-40,40]);
L_t= ureal('L_t',2*10^-3,'Percentage',[-30,30] );
R_l= 40;
%% Implement a Single Phase Microgrid in a contious time form
% x_dot= AX+BU+dW ; Y= CX+DU.
% X=[il Vg]' ; U=[Vsw] ; d= [ig]; Y=[Vg].
Aop=[0 1/L_t; 1/C_st 0];
Bop= [1/L_t; 0];
d=[0; -1/C_st];
Cop=[0 1];
Dop= [0 0];
% B= [Bop d];
sys1= ss(Aop,[Bop d] ,Cop,Dop);
sys2= ss(Aop,[Bop d] ,Cop,Dop,Ts);
Ad= sys2.A;
Bd= sys2.B;
Cd=sys2.C;
Dd= sys2.D;
% % Determine sizes
ns = size(Aop,1); % number of states
nu = size(Bop,2); % number of actuator inputs
ny = size(Cop,1); % number of measured outputs
nq = size(Cop,1); % number of regulated output
nw = nu; % number of disturbances
% % 9 Matrix Representation
B1 = Bd(:,1:nw);
B2 = Bd(:,nw+1:nw+nu);
C1 = Cd(1:nq,:);
C2 = Cd(nq+1:nq+ny,:);
D11 = Dd(1:nq,1:nw);
D12 = Dd(1:nq,nw+1:nw+nu);
D21 = 0; %Dd(nq+1:end,1:nw);
D22 = Dd(nq+1:nq+ny,nw+1:nw+nu);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% lsim(sys1,step);
%% LMI by using YALMIP
% eta=1.5;
% Settings
opt = sdpsettings('verbose',0,'solver','sedumi');
% Define Variables
Y= sdpvar(2,2);
P= sdpvar(1,2);
H= sdpvar(2,2);
y= sdpvar(2,2);
F = sdpvar(2,1);
Q = sdpvar(2,2);
R = sdpvar(1,1);
S = sdpvar(2,2);
J = sdpvar(2,2);
Lo = sdpvar(1,2);
L= sdpvar(2,2);
eta = sdpvar(1,1);
m11= L;
m12= J;
m13= Ad*Y+B2*P;
m14= Ad+B2*R*C2;
m15= B1+B2*R*D21;
m16= zeros(2,1);
m22= H;
m23= Q;
m24= y*Ad+F*C2;
m25= y*B2+F*D21;
m26= zeros(2,1);
m33= Y+Y'-L;
m34= eye(2)+S'-J;
m35= zeros(2,1);
m36= Y'*C1'+Lo'*D12';
m44= y+y'-H;
m45=zeros(2,1);
m46= C1'+C2'*R'*D12';
m55= eye(1);
m56= D11'+D21'*R'*D12';
m66= eta*eye(1);
mat2= [m11 m12 m13 m14 m15 m16;...
m12' m22 m23 m24 m25 m26;...
m13' m23' m33 m34 m35 m36;...
m14' m24' m34' m44 m45 m46;...
m15' m25' m35' m45' m55 m56;...
m16' m26' m36' m46' m56' m66];
F = [ mat2>=0];
% Optimization Problem
% optimize(F,eta,opt);
opt = sdpsettings('solver','lmilab','verbose',2); %(better SDP solver recommended)
% opt.lmilab.maxiter = 1000;
% opt.lmilab.feasradius = 1e20;
solvesdp(F,[],opt);
eta= double(eta);
L = double(L);
F = double(F);
R = double(R);
Lo = double(Lo);
Mohammed Yakoob
Mohammed Yakoob 2022 年 2 月 17 日
Hello dear again
the above is my codes but not the final one , Im dealing with uncertian system and this also add some defctes to my code , I want to detrmine he H_inf to design a controller

サインインしてコメントする。

その他の回答 (1 件)

Paul
Paul 2022 年 2 月 17 日
編集済み: Paul 2022 年 2 月 19 日
Edit: This answer thread was intended to be a response to this comment.
%% Plant Paramiters
Ts= 0.0005;
f= 60;
Wo= 2*pi*f;
Vdc= 300;
C_st= ureal('C_st',15*10^-6,'Percentage',[-40,40]);
L_t= ureal('L_t',2*10^-3,'Percentage',[-30,30] );
R_l= 40;
%% Implement a Single Phase Microgrid in a contious time form
Based on the code as written, the output equation for Y is really Y = CX + DU + 0w
% x_dot= AX+BU+dW ; Y= CX+DU.
% X=[il Vg]' ; U=[Vsw] ; d= [ig]; Y=[Vg].
Aop=[0 1/L_t; 1/C_st 0];
Bop= [1/L_t; 0];
d=[0; -1/C_st];
Cop=[0 1];
Dop= [0 0];
% B= [Bop d];
For H-inf control, the disturbance input, w, typically is "before" the control input, u.
%sys1= ss(Aop,[Bop d] ,Cop,Dop);
sys1= ss(Aop,[d Bop],Cop,Dop);
At this point sys1 has two inputs (w,u) and only one output, y.
size(sys1)
Uncertain state-space model with 1 outputs, 2 inputs, 2 states, and 2 blocks.
I don't understand the next line. If sys2 is supposed to the discrete approximation to sys1, then it should be using c2d(). Becasue the actual definition of sys2 isn't really relevant to the question of partitioning, I'm going to just set sys2 to sys1 so that there aren't any problems with subsequent references to sys2.
% sys2= ss(Aop,[Bop d] ,Cop,Dop,Ts);
sys2 = sys1;
Ad= sys2.A;
Bd= sys2.B;
Cd=sys2.C;
Dd= sys2.D;
% Determine sizes
ns = size(Aop,1); % number of states
nu = size(Bop,2); % number of actuator inputs
ny = size(Cop,1); % number of measured outputs
So far so good. Now the following line indicates that there should be as many regulated outputs, z, as there are measured ouputs, y (why use nq, and not nz?). But nowhere is there an equation that defines the output equation for z. in terms of x, w, and u. And z is not included as an output in sys1.
nq = size(Cop,1); % number of regulated output
nw = nu; % number of disturbances
Because I don't know what z is supposed to be, I'm just going to assume that z = 2*y for purposes of illustration. Under this assumption, the output equation for z is z = 2*Cop*x + 2*Dop*[w;u]. Recreate sys1 with z as the first output and y as the second output, and the repeat all the subsequent code.
sys1= ss(Aop,[d Bop],[2*Cop; Cop],[2*Dop; Dop]);
size(sys1)
Uncertain state-space model with 2 outputs, 2 inputs, 2 states, and 2 blocks.
sys2 = sys1;
Ad = sys2.A;
Bd = sys2.B;
Cd = sys2.C;
Dd = sys2.D;
% Determine sizes
ns = size(Aop,1); % number of states
nu = size(Bop,2); % number of actuator inputs
ny = size(Cop,1); % number of measured outputs
nq = ny; % number of regulated output
nw = nu; % number of disturbances
Now get the partitions
% % 9 Matrix Representation
A = Ad;
B1 = Bd(:,1:nw);
B2 = Bd(:,nw+1:nw+nu);
C1 = Cd(1:nq,:);
C2 = Cd(nq+1:nq+ny,:);
D11 = Dd(1:nq,1:nw);
D12 = Dd(1:nq,nw+1:nw+nu);
D21 = Dd(nq+1:end,1:nw);
D22 = Dd(nq+1:nq+ny,nw+1:nw+nu);
disp('complete')
complete
  3 件のコメント
Paul
Paul 2022 年 2 月 19 日
If you have the partitioned model set up correctly, I'm afraid I can't be of any more help. Good luck.
Mohammed Yakoob
Mohammed Yakoob 2022 年 2 月 19 日
Thank you so much dear and good luck with my respect

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRobust Control Toolbox についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by