# Computational Dynamics Lab¶

name: __

Answer the questions below by performing the necessary computation. Much of the code can be copied from the Intro to Computational Dynamics notebook.

After completion, turn in this `ipynb`

file on Blackboard and the paper lab
report in class.

```
from numpy import *
import matplotlib.pyplot as plt
```

## A. Projectile Motion¶

Use the code from the Intro to Computational Dynamics notebook to perform the following trials and answer the corresponding questions in the lab report.

- Test the flight with a different mass $m$. Does this affect the trajectory?
- The example code uses $\Delta t=0.01$ s. Smaller values of $\Delta t$ will also give accurate results. Try to run the projectile motion with $\Delta t=0.4$ s. Is the range and maximum height correct with $\Delta t = 0.4$ s? Find the $\Delta t$ value at which the range is inaccurate by about 10%.
- Find the projectile range for several initial angles. Print the range at the end of each loop. Record the angle that provides the maximum range. (Optional bonus step: make a plot of range versus launch angle.)

Hint:Copy the whole code block from the section called "A Loop in a Loop" into this notebook. Then edit it to answer the questions above.

```
# your code here
```

## B. Projectile with Air Drag¶

Write a new force function for a spherical projectile that experiences air drag throughout its flight. Refer to the text section 6.4 if necessary. Use the density of air, $\rho = 1.2 \; \rm{kg}/\rm{m}^3$, drag coefficient $C = 0.5$, and initial velocity 10 m/s at $60^\circ$.

Hint:Your function should get the input parameters that it needs for the calculation. Something like

`def drag_force(C,A,v):`

`...`

- Projectile motion in a vacuum is independent of mass, as you found above. What about projectiles with air drag? Consider an iron cannonball and a styrofoam ball of the same size (radius 3.8 cm). Find the range of the iron cannonball (mass 1.8 kg) and the range of a styrofoam ball (mass 12 g).
- Suppose you go skydiving.
What is your terminal velocity if you're tucked into a spherical shape
($C \approx 0.5$)?
What is your terminal velocity if you're spread-eagle ($C \approx 1.3$)?
(Make reasonable estimates of your own body's mass and size.)
You must show how to use the same code to find the terminal velocity
-- your answer should agree with (but not use)
the equation in section 6.4.
*Hint:*start with an initial position of`(10e3,0)`

and a very small initial velocity. Then check the final $y$-velocity value`vv[-1,1]`

.

```
# your code here
```