{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

skydiver_func4 - t = input'Enter time vector in s desc =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 function v = skydiver_func4 % Function to calculate skydiver falling speed % for specified parameter values and time vector % using the analytic solution. % % Inputs: mass m (kg) % gravity g (m/s^2) % drag coefficient c (kg/m) % time vector (s) % All inputs are provided interactively. % % Outputs: falling speed vector v (m/s) % Read inputs m = input('Enter mass in kg: ') g = input('Enter gravity in m/s^2: ') c = input('Enter drag coefficient in kg/m: ')
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t = input('Enter time vector in s: ') desc = input('Enter a description of this analysis: ','s') % Display inputs to verify that they are correct m disp(g) c disp('Size of time vector is') disp(size(t)) disp(desc) pause % Calculate falling speed v = sqrt(m*g/c)*tanh(sqrt(g*c/m)*t) % Output final time and falling speed npts = size(t,1) tf = t(npts,1) vf = v(npts,1) disp('Final falling speed in m/s:') disp(vf)...
View Full Document

{[ snackBarMessage ]}