-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCF_Derivative.m
87 lines (76 loc) · 2.39 KB
/
CF_Derivative.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
% Define the parameters
alpha = [0.9, 0.92, 0.94];
eta_a = [2, 2, 2];
eta_b = [1, 1, 1];
rho = [0.25, 0.2, 0.15];
gamm = [0.1, 0.15, 0.2];
a = 35; b = 3; c = 28;
mu = 0.5;
eta = 0.5;
k = 1;
T = settlingTime(rho(1), eta);
xi_num = [-1, -2, -6].^T;
first_term = Caputo(alpha(1)-1)*sign(xi_num(1));
second_term = 2*Caputo(alpha(1)-1)*xi_num(1);
third_term = 1*Caputo(alpha(1)-2)*(xi_num(1)+abs(xi_num(1)).^mu*sign(xi_num(1)));
si = first_term + second_term + third_term; % Eq. (9)
f = @(x) sin(x);
first_term = (sign(si)/(sign(xi_num(1))+2));
second_term = ((1+2)*(abs(f(xi_num(1)))) + rho(1) + gamm(1));
third_term = (1*abs(Caputo(alpha(1)-1)*(xi_num(1)+abs(xi_num(1).^mu)*sign(xi_num(1)))));
ui_num = -((first_term * second_term) + third_term + k); % Eq. (21)
tMin = 0;
tMax = 200;
Nt = 100;
t = linspace(tMin, tMax, Nt);
% plot x1
D_1 = a*(xi_num(2)-xi_num(1))+((0.25*cos(2*t))-(0.1*sin(t))) + ui_num;
figure(1)
plot(t, D_1)
xlabel('t(s)')
ylabel('X1')
% %% plot x2
% first_term = Caputo(alpha(2)-1)*sign(xi_num(2));
% second_term = 2*Caputo(alpha(2)-1)*xi_num(2);
% third_term = 1*Caputo(alpha(2)-2)*(xi_num(2)+abs(xi_num(2)).^mu*sign(xi_num(2)));
%
% si = first_term + second_term + third_term; % Eq. (9)
%
% f = @(x) sin(x);
% first_term = (sign(si)/(sign(xi_num(2))+2));
% second_term = ((1+2)*(abs(f(xi_num(2)))) + rho(2) + gamm(2));
% third_term = (1*abs(Caputo(alpha(2)-1)*(xi_num(2)+abs(xi_num(2).^mu)*sign(xi_num(2)))));
%
% ui_num = -((first_term * second_term) + third_term + k); % Eq. (21)
%
% disp(ui_num);
%
% D_2 = ((c - a)*xi_num(1)) + (c*xi_num(2)) - (xi_num(1) * xi_num(3)) + ((-0.2*cos(3*t)) + 0.15*sin(2*t)) + ui_num;
%
% figure(2)
% plot(t, D_2)
% xlabel('t(s)')
% ylabel('X2')
%
% %% plot x3
% first_term = Caputo(alpha(3)-1)*sign(xi_num(3));
% second_term = 2*Caputo(alpha(3)-1)*xi_num(3);
% third_term = 1*Caputo(alpha(3)-2)*(xi_num(3)+abs(xi_num(3)).^mu*sign(xi_num(3)));
%
% si = first_term + second_term + third_term; % Eq. (9)
%
% f = @(x) sin(x);
% first_term = (sign(si)/(sign(xi_num(3))+2));
% second_term = ((1+2)*(abs(f(xi_num(3)))) + rho(3) + gamm(3));
% third_term = (1*abs(Caputo(alpha(3)-1)*(xi_num(3)+abs(xi_num(3).^mu)*sign(xi_num(3)))));
%
% ui_num = -((first_term * second_term) + third_term + k); % Eq. (21)
%
% D_3 = (-b*xi_num(3)) + (xi_num(1) + xi_num(2)) + (0.15*cos(4*t)) - (0.2*sin(3*t)) + ui_num;
%
% % plot results
% figure(3);
% plot(t, D_3)
% xlabel('t(s)')
% ylabel('X3')
%