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
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.
採用された回答
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
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
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
2022 年 2 月 17 日
編集済み: Paul
2022 年 2 月 19 日
%% 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)
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)
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')
3 件のコメント
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.
参考
カテゴリ
Help Center および File Exchange で Robust Control Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!