RESULTS OF TRAJECTORY PLOTS
RESULTS FOR LOS DIABLOS BIRDS COMPARING KIT BASED BLUE MECHANICAL BIRD VS 3D-PEN DESIGNED RED MECHANICAL BIRD :
Analysis:
The students were able to observe that by using projectile motion equations both of their red and blue mechanical birds were able to fly at very different speeds. From the High school students plots the group, "Los Diablos" flew the blue bird with a much higher trajectory however by starting off with a greater angle of attack then the 3D-pen red mechanical bird. The 3D-pen red mechanical bird was able to fly further due to the light weight of the bird. The students were easily able to grasp "SOHCAHTOA" concepts and calculate the flight path angle that they calculated to be around 53 degrees. The students built, designed, tested, collected data and plotted their data in matlab working with real professional engineers. The best part was an enjoyable atmosphere where the students enjoyed Mexican food, Tamales and was able to network with the professional / PhD / student engineers in an enjoyable atmosphere to ask career based questions such as "Do you like your job?"; "What do you do at Honeywell / Raytheon / General Motors / APS / Catipillar ?" " Are you the only girl who work in your group?" Sadly, teh students quickly learned that women in engineering is rare based on the last question. This is obvious for us. That's why we have developed this project based micro air vehicle outreach program!
RESULTS FOR DREAM TEAM BIRDS COMPARING KIT BASED BLUE MECHANICAL BIRD VS 3D-PEN DESIGNED RED MECHANICAL BIRD :
Analysis:
Here, the students were able to observe that the blue mechanical bird was able to fly much higher and further then
their red mechanical bird. The 3D-pen red mechanical bird has a much higher payload than the blue mechanical bird.
The students put more of the 3D-pen plastic on top of the bird and weighed the vehicle down. The mass of the blue mechanical bird
was able to soar and fly through the air. The micro air vehicle club had built hoops where the students were able to fly the bird through.
This helped the students to aim the bird at a higher angle of attack and fly mechanical birds through a series of tests. The students
tested both the red and blue mechanical birds fixe times collected distance and time measurements. With this data the high school
students were able to compute the velocity of the mechanical birds. Then the students calculated the angle with "SOHCAHTOA." After the students had the angle and velocity the students were able to use projectile motion equations to plot the trajectory of the micro air vehicles in matlab engineering software.
This code will be given to group leader / instructor / Engineer to make sure statistics are calculated and graphed/plotted correctly.
This code will plot the groups data and tell you which vehicle performed the best. The code will also calculate all
21 answers for the 21 questions to double check the students correctly computed the statistics of each of their
vehicles.
The matlab code is called Code_For_Engineers_7_12_15.m .. When the students are done collecting there data they will be able to plot and calculate the statistics by hand. They also with this code
that I have attached here. This code will save a lot of time because we won't have to calculate
each vehicle by hand. All we will need to do is insert the students data into the code and
it should produce the plots / answers automatically to save us a lot of time.
This code is to be given to the engineers. The matlab code is called Code_For_Engineers
clear all;
close all;
clear;
clc;
% cd('J:\STEAM_matlab_code')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group A - Data Collection ( 5 experiments) %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%% Blue bird
L1A=[3.9 0.01 0.01 0.01 0.01];
t1A=[1 0.01 0.01 0.01 0.01 ];
v1A=L1A/t1A;
%%%% 3D-pen Red bird
L2A=[4 0.01 0.01 0.01 0.01];
t2A=[1 0.01 0.01 0.01 0.01 ];
v2A=L2A/t2A;
%%%% Avitron motor based bird
L3A=[4.12 0.01 0.01 0.01 0.01];
t3A=[1 0.01 0.01 0.01 0.01 ];
v3A=L3A/t3A;
%%%% Arduinocar
L4A=[4.2 0.01 0.01 0.01 0.01];
t4A=[1 0.01 0.01 0.01 0.01];
v4A=L4A/t4A;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group A Trajectory data %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% theory
%%%%%%%%%%%%%%%%%
%%% Blue Bird data
%%%%%%%%%%%%%%%%%
theta=20;
vox=v1A*cos(theta*pi/180);
voy=v1A*sin(theta*pi/180);
g=9.81;
thmax=voy/g;
hmax=voy^2/(2*g);
ttot=2*thmax;
dmax=vox*ttot;
tplot=linspace(0,ttot,200);
x=vox*tplot;
y=voy*tplot-0.5*g*tplot.^2;
%%%%%%%%%%%%%%%%%
%%% 3D pen-Red Bird data
%%%%%%%%%%%%%%%%%
theta2=20;
vox2=v2A*cos(theta2*pi/180);
voy2=v2A*sin(theta2*pi/180);
g=9.81;
thmax2=voy2/g;
hmax2=voy2^2/(2*g);
ttot2=2*thmax2;
dmax2=vox2*ttot2;
tplot2=linspace(0,ttot2,200);
x2=vox2*tplot2;
y2=voy2*tplot2-0.5*g*tplot2.^2;
%%%%%%%%%%%%%%%%%
%%% Avitron Bird data
%%%%%%%%%%%%%%%%%
theta3=20;
vox3=v3A*cos(theta3*pi/180);
voy3=v3A*sin(theta3*pi/180);
g=9.81;
thmax3=voy2/g;
hmax3=voy2^2/(2*g);
ttot3=2*thmax3;
dmax3=vox3*ttot3;
tplot3=linspace(0,ttot3,200);
x3=vox3*tplot3;
y3=voy3*tplot3-0.5*g*tplot3.^2;
%%%%%%%%%%%%%%%%%
%%% Arduinocar data
%%%%%%%%%%%%%%%%%
theta4=19;
vox4=v4A*cos(theta4*pi/180);
voy4=v4A*sin(theta4*pi/180);
g=9.81;
thmax4=voy4/g;
hmax4=voy4^2/(2*g);
ttot4=2*thmax3;
dmax4=vox4*ttot4;
tplot4=linspace(0,ttot4,200);
x4=vox4*tplot4;
y4=voy4*tplot4-0.5*g*tplot4.^2;
subplot(2,2,1);
plot(x,y,'b',...
x2,y2,'r',...
x3,y3,'g',...
x4,y4,'k','Linewidth',3);
str1 = 'Best performance is the Avitron Bird!';
h=text(0,0.13,str1,'Linewidth',5);
s=h.FontSize;
h.FontSize = 12;
set(gca,'FontSize',12);
xlabel('Distance (meters)','FontSize',14);
ylabel('Height (meters)','FontSize',14);
title('Group A - Trajectory of Vehicle','FontSize',18);
legend('Blue Mechanical-Bird',...
'3D-pen Red Mechanical-Bird',...
'Avitron Motor-Bird',...
'Arduinocar');
saveas(gcf,'Theory','jpg');
axis([0 2 0 0.2]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group A Answers 21 %%%%%%
% Questions %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% CONSTANTS GIVEN FOR
% Blue - Bird , 3d-pen Red Bird
% Avitron motor bird & Arduinocar
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cd = 0.3; % FROM ASU WINDTUNNEL
Cl = 0.2; % FROM ASU WINDTUNNEL
rho = 1.223; % [kg/m^3]
A = 2 ; % [m^2]
g = 9.8 ; % [m/s^2]
mass_BlueBird = 6 ; % [grams]
mass_3dpen = 8 ; % [grams]
mass_Avitronmotorbird = 20 ; % [grams]
mass_Arduinocar = 100 ; % [grams]
base_BlueBird = 1 ; % [meters]
base_3dpen = 2 ; % [meters]
base_Avitronmotorbird = 3 ; % [meters]
base_Arduinocar = 4 ; % [meters]
height_BlueBird = 2 ; % [meters]
height_3dpen = 3 ; % [meters]
height_Avitronmotorbird = 4 ; % [meters]
height_Arduinocar = 5 ; % [meters]
Opposite_BlueBird = 8 ; % [meters]
Opposite_3dpen = 7 ; % [meters]
Opposite_Avitronmotorbird = 6 ; % [meters]
Opposite_Arduinocar = 5 ; % [meters]
Adjacent_BlueBird = 5 ; % [meters]
Adjacent_3dpen = 6 ; % [meters]
Adjacent_Avitronmotorbird = 7 ; % [meters]
Adjacent_Arduinocar = 8 ; % [meters]
% #1 , best performance vehicle was
Highest = max ([max(v1A), max(v2A), max(v3A), max(v4A)]);
% hmax = Blue Bird
% hmax2 = 3d-pen
% hmax3 = Avitron motor bird
% hmax4Red = Arduinocar
if Highest == max(v1A); % Blue Bird
disp ('#1 answer: Best performance is the Blue Bird!')
theta_BlueBird = atan(Opposite_BlueBird/Adjacent_BlueBird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_BlueBird)
v1B=L1A/t1A
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v1B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_BlueBird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_BlueBird*height_BlueBird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v1B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v1B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t1A)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t1A)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L1A)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L1A)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L1A)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t1A)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t1A) - min(t1A)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L1A) - min(L1A)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t1A)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L1A)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t1A)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L1A)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v2A); % 3D-pen Red Bird
disp ('#1 answer: Best performance is the 3D-pen Red Bird!')
theta_3dpen = atan(Opposite_3dpen/Adjacent_3dpen)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_3dpen)
v2A=L2A/t2A
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v2A)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_3dpen*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_3dpen*height_3dpen
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v2A^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v2A^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t2A)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t2A)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L2A)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L2A)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L2A)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t2A)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t2A) - min(t2A)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2A) - min(L2A)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t2A)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L2A)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t2A)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L2A)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v3A); % Avitron motor bird
disp ('#1 answer: Best performance is the Avitron Bird!')
theta_Avitronmotorbird = atan(Opposite_Avitronmotorbird/Adjacent_Avitronmotorbird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Avitronmotorbird)
v3A=L3A/t3A
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v3A)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Avitronmotorbird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Avitronmotorbird*height_Avitronmotorbird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v3A^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v3A^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t3A)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t3A)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L3A)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L3A)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L3A)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t3A)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t3A) - min(t3A)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2A) - min(L2A)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t3A)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L3A)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t3A)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L3A)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v4A); % Arduinocar
disp ('#1 answer: Best performance is the Arduino Robocar!')
theta_Arduinocar = atan(Opposite_Arduinocar/Adjacent_Arduinocar)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Arduinocar)
v4A=L4A/t4A
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v4A)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Arduinocar*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Arduinocar*height_Arduinocar
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v4A^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v4A^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t4A)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t4A)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L4A)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L4A)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L4A)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t4A)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t4A) - min(t4A)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L4A) - min(L4A)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t4A)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L4A)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t4A)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L4A)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
end
This code is to evaluate all the groups performance. The matlab code is called workv2.
clear all;
close all;
clear;
clc;
% cd('J:\STEAM_matlab_code')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group A - Data Collection ( 5 experiments) %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%% Blue bird
L1A=[3.9 0.01 0.01 0.01 0.01];
t1A=[1 0.01 0.01 0.01 0.01 ];
v1A=L1A/t1A;
%%%% 3D-pen Red bird
L2A=[4 0.01 0.01 0.01 0.01];
t2A=[1 0.01 0.01 0.01 0.01 ];
v2A=L2A/t2A;
%%%% Avitron motor based bird
L3A=[4.12 0.01 0.01 0.01 0.01];
t3A=[1 0.01 0.01 0.01 0.01 ];
v3A=L3A/t3A;
%%%% Arduinocar
L4A=[4.2 0.01 0.01 0.01 0.01];
t4A=[1 0.01 0.01 0.01 0.01];
v4A=L4A/t4A;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group A Trajectory data %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% theory
%%%%%%%%%%%%%%%%%
%%% Blue Bird data
%%%%%%%%%%%%%%%%%
theta=20;
vox=v1A*cos(theta*pi/180);
voy=v1A*sin(theta*pi/180);
g=9.81;
thmax=voy/g;
hmax=voy^2/(2*g);
ttot=2*thmax;
dmax=vox*ttot;
tplot=linspace(0,ttot,200);
x=vox*tplot;
y=voy*tplot-0.5*g*tplot.^2;
%%%%%%%%%%%%%%%%%
%%% 3D pen-Red Bird data
%%%%%%%%%%%%%%%%%
theta2=20;
vox2=v2A*cos(theta2*pi/180);
voy2=v2A*sin(theta2*pi/180);
g=9.81;
thmax2=voy2/g;
hmax2=voy2^2/(2*g);
ttot2=2*thmax2;
dmax2=vox2*ttot2;
tplot2=linspace(0,ttot2,200);
x2=vox2*tplot2;
y2=voy2*tplot2-0.5*g*tplot2.^2;
%%%%%%%%%%%%%%%%%
%%% Avitron Bird data
%%%%%%%%%%%%%%%%%
theta3=20;
vox3=v3A*cos(theta3*pi/180);
voy3=v3A*sin(theta3*pi/180);
g=9.81;
thmax3=voy2/g;
hmax3=voy2^2/(2*g);
ttot3=2*thmax3;
dmax3=vox3*ttot3;
tplot3=linspace(0,ttot3,200);
x3=vox3*tplot3;
y3=voy3*tplot3-0.5*g*tplot3.^2;
%%%%%%%%%%%%%%%%%
%%% Arduinocar data
%%%%%%%%%%%%%%%%%
theta4=19;
vox4=v4A*cos(theta4*pi/180);
voy4=v4A*sin(theta4*pi/180);
g=9.81;
thmax4=voy4/g;
hmax4=voy4^2/(2*g);
ttot4=2*thmax3;
dmax4=vox4*ttot4;
tplot4=linspace(0,ttot4,200);
x4=vox4*tplot4;
y4=voy4*tplot4-0.5*g*tplot4.^2;
subplot(2,2,1);
plot(x,y,'b',...
x2,y2,'r',...
x3,y3,'g',...
x4,y4,'k','Linewidth',3);
str1 = 'Best performance is the Avitron Bird!';
h=text(0,0.13,str1,'Linewidth',5);
s=h.FontSize;
h.FontSize = 12;
set(gca,'FontSize',12);
xlabel('Distance (meters)','FontSize',14);
ylabel('Height (meters)','FontSize',14);
title('Group A - Trajectory of Vehicle','FontSize',18);
legend('Blue Mechanical-Bird',...
'3D-pen Red Mechanical-Bird',...
'Avitron Motor-Bird',...
'Arduinocar');
saveas(gcf,'Theory','jpg');
axis([0 2 0 0.2]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group A Answers 21 %%%%%%
% Questions %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% CONSTANTS GIVEN FOR
% Blue - Bird , 3d-pen Red Bird
% Avitron motor bird & Arduinocar
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cd = 0.3; % FROM ASU WINDTUNNEL
Cl = 0.2; % FROM ASU WINDTUNNEL
rho = 1.223; % [kg/m^3]
A = 2 ; % [m^2]
g = 9.8 ; % [m/s^2]
mass_BlueBird = 6 ; % [grams]
mass_3dpen = 8 ; % [grams]
mass_Avitronmotorbird = 20 ; % [grams]
mass_Arduinocar = 100 ; % [grams]
base_BlueBird = 1 ; % [meters]
base_3dpen = 2 ; % [meters]
base_Avitronmotorbird = 3 ; % [meters]
base_Arduinocar = 4 ; % [meters]
height_BlueBird = 2 ; % [meters]
height_3dpen = 3 ; % [meters]
height_Avitronmotorbird = 4 ; % [meters]
height_Arduinocar = 5 ; % [meters]
Opposite_BlueBird = 8 ; % [meters]
Opposite_3dpen = 7 ; % [meters]
Opposite_Avitronmotorbird = 6 ; % [meters]
Opposite_Arduinocar = 5 ; % [meters]
Adjacent_BlueBird = 5 ; % [meters]
Adjacent_3dpen = 6 ; % [meters]
Adjacent_Avitronmotorbird = 7 ; % [meters]
Adjacent_Arduinocar = 8 ; % [meters]
% #1 , best performance vehicle was
Highest = max ([max(v1A), max(v2A), max(v3A), max(v4A)]);
% hmax = Blue Bird
% hmax2 = 3d-pen
% hmax3 = Avitron motor bird
% hmax4Red = Arduinocar
if Highest == max(v1A); % Blue Bird
disp ('#1 answer: Best performance is the Blue Bird!')
theta_BlueBird = atan(Opposite_BlueBird/Adjacent_BlueBird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_BlueBird)
v1B=L1A/t1A
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v1B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_BlueBird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_BlueBird*height_BlueBird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v1B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v1B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t1A)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t1A)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L1A)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L1A)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L1A)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t1A)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t1A) - min(t1A)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L1A) - min(L1A)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t1A)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L1A)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t1A)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L1A)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v2A); % 3D-pen Red Bird
disp ('#1 answer: Best performance is the 3D-pen Red Bird!')
theta_3dpen = atan(Opposite_3dpen/Adjacent_3dpen)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_3dpen)
v2A=L2A/t2A
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v2A)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_3dpen*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_3dpen*height_3dpen
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v2A^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v2A^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t2A)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t2A)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L2A)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L2A)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L2A)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t2A)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t2A) - min(t2A)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2A) - min(L2A)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t2A)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L2A)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t2A)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L2A)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v3A); % Avitron motor bird
disp ('#1 answer: Best performance is the Avitron Bird!')
theta_Avitronmotorbird = atan(Opposite_Avitronmotorbird/Adjacent_Avitronmotorbird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Avitronmotorbird)
v3A=L3A/t3A
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v3A)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Avitronmotorbird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Avitronmotorbird*height_Avitronmotorbird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v3A^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v3A^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t3A)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t3A)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L3A)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L3A)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L3A)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t3A)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t3A) - min(t3A)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2A) - min(L2A)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t3A)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L3A)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t3A)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L3A)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v4A); % Arduinocar
disp ('#1 answer: Best performance is the Arduino Robocar!')
theta_Arduinocar = atan(Opposite_Arduinocar/Adjacent_Arduinocar)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Arduinocar)
v4A=L4A/t4A
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v4A)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Arduinocar*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Arduinocar*height_Arduinocar
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v4A^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v4A^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t4A)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t4A)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L4A)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L4A)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L4A)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t4A)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t4A) - min(t4A)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L4A) - min(L4A)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t4A)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L4A)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t4A)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L4A)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group B - Data Collection ( 5 experiments) %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%% Blue bird
L1B=[4.12 0.01 0.01 0.01 0.01];
t1B=[1 0.01 0.01 0.01 0.01 ];
v1B=L1B/t1B;
%%%% 3D-pen Red bird
L2B=[4 0.01 0.01 0.01 0.01];
t2B=[1 0.01 0.01 0.01 0.01 ];
v2B=L2B/t2B;
%%%% Avitron motor based bird
L3B=[3.9 0.01 0.01 0.01 0.01];
t3B=[1 0.01 0.01 0.01 0.01 ];
v3B=L3B/t3B;
%%%% Arduinocar
L4B=[4.2 0.01 0.01 0.01 0.01];
t4B=[1 0.01 0.01 0.01 0.01];
v4B=L4B/t4B;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group B Trajectory data %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% theory
%%%%%%%%%%%%%%%%%
%%% Blue Bird data
%%%%%%%%%%%%%%%%%
theta=20;
vox=v1B*cos(theta*pi/180);
voy=v1B*sin(theta*pi/180);
g=9.81;
thmax=voy/g;
hmax=voy^2/(2*g);
ttot=2*thmax;
dmax=vox*ttot;
tplot=linspace(0,ttot,200);
x=vox*tplot;
y=voy*tplot-0.5*g*tplot.^2;
%%%%%%%%%%%%%%%%%
%%% 3D pen-Red Bird data
%%%%%%%%%%%%%%%%%
theta2=20;
vox2=v2B*cos(theta2*pi/180);
voy2=v2B*sin(theta2*pi/180);
g=9.81;
thmax2=voy2/g;
hmax2=voy2^2/(2*g);
ttot2=2*thmax2;
dmax2=vox2*ttot2;
tplot2=linspace(0,ttot2,200);
x2=vox2*tplot2;
y2=voy2*tplot2-0.5*g*tplot2.^2;
%%%%%%%%%%%%%%%%%
%%% Avitron Bird data
%%%%%%%%%%%%%%%%%
theta3=19;
vox3=v3B*cos(theta3*pi/180);
voy3=v3B*sin(theta3*pi/180);
g=9.81;
thmax3=voy2/g;
hmax3=voy2^2/(2*g);
ttot3=2*thmax3;
dmax3=vox3*ttot3;
tplot3=linspace(0,ttot3,200);
x3=vox3*tplot3;
y3=voy3*tplot3-0.5*g*tplot3.^2;
%%%%%%%%%%%%%%%%%
%%% Arduinocar data
%%%%%%%%%%%%%%%%%
theta4=1;
vox4=v4B*cos(theta4*pi/180);
voy4=v4B*sin(theta4*pi/180);
g=9.81;
thmax4=voy4/g;
hmax4=voy4^2/(2*g);
ttot4=2*thmax3;
dmax4=vox4*ttot4;
tplot4=linspace(0,ttot4,200);
x4=vox4*tplot4;
y4=voy4*tplot4-0.5*g*tplot4.^2;
subplot(2,2,2);
plot(x,y,'b',...
x2,y2,'r',...
x3,y3,'g',...
x4,y4,'k','Linewidth',3);
str1 = 'Best performance is the BlueBird!';
h=text(0,0.12,str1,'Linewidth',5);
s=h.FontSize;
h.FontSize = 12;
set(gca,'FontSize',12);
xlabel('Distance (meters)','FontSize',14);
ylabel('Height (meters)','FontSize',14);
title('Group B - Trajectory of Vehicle','FontSize',18);
legend('Blue Mechanical-Bird',...
'3D-pen Red Mechanical-Bird',...
'Avitron Motor-Bird',...
'Arduinocar');
saveas(gcf,'Theory','jpg');
axis([0 2 0 0.2]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group B Answers 21 %%%%%%
% Questions %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% CONSTANTS GIVEN FOR
% Blue - Bird , 3d-pen Red Bird
% Avitron motor bird & Arduinocar
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cd = 0.3; % FROM ASU WINDTUNNEL
Cl = 0.2 ; % FROM ASU WINDTUNNEL
rho = 1.223 ; % [kg/m^3]
A = 2 ; % [m^2]
g = 9.8 ; % [m/s^2]
mass_BlueBird = 6 ; % [grams]
mass_3dpen = 8 ; % [grams]
mass_Avitronmotorbird = 20 ; % [grams]
mass_Arduinocar = 100 ; % [grams]
base_BlueBird = 1 ; % [meters]
base_3dpen = 2 ; % [meters]
base_Avitronmotorbird = 3 ; % [meters]
base_Arduinocar = 4 ; % [meters]
height_BlueBird = 2 ; % [meters]
height_3dpen = 3 ; % [meters]
height_Avitronmotorbird = 4 ; % [meters]
height_Arduinocar = 5 ; % [meters]
Opposite_BlueBird = 8 ; % [meters]
Opposite_3dpen = 7 ; % [meters]
Opposite_Avitronmotorbird = 6 ; % [meters]
Opposite_Arduinocar = 5 ; % [meters]
Adjacent_BlueBird = 5 ; % [meters]
Adjacent_3dpen = 6 ; % [meters]
Adjacent_Avitronmotorbird = 7 ; % [meters]
Adjacent_Arduinocar = 8 ; % [meters]
% #1 , best performance vehicle was
Highest = max ([max(v1B), max(v2B), max(v3B), max(v4B)]);
% hmax = Blue Bird
% hmax2 = 3d-pen
% hmax3 = Avitron motor bird
% hmax4Red = Arduinocar
if Highest == max(v1B) % Blue Bird
disp ('#1 answer: Best performance is the Blue Bird!')
theta_BlueBird = atan(Opposite_BlueBird/Adjacent_BlueBird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_BlueBird)
v1B=L1B/t1B
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v1B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_BlueBird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_BlueBird*height_BlueBird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v1B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v1B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t1B)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t1B)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L1B)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L1B)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L1B)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t1B)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t1B) - min(t1B)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L1B) - min(L1B)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t1B)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L1B)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t1B)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L1B)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v2B) % 3D-pen Red Bird
disp ('#1 answer: Best performance is the 3D-pen Red Bird!')
theta_3dpen = atan(Opposite_3dpen/Adjacent_3dpen)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_3dpen)
v2B=L2B/t2B
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v2B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_3dpen*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_3dpen*height_3dpen
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v2B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v2B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t2B)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t2B)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L2B)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L2B)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L2B)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t2B)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t2B) - min(t2B)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2B) - min(L2B)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t2B)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L2B)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t2B)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L2B)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v3B) % Avitron motor bird
disp ('#1 answer: Best performance is the Avitron Bird!')
theta_Avitronmotorbird = atan(Opposite_Avitronmotorbird/Adjacent_Avitronmotorbird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Avitronmotorbird)
v3B=L3B/t3B
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v3B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Avitronmotorbird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Avitronmotorbird*height_Avitronmotorbird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v3B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v3B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t3B)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t3B)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L3B)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L3B)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L3B)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t3B)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t3B) - min(t3B)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2B) - min(L2B)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t3B)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L3B)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t3B)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L3B)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v4B) % Arduinocar
disp ('#1 answer: Best performance is the Arduino Robocar!')
theta_Arduinocar = atan(Opposite_Arduinocar/Adjacent_Arduinocar)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Arduinocar)
v4B=L4B/t4B
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v4B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Arduinocar*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Arduinocar*height_Arduinocar
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v4B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v4B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t4B)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t4B)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L4B)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L4B)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L4B)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t4B)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t4B) - min(t4B)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L4B) - min(L4B)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t4B)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L4B)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t4B)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L4B)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group C - Data Collection ( 5 experiments) %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%% Blue bird
L1C=[4 0.01 0.01 0.01 0.01];
t1C=[1 0.01 0.01 0.01 0.01 ];
v1C=L1C/t1C;
%%%% 3D-pen Red bird
L2C=[4.12 0.01 0.01 0.01 0.01];
t2C=[1 0.01 0.01 0.01 0.01 ];
v2C=L2C/t2C;
%%%% Avitron motor based bird
L3C=[3.9 0.01 0.01 0.01 0.01];
t3C=[1 0.01 0.01 0.01 0.01 ];
v3C=L3C/t3C;
%%%% Arduinocar
L4C=[4.2 0.01 0.01 0.01 0.01];
t4C=[1 0.01 0.01 0.01 0.01];
v4C=L4C/t4C;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group C Trajectory data %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% theory
%%%%%%%%%%%%%%%%%
%%% Blue Bird data
%%%%%%%%%%%%%%%%%
theta=20;
vox=v1C*cos(theta*pi/180);
voy=v1C*sin(theta*pi/180);
g=9.81;
thmax=voy/g;
hmax=voy^2/(2*g);
ttot=2*thmax;
dmax=vox*ttot;
tplot=linspace(0,ttot,200);
x=vox*tplot;
y=voy*tplot-0.5*g*tplot.^2;
%%%%%%%%%%%%%%%%%
%%% 3D pen-Red Bird data
%%%%%%%%%%%%%%%%%
theta2=20;
vox2=v2C*cos(theta2*pi/180);
voy2=v2C*sin(theta2*pi/180);
g=9.81;
thmax2=voy2/g;
hmax2=voy2^2/(2*g);
ttot2=2*thmax2;
dmax2=vox2*ttot2;
tplot2=linspace(0,ttot2,200);
x2=vox2*tplot2;
y2=voy2*tplot2-0.5*g*tplot2.^2;
%%%%%%%%%%%%%%%%%
%%% Avitron Bird data
%%%%%%%%%%%%%%%%%
theta3=19;
vox3=v3C*cos(theta3*pi/180);
voy3=v3C*sin(theta3*pi/180);
g=9.81;
thmax3=voy2/g;
hmax3=voy2^2/(2*g);
ttot3=2*thmax3;
dmax3=vox3*ttot3;
tplot3=linspace(0,ttot3,200);
x3=vox3*tplot3;
y3=voy3*tplot3-0.5*g*tplot3.^2;
%%%%%%%%%%%%%%%%%
%%% Arduinocar data
%%%%%%%%%%%%%%%%%
theta4=15;
vox4=v4C*cos(theta4*pi/180);
voy4=v4C*sin(theta4*pi/180);
g=9.81;
thmax4=voy4/g;
hmax4=voy4^2/(2*g);
ttot4=2*thmax3;
dmax4=vox4*ttot4;
tplot4=linspace(0,ttot4,200);
x4=vox4*tplot4;
y4=voy4*tplot4-0.5*g*tplot4.^2;
subplot(2,2,3);
plot(x,y,'b',...
x2,y2,'r',...
x3,y3,'g',...
x4,y4,'k','Linewidth',3);
str1 = 'Best performance is the 3D-pen Red Bird!';
h=text(0,0.12,str1,'Linewidth',5);
s=h.FontSize;
h.FontSize = 12;
set(gca,'FontSize',12);
xlabel('Distance (meters)','FontSize',14);
ylabel('Height (meters)','FontSize',14);
title('Group C - Trajectory of Vehicle','FontSize',18);
legend('Blue Mechanical-Bird',...
'3D-pen Red Mechanical-Bird',...
'Avitron Motor-Bird',...
'Arduinocar');
saveas(gcf,'Theory','jpg');
axis([0 2 0 0.2]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group C Answers 21 %%%%%%
% Questions %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% CONSTANTS GIVEN FOR
% Blue - Bird , 3d-pen Red Bird
% Avitron motor bird & Arduinocar
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cd = 0.3; % FROM ASU WINDTUNNEL
Cl = 0.2; % FROM ASU WINDTUNNEL
rho = 1.223; % [kg/m^3]
A = 2; % [m^2]
g = 9.8; % [m/s^2]
mass_BlueBird = 6; % [grams]
mass_3dpen = 8 ; % [grams]
mass_Avitronmotorbird = 20 ; % [grams]
mass_Arduinocar = 100 ; % [grams]
base_BlueBird = 1 ; % [meters]
base_3dpen = 2; % [meters]
base_Avitronmotorbird = 3; % [meters]
base_Arduinocar = 4 ; % [meters]
height_BlueBird = 2 ; % [meters]
height_3dpen = 3; % [meters]
height_Avitronmotorbird = 4 ; % [meters]
height_Arduinocar = 5 ; % [meters]
Opposite_BlueBird = 8 ; % [meters]
Opposite_3dpen = 7 ; % [meters]
Opposite_Avitronmotorbird = 6 ; % [meters]
Opposite_Arduinocar = 5 ; % [meters]
Adjacent_BlueBird = 5 ; % [meters]
Adjacent_3dpen = 6 ; % [meters]
Adjacent_Avitronmotorbird = 7 ; % [meters]
Adjacent_Arduinocar = 8 ; % [meters]
% #1 , best performance vehicle was
Highest = max ([max(v1C), max(v2C), max(v3C), max(v4C)])
% hmax = Blue Bird
% hmax2 = 3d-pen
% hmax3 = Avitron motor bird
% hmax4Red = Arduinocar
if Highest == max(v1C) % Blue Bird
disp ('#1 answer: Best performance is the Blue Bird!')
theta_BlueBird = atan(Opposite_BlueBird/Adjacent_BlueBird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_BlueBird)
v1B=L1C/t1C
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v1B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_BlueBird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_BlueBird*height_BlueBird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v1B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v1B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t1C)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t1C)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L1C)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L1C)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L1C)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t1C)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t1C) - min(t1C)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L1C) - min(L1C)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t1C)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L1C)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t1C)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L1C)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v2C) % 3D-pen Red Bird
disp ('#1 answer: Best performance is the 3D-pen Red Bird!')
theta_3dpen = atan(Opposite_3dpen/Adjacent_3dpen)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_3dpen)
v2B=L2C/t2C
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v2B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_3dpen*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_3dpen*height_3dpen
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v2B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v2B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t2C)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t2C)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L2C)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L2C)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L2C)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t2C)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t2C) - min(t2C)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2C) - min(L2C)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t2C)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L2C)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t2C)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L2C)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v3C) % Avitron motor bird
disp ('#1 answer: Best performance is the Avitron Bird!')
theta_Avitronmotorbird = atan(Opposite_Avitronmotorbird/Adjacent_Avitronmotorbird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Avitronmotorbird)
v3C=L3C/t3C
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v3C)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Avitronmotorbird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Avitronmotorbird*height_Avitronmotorbird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v3C^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v3C^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t3C)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t3C)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L3C)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L3C)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L3C)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t3C)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t3C) - min(t3C)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2C) - min(L2C)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t3C)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L3C)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t3C)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L3C)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v4C) % Arduinocar
disp ('#1 answer: Best performance is the Arduino Robocar!')
theta_Arduinocar = atan(Opposite_Arduinocar/Adjacent_Arduinocar)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Arduinocar)
v4C=L4C/t4C
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v4C)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Arduinocar*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Arduinocar*height_Arduinocar
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v4C^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v4C^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t4C)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t4C)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L4C)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L4C)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L4C)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t4C)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t4C) - min(t4C)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L4C) - min(L4C)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t4C)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L4C)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t4C)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L4C)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group D - Data Collection ( 5 experiments) %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%% Blue bird
L1D=[3.9 0.01 0.01 0.01 0.01];
t1D=[1 0.01 0.01 0.01 0.01 ];
v1D=L1D/t1D;
%%%% 3D-pen Red bird
L2D=[4 0.01 0.01 0.01 0.01];
t2D=[1 0.01 0.01 0.01 0.01 ];
v2D=L2D/t2D;
%%%% Avitron motor bDsed bird
L3D=[4.2 0.01 0.01 0.01 0.01];
t3D=[1 0.01 0.01 0.01 0.01];
v3D=L3D/t3D;
%%%% ArduinocDr
L4D=[4.6 0.01 0.01 0.01 0.01];
t4D=[1 0.01 0.01 0.01 0.01 ];
v4D=L4D/t4D;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group D Trajectory data %%%%%%
% %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% theory
%%%%%%%%%%%%%%%%%
%%% Blue Bird data
%%%%%%%%%%%%%%%%%
theta=20;
vox=v1D*cos(theta*pi/180);
voy=v1D*sin(theta*pi/180);
g=9.81;
thmax=voy/g;
hmax=voy^2/(2*g);
ttot=2*thmax;
dmax=vox*ttot;
tplot=linspace(0,ttot,200);
x=vox*tplot;
y=voy*tplot-0.5*g*tplot.^2;
%%%%%%%%%%%%%%%%%
%%% 3D pen-Red Bird data
%%%%%%%%%%%%%%%%%
theta2=20;
vox2=v2D*cos(theta2*pi/180);
voy2=v2D*sin(theta2*pi/180);
g=9.81;
thmax2=voy2/g;
hmax2=voy2^2/(2*g);
ttot2=2*thmax2;
dmax2=vox2*ttot2;
tplot2=linspace(0,ttot2,200);
x2=vox2*tplot2;
y2=voy2*tplot2-0.5*g*tplot2.^2;
%%%%%%%%%%%%%%%%%
%%% Avitron Bird data
%%%%%%%%%%%%%%%%%
theta3=19;
vox3=v3D*cos(theta3*pi/180);
voy3=v3D*sin(theta3*pi/180);
g=9.81;
thmax3=voy2/g;
hmax3=voy2^2/(2*g);
ttot3=2*thmax3;
dmax3=vox3*ttot3;
tplot3=linspace(0,ttot3,200);
x3=vox3*tplot3;
y3=voy3*tplot3-0.5*g*tplot3.^2;
%%%%%%%%%%%%%%%%%
%%% Arduinocar data
%%%%%%%%%%%%%%%%%
theta4=17.4;
vox4=v4D*cos(theta4*pi/180);
voy4=v4D*sin(theta4*pi/180);
g=9.81;
thmax4=voy4/g;
hmax4=voy4^2/(2*g);
ttot4=2*thmax3;
dmax4=vox4*ttot4;
tplot4=linspace(0,ttot4,200);
x4=vox4*tplot4;
y4=voy4*tplot4-0.5*g*tplot4.^2;
subplot(2,2,4);
plot(x,y,'b',...
x2,y2,'r',...
x3,y3,'g',...
x4,y4,'k','Linewidth',3);
str1 = 'Best performance is the ArduinoCar';
h=text(0,0.12,str1,'Linewidth',5);
s=h.FontSize;
h.FontSize = 12;
set(gca,'FontSize',12);
xlabel('Distance (meters)','FontSize',14);
ylabel('Height (meters)','FontSize',14);
title('Group D - Trajectory of Vehicle','FontSize',18);
legend('Blue Mechanical-Bird',...
'3D-pen Red Mechanical-Bird',...
'Avitron Motor-Bird',...
'Arduinocar');
saveas(gcf,'Theory','jpg');
axis([0 2 0 0.2]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%
% Group D Answers 21 %%%%%%
% Questions %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% CONSTANTS GIVEN FOR
% Blue - Bird , 3d-pen Red Bird
% Avitron motor bird & Arduinocar
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cd = 0.3; % FROM ASU WINDTUNNEL
Cl = 0.2 ; % FROM ASU WINDTUNNEL
rho = 1.223 ; % [kg/m^3]
A = 2 ; % [m^2]
g = 9.8 ; % [m/s^2]
mass_BlueBird = 6 ; % [grams]
mass_3dpen = 8 ; % [grams]
mass_Avitronmotorbird = 20 ; % [grams]
mass_Arduinocar = 100 ; % [grams]
base_BlueBird = 1 ; % [meters]
base_3dpen = 2 ; % [meters]
base_Avitronmotorbird = 3 ; % [meters]
base_Arduinocar = 4 ; % [meters]
height_BlueBird = 2 ; % [meters]
height_3dpen = 3 ; % [meters]
height_Avitronmotorbird = 4 ; % [meters]
height_Arduinocar = 5 ; % [meters]
Opposite_BlueBird = 8 ; % [meters]
Opposite_3dpen = 7 ; % [meters]
Opposite_Avitronmotorbird = 6 ; % [meters]
Opposite_Arduinocar = 5 ; % [meters]
Adjacent_BlueBird = 5 ; % [meters]
Adjacent_3dpen = 6 ; % [meters]
Adjacent_Avitronmotorbird = 7 ; % [meters]
Adjacent_Arduinocar = 8 ; % [meters]
% #1 , best performance vehicle was
Highest = max ([max(v1D), max(v2D), max(v3D), max(v4D)])
% hmax = Blue Bird
% hmax2 = 3d-pen
% hmax3 = Avitron motor bird
% hmax4Red = Arduinocar
if Highest == max(v1D) % Blue Bird
disp ('#1 answer: Best performance is the Blue Bird!')
theta_BlueBird = atan(Opposite_BlueBird/Adjacent_BlueBird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_BlueBird)
v1B=L1D/t1D
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v1B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_BlueBird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_BlueBird*height_BlueBird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v1B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v1B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t1D)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t1D)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L1D)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L1D)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L1D)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t1D)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t1D) - min(t1D)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L1D) - min(L1D)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t1D)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L1D)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t1D)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L1D)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v2D) % 3D-pen Red Bird
disp ('#1 answer: Best performance is the 3D-pen Red Bird!')
theta_3dpen = atan(Opposite_3dpen/Adjacent_3dpen)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_3dpen)
v2B=L2D/t2D
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v2B)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_3dpen*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_3dpen*height_3dpen
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v2B^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v2B^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t2D)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t2D)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L2D)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L2D)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L2D)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t2D)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t2D) - min(t2D)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2D) - min(L2D)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t2D)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L2D)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t2D)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L2D)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v3D) % Avitron motor bird
disp ('#1 answer: Best performance is the Avitron Bird!')
theta_Avitronmotorbird = atan(Opposite_Avitronmotorbird/Adjacent_Avitronmotorbird)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Avitronmotorbird)
v3D=L3D/t3D
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v3D)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Avitronmotorbird*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Avitronmotorbird*height_Avitronmotorbird
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v3D^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v3D^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t3D)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t3D)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L3D)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L3D)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L3D)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t3D)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t3D) - min(t3D)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L2D) - min(L2D)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t3D)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L3D)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t3D)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L3D)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
elseif Highest == max(v4D) % Arduinocar
disp ('#1 answer: Best performance is the Arduino Robocar!')
theta_Arduinocar = atan(Opposite_Arduinocar/Adjacent_Arduinocar)*(180/pi) % [degrees]
fprintf('#2 answer: The angle was %4.2f Degrees \n',theta_Arduinocar)
v4D=L4D/t4D
fprintf('#3 answer: The average velocity from experimental data was %4.2f m/s \n',v4D)
Maxdistance_horizontal = max ([y, y2, y3, y4])
fprintf('#4 answer: The max height traveled was %4.2f Meters \n',Maxdistance_horizontal)
Maxheight_vertical = max ([x, x2, x3, x4])
fprintf('#5 answer: The max distance traveled was %4.2f Meters \n',Maxheight_vertical)
Weight = mass_Arduinocar*g
fprintf('#6 answer: The weight of the bird was %4.2f Pounds \n',Weight)
Surfacearea = 0.5*base_Arduinocar*height_Arduinocar
fprintf('#7 answer: The surfae area of the triangular wing was %4.2f m^2 \n',Surfacearea)
D = 0.5*rho*v4D^2*A*Cd
fprintf('#8 answer: The drag force on the bird was %4.2f Netwons\n',D)
L = 0.5*rho*v4D^2*A*Cl
fprintf('#9 answer: The lift force on the bird was %4.2f Netwons\n',L)
Maxtime = max(t4D)
fprintf('#10 answer: The maximum time the bird traveled was %4.2f seconds\n',Maxtime)
Mintime = min(t4D)
fprintf('#11 answer: The minimum time the bird traveled was %4.2f seconds\n',Mintime)
Maxdistance = max(L4D)
fprintf('#12 answer: The maximum distance the bird traveled was %4.2f meters\n',Maxdistance)
Mindistance = min(L4D)
fprintf('#13 answer: The minimum distance the bird traveled was %4.2f meters\n',Mindistance)
Averagedistance = mean(L4D)
fprintf('#14 answer: The average distance the bird traveled was %4.2f meters\n',Averagedistance)
Averagetime = mean(t4D)
fprintf('#15 answer: The average time the bird traveled was %4.2f seconds\n',Averagetime)
Rangetime = max(t4D) - min(t4D)
fprintf('#16 answer: The range of the time the bird traveled was %4.2f seconds\n',Rangetime)
Rangedistance = max(L4D) - min(L4D)
fprintf('#17 answer: The range of the distance the bird traveled was %4.2f meters\n',Rangedistance)
Mediantime = median(t4D)
fprintf('#18 answer: The median of the time the bird traveled was %4.2f seconds\n',Mediantime)
Mediandistance = median(L4D)
fprintf('#19 answer: The median of the distance the bird traveled was %4.2f meters\n',Mediandistance)
Modetime = mode(t4D)
fprintf('#20 answer: The mode of the time the bird traveled was %4.2f seconds\n',Modetime)
Modedistance = mode(L4D)
fprintf('#21 answer: The mode of the distance the bird traveled was %4.2f meters\n',Modedistance)
end