0% found this document useful (0 votes)
18 views

Cs Report Final

This document summarizes modeling and simulation work on optimal baseball trajectories and bungee jumping. It describes modeling a baseball's flight and optimizing launch angle and velocity to clear Fenway Park's Green Monster wall. The minimum velocity found was 41.039 m/s at an angle of 43.1 degrees. It also models a basketball shot, finding an optimal angle of 74 degrees and minimum speed of 15.339 m/s. Finally, it models bungee jumping to determine the minimum wire length for a record 80m bungee dunk.

Uploaded by

Baishali Sur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Cs Report Final

This document summarizes modeling and simulation work on optimal baseball trajectories and bungee jumping. It describes modeling a baseball's flight and optimizing launch angle and velocity to clear Fenway Park's Green Monster wall. The minimum velocity found was 41.039 m/s at an angle of 43.1 degrees. It also models a basketball shot, finding an optimal angle of 74 degrees and minimum speed of 15.339 m/s. Finally, it models bungee jumping to determine the minimum wire length for a record 80m bungee dunk.

Uploaded by

Baishali Sur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Modelling and simulation of Optimal baseball problem and Bungee jumping

Baishali Sur, Roll-2111240, Int. M.Sc


(Dated: November 26, 2023)

I. AIMS OF THE PROJECT 2. We’ll create a params object with all the parameters
we need. We keep the drag coefficient fixed, at 0.33 which
The aims of this project are: is average for a baseball.
1. To model the flight of a baseball, and taking a specific 3. We will use a system object that makes a system
example, apply optimization. with these parameters.
2. Modelling and finding the parameters for a bungee 4. We will use a function that computes the drag force,
dunk. as a function of the velocity and acting on the opposite
direction of the velocity. The formula of the drag force
will be:
II. INTRODUCTION ρ × v 2 × Cd × Area
Fdrag =
2
We are curious about the characteristics of a real-world
system that piques our curiosity. Real-world systems are 5. Then we create slope function which basically re-
frequently quite complex, therefore we must choose which turns the total velocity and acceleration of the ball.
aspects to exclude; this process is known as abstraction. 6. Next, we construct an event function that returns
An abstraction produces a model, which is a description the position coordinate and accepts the same inputs as
of the system that only contains the elements we deem the slope function. The simulation ends as soon as the
necessary. Equations and diagrams are two ways that a coordinate crosses 0.
model can be represented and utilized in mathematical 7. And then we run the simulation, and plot the tra-
analysis. It can also be put into practice as a computer jectory.
software that is capable of simulating situations. An ex- The trajectory looks like:
planation for the system’s behavior, a prediction about
what the system will do, or a purpose-driven design could
be the outcome of analysis and simulation. According to
the optimization principle, an entity will behave in a way
that maximizes the value of a particular combination of
abstract functions while taking certain limitations into
account.

III. THE BASEBALL PROBLEM

A. The results of the original project

In this project, we first learn about simulating a base-


ball flight, without which the optimization problem alone FIG. 1: The trajectory of a baseball
cannot be solved. In all of these problems, we take some
assumptions which help us simplify the problem. In this
case, the assumptions are:
1. Any potential spin on the ball and the ensuing Magnus B. The Manny Ramirez problem with results
force are disregarded. Since the ball moves on a vertical
plane under this supposition, two dimensions will be used Now we implement our optimization, with the help of
for simulations instead of three. a specific example.
2. First, let’s look at a straightforward model in which In Boston, Massachusetts, there is a baseball stadium
the drag coefficient is independent of velocity. called Fenway Park. The "Green Monster," a wall in left
The steps are: field that is exceptionally near to home plate—just 310
1. We’ll need a vector object for this. A Vector object, feet away—is one of its most well-known characteristics.
which represents a vector quantity, is provided by the At 37 feet, the wall is particularly high to make up for
ModSim library. Similar to a NumPy array, a Vector the short distance. The goal is to determine the lowest
object is made up of elements that correspond to the ball speed and ideal angle that will allow a ball to clear
vector’s constituent parts. home plate and still cross the Green Monster.
2

We’ll proceed in the following steps: D. Additional: The basketball problem


1. We will determine the ideal launch angle, or the angle
at which the ball should leave home plate to maximize
its height upon hitting the wall, for a given velocity.
2. After that, assuming it has the ideal launch angle, we For doing something extra, I tried to do the same
will determine the lowest velocity that clears the wall. thing I did for the baseball optimization problem, find
the optimal angle and the minimum velocity that gets
The steps are: the ball past the hoop. I have followed the same pro-
We again create a params object to store all the pa- cedure, with the parameters from an average basketball,
rameters. Next, we write a height function that takes and the height of an average basketball player and the
a launch angle, simulates the flight of a baseball, and distance and height of a basketball hoop.
returns the height of the baseball when it reaches the
wall. Now, we use the maximize scalar function to find The results are: The optimal angle here is around 74
the optimal angle. Now, let’s find the initial speed that degrees, and the minimum speed is 15.339 m/s. The
makes the height at the wall exactly 37 feet, given that trajectory is:
it’s launched at the optimal angle. This is a root-finding
problem, so we’ll use root scalar function. We Write an
error function that takes a speed and a System object
as parameters. It uses a maximize scalar to find the
highest possible height of the ball at the wall for the
given speed. Then, it returns the difference between that
optimal height and wall height, a parameter in params.
Then, we use root scalar to find the answer to the prob-
lem, the minimum speed that gets the ball out of the
park.
The answer for the minimum speed here is
41.039294634028856 m/s and the optimal angle here is
43.105080979149434 degrees.
The trajectory of the ball is:

FIG. 3: Trajectory of a basketball

E. Questions asked during session

FIG. 2: Trajectory of the ball with optimal velocity and


launched with optimal angle, until it reaches the wall
1. Introducing velocity dependent drag coefficient into the
problem:

C. Excercises Previously, we took the assumption that the drag co-


efficient of the baseball was not velocity dependent for
In this case, finishing off the Manny Ramirez problem simplicity, now we introduce velocity-dependent drag co-
was itself the excercise, with finding the angle and range. efficient.
With it, I have finished the problem and found the opti-
mal angle and velocity as described before, and plotted The following figure shows drag coefficient as a func-
the trajectory. tion of velocity.
3

FIG. 6: Trajectory for velocity-dependent drag coeffi-


cient

FIG. 4 For the Manny Ramirez optimization problem, 44.2353


is the optimal angle and 41.039 is the minimum velocity.
The range decreases by 1.42 m.
The trajectory is:

Using an online graph digitizer to extract the data and


plotting it, we get the following curve:

FIG. 7: Trajectory for Manny Ramirez problem with ve-


locity dependent drag coefficient

IV. BUNGEE JUMPING: BUNGEE DUNK

FIG. 5: Velocity vs Drag coefficient A. The results of the original project

In this project, we will model a bungee dunk and find


out the minimal length of wire to make a certain length
of jump. A Bungee Dunk is a stunt where a person who
is jumping from bungees dunks a cookie into a cup of tea
We now modify our model to include the velocity de- at the bottom of the leap. We aim to set a record for the
pendent drag coefficient and see how much it affects our longest Bungee Dunk: i.e., 80 meters. For this, we start
results. with the following modeling assumptions:
1. At first, the attachment point of the bungee rope is
We modify the drag force function to include the ve- 80 meters above a cup of tea and it is suspended from a
locity dependent drag coefficient. crane.
2. The jumper is not exerted with any force until the
We see, that with inclusion of velocity dependent drag rope is fully extended. We’ll look at this assumption
coefficient, for the normal baseball projection, the range again in the case study that follows, but it turns out it
of it decreases by 8.95 or almost 9 meters. might not be reasonable.
4

3. The cord adheres to Hooke’s Law once it has reached for which the lowest point of the jump will be exactly
its maximum length, exerting force on the jumper in pro- zero.
portion to the length of the extension above its resting To find the length of cord that is required to make the
length. The jumper weighs seventy-five kilograms. jump, we write an error function that simulates a bungee
4. The jumper’s final velocity is 60 meters per second jump and returns the lowest point.
due to drag force.
Our goal is to determine the cord’s length, L, so that We use root scalar with the error function to find the
the jumper descends to the teacup and no beyond. value of cord length that yields a perfect bungee dunk.
The steps are: The required length is 28.8 m.
1. We will proceed in a similar way as before. First, After simulating with the required length of cord, we
we’ll create a params object to contain the quantities get the position vs time plot as:
we’ll need.
2. Then we will use make system to make a system
from the parameters in params.
3. A function that computes the total force of the
cord on the jumper. When the cord is not stretched, it
returns 0, and when it is stretched, it will return the force
constant multiplied by the length stretched, according to
Hooke’s law.
4. Drag force, which computes the drag force as a
function of velocity. We use the same formula for drag
force as we had used before:
ρ × v 2 × Cd × Area
Fdrag =
2
5. We have the slope function, which gives us the total
acceleration and velocity. FIG. 9: Position vs time plot for the length of cord that
Then we run the simulation, and find the following makes the jump
position vs time plot:

Here we see that the lowest point of the first jump is


zero, which is our requirement.

B. Bungee Dunk: With a different model

In the earlier case study, we made the assumption that


the jumper is not pulled by the rope until it is extended.
It is incorrect, despite the seeming intuitive assumption
that when the cord falls with the jumper, it has no effect.
The falling cable transfers energy to the jumper. We
modify our model to take into consideration the force
FIG. 8: Position vs time plot for bungee dunk generated by the jumper.
With accommodating that, the acceleration of the
We see that the jumper does not reach the full length, jumper becomes:
which is fine, because we have not yet found out the µv 2 /2
minimum length of the cord required. a=g+
But, we do have one major problem in our model: µ(L + y) + 2L
After reaching the lowest point, the jumper springs
back almost to almost 70 m and oscillates several times. where y is the jumper’s position in relation to the start-
That looks like more oscillation than we expect from an ing point, µ is the ratio of the mass of the cord, m, to the
actual jump, which suggests that there is some dissipa- mass of the jumper, M, and g is the acceleration caused
tion of energy in the real world that is not captured in by gravity.
our model. We will try to modify this in our next at- Derivation of the above mentioned formula for
tempt. For now, we find the length of the minimum cord acceleration:
5

The bend, where the links of the moving chain come


to rest, travels at u = 1/2 v, while the free side of the
curve falls at speed v and the fixed side of the bend re-
mains stationary. The velocity at which the mass exits
the moving system is indicated by vobj . Therefore, in our
scenario, this velocity nearly instantly drops from v to 0,
and it is assumed to represent the average value—that is,
the bend’s speed. We simply consider the gravitational
force and neglect friction forces:

Substitution gives,

µv 2 /2
a=g+
µ(L + y) + 2L

which is our required formula.


The assumptions are:
We’ll model the jump using the following presumptions
in accordance with the previous case study:
1. To begin with, the bungee cord is suspended 80
FIG. 10: Falling chained block meters above a cup of tea from a crane.
2. As previously mentioned, the rope exerts stress
on the jumper up until it reaches its maximum length.
An illustration of the scenario of a falling chained block
Hooke’s law states that after the cable is fully extended,
can be found above. The right side, which consists of the
it will exert a force on the jumper according to the length
chained block and the moving chain link, is the object
of the extension above its resting length.
that is being examined. We call this the free side of the
3. The jumper is subject to drag force proportional to
bend.
the square of their velocity, opposite their direction of
The following symbols are used:
motion.
M = mass of the block (0.125 kg);
4. Let’s assume that the jumper’s mass is 75 kg and the
m = mass of the chain (0.68 kg);
cord’s mass is also 75 kg, so mu=1.
µ = m/M = the chain : block mass ratio;
L = length of the chain (4.15 m); 5. The jumper’s frontal area is 1 square meter, and
g = acceleration due to gravity (9.81 ms−2 ); terminal velocity is 60 m/s. I’ll use these values to back
a = acceleration of the chained block; out the coefficient of drag.
v = speed of the chained block; 6. The length of the bungee cord is L = 28.8 m from
y = distance travelled by the block. the previous section.
We have, 7. The spring constant of the cord is k = 40 N / m.
1 m The steps are:
mobj = M + (L − y) We divide the simulation into Phases 1 and Phase 2,
2 L
phase 1 for which the jumper has not fallen the entire
length of the rope and the rope is slack, and phase 2
dmobj mv for which the rope is extended. For phase 1, we only
=−
dt 2L modify the function which computes the acceleration of
the jumper. And then we run the simulation with an
Instead of dealing with a falling, inflexible body in the
event function that stops the simulation when we get to
instance of the linked block, we are dealing with an object
the end of the cord.
whose mass is changing, much like the moving end of a
lion tamer’s whip. As a result, the following generalized For phase 2, Once the jumper has fallen more than the
law should be used instead of Newton’s law F=ma: length of the cord, acceleration due to energy transfer
from the cord stops abruptly. As the cord stretches, it
starts to exert a spring force.
Then we follow similar procedure as before, and run
the simulation. The position vs time plot will look like:
6

FIG. 11: Position vs time plot for bungee dunk with new FIG. 13: Variation with mass of jumper
model
The falling body problem
I have, once again, used the same procedure to the
problem of a falling body, and tried to map its position
vs. time.
C. Excercises
The position vs time graph is :

For this chapter, the excercise was to Write an error


function that takes L and params as arguments, simulates
a bungee jump, and returns the lowest point.
Test the error function with a guess of 25 m and con-
firm that the return value is about 5 meters. Use root
scalar with your error function to find the value of L that
yields a perfect bungee dunk. Run a simulation with the
result from root scalar and confirm that it works. I have FIG. 14: The falling body: position vs time
already shown the works above in the project part.

E. Questions asked during the session

D. Additional: Variation with mass of cord and Variation of wire mass with mass of jumper:
mass of jumper and falling body problem We vary the mass of wire and the jumper, and try to
see the effects on the trajectory. For low mass of jumper:
I tried to investigate how would the jump vary with For mass of the jumper=20 kg, we have,
the variation of the mass of the cord, here is the result.
With varying mass of cord, the µ varies, and so does the
force exerted by the cord. The difference between lowest
and highest value of µ is the difference in lowest points
of the jump, which is 1 meter. The rest of the values of
µ are in between them.

FIG. 15: For mass of jumper 20 kg

So we see that mass of wire as low as 0.5 kg will also


make a jumper with a very low weight as 20 kg oscillate.
For a mass of jumper that is in the middle range: Mass
of jumper=40 kg, we have,
FIG. 12: Variation with mass of the cord

I also tried to investigate how these trajectories vary


with the mass of the jumper. Here is the plot for the
position vs time of the jumper for different masses of
the jumper. It is as expected, with the lightest jumper
falling to the least length and the heaviest jumper falling
FIG. 16: Mass of jumper 40 kg
the most.
7

For this mass of jumper, the oscillation is not much.


For mass of jumper that of a normal adult human:
Mass of jumper=70 kg, we have,

FIG. 19

We see, that when the mass of the jumper is 200 kg,


then only the cord breaks. So, the rope can withstand
weight upto 200 kg. Varying the mass of rope doesn’t
FIG. 17: Mass of jumper 70 kg change anything, as the tensile strength of the rope is not
dependent on its mass. We get the same above graph of
varying the mass of the ropes.
Rocket propulsion:
For a rocket propulsion, the basic principles are same
The oscillations are even less this time.
as bungee jumping. There are three forces that act on
For the mass of jumper 110 kg, we have the rocket, the gravitational force, the drag force, and
the thrust due to propulsion being ejected.
We take the basic assumptions:
1.For an average rocket, the mass is almost 10000 kg.
The mass of propulsion is almost 91%, so 9100 kg.
2.We do not take variation of the gravitational force as
the rocket travels upward, nor do we take the variation
of density of air as it goes upward. With the addition of
these, the problem will become extremely difficult. This
is to simplify the model.
3.The thrust force is given by the change of momentum
FIG. 18: Mass of jumper 110 kg
of the propulsion that is ejected, therefore the formula
being force=rate of mass being ejected X velocity of the
ejected mass.
Steps:
So we see, with the variation of mass of wire the effect The state function here is:
is minimal. The only factor that matters a lot is the
mass of the jumper. The mass of the jumper is the only
determining factor in the number of oscillations of the
jumper in our model. For lower mass of the jumper,
there are more oscillations, while for higher masses of
the jumper, the oscillations are less, as well as the height
of the bounce back.
Measure of tensile strength of the wire With this state function, we see this trajectory:
Bungee jumping typically uses a rope that is made up
of multiple layers of latex. The tensile strength of latex
is 10-20 Mpa, which means they can be stretched up to
2 times their original length without breaking. We have
already incorporated Hooke’s law in the previous section,
in this section we find out for how much weight of the
jumper and weight of the rope is ideal. A typical bungee
jumping rope is approximately 45 kg.
FIG. 20: Trajectory of rocket proplusion
With the mass of jumper fixed at 75 kg, I added a
section where if the extension of the cord is more than
The rocket is going upward, it is just the upward di-
the length of the cord, the trajectory of the jumper would
rection is negative here.
be the same as a free falling body.
Also, the derivation of the formula that we used in the
With that modification, I varied the mass of the 2nd model was in the questions, but I already explained
jumper again and plotted the trajectories. it in that section.
8

V. CONCLUSION VI. REFERENCES

I have attached the google colab files of the excercises


and the questions.

1. Modeling and Simulation in Python, Version 3.4.3,


In this project, I have learned about simulations. I
by Allen B. Downey
have done simulations of the baseball, and the bungee
dunk. Additionally, I have also done simulations of a 2. Understanding the physics of bungee jumping, An-
basketball and a free-falling body, and a rocket propul- dré Heck et al 2010 Phys. Educ. 45 63
sion. In all of these cases, we had some assumptions
which helped us to simplify the problems, like neglecting 3. https://www.sciencedirect.com/
some forces or effects. I have also found out the opti-
mal parameters of baseball, for a specific example, and 4. https://www1.grc.nasa.gov/
the length of rope required to simulate a bungee dunk 5. https://web.mit.edu/
of 80 m. In the bungee jump model, I have used two
different models for the acceleration of the body, one is 6. Colab notebook 1
where the assumption was that the cord doesn’t exert any
force on the jumper until it is stretched, and one where 7. Colab notebook 2
the assumption was that the cord transfers energy to the 8. Colab notebook 3
jumper even when it is not completely stretched. The
second model was found to be more accurate in terms of 9. Colab notebook 4
describing the oscillations after making the first jump.

You might also like