Skip to content

Commit

Permalink
Resolving conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Auralius Manurung committed Jul 4, 2021
2 parents 26f1fd9 + 1e6f07c commit 4105976
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions demo2.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@
zdot = q_sol(k,2) - ( (q_sol(k,3)*abs(q_sol(k,2))*sigma_0) / ...
(Fc+(Fs-Fc)*exp(-(q_sol(k,2)/vs)^2)) );
F(k) = sigma_0*q_sol(k,3) + sigma_1 * zdot + sigma_2*q_sol(k,2);

% When motion occurs, the resulting force suddenly drops
% See Fig. 6 (bottom figure)
if (k>1) && (F(k)-F(k-1)<0)
break;
end
Expand Down
14 changes: 8 additions & 6 deletions sim_stick_slip.m
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
function [xdot, zdot, F] = sim_stick_slip(t, q, M, Fs, Fc, sigma_0, sigma_1, sigma_2, vs)


k = 2; % stiffness of the spring
y = 0.1*t; % 0.1 m/s
u = k * (y - q(1,:)); % force by the spring

k = 2; % stiffness of the spring
y = 0.1*t; % 0.1 m/s
u = k * (y - q(1,:)); % force by the spring

zdot = q(2,:) - ( (q(3,:).*abs(q(2,:))*sigma_0) ./ (Fc+(Fs-Fc)*exp(-(q(2,:)/vs).^2)) );
zdot = q(2,:) - ( (q(3,:).*abs(q(2,:))*sigma_0) ./ ...
(Fc+(Fs-Fc)*exp(-(q(2,:)/vs).^2)) );

F = sigma_0*q(3,:) + sigma_1 * zdot + sigma_2*q(2,:);

qdot_1 = q(2,:);
qdot_2 = (u - F) / M;
qdot_3 = zdot;
xdot = [qdot_1 ; qdot_2; qdot_3 ];

end

0 comments on commit 4105976

Please sign in to comment.