-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathall_external_forces.m
67 lines (50 loc) · 1.74 KB
/
all_external_forces.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
function [FX, FY] = all_external_forces(FX_IN, FY_IN, X_S, Y_S, N_w, DL, filament_separation, N_pairs, nt, TOTAL_STEPS, dt, T_S)
FX = FX_IN;
FY = FY_IN;
% Forces to include
passive_links_full = true;
cross_links_trig = false;
cross_links_linear = false;
cross_links_linear_osc = true;
cross_links_han_peskin = false;
external_pinch = false;
% -- PARAMETERS (NOT FOR HAN PESKIN)--
% Cross link equilibrium length
cl_el = sqrt(filament_separation^2 + DL^2);
% Constant for full passive links
k_f = 10;
% Constants for external pinch
k_e = 1;
%seg_a = N_w + 3;
%seg_b = N_w + 8;
% ---- Add Forces ----
% Cross linked forces with variable arc length, trig
if cross_links_trig
[FX, FY] = cl_forces_variable_al(FX, FY, X_S, Y_S, N_w, cl_el);
end
% Cross linked forces with variable arc length, linear
if cross_links_linear
[FX, FY] = cl_forces_variable_al_linear(FX, FY, X_S, Y_S, N_w, cl_el);
end
% Cross linked forces with variable arc length, linear
if cross_links_linear_osc
[FX, FY] = cl_forces_variable_al_linear_osc(FX, FY, X_S, Y_S, N_w, cl_el, nt, TOTAL_STEPS);
end
if cross_links_han_peskin
[FX, FY, T] = cl_forces_hanpeskin_new(FX, FY, X_S, Y_S, N_w, N_pairs, dt, T_S);
end
% Passive Links (every set of segments)
% - for use with pairs of filaments
if passive_links_full
for i_pairs=1:N_pairs
for j=1:N_w
seg_a = (((2 * i_pairs) - 2) * N_w) + j;
seg_b = (((2 * i_pairs) - 1) * N_w) + j;
[FX, FY] = add_spring_force_between_segments(FX, FY, X_S, Y_S, seg_a, seg_b, k_f, filament_separation);
end
end
end
% External pinch
if external_pinch
[FX, FY] = add_spring_force_between_segments(FX, FY, X_S, Y_S, seg_a, seg_b, k_e, filament_separation);
end