Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Ch 2 Python Exercises

Example Code.

Exercises:

  1. Constant Acceleration (shown in full)

    1. For v0v_0 = 10 m/s and a = 9.8 m/s2^2, plot displacement, velocity, and acceleration for the first 3 seconds. Assume initial displacement is zero.

    2. For v0v_0 = 10 m/s and θ\theta = 45∘45^{\circ}, plot displacement, velocity, and acceleration for horizontal and vertical components for the first five seconds.

  2. Variable Acceleration (for practice)

    1. Adapt the example code for Variable Acceleration (a=4e−2ta = 4e^{-2t}) to plot acceleration, velocity, and displacement for starting conditions of v = 5.0 m/s, x = 3 m

    2. Consider an alien parachutist of mass m jumping out of a hoverplane on their remarkably Earth-like home planet. If their initial vertical velocity is 0 m/s, taking g = 10 m/s and the variable acceleration due to air resistance as Fdrag=−0.2mvF_{drag} = -0.2mv,

      1. Find the Terminal Velocity, i.e. the velocity when their acceleration reaches zero.

      2. Have Python plot their velocity and acceleration for the first minute of their fall.

Note: all units used are SI standard units.

Important Constant Acceleration Equations

  • v=v0+atv = v_0 + at

  • x=x0+v0t+0.5at2x = x_0 + v_0t + 0.5at^2

  • v2=v02+2a(x−x0)v^2 = v_0^2 + 2a(x-x_0)

2-D Velocity Components

  • vx=v0cos⁡θv_x = v_0\cos{\theta}

  • vy=v0sin⁡θv_y = v_0\sin{\theta}

Where θ\theta is the angle above the horizontal.

Useful Python functions:

  • np.sin(x)

  • np.cos(x)

  • np.pi Where x is the input value in radians.

<Figure size 900x720 with 3 Axes>
<Figure size 900x720 with 3 Axes>