Monday, April 30, 2018

Simulation #2: Ball motion in gravitational field (part 1 - theory)

In this simulation, I would like to take up the subject of the ball's movement in the Earth's gravitational field. We will calculate real values of physical quantities with their units. I know that it is simple simulation, however I treat it as base for more complicated simulations. During implementation, I would like to focus also on learning Python's variant (for physical simulations) called VPython. It will be used in this simulation.

First, a bit of theory. We can distinguish couple of classic examples of physical body motion in gravitational field:
  1. upward projection and free fall
  2. horizontal projection
  3. angular projection
We assume that ball does not collide with any barrier and no other forces are acting on it. In other words - there is only Earth's surface, gravity and the ball with or without initial velocity. What is more, this assumption is valid for all motions described in this post.

Below is description of each motion:

Ad 1. Upward projection and free fall

Depending on initial conditions (position and velocity), we can distinguish the following combination of those 2 motions:
  1. upward motion and then free fall
  2. only free fall
Below picture (fig 1) presents both types of motion:

Fig 1.

  • Ad a. Ball is moving upward and then does free fall, when its initial velocity:
  • $\vec{V}_0=[0,V_y]$, where $V_y\gt 0$.

    We can define key parameters that describe ball movement:

    $t_0$ - time when movement starts (here $t_0=0$),
    $t_{max}$ - time, when ball reaches highest height above the Earth's surface,
    $t_{end}$ - time, when ball falls to the ground (moment of contact with Earth's surface),
    $E_k$ - kinetic energy of ball,
    $E_p$ - potential energy of ball,
    $V_0$ - initial speed of ball ($V_0=|\vec{V_0}|$),
    $V_{end}$ - speed of ball, when it contacts the ground,
    $h$ - height of ball above the ground,
    $h_0$ - initial height of ball laying on the ground. It equals to its radius $r$. If $r\ll h_{max}$, then $h_0\approx0$,
    $h_{max}$ - max height of ball above the ground,
    $g$ - acceleration of gravity (9.8 $m/s^2$). In our simulation we omit force due to air resistance. We can use energy conservation law, where only factors are potential and kinetic energy. Therefore: $$ E_p(t_{max})=E_k(t_0)=E_k(t_{end}) $$ $$ mgh_{max}=\frac{mV^2_0}{2}=\frac{mV^2_{end}}{2} $$ $$ h_{max}=\frac{V^2_0}{2g}=\frac{V^2_{end}}{2g} \tag{1}$$ We can come to conclusion: $$ V_0=V_{end}\tag{2}$$ Let's calculate $t_{max}$, $t_{end}$ now. To do this, we need to use formula for $h$: $$h=h_0+V_0t-\frac{gt^2}{2} \tag{3}$$ $t_{max}$ corresponds to $h_{max}$, therefore: $$h_{max}=h_0+V_0t_{max}-\frac{gt_{max}^2}{2} \tag{4}$$ Now, equation (1) needs to be put into formula (4). Finally $t_{max}$ is: $$t_{max}=\frac{V_0}{g} \tag{5}$$ Condition for $t_{end}$ looks like this: $$h_0=h_0+V_0\cdot t_{end}-\frac{gt_{end}^2}{2}$$ Therfore after simple calculations, $t_{end}$ is: $$t_{end}=\frac{2V_0}{g} \tag{6}$$ After comparison of $t_{max}$ with $t_{end}$, we can conclude that motion of ball, when it is first moving upward and then falls to the ground is completely symmetrical.

  • Ad b. Ball does only free fall, when its initial velocity is $\vec{0}$ and initial position is above the ground.
  • Parameters that describe the ball's motion are:
    $t_0$ - time when free fall motion starts,
    $t_{end}$ - time, when ball falls to the ground (moment of contact with Earth's surface),
    $V_{end}$ - speed of ball, when it contacts the ground,
    $h$ - height of ball above the ground,
    $h_0$ - initial height of ball above the ground.
    Height $h$ is given by the formula: $$h=h_0-\frac{gt^2}{2} \tag{7}$$ We need to find parameters: $t_{end}$ and $V_{end}$. Condition for $t_{end}$ is: $$0=h_0-\frac{gt_{end}^2}{2}$$ Finally, $t_{end}$ is: $$t_{end}=\sqrt{\frac{2h_0}{g}} \tag{8}$$ Condition for $V_{end}$ is: $$mgh_0=\frac{mV_{end}^2}{2}$$ Finally, $V_{end}$ is: $$V_{end}=\sqrt{2gh_0} \tag{9}$$


Ad 2. Horizontal projection


Below picture (fig 2) presents this type of motion:

Fig 2.

Ball is moving in gravitational field according to horizontal projection motion, when its:
  • initial position is above the ground level,
  • has initial horizontal velocity $V_0$.
Ball's velocity is sum of vectors: $$\vec{V}=\vec{V}_0+\vec{V}_g, \tag{10}$$ where:
$\vec{V}_0=[V_0,0]$ - initial horizontal velocity, $\vec{V}_g=-gt$ - velocity caused by gravitational acceleration.

Parameters, that describe horizontal projection:
$t_0$ - time when horizontal projection starts,
$t_{end}$ - time, when ball falls to the ground (moment of contact with Earth's surface),
$V$ - ball's speed,
$V_{end}$ - speed of ball, when it contacts the ground,
$h$ - height of ball above the ground,
$h_0$ - initial height of ball above the ground,
$d$ - distance that ball moves.

Height $h$ is given by the same formula as free fall (equation (7)).
We need to find parameters: $t_{end}$, $V$, $V_{end}$, $d$.
$t_{end}$ is actually identical with $t_{end}$ for free fall motion (given by equation (8)) Based on formula (10), we can calculate speed of ball $V$: $$V=|\vec{V}|=\sqrt{V_0^2+(gt)^2} \tag{11}$$ Condition for $V_{end}$ is energy conservation law: $$mgh_0+\frac{mv_0^2}{2}=\frac{mV_{end}^2}{2}$$ Finally, after calculations we get: $$V_{end}=\sqrt{V_0^2+2gh_0} \tag{12}$$ Distance $d$ that balls reaches is pretty easy to figure out. It is just $V_0t_{end}$: $$d=V_0\sqrt{\frac{2h_0}{g}}. \tag{13}$$.

Ad 3. Angular projection


Below Fig 3. presents this type of ball's motion:

Fig 3.

Parameters, that describe angular projection are:
$t_0$ - time when angular projection starts,
$t_{max}$ - time after which ball reaches $h_{max}$,
$t_{end}$ - time, when ball falls to the ground (moment of contact with ground level),
$V$ - ball's speed,
$\vec{V_0}$ - initial ball's velocity vector,
$V_0$ - initial speed of ball,
$\alpha$ - angle between initial velocity vector $\vec{V}_0$ and ground level,
$V_{end}$ - speed of ball, when it contacts the ground (in $t=t_{end}$ moment),
$h$ - height of ball above the ground,
$h_0$ - initial height of ball laying on the ground. It equals to its radius $r$. If $r\ll h_{max}$, then $h_0\approx0$,
$h_{max}$ - max height of ball above the ground,
$d$ - distance that ball moves.

Initial velocity vector $\vec{V}_0$ can be present in general form: $$\vec{V}_0=[V_{0x},V_{0y}].$$ We can present initial velocity vector's components by $\alpha$ angle and its length $V_0$ as follows: $$ \begin{cases} V_{0x}=V_{0}\cdot cos(\alpha)\\ V_{0y}=V_{0}\cdot sin(\alpha) \end{cases} \tag{14}$$ Therefore, height of ball $h$ is: $$h=\underbrace{V_{0}\cdot sin(\alpha)}_{V_{0y}}\cdot t -\frac{gt^2}{2} \tag{15}$$ To calculate $h_{max}$ we use as usual energy conversation law: $$mgh_{max}+\frac{m\overbrace{V_0^2cos^2(\alpha)}^{V_{0x}^2}}{2}=\frac{mV_0^2}{2}$$ After basic calculations, we get: $$h_{max}=\frac{\overbrace{V_0^2\cdot sin^2(\alpha)}^{V_{0y}^2}}{2g} \tag{16}$$ To calculate $V_{end}$ we use energy conversation law again: $$\frac{mV_0^2}{2}=\frac{mV_{end}^2}{2}.$$ Based on above equation, we can easily conclude that: $$V_{end}=V_0. \tag{17}$$ To calculate $t_{max}$ we use equation (15) to create proper condition: $$h_{max}=V_{0y}t_{max}-\frac{gt_{max}^2}{2}. $$ $h_{max}$ is known because we calculate it before. It can be put to above equation: $$\frac{V_{0y^2}}{2g}=V_{0y}t_{max}-\frac{gt_{max}^2}{2}. $$ Finally, after basic calculations, $t_{max}$ is: $$t_{max}=\frac{V_{0y}}{g}. \tag{18}$$ Based on equation (15), we can write condition for $t_{end}$ parameter: $$0=V_{0y}\cdot t_{end}-\frac{g\cdot t_{end}^2}{2}.$$ After simple transformations we get: $$t_{end}=\frac{2V_{0y}}{g}. \tag{19}$$ We can easily figure out that $t_{end}=2\cdot t_{max}$, which means that angular projection motion is completely symmetrical.
Distance of ball $d$ is given by similar equation to eq(13): $$d=V_{0x}\cdot t_{end}= V_0cos(\alpha) \cdot \frac{2V_{0y}}{g}.$$ After simple calculations we get final version: $$d=\frac{V_0^2}{g}sin(2\alpha). \tag{20}$$

No comments:

Post a Comment