You are on page 1of 1

% Constants

g = 9.8; % acceleration due to gravity in m/s^2


c = 15; % drag coefficient in kg/s
v = 35; % velocity in m/s
t = 9; % time in seconds
epsilon = 0.001; % tolerance level

% Function for the velocity of a falling parachutist


f = @(m) (g*m/c)*(1 - exp(-c*t/m)) - v;

% Initial guesses for the secant method


m0 = 50; % initial guess 1 for mass
m1 = 60; % initial guess 2 for mass

% Secant Method
while abs(m1-m0) >= epsilon
m2 = m1 - (f(m1)*(m1-m0))/(f(m1)-f(m0));
m0 = m1;
m1 = m2;
end

% The mass m
m = m1;
fprintf('The value of mass m is %.2f kg\n', m);

The value of mass m is 59.84 kg

Published with MATLAB® R2015a

You might also like