-
Notifications
You must be signed in to change notification settings - Fork 0
/
calculate_mu_PI.m
55 lines (46 loc) · 1.49 KB
/
calculate_mu_PI.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
% calculate_mu_PI.m, V. Ziemann, 230811
CC=eye(2)+Areal+Breal*Bplus-Breal*Ki;
DD=Areal+Breal*Bplus;
Z1=0.5*CC+sqrtm(0.25*CC^2-DD);
Z2=0.5*CC-sqrtm(0.25*CC^2-DD);
SS=inv(Z1-Z2);
R1=SS*(Z1-eye(2));
R2=SS*(Z2-eye(2));
A11=inv(eye(2)-Z1*Z1');
A12=inv(eye(2)-Z1*Z2');
A21=inv(eye(2)-Z2*Z1');
A22=inv(eye(2)-Z2*Z2');
% Evv=R1*A11*R1'-R1*A12*R2'-R2*A21*R1'+R2*A22*R2'
% Evy=SS*(A11*(eye(2)-Z1')-A12*(eye(2)-Z2')-A21*(eye(2)-Z1')+A22*(eye(2)-Z2'))*SS'
% Eyv=SS*((eye(2)-Z1)*A11-(eye(2)-Z1)*A12-(eye(2)-Z2)*A21+(eye(2)-Z2)*A22)*SS'
% Eyy=SS*(A11-A12-A21+A22)*SS'
Evv=R1*A11*R1'-R1*A12*R2'-R2*A21*R1'+R2*A22*R2';
Evy=R1*A11*Z1'*SS'-R1*A12*Z2'*SS'-R2*A21*Z1'*SS'+R2*A22*Z2'*SS';
Eyv=SS*Z1*A11*R1'-SS*Z1*A12*R2'-SS*Z2*A21*R1'+SS*Z2*A22*R2';
Eyy=SS*(Z1*A11*Z1'-Z1*A12*Z2'-Z2*A21*Z1'+Z2*A22*Z2')*SS';
h=zeros(2,2,2);
h(1,:,:)=[-1+R*Kp,0;0,1];
h(2,:,:)=[0,-1;-1+R*Kp,0];
hb=zeros(2,2,2);
hb(:,:,1)=[-1+R*Kp,0;0,1];
hb(:,:,2)=[0,-1+R*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