AMME2500 Assignment 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Subject: AMME 2500

SID: 440376024

Date: 27/3/21

Question 1.i Euler integration function.


function [t,s,v] = euler_intergration2(y,yp,m)

% gravity, air drag and density constants


g = 9.81;
pd = 1.226;

% Time increment
dt = 0.05;

% time period
t = 0:dt:(y/25);

% Vector with amount of time and vector with velocity at each time
s = zeros(1,length(t));
v = zeros(1,length(t));

% set the initial values for v and s


v(1) = 0;
s(1) = y;

% flag to choose between models


if m == 0
% Use Euler's method to solve for velocity and position over
time
% Using a for loop start at k = 2
for k = 2:(length(t))
% initalize the switch for kd at s = 500
if s(k-1) <= yp
kd = 0.15;
else
% kd when parachute deploys
kd = 0.003;
end

% Find acceleration due to gravity while accoutning for drag


ak = kd*pd*(v(k-1).^2) - g;
% Find velocity and acceleration knowing ds = v(k) and dv =
ak
% perform Euler's integration for velocity and acceleration
v(k) = v(k-1)+ak*dt;
s(k) = s(k-1) + v(k-1)*dt;
end
elseif m == 1
% Use Euler's method to solve for velocity and position over
time
% using a for loop, Start at k = 2
for k = 2:(length(t))
% determine the standard atmospheric model results
T = 15.04 -0.00649*s(k-1);
Ps = 101.29*(((273.1+T)/288.08).^5.256);
p = Ps/(0.2869*(T+273.1));
% initialize the switch for kd at s = 500
if s(k-1) <= yp
kd = 0.15;
else
% kd when parachute deploys
kd = 0.003;
end

% Find acceleration due to gravity while accouting for drag


ak = kd*p*(v(k-1).^2) - g;
% Discover velocity and acceleration knowing ds = v(k) and
dv = ak
% perform Euler's integration for velocity and acceleration
v(k) = v(k-1) + ak*dt;
s(k) = s(k-1) + v(k-1)*dt;
end
else
% return an error message if m = 0 or m = 1 is not used
error('please select 0 or 1 for model A or B respectively')
end
end

Question 1.ii and 1.iii Graph the models and use the functions
% clear workspace
clear;
clc;
clf;

% Initialization of function inputs Height Parachute deployment and


model
% number 0 == A and 1 == B
y = 4000;
yp = 500;
m = 0;

% Call Euler's integration function for model A


[t1,s1,v1]= euler_intergration2(y,yp,m);

% Obtain a set of vectors again for model B by letting m = 1


m = 1;
[t2,s2,v2] = euler_intergration2(y,yp,m);

% Graph Velocity vs time using the plot function model A in blue


figure(1)
plot(t1,v1,'b')
hold on
% Plot the second line of velocity vs. time Model B in red
plot(t2,v2,'r');
% title and label each aspect of the graph including axis and lines
% labelled, legends and units specified
title('Velocity vs. Time')
ylabel('Velocity (ms)')
xlabel('Time (s)')
legend('Model A','Model B','Location','East')
grid on

% Graph altitude vs time using model A in blue


figure(2)
plot(t1,s1,'b')
hold on
% Plot model B using red onto the altitude vs. time graph
plot(t2,s2,'r');
% title and label each aspect of the graph including axis and lines
% labelled legends and units specified
title('Altitude vs. Time')
ylabel('Altitude (m)')
xlabel('Time (s)')
legend('Model A','Model B','Location','East')
grid on

% Q1iii determine the maximum free fall possible using Q1i function
% complete for range 1000m to 4000m
% record the time taken to hit the ground for each simulation run
% two curves in one figure one using Model A and One Model B

% set parachute free jumping


yp = 0;
% set a range of values between 1000 and 4000
yt = 1000:1:4000;

% initialize an empty vector with time values time test = tt


t_model = zeros(2,length(yt));

% run a loop to obtain different times for each range


% test results for both model A and B 0 and 1 respectively
for m = 0:1
% obtain time for each iteration of height
for i = 1:length(yt)
[t3,s3,v3] = euler_intergration2(yt(i),yp,m);
% determine the first instance the object has landed by
finding
% when the height first goes negative
f = find(s3<=0,1);
% let this be the position at which t3 is extracted the time
when
% s(k) first goes negative
t_model(m+1,i) = t3(f);
end
end
hold off
% Create a third figure and plot the time to hit the ground as a
function
% of time
figure(3)
plot(yt,t_model);
% Title and label each aspect of the graph including axis and lines
% labelled, legends and units specified
title('Time vs. Jump Altitude')
xlabel('Altitude (m)')
ylabel('Time (s)')
legend('Model A','Model B','Location','East')
grid on

Figure 1

Figure 2
Figure 3

Question 1.iv

Terminal velocity is the constant velocity attained when the forces of gravity are in equilibrium with
forces opposing and aiding an objects gravitational descent such as drag and atmospheric density
respectively.

Based on the plots found using Euler’s Integration method. It is evident that the amount of drag in
both models brings the sky diver to a constant terminal velocity of approx. -52m/s in model A.
further to this, Figure 1 Model B shows that reduced atmospheric density at higher altitudes has the
further effect of increasing the rate of descent of the sky diver in Model B. Further to this we see that
as the atmospheric density getting closer to the earth increases that rate of descent slows at a
constant rate from time 18s to 60s.

The parachute deployment at y=500m also has the immediate effect of increasing the drag of the
skydiver against gravity and hence changes the terminal velocity to a constant rate of approx. 7.5m/s,
at this point it is evident that the effect of Model B atmospheric density is now negligible. The
increase of drag at y = 500m is further emphasised in figure 2 as the steepness of the gradient in both
models change becoming less steep suggesting a slowly rate of descent.

In both figures 1 and 2 model B indicated that the effect of reduced atmospheric density reduces the
time taken for the skydiver to reach the ground. We can conclude model B to be a more accurate
depiction of the skydivers descent in terms of experience with both density and drag and its effect of
terminal velocity.

You might also like