-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunQuickSimulation.m
More file actions
35 lines (31 loc) · 1.03 KB
/
runQuickSimulation.m
File metadata and controls
35 lines (31 loc) · 1.03 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
tic;
%Remember to initialize sysplotter and have gif Add-On installed
%Declare salp characteristic values
salp = struct();
%Length of individual zooid units
salp.L = .25;
%Ratio of Y drag to X drag of a link - Y drag probably higher
salp.dragRatio = 3;
%Stiffness of springs connecting links
salp.jointStiffness = .15;
%Value of maximum thrust available from zooids
salp.thrustAmp = 2;
%Angle of thrusters relative to back of link
salp.thrustAngle = pi/12;
%Phase lag between link and its neighbors for synchronized swimming
salp.phaseDelay = pi/4;
%Frequency at which each thruster operates
salp.thrustFrequency = 1;
%Number of periods to simulate
salp.numPeriods = 8;
%Percent of time thrusters are activated
salp.percentThrusting = .75;
%Type of thruster activation: can be 'synch', 'asynch', or 'random'
salp.forceType = 'synch';
%Frequency at which to animate salp
salp.FPS = 60;
%Run salp simulation
[ts,states,forces] = integrateSalpMotion(12,salp);
toc
%animate the results
animateSalp(ts,states,forces,salp);