-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecond.m
More file actions
39 lines (36 loc) · 753 Bytes
/
Copy pathsecond.m
File metadata and controls
39 lines (36 loc) · 753 Bytes
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
h=1e-3; %simulation step size
N=1000;%mini batch size
b0=23.2;%acc paper: 23
alpha=0.01;
wo=20; %acc paper: 40
wc=10; %acc paper: 150
kp=wc^2;kd=-2.*wc;
b1=3*wo;
b2=3*wo^2;
b3=wo^3;
T=1e-3;
A=[0 1 0 ;
0 -1.41 1 ;
0 0 0 ;];
B=[0;23.2;0];
C=[1 0 0 ];
syms L1 L2 L3
L=[L1;L2;L3;];
AA=A-L*C;
syms lambda
AA=det(lambda*eye(3)-AA);
AA=collect(AA,lambda);
xx=coeffs(AA,lambda);
BB=collect((lambda+wo)^3,lambda);
yy=coeffs(BB,lambda);
eqns=[xx(3)==yy(3),xx(2)==yy(2),xx(1)==yy(1)];
S = vpasolve(eqns, [L1 L2 L3]);
L1=real(double(S.L1(1)));
L2=real(double(S.L2(1)));
L3=real(double(S.L3(1)));
L=[L1;L2;L3];
AAex=A-L*C;
BBex=[B,L]; % (input: tao_M, theta_H)
CCex=eye(3);
DDex=zeros(3,2);
sim('CompareLearning');