Activity Information

Learning Goals

- Add to a computational model of two skydivers
- Use the drag equation in a computational model
- Use newton’s second law to determine the acceleration of a body in motion (HS-PS2-1)
- Fnet = 0 means velocity is constant (HS-ps2-2)

Prior Knowledge Required

- Vectors
- kinematics
- Newton’s second law
- Drag Equation
- Coefficient of drag Cd

Code Manipulation

- Interpret existing code
- Create code based on mathematical equations
- Use if statements
- Edit existing code

Activity

Handout – Skydiving Stunt

Your lifelong dream of being a videographer has come true! You’ve been hired to film action sequences for the upcoming blockbuster movie: “Avengers 11: You’ll Still Watch It.” One of the scenes you get to film is Squirrel Girl falling through the air and opening a parachute just in time to avoid hitting the ground.

The director of the movie has decided that this scene will be filmed practically, with you and an actor skydiving. To ensure that the stunt is safe, you have been instructed to create a computational model of the stunt and have been given this starter code.

Your parachute should open when you are 300 m above the ground and the actor’s should open when they are 600m above the ground. Each parachute should have an appropriate area so that you both fall at 5 m/s after they open.

Your Mass with your camera is 75 kg and the actor’s mass is 50 kg. The area of a person laying prone can be approximated to 1 square meter and the coefficient of drag between a person and air is 0.75.

Additionally, the parachutes should open quickly but not instantaneously, as that isn’t possible. There is no need to represent the parachutes graphically in the model.

Code

```
GlowScript 3.1 VPython
from visual import *
#setting the scene - these can be changed as necessary for your screen size
scene.width = 800
scene.height = 600
scene.center = vector(300,900, 0)
#define some variables
test = 0
g = 5 #Gravitational Field Strength - in N/kg
t = 0
dt = 0.001
mass1 = 50 #skydivers mass in kg
# define graph of motion
grph = graph(title='Velocity vs Time', xtitle='Time (s)', ytitle='Velocity (m/s)')
sdgraph = gcurve(color=color.red, width = 5, label='Skydiver')
#defining the objects
ground = box(length=2000, height = 50, width = 200, color=color.green)
ground.pos = vector(0,0,0)
sd = sphere(pos = vector(0,2000,0), radius=50, color=color.red, make_trail = True)
sd.velocity = vector(0,0,0)
#loop to create the animation
while test == 0:
rate(1000)
sd.pos = sd.pos + sd.velocity*dt
sd.velocity.y = sd.velocity.y - (g * dt)
if sd.pos.y < 50: #check to see if the skydiver has reached the ground
sd.velocity.y = 0 #stop the skydivers when they reach the ground
test = 1 #trigger to get out of the while loop
sdgraph.plot(t, sd.velocity.y)
t=t+dt
```

Answer Key

Handout

First g needs to be changed to the appropriate value (new code in bold):

`g = `**9.81 ** #Gravitational Field Strength - in N/kg

Now the rest of the constants can be added:

```
mass1 = 50 #skydivers mass in kg
```**mass2 = 75** #skydiver with camera mass in kg
**A1 = 1 ** #area of a prone human in square meters - Skydiver
**A2 = 1 ** #area of a prone human in square meters - Camera
**rho = 1.2** #density of air, this can be assumed
**cd = .75** #coefficient of drag for a human in air

The area for each parachute can be calculated here as well. To do this the Drag equation can be rearranged to solve for area:

D = 1/2*Cd*ρ*v^2*A => A = 2D/(Cd*ρ*v^2)

Because both skydivers will fall at a constant 5 m/s with their parachutes open, their respective net forces are zero, which means that drag force is cancelling out the gravitational force: Fg + D = 0 => mg = D

Substituting this into the area equation above gives:

A = 2mg/(Cd*ρ*v^2)

In the code this looks like:

**A1term = (2 * mass1 * g)/(cd * rho * 5 ** 2)** #Area of the parachute necessary for a velocity of 5m/s
**A2term = (2 * mass2 * g)/(cd * rho * 5 ** 2)** #Area of the parachute necessary for a velocity of 5m/s

Another shape needs to be added that represents the second skydiver with a camera. Any shape or color will do, this solution will use a torus:

**scam = ring(pos = vector(200,2000,0), axis=vector(0,1,0), radius=50, thickness=15, radius=50, color=color.blue, make_trail = True, trail_type = "points", trail_radius = 10, interval = 100)
scam.velocity = vector(0,0,0) **#camera initial velocity**
scam.accel = vector(0,0,0)** #camera initial acceleration
**Fnet1 = 0** #Initialize the net force on each skydiver
**Fnet2 = 0**

Now the loop needs to be edited to appropriately use everything that was just defined.

First, the velocity and position update equations from the starter code can be copied for the second skydiver:

```
while test == 0:
rate(1000)
sd.velocity.y = sd.velocity.y - (g * dt)
sd.pos.y = sd.pos.y + sd.velocity.y*dt
```** scam.velocity.y = scam.velocity.y - (g * dt)
scam.pos = scam.pos + scam.velocity*dt**

– g * dt doesn’t make sense for the change in velocity of either skydiver, the acceleration of each will have to be found. To find each acceleration, newton’s second law Fnet = ma can be used. The net force on each skydiver is the sum of all the forces, which in this case is the gravitational force and the force of drag:

Fnet = Fg + D = mg - 1/2*Cd*ρ*v^2*A

To find the acceleration, this value simply needs to be divided by the skydiver’s mass because Fnet = ma => a = Fnet/m

Implementing this in the code looks like:

```
while test == 0:
rate(1000)
```**Fnet1 = (mass1*g) - (.5 * cd * rho * A1 * sd.velocity.y**2)**
**sd.accel.y = Fnet1/mass1**
sd.velocity.y = sd.velocity.y - **(sd.accel.y * dt)**
sd.pos.y = sd.pos.y + sd.velocity.y*dt
** Fnet2 = (mass2*g) - (.5 * cd * rho * A2 * scam.velocity.y**2)
scam.accel.y = Fnet2/mass2**
** ** scam.velocity.y = scam.velocity.y - **(scam.accel.y * dt)**
scam.pos = scam.pos + scam.velocity*dt

Now the parachutes need to open at the appropriate heights. The easiest way to do this is to use if statements in the while loop. These statements should check to see if each skydiver is at the right height for their parachute to open and if the parachute is already all the way open. If it isn’t, then the parachute can be opened by adding some area:

` `**if sd.pos.y < 600 and A1 <= A1term: ** #Check to see if the skydiver has reached 600m above the ground
**A1 = A1 + .1** #open parachute by increasing the area
**if scam.pos.y < 300 and A2 <= A2term: ** #Check to see if the skydiver has reached 300m above the ground
**A2 = A2 + .1 ** #open parachute by increasing the area

Lastly, the bits of code that stop the skydiver when they touch the ground and create and update the graph of the skydiver’s velocity need to be copied for the second skydiver with the camera.

Code

```
GlowScript 3.1 VPython
from visual import *
#setting the scene - these can be changed as necessary for your screen size
scene.width = 800
scene.height = 600
scene.center = vector(400, 800, 0)
#define some variables
test = 0
g = 9.81 #Gravitational Field Strength - in N/kg
t = 0 #time
dt = 0.01 #time increment
mass1 = 50 #skydivers mass in kg
mass2 = 75 #skydiver with camera mass in kg
A1 = 1 #area of a prone human in square meters - Skydiver
A2 = 1 #area of a prone human in square meters - Camera
rho = 1.2 #density of air
cd = .75 #coefficient of drag for a human in air
A1term = (2 * mass1 * g)/(cd * rho * 5 ** 2) #Area of the parachute necessary for a velocity of 5m/s
A2term = (2 * mass2 * g)/(cd * rho * 5 ** 2) #Area of the parachute necessary for a velocity of 5m/s
# define graph of motion
grph = graph(title='Velocity vs Time', xtitle='Time (s)', ytitle='Velocity (m/s)')
sdgraph = gcurve(color=color.red, width = 5, label='Skydiver')
scamgraph = gcurve(color=color.blue, width = 3, label='Camera')
#defining the objects
ground = box(length=2000, height = 50, width = 200, color=color.green)
ground.pos = vector(0,0,0)
sd = sphere(pos = vector(0,2000,0), radius=50, color=color.red, make_trail = True, trail_type = "points", trail_radius = 10, interval = 100)
sd.velocity = vector(0,0,0) #skydiver initial velocity
sd.accel = vector(0,0,0) #skydiver initial acceleration
scam = ring(pos = vector(200,2000,0), axis=vector(0,1,0), radius=50, thickness=15, radius=50, color=color.blue, make_trail = True, trail_type = "points", trail_radius = 10, interval = 100)
scam.velocity = vector(0,0,0) #camera initial velocity
scam.accel = vector(0,0,0) #camera initial acceleration
Fnet1 = 0
Fnet2 = 0
#loop to create the animation
while test == 0:
rate(1000)
Fnet1 = (mass1*g) - (.5 * cd * rho * A1 * sd.velocity.y**2) #calculate the net force
sd.accel.y = Fnet1/mass1 #calculate the resuling acceleration
sd.velocity.y = sd.velocity.y - (sd.accel.y * dt) #calculate the new velocity
sd.pos.y = sd.pos.y + sd.velocity.y*dt #update the position of the skydiver
Fnet2 = (mass2*g) - (.5 * cd * rho * A2 * scam.velocity.y**2) #calculate the net force
scam.accel.y = Fnet2/mass2 #calculate the resuling acceleration
scam.velocity.y = scam.velocity.y - (scam.accel.y * dt) #calculate the new velocity
scam.pos = scam.pos + scam.velocity*dt #update the position of the camera
if sd.pos.y < 600 and A1 <= A1term: #Check to see if the skydiver has reached 600m above the ground
A1 = A1 + .1 #open parachute by increasing the area
if scam.pos.y < 300 and A2 <= A2term: #Check to see if the skydiver has reached 300m above the ground
A2 = A2 + .1 #open parachute by increasing the area
if sd.pos.y < 50: #check to see if the skydiver has reached the ground
sd.velocity.y = 0 #stop the skydivers when they reach the ground
test = 1 #trigger to get out of the while loop
if scam.pos.y < 50: #check to see if the camera has reached the ground
scam.velocity.y = 0 #stop the camera when they reach the ground
sdgraph.plot(t, sd.velocity.y) #plot the graph of skydiver velocity vs time
scamgraph.plot(t, scam.velocity.y) #plot the graph of camera velocity vs time
t=t+dt #increment the time
```