-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfUNoise.m
More file actions
44 lines (38 loc) · 1.37 KB
/
Copy pathfUNoise.m
File metadata and controls
44 lines (38 loc) · 1.37 KB
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
function xdot = fUNoise(x)
%--------------------------------------------------------------------------
% Matlab M-file Project: HyEQ Toolbox @ Hybrid Systems Laboratory (HSL),
% https://hybrid.soe.ucsc.edu/software
% http://hybridsimulator.wordpress.com/
% Filename: fU.m
%--------------------------------------------------------------------------
% Project: Uniting Nesterov's accelerated gradient descent globally with
% heavy ball locally.
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% See also HYEQSOLVER, PLOTARC, PLOTARC3, PLOTFLOWS, PLOTHARC,
% PLOTHARCCOLOR, PLOTHARCCOLOR3D, PLOTHYBRIDARC, PLOTJUMPS.
% Copyright @ Hybrid Systems Laboratory (HSL),
% Revision: 0.0.0.3 Date: 09/29/2020 1:07:00
% The global variables
global lambda gamma M zeta sigma rho randomsIndex randomsInterp
% state
z1 = x(1);
z2 = x(2);
q = x(3);
tau = x(4);
if(randomsIndex < length(randomsInterp))
rho = sigma*randomsInterp(randomsIndex);
else
randomsIndex = 1;
rho = sigma*randomsInterp(randomsIndex);
end
randomsIndex = randomsIndex + 1;
if (q == 0)
u = - lambda*z2 - gamma*(GradientL(z1) + rho);
elseif (q == 1)
dBar = 3/(2*(tau + 2));
betaBar = (tau - 1)/(tau + 2);
u = - 2*dBar*z2 - (zeta^2/(M))*(GradientL(z1 + betaBar*z2) + rho);
end
xdot = [z2;u;0;q];
end