Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
petermnhull committed Aug 13, 2020
1 parent 86f64d4 commit e696abe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
22 changes: 11 additions & 11 deletions code/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ function main()
N_swimmers = 2;

% ----- Initial positions of each swimmer -----
x = [10, 0]; % x position of head
y = [30, 0]; % y position of head
alpha = [pi/6, pi]; % Angle measured between positive y-axis and direction of travel
x = [0, 0]; % x position of head
y = [0, 10]; % y position of head
alpha = [3*pi/2, 3*pi/2]; % Angle measured between positive y-axis and direction of travel

% ----- Basic parameters -----
lambda_s = [10, 6]; % Amplitude Ratio
k_s = [1.5, 3]; % Wavenumber
beta_A = [0.5, 1]; % Multiplier on Amplitude
zeta = [0.5, 1]; % Body / Tail Ratio (1 = no tail, 0 = all tail)
gamma = [8, 12]; % Number of undulations per unit time
phi = [0, 0];
lambda_s = [15, 15]; % Amplitude Ratio
k_s = [1.5, 1.5]; % Wavenumber
beta_A = [1, 1]; % Multiplier on Amplitude
zeta = [1, 1]; % Body / Tail Ratio (1 = no tail, 0 = all tail)
gamma = [5, 5]; % Number of undulations per unit time
phi = [0, pi];

% ----- Motion type (1 = symmetric, 2 = peristalsis, 3 = asymmetric I, 4 = asymmetric II) -----
locomotion_type = [1, 2];
locomotion_type = [1, 1];

% ----- Passive links for swimmers (warning: increase amplitude ratio if false)-----
passive_links = [true, true];
Expand All @@ -27,7 +27,7 @@ function main()

% ----- Plotting and Saving ------
% For plots
limit = 0.75; % Recommended: 0.5 for individuals, and 1 for multiple
limit = 0.5; % Recommended: 0.5 for individuals, and 1 for multiple
filename = strcat(datestr(now, 'yyyymmdd-HHMMSS'), '.txt');
save_to_file = false;

Expand Down
7 changes: 2 additions & 5 deletions code/main_plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,6 @@ function main_plot(N_swimmers, x, y, alpha, lambda_s, k_s, beta_A, zeta, locomot
% scaled by length of filament / nondimensionalising
plot((X_S(SW_IND(i_sw,:)))/L, (Y_S(SW_IND(i_sw,:)))/L, ...
'k', 'LineWidth', wdth_wall);

% added hold on to try and fix problem
% this is done so that the axes isn't being cleared
hold on;
end
end
Expand All @@ -405,8 +402,8 @@ function main_plot(N_swimmers, x, y, alpha, lambda_s, k_s, beta_A, zeta, locomot
ylim([com_Y/L - limit, com_Y/L + limit]);

% Labelling
xlabel('$x / L$');
ylabel('$y / L$');
xlabel('$x_{avg} / L$');
ylabel('$y_{avg} / L$');
axis equal

% Video recording
Expand Down
Binary file modified code/video.avi
Binary file not shown.
Binary file added videos/multiple/3 coplanar swimmers.avi
Binary file not shown.
Binary file modified videos/multiple/phase difference = pi.avi
Binary file not shown.

0 comments on commit e696abe

Please sign in to comment.