Where is the mistake in this solution

  • Thread starter Thread starter bksree
  • Start date Start date
  • Tags Tags
    Mistake
AI Thread Summary
The discussion centers on a bungee jumper problem analyzed using MATLAB, where two different conventions for direction are applied. The first solution assumes downward as positive, yielding a time of 9.5475 seconds to hit the ground, while the second solution, assuming upward as positive, incorrectly calculates a time of 8.0142 seconds. The key mistake identified is in the formulation of the differential equation, particularly in how forces are treated and the incorrect sign conventions used for the forces. The participants clarify that the equation should reflect the correct relationship between forces and mass, leading to confusion regarding the drag coefficient's role. Ultimately, the error lies in the misapplication of force direction and the resulting equations used in the MATLAB code.
bksree
Messages
75
Reaction score
2
This is a solved example in the book 'Applied numerical methods with MATLAB by Chapra'

A bungee jumper jumps off a cliff 200 m high with an upward velocity of 20 m/s. Detemine when he hits the ground and plot dist vs time and velocity vs time.

The problem is solved in the book using MATLAB as below :
Assuming DOWNWARD direction is positive (i.e. distance (y), velocity (v) and force are positive downards, and x = 0 at ground levele. the boundary conditions are : x(0) = -200 m/s, v(0) = -20 m/s

The diff eqn being solved is : md2y/dt2 = Fdown - F up = mg - cd / m * v^2

The following functions are written

1. Function for derivative --- Here
function dydt=freefall(t,y,cd,m)
% y(1) = x and y(2) = v
grav=9.81;
dydt=[y(2);grav-cd/m*y(2)*abs(y(2))];

2. Function to detect event of hitting the ground
function [detect,stopint,direction]=endevent(t,y,varargin)
% Locate the time when height passes through zero
% and stop integration.
detect=y(1); % Detect height = 0
stopint=1; % Stop the integration
direction=0; % Direction does not matter

3. Script file to run the problem
opts=odeset('events',@endevent);
y0=[-200 -20];
[t,y,te,ye]=ode45(@freefall,[0 inf],y0,opts,0.25,68.1);
te,ye
plot(t,y(:,1),'-',t,y(:,2),'--','LineWidth',2)
legend('Height (m)','Velocity (m/s)')
xlabel('time (s)');
ylabel('x (m) and v (m/s)')

The answer for this is : jumper hits the ground after 9.5475 s at 46.2454 m/s (downward)

====================================================================================
I am trying to solve THE SAME problem using the following convention :

Assuming UPWARD direction is positive (i.e. distance (y), velocity (v) and force are positive downards, and x = 0 at ground levele. the boundary conditions are : x(0) = 200 m, v(0) = 20 m/s

The diff eqn being solved is : md2y/dt2 = -Fdown + F up = -mg + cd / m * v^2

The following functions are written

1. Function for derivative
function dydt=freefall(t,y,cd,m)
% y(1) = x and y(2) = v
grav=9.81;
dydt=[y(2);-grav + cd/m*y(2)*abs(y(2))];

2. Function to detect event of hitting the ground
function [detect,stopint,direction]=endevent(t,y,varargin)
% Locate the time when height passes through zero
% and stop integration.
detect=y(1); % Detect height = 0
stopint=1; % Stop the integration
direction=0; % Direction does not matter

3. Script file to run the problem
opts=odeset('events',@endevent);
y0=[200 20];
[t,y,te,ye]=ode45(@freefall,[0 inf],y0,opts,0.25,68.1);
te,ye
plot(t,y(:,1),'-',t,y(:,2),'--','LineWidth',2)
legend('Height (m)','Velocity (m/s)')
xlabel('time (s)');
ylabel('x (m) and v (m/s)')

The answer for this is : jumper hits the ground after 8.0142 s at -104.8502 m/s (downward)

I am unable to spot the error. Will someone please explain where the mistake is ?

TIA
 
Physics news on Phys.org
bksree said:
The diff eqn being solved is : md2y/dt2 = Fdown - F up = mg - cd / m * v^2
I assume that "cd" is the coefficient of drag. Why would this contribution to force be divided by mass?

Certainly if you cast the equation in terms of acceleration, you would want to divide by mass. But you are casting this as a force equation.
 
Thanks for the reply. As you have pointed out there is a typo in the eqn.
The eqn being solved is d2y/dt2 = 1/m (Fdown - F up) = g - cd / m * v^2
This is the eqn that is coded.

TIA
 
Back
Top