Skip to content

Commit 4105976

Browse files
author
Auralius Manurung
committed
Resolving conflicts
2 parents 26f1fd9 + 1e6f07c commit 4105976

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

demo2.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@
190190
zdot = q_sol(k,2) - ( (q_sol(k,3)*abs(q_sol(k,2))*sigma_0) / ...
191191
(Fc+(Fs-Fc)*exp(-(q_sol(k,2)/vs)^2)) );
192192
F(k) = sigma_0*q_sol(k,3) + sigma_1 * zdot + sigma_2*q_sol(k,2);
193+
194+
% When motion occurs, the resulting force suddenly drops
195+
% See Fig. 6 (bottom figure)
193196
if (k>1) && (F(k)-F(k-1)<0)
194197
break;
195198
end

sim_stick_slip.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
function [xdot, zdot, F] = sim_stick_slip(t, q, M, Fs, Fc, sigma_0, sigma_1, sigma_2, vs)
2-
3-
4-
k = 2; % stiffness of the spring
5-
y = 0.1*t; % 0.1 m/s
6-
u = k * (y - q(1,:)); % force by the spring
2+
3+
k = 2; % stiffness of the spring
4+
y = 0.1*t; % 0.1 m/s
5+
u = k * (y - q(1,:)); % force by the spring
76

8-
zdot = q(2,:) - ( (q(3,:).*abs(q(2,:))*sigma_0) ./ (Fc+(Fs-Fc)*exp(-(q(2,:)/vs).^2)) );
7+
zdot = q(2,:) - ( (q(3,:).*abs(q(2,:))*sigma_0) ./ ...
8+
(Fc+(Fs-Fc)*exp(-(q(2,:)/vs).^2)) );
9+
910
F = sigma_0*q(3,:) + sigma_1 * zdot + sigma_2*q(2,:);
1011

1112
qdot_1 = q(2,:);
1213
qdot_2 = (u - F) / M;
1314
qdot_3 = zdot;
1415
xdot = [qdot_1 ; qdot_2; qdot_3 ];
16+
1517
end

0 commit comments

Comments
 (0)