-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparams_danio.m
More file actions
124 lines (80 loc) · 2.35 KB
/
Copy pathparams_danio.m
File metadata and controls
124 lines (80 loc) · 2.35 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
function [sim,pred,prey] = params_danio
% Parameter values for danio predator-prey. Assumes axial symmetry for the
% prey.
%% PREY PARAMETERS
% Load larval body shape ('bod' structure)
load('larva_body_shape.mat')
% Prey length (m)
prey.len = 3.5e-3;
% Prey density (kg m^-3)
prey.rho = 1000;
% Number of body segments defining morphology
prey.num_segs = 10;
% Position of COM
prey.sCOM = 0.25 * prey.len;
% Body positons of segments
prey.s = linspace(0,prey.len,prey.num_segs)';
% Radius of body (m)
prey.r = interp1(bod.s,bod.r,prey.s);
%width = flipud(width);
% x-Sectional area of segments
prey.x_area = pi.*prey.r.^2;
% Section volume
prey.vol = [0; diff(prey.s)].*pi.*prey.r.^2;
% Wetted area of the segments
prey.wet_area = [0; diff(prey.s)].*2*pi.*prey.r;
% Volume of body
prey.bod_vol = trapz(prey.s,prey.x_area);
% Mass
prey.mass = prey.bod_vol * prey.rho;
% Added mass coefficient for a cylinder(?) (dimensionless)
prey.add_mass = 0.6;
% Drag coefficient for body segment, set to cylinder drag coefficent for
% above-critical Re (Hoerner, 1965)
prey.Cd = 1.2;
% Initial prey position (x (m), y (m), orientaton angle (rad))
prey.pos0= [.01 0 -pi/2];
% Initial prey speed (x(m/s), y(m/s), angle rate (rad/s))
prey.vel0 = [0 0 0];
% Escape force/torque (x(N), y(N), theta (Nm))
prey.esc = [0 0 0];
% Sensitivity threshold
%prey.thresh = 0.006;
%% PREDATOR PARAMETERS
% Max suction speed (m/s)
pred.flw_spd.max = 1;
% Time of max speed (s)
pred.flw_spd.t_max = 30e-3;
% Shape factor for speed
pred.flw_spd.alpha = 2;
% Max gape (m)
pred.gape.max = 20e-3;
% Time of max gape (s)
pred.gape.t_max = 30e-3;
% Shape factor
pred.gape.alpha = 2;
% Initial position of predator (m)
pred.pos0 = [0 0 0];
% Approach speed (m/s)
pred.app_spd = 10e-2;
%% SIMULATION PARAMETERS
% Water density (kg m^-3)
sim.rho_water = 1000;
% Kinematic viscosity (Pa s)
sim.mu_water = 0.001;
% Maximum simulation duration (s)
sim.dur = .1;
% Relative tolerance for the solver (dimensionless)
sim.reltol = 1e-3;
% Number of time values to define predator flow
sim.num_time = 250;
% Number of values along the x-axis to define pred flow
sim.num_x = 100;
% Boundaries in x and y directions for defining pred flow
sim.flow_lim = [0 .03 -.015 .015];
% Scaling constants
sim.sL = prey.len;
sim.sT = 10^-3;
sim.sM = prey.mass*10^6;
sim.sF = sim.sM .* sim.sL ./ sim.sT^2;
end