Cody

Problem 1846. Free Fall analytical solution (Chapra 2012 textbook Example 1.1)

Solution 310466

Submitted on 26 Aug 2013 by Tobias Schäfer
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% AOE 2074 Week 1 -- Cody Example % Chapra Example 1.1 % Analytical Solution to the Bungee Jumper Problem % Initialize state variable, time (t), parameters (p), and right-side force (f) % Time, t, is a vector of values taken from the table on page 8 of Chapra's textbook. t = 0:2:12; % seconds % Parameters are the bungee jumper's mass (m) and drag coefficient (c_d) m = 68.1; % kg c_d = 0.25; % kg/m % Right-hand-side force is the gravitational force with gravitational constant (g) g = 9.81; % m/s^2 % Compute analytical solution for velocity (downward speed) at given values of time. v = Chapra_Example_1p1_velocity( t, m, c_d, g ); % Check error against textbook solution given in table on page 8. Velocity = [0 18.7292 33.1118 42.0762 46.9575 49.4214 50.6175]; assert(norm(Velocity-v(:),inf)<1e-4)

ans = 0 18.7292 33.1118 42.0762 46.9575 49.4214 50.6175

2   Pass
%% Steady-state solution v = Chapra_Example_1p1_velocity( inf, 68.1, 0.25, 9.81 ); assert(abs(v-51.6938)<1e-4)

ans = 51.6938

3   Pass
%% Chapra Example 1.1 for t=30 v = Chapra_Example_1p1_velocity( 30, 68.1, 0.25, 9.81 ); assert(abs(v-51.6926)<1e-4)

ans = 51.6926

4   Pass
%% Cheating check assert(isempty(regexp(fileread('Chapra_Example_1p1_velocity.m'),'assert.m','once')))

Suggested Problems

More from this Author17

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!