-
Notifications
You must be signed in to change notification settings - Fork 0
/
Analytical_solutions_generic_eqn_linear_friction.m
82 lines (61 loc) · 1.76 KB
/
Analytical_solutions_generic_eqn_linear_friction.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
clearvars;
close all;
%% Analytical solutions for the generic equation (fully symbolic)
% by Ekaterina Bolotskaya
% 12/30/2021
% This script solves the nondim equation of motion for 1D spring-slider:
% y" + (1-K_f/K)*y = V_0*t + d_tau_i
% where y - nondim slip
% y" - nondim acceleration
% t - nondim time
% K_f - failure law segment slope
% K - elastic loading slope (spring stiffness)
% V_0 - nondim load point velocity
% d_tau_i - nondim stress difference at the beginning of the segment
% Substitute Ke = (K-K_f)/K - effective loading slope
% There are three "stability regimes"
% and three solution types depending on the sign of Ke
%% Equation
syms y(t)
Dy = diff(y);
syms Ke real
syms V_0 d_tau_i V_i real
% V_i - nondim slip rate at t = 0
ode = diff(y,t,2) + Ke*y == V_0*t + d_tau_i;
cond1 = y(0) == 0;
cond2 = Dy(0) == V_i;
%% Ke > 0
assumeAlso(Ke > 0)
% Solve
ySol(t) = dsolve(ode,[cond1 cond2]);
% Display
fprintf('K_seg < K \n\n y(t) = \n\n');
pretty(simplify(ySol))
fprintf('y''(t) = \n\n');
pretty(simplify(diff(ySol)))
fprintf('y"(t) = \n\n');
pretty(simplify(diff(diff(ySol))))
%% Ke < 0
syms Ke real
assumeAlso(Ke < 0)
% Solve
ySol(t) = dsolve(ode,[cond1 cond2]);
% Display
fprintf('K_seg > K \n\n y(t) = \n\n');
pretty(simplify(ySol))
fprintf('y''(t) = \n\n');
pretty(simplify(diff(ySol)))
fprintf('y"(t) = \n\n');
pretty(simplify(diff(diff(ySol))))
%% Ke = 0
% New equation
ode = diff(y,t,2) == V_0*t + d_tau_i;
% Solve
ySol(t) = dsolve(ode,[cond1 cond2]);
% Display
fprintf('K_seg = K \n\n y(t) = \n\n');
pretty(simplify(ySol))
fprintf('y''(t) = \n\n');
pretty(simplify(diff(ySol)))
fprintf('y"(t) = \n\n');
pretty(simplify(diff(diff(ySol))))