Documente Academic
Documente Profesional
Documente Cultură
Its height h
(in m) after t seconds is given by
1
g
gt
h = v0 + (1 e rt )
r
r
r
where r is a drag coefficient and g is 9.81 m/s2.
If r = 0.35 s-1 and v0 = 78 m/s
(i) When will be object be 80m above the ground?
(ii) When will the object hit the ground?
(iii) What maximum height will be attained?
A good first step in solving the problem is to implement the key equation as a
function m-file (although its admittedly on the simple side and an anonymous
function could also be used).
function [ height ] = objectHeight( v0, r, t )
% OBJECTHEIGHT Calculates height of an object shot vertically.
% Inputs: v0 = initial velocity (in m/s)
%
r = drag coefficient (in 1/s)
%
t = time (in s), cannot be zero
% Outputs: height = height of object
if r == 0
error ('zero drag coefficients are not allowed');
end
g = 9.81; % gravity
height = (1 / r) * (v0 + g/r) * (1 - exp(-r * t)) - g * t / r;
end
120
100
Height (metres)
80
60
40
20
0
-20
-40
0
6
Time (seconds)
10
12
One possibility is to differentiate the height equation and set the result equal to
zero.
dh 1
g rt g
= v0 + (re )
dt r
r
r
D
max tension
L
T0
If the cable is very short (L not much bigger than D) it will also be very tight.
If the cable is very long it will also be very heavy and this weight must be supported.
The length that we want will be somewhere between these extremes.
mg D
2T0
L=
sinh
mg
T0 2
mgD
TMAX = T0 cosh
2T0
where
D
max tension
L
T0
The first step in solving the problem is to write a function that that given If L, m,
and D computes and returns TMAX.
Once this function exists the effects of varying L can be investigated and the value
of L that minimizes the maximum tension can be found.
The function must do two things:
1/. Use the first equation and root finding to determine T0
mg D
2T0
L = 0
F (T0 ) =
sinh
mg
T0 2
2/. Use T0 and the second equation to determine TMAX
The limits for fminbnd can be found by graphing the function and observing the
approximate location of the minimum (maxTensionDemo1, below).
D = 100; m = 5;
Tfunc = @(L) maxTension (L, m, D);
fplot (Tfunc, [D * 1.01, D * 2]);
grid on;
xlabel ('Length (metres)');
ylabel ('Max tension (Newtons)');
% Limits found by examining graph
bestL = fminbnd (Tfunc, 100, 140);
fprintf ('Best length is %4.2fm.\n', bestL);
fprintf ('Max tension is %4.2fN.\n', Tfunc(bestL));