Where is the mistake in this solution

  • Context: Graduate 
  • Thread starter Thread starter bksree
  • Start date Start date
  • Tags Tags
    Mistake
Click For Summary
SUMMARY

The forum discussion centers on a bungee jumper simulation using MATLAB, specifically addressing discrepancies in the equations of motion for two different conventions of direction. The original solution, based on downward as positive, yields a time of 9.5475 seconds and a velocity of 46.2454 m/s upon impact. The alternate approach, assuming upward as positive, incorrectly calculates the time to hit the ground as 8.0142 seconds with a velocity of -104.8502 m/s. The error is identified as a typo in the differential equation, which should be expressed as d²y/dt² = (1/m)(Fdown - Fup) = g - (cd/m)v².

PREREQUISITES
  • Understanding of MATLAB programming, specifically version R2021a or later.
  • Familiarity with ordinary differential equations (ODEs) and their numerical solutions.
  • Knowledge of physics concepts such as forces, acceleration, and drag coefficients.
  • Experience with MATLAB's ODE solver, ode45, and event detection functions.
NEXT STEPS
  • Review MATLAB's documentation on the ode45 function for solving ODEs.
  • Study the effects of drag on falling objects, focusing on the role of the drag coefficient (cd).
  • Learn about event detection in MATLAB ODEs, particularly the use of the 'events' option in ode45.
  • Explore numerical methods for solving differential equations in MATLAB, including stability and accuracy considerations.
USEFUL FOR

This discussion is beneficial for physicists, engineers, and MATLAB users involved in simulations of motion under the influence of forces, particularly those interested in bungee jumping dynamics and numerical methods for solving differential equations.

bksree
Messages
75
Reaction score
3
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
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
1K
Replies
12
Views
2K
  • · Replies 38 ·
2
Replies
38
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
11
Views
2K
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K