∮ 1-D Kinematics

∯ Constant speed

∰ Position vs. Time

One of the first topics talked about in introductory physics courses is almost always mechanics, the study of motion. That is, the study of how space and time are connected -- how does an object's position in space change with respect to time? In brief, we are interested in how position, time, speed, and acceleration are related to each other. To investigate this topic, it is important that we define these familiar words in a more rigorous way. To do this we will use the symbolic language of mathematics. Let us begin by saying $$ x = \text{position} $$ Great, we now have a variable that represents position. However, this means absolutely nothing without some kind of a reference point. For example what does it mean for my position to be x = 15m? Am I 15m away from home? Or 15m away from Jupiter? Thus, it is necessary for us to use our words and elaborate on what we mean by x = 15m -- "we are 15m away from the grocery store." We might represent this in a picture as seen below, where we define the position of our grocery store to be 0. That way when I tell you that my position is 15m, you know that I am trying to express the fact that I am 15m away from the grocery store.

position1
As boring as the previous paragraph might have been to read, it actually alludes to a very interesting metaphysical idea. There is no such thing as an absolute reference point. What I mean by this, is that there is no position in the universe that everything else in the universe is measured from, unless a human were to arbitrarily assign such a position.

We need to make one more destinction about position. Position is a vector quantity, meaning it has both magnitude and direction. Imagine we were 15m behind the grocery store. We would then say we have a position of $$ \vec{x} = -15\text{m} $$ where the negative sign lets us know that we must be behind the grocery store (the direction), but we are still 15m away from the grocery store (the magnitude). The arrow on top lets us know that we are dealing with a vector quantity.

Now that we have a more rigorous definition of position, we will describe how a position might change with respect to time. We define the average velocity of an object as our change in position divided by the time it took our position to change by that amount. $$ \vec{v}= \frac{\vec{x}_f-\vec{x}_i}{t_f-t_i} =\frac{\Delta \vec{x}}{\Delta t} $$ Note that velocity is also a vector quantity. Imagine that your uncle Joseph starts at the store and travels with a constant velocity of 3m/s for 5 seconds. We can rearrange the equation above to determine what our final position would be $$ \vec{x}_f = \vec{x}_i + \vec{v}\Delta t = 0\text{m} + (3\text{m/s})(5\text{s}) = 15\text{m} $$ This lets us know that Joseph would be 15m in front of the grocery store. What if at the same time Joseph started walking, our aunt Melonie, who was standing by their car in the parking lot 3m in front of the store, began to jog with a constant velocity of -5m/s for 3 seconds? Then we could use the same equation to find Melonie's final position $$ \vec{x}_f = \vec{x}_i + \vec{v}\Delta t = 3\text{m} + (-5\text{m/s})(3\text{s}) = -12\text{m} $$ This tells us that aunt Melonie ends up 12m behind the store. Since we already know how to intuit what a negative sign means when we talk about position, it directly follows that a negative velocity means you are moving in the negative direction. Hopefully you see how powerful the idea of vectors is. They are an essential tool to have in your physics tool-belt as you progress in your studies.

Let us now take a closer look at our equation for final position by comparing it to the general equation for a line in slope-intercept form. $$ f(t) = b + mt $$ $$ x_f = x_i + v\Delta t $$ We can see that our final position is our dependent variable, while the amount of time that has passed is the independent variable. So, if we were to plot the position vs. time we should expect to find that our initial position is our y-intercept, and our velocity is our slope! However, we will go one step beyond plotting the position vs. time; we will use python to create an animation of the situation. This is done by incrementally making a plot of your position after some small amount of time has passed (for example, what is our position at t = 0.025s, then what is are position at t = 0.05s, etc...), then telling Python to create a gif by showing each plot one after another. See the code block below, and the final product below that.



   # Create a graph of position vs time, and animate it

   # import packages needed
   from pylab import figure,plot,xlabel,ylabel,title,show,grid,yticks,xticks,\
        axhline,axvline,subplot,ylim,xlim,rcParams,rc,rc_context
   from numpy import arange
   import matplotlib.animation as animation
   
   
   # set up the parameters of our problem. First for Joseph's movement
   x_i = 0.0                             # initial position
   v_1 = 3                               # positive velocity
   t = 0.0                               # initial time
   t_1_f = 5                             # final time
   dt = 0.05                             # time step
   
   # create a list of x-positions for each point in time between
   # t_i and t_f in increments of dt
   x_1_points = []              # our list to fill with positions
   t_1_points = []              # a list of time points to fill then plot
   while t <= t_1_f:
       x_position = x_i + v_1*t          # find joseph's position at time t
       x_1_points.append(x_position)       # add the time to our list
   
       t_1_points.append(t)               # add the time to out list
       t += dt                            # go to our next time step
   
   # Repeat the above process for Aunt Melonie
   x_i = 3.0                             # initial position
   v_2 = -5                              # positive velocity
   t = 0.0                               # initial time
   t_2_f = 3                             # final time
   dt = 0.05                             # time step
   
   # create a list of x-positions for each point in time between
   # t_i and t_f in increments of dt
   x_2_points = []              # our list to fill
   t_2_points = []              # a list of time points to fill then plot
   while t <= t_2_f:
       x_position = x_i + v_2*t           # find our position at time t
       x_2_points.append(x_position)        # add the time to our list
   
       t_2_points.append(t)               # add the time to out list
       t += dt                            # go to our next time step
   
   # create a plot
   # for us
   figure(figsize=(12,12))
   subplot(2,1,1)
   plot(t_1_points,x_1_points,color="darkmagenta")
   grid(True)
   xlabel("Times (s)")
   ylabel("Position (m)")
   title("Position vs. Time (Joseph)")
   ylim(-3.5,15.5)
   yticks([-3,0,3,6,9,12,15])
   axhline(color="k",lw=1)
   
   # for Melonie
   subplot(2,1,2)
   plot(t_2_points,x_2_points,color="teal")
   grid(True)
   xlabel("Times (s)")
   ylabel("Position (m)")
   title("Position vs. Time (Melonie)")
   yticks([3,0,-3,-6,-9,-12,-15])
   ylim(-15.5,3.5)
   axhline(color="k",lw=1)
   
   ##show()
   
   # make all of our lists the same size for animating
   x_1_f = x_1_points[-1]             # Joesph's final position
   x_2_f = x_2_points[-1]             # Melonie's final position
   for t in t_1_points:
       if t not in t_2_points:
           t_2_points.append(t)
           x_2_points.append(x_2_f)
   
   # add points at the end of our lists to still image before it repeats
   for t in arange(t_1_f,8.0,dt):
       t_1_points.append(t_1_f)
       t_2_points.append(t_1_f)
   
       x_1_points.append(x_1_f)
       x_2_points.append(x_2_f)
   
   # Remove some frames to save space
   for i in range(len(t_1_points)+1,len(t_1_points),5):
       del t_1_points[i]
       del t_2_points[i]
       del x_1_points[i]
       del x_2_points[i]
   
   
   
   # make a list of zeros for animating
   zero_points = []
   for x in x_1_points:
       zero_points.append(0)
   
   # plot/animate
   rcParams.update({'font.size': 16})
   rc('axes', linewidth=2)
   with rc_context({'axes.edgecolor':'white', 'xtick.color':'white', \
                    'ytick.color':'white', 'figure.facecolor':'darkslategrey',\
                    'axes.facecolor':'darkslategrey','axes.labelcolor':'white',\
                    'axes.titlecolor':'white'}):
       # our figure
       fig = figure(figsize=(14,12))
       fig.subplots_adjust(hspace=0.3,wspace=0.3)
   
       # Joseph's x vs. t graph
       ax1 = fig.add_subplot(2,2,1)
       grid(True)
       xlabel("Times (s)")
       ylabel("Position (m)")
       title("Position vs. Time (Joseph)")
       ylim(-3.5,16)
       yticks([-3,0,3,6,9,12,15])
       axhline(color="k",lw=1)
   
       # make an animation of Joseph walking away from the store
       ax2 = fig.add_subplot(2,2,2)
       grid(False)
       xlabel("Position (m)")
       ylabel("")
       title("Joseph walking away from the store")
       ylim(-0.5,16)
       xlim(-3,16.5)
       xticks([-3,0,3,6,9,12,15])
       yticks([0])
       axvline(color="k",lw=1)
   
       # Melonie's position vs time graph
       ax3 = fig.add_subplot(2,2,3)
       grid(True)
       xlabel("Times (s)")
       ylabel("Position (m)")
       title("Position vs. Time (Melonie)")
       yticks([3,0,-3,-6,-9,-12])
       ylim(-12.5,5.5)
       axhline(color="k",lw=1)
   
       # make an animation of Melonie walking away from the store
       ax4 = fig.add_subplot(2,2,4)
       grid(False)
       xlabel("Position (m)")
       ylabel("")
       title("Melonie walking away from the store")
       ylim(-0.5,16)
       xlim(-16.5,3)
       xticks([-15,-12,-9,-6,-3,0,3,6])
       yticks([0])
       axvline(color="k",lw=1)
   
   
       ims = []
       index = 0
       while index <= len(t_1_points)+1:
           # Joseph's position graph
           joe, = ax1.plot(t_1_points[:(index+1)],x_1_points[:(index+1)],color='cyan',lw=2.4)
   
           # visual of Joseph actually moving
           # the store
           joeStore, = ax2.plot(0,1.5,color='k',marker="1",markersize=80)
           # Joseph
           joeMove, = ax2.plot(x_1_points[index:(index+1)],zero_points[index:(index+1)],\
                               color="cyan",marker="^",markersize=35)
   
           # Melonie's position
           melonie, = ax3.plot(t_2_points[:(index+1)],x_2_points[:(index+1)],color="magenta",lw=2.4)
   
           # visual of Melonie actually moving
           # the store
           melonieStore, = ax4.plot(0,1.5,color='k',marker="1",markersize=80)
           # Melonie
           melonieMove, = ax4.plot(x_2_points[index:(index+1)],zero_points[index:(index+1)],\
                                   color="magenta",marker="^",markersize=35)
   
   
           # add to ims list
           ims.append([joe,joeStore,joeMove,melonie,melonieStore,melonieMove])
   
           index += 1
   
   ani = animation.ArtistAnimation(fig, ims, interval=200, repeat_delay=300, blit=True)
   writer1 = animation.PillowWriter(fps=24)
   ani.save("joeMeloniePosition.gif",writer=writer1,dpi=80)
   

Position vs. Time of Joseph and Aunt Melonie Moving Away From the Store

Position vs. Time gif

Great, we know what our position vs. time graphs look like now, and we have briefly discussed how to extract information from such a graph. Joseph's position vs. time graph indeed has a y-intercept of 0, which was their initial position, and it has a slope of $$ \text{slope}=\frac{\text{rise}}{\text{run}}=\frac{\Delta x}{\Delta t}= \frac{15\text{m}-0\text{m}}{5\text{s}-0\text{s}}=\frac{15\text{m}}{5\text{s} }=3\text{m/s} $$ Melonie's posotion vs. time graph has a y-intercept of 3m, which was their initial position, and we can find their velocity by finding the slope of the line from t = 0s to t = 3s, $$ \text{slope}=\frac{\text{rise}}{\text{run}}=\frac{\Delta x}{\Delta t}= \frac{-12\text{m}-3\text{m}}{3\text{s}-0\text{s}}=\frac{-15\text{m}}{3\text{s} }=-5\text{m/s} $$ For the sake of being complete, let us also find the slope of Melonie's position vs. time graph from t = 3s to t = 5s to make sure the math confirms what we should already know the answer to be, $$ \text{slope}=\frac{\text{rise}}{\text{run}}=\frac{\Delta x}{\Delta t}= \frac{-12\text{m}-(-12\text{m})}{5\text{s}-3\text{s}}=\frac{0\text{m}}{2\text{s} }=0\text{m/s} $$

∰ Velocity vs. Time

Let us now focus our attention on the velocity vs. time graphs of Joseph's and Melonie's movement. If you have experience with graphing functions, you can already probably picture what these plots might look like. See the code block below to see how I go about plotting both curves on the same graph -- this is not a very interesting case, so we will not go through the trouble of animating it.

   # Create a graph of position vs time, and animate it

   # import packages needed
   from pylab import figure,plot,xlabel,ylabel,title,show,grid,yticks,xticks,\
        axhline,axvline,subplot,ylim,xlim,fill,savefig,rc_context,rcParams
   from numpy import arange
   
   
   # set up the parameters of our problem. First for Joseph's movement
   x_i = 0.0                             # initial position
   v_1 = 3                               # positive velocity
   t = 0.0                               # initial time
   t_1_f = 5                             # final time
   dt = 0.05                             # time step
   
   # create a list of x-positions for each point in time between
   # t_i and t_f in increments of dt
   x_1_points = []              # our list to fill with positions
   v_1_points = []              # our list to fill with velocities
   t_1_points = []              # a list of time points to fill then plot
   while t <= t_1_f:
       position_new = x_i + v_1*t         # our new position
       x_1_points.append(position_new)    # add new position to list
       v_1_points.append(v_1)             # add the velcocity to our list
   
       t_1_points.append(t)               # add the time to out list
       t += dt                            # go to our next time step
   
   # Repeat the above process for Aunt Melonie
   x_i = 3.0                             # initial position
   v_2 = -5                              # positive velocity
   t = 0.0                               # initial time
   t_2_f = 3                             # final time
   dt = 0.05                             # time step
   
   # create a list of x-positions for each point in time between
   # t_i and t_f in increments of dt
   x_2_points = []              # a list to fill with positions
   v_2_points = []              # a list to fill with velocities
   t_2_points = []              # a list of time points to fill then plot
   while t <= t_2_f:
       position_new = x_i + v_2*t         # our new position
       x_2_points.append(position_new)    # add new position to list
       v_2_points.append(v_2)             # add the velocity to our list
   
       t_2_points.append(t)               # add the time to out list
       t += dt                            # go to our next time step
   
   # Now to consider Melonie's position and velocity from t=3s to t=5s
   x_2_f = x_2_points[-1]                 # Melonie's final position
   for t in arange(3.0,5.0+dt,dt):
       x_2_points.append(x_2_f)
       v_2_points.append(0)
       t_2_points.append(t)
   
   # plot/animate
   rcParams.update({'font.size': 16})
   with rc_context({'axes.edgecolor':'white', 'xtick.color':'white', \
                    'ytick.color':'white', 'figure.facecolor':'darkslategrey',\
                    'axes.facecolor':'darkslategrey','axes.labelcolor':'white',\
                    'axes.titlecolor':'white'}):
       # our figure
       fig = figure(figsize=(12,12))
       fig.subplots_adjust(hspace=0.3,wspace=0.3)
   
       # for Joseph
       # x vs t      
       subplot(2,2,1)
       plot(t_1_points,x_1_points,color="aquamarine",lw=2.8,zorder=9)
       grid(True)
       xlabel("Times (s)")
       ylabel("Position (m)")
       title("Position vs. Time (Joseph)")
       ylim(-3.5,15.5)
       yticks([-3,0,3,6,9,12,15])
       axhline(color="k",lw=1)
       axvline(color="k",lw=1)
   
       # v vs t
       ax2 = subplot(2,2,2)
       plot(t_1_points,v_1_points,color="lime",lw=3.2,zorder=9)
       grid(True)
       xlabel("Times (s)")
       ylabel("Velocity (m/s)")
       title("Velocity vs. Time (Joseph)")
       ylim(-3.5,10)
       xlim(-0.3,5.5)
       yticks([-3,0,3,6,9])
       axhline(color="k",lw=1.5)
       axvline(color="k",lw=1.5)
       ax2.fill([0,0,5,5], [0,3,3,0],"violet",alpha=0.45)
   
       # for Melonie
       # x vs t
       subplot(2,2,3)
       plot(t_2_points,x_2_points,color="hotpink",lw=2.8,zorder=9)
       grid(True)
       xlabel("Times (s)")
       ylabel("Position (m)")
       title("Position vs. Time (Melonie)")
       yticks([3,0,-3,-6,-9,-12,-15])
       ylim(-15.5,3.5)
       axhline(color="k",lw=1)
       axvline(color="k",lw=1)
   
       # v vs t
       ax4 = subplot(2,2,4)
       plot(t_2_points,v_2_points,color="coral",lw=2.8,zorder=9)
       grid(True)
       xlabel("Times (s)")
       ylabel("Velocity (m/s)")
       title("Velocity vs. Time (Melonie)")
       yticks([2.5,0,-2.5,-5,-7.5])
       ylim(-9,3.5)
       axhline(color="k",lw=1.5,zorder=2)
       axvline(color="k",lw=1.5)
       ax4.fill([0,0,3,3], [0,-5,-5,0],"cyan",alpha=0.25)
   
   savefig("joeMelonieVvsT.png")
   

x vs. t and v vs. t of Joeseph and Melonie

Joseph and Melonie's V vs. T graph

I hope that our velocity vs. time curves do not look shocking to you. If we are moving at a constant velocity, it makes sense that a velocity vs. time graph would be a flat horizontal line. Note how Melonie has a sudden (physically impossible) shift from moving v = -5.0m/s to v = 0.0m/s at t = 3.0s. It is also perhaps worth pointing out that our initial position has absolutely no bearing on our velocity.

Perhaps you were shocked when you saw the graphs due to the shaded regions I have added. I have highlighted these regions to segway into the next important idea, that the area under a velocity vs. time curve yields the change in position! By "under the curve" we really mean the area between the curve and the x-axis. First, take a look at Joseph's velocity vs. time graph. It is clear that the area under the curve is a rectangle, who's area can be simply calculated, $$ \Delta \vec{x} = \text{Area}=\text{(height)(base)}=\vec{v}\Delta t =(3\text{m/s})(5\text{s})=15\text{m} $$ You can see that we have really just rearranged the equation we came up with for velocity earlier on this page to find the change in position. We might do the same for Melonie, $$ \Delta \vec{x} = \text{Area}=\text{(height)(base)}=\vec{v}\Delta t =(-5\text{m/s})(3\text{s})=-15\text{m} $$ So if the curve is below our x-axis, we are technically finding the area above the curve, and it corresponds to a negative change in position. Note that in Melonie's case, it did not give us their final position, but only the distance and direction they traveled.

∯ Non-zero Acceleration

Up to this point, we have been discussing cases in which our subjects of interest are moving with constant velocity. Now, we shift our focus to a slightly more complicated case, one in which objects move with some constant acceleration. This is where I officially introduce the word Kinematics. We will derive the kinematic equations of motion, which may only be applied in cases where acceleration is constant.

Okay, so I have used this word "acceleration" with the assumption that everybody reading already has some intuition of what this word means. Now to add some rigor. We save that an object's average acceleration is eqal to its change in velocity over the amount of time it took for the change in velocity to occur, $$ \vec{a}=\frac{\vec{v}_f - \vec{v}_i}{t_f - t_i}=\frac{\Delta \vec{v}}{\Delta t} $$ Let's say that your Uncle Lee just bought a new Tesla that is marketed to accelerate from 0-60mph (around 0-27m/s) in just a mere 4.0 seconds. If we assume that the vehicle undergoes constant acceleration for these 4.0 seconds, what would the acceleration be equal to?

This is quite easy to solve with our equation for acceleration, $$ \vec{a}=\frac{\vec{v}_f - \vec{v}_i}{t_f - t_i}=\frac{27\text{m/s} - 0\text{m/s}}{4.0\text{s}-0\text{s}}=\frac{27\text{m/s}}{4.0\text{s}}=6.75\text{m/s}^2 $$ This would mean that for every seconds that passes, the velocity of the Tesla would increase by 6.75m/s.

Excited to feel the power of their new ride, Lee hops into the car, cranks it up and "puts the pedal to the metal" for 7 seconds. What is Lee's final speed?

We can solve this by simply rearranging our equation for acceleration. We find, $$ \vec{v}_f = \vec{v}_i + \vec{a}(t_f - t_i) = 0\text{m/s} + 6.75\text{m/s}^2(4.0\text{s}-0\text{s})=47.25\text{m/s}\approx 105\text{mph} $$ Lee is satisfied with this experience and takes their foot off of the gas, and they cruise at a constant velocity for 1.5 seconds. Suddenly, Lee notices a mother duck and her babies crossing the road up ahead. Lee slams on the break such that they come to a complete stop in just 4.0 seconds, narrowly missing family of ducks. This means that Lee's acceleration while breaking was $$ \vec{a}=\frac{\vec{v}_f - \vec{v}_i}{t_f - t_i}=\frac{0\text{m/s} - 47.25\text{m/s}}{12.5\text{s}-8.5\text{s}}=\frac{-47.25\text{m/s}}{4.0\text{s}}=-11.81\text{m/s}^2 $$ This means that for every second that passed while breaking, Lee's speed decreased by 11.81m/s

Analogously to how we rearranged our equation for the definition of velocity to find an equation for the final position of an object moving with some velocity, we can rearange our acceleration equation to find the final velocity of an object that is moving with some acceleration (and we compare it to the general equation for a line in slope-intercept form), $$ f(t) = b + mt $$ $$ \vec{v}_f = \vec{v}_i + \vec{a}\Delta t $$ We can clearly see that the slope of our velocity vs. time graph will yield our acceleration -- amazing! But, how does acceleration affect our position over time? Let us recall, $$ \vec{x}_f = \vec{x}_i + \vec{v}\Delta t $$ Where we can think about v as being our average velocity over the time interval of interest (to prove this to yourself, go back to the example above and calculate Melonie's change in position knowing that their average velocity over the course of the 5 second interval was -3m/s). So, we may find our final position by plugging in the average velocity (the general equation for the average of two quantities), then subbing in our newly found equation for the final velocity of an object undergoing constant acceleration. $$ \vec{x}_f = \vec{x}_i + \vec{v}_{avg}\Delta t = \vec{x}_i + \frac{1}{2}(\vec{v}_f + \vec{v}_i)\Delta t $$ $$ \Rightarrow \vec{x}_f = \vec{x}_i + \frac{1}{2}\left[ (\vec{v}_i + \vec{a}\Delta t) + \vec{v}_i \right]\Delta t $$ $$ \Rightarrow \vec{x}_f = \vec{x}_i + \frac{1}{2}(2\vec{v}_i)\Delta t + \frac{1}{2}\vec{a} \Delta t^2 $$ $$ \Rightarrow \vec{x}_f = \vec{x}_i + \vec{v}_i\Delta t + \frac{1}{2}\vec{a} \Delta t^2 $$ Let us now analyze this equation to try and make sense of what it is telling us. Firstly, if our initial velocity and our acceleration is equal to zero, then our final position is just equal to our initial position, which makes perfect sense. Next, if we have no acceleration, then just the third term on the right hand side equals zero, and our final poisition is just equal to our initial position plus how far we have traveled due to us moving with some constant speed for a certain amount of time -- which is equivalent to the position equation derived earlier on this page. This means that the third term can be thought of as a correction term to find the extra distance we have traveled due to acceleration. Note that if we have negative acceleration, it will make it such that our final position is less than what it would be had we moved for the same amount of time with constant velocity.

Now let us compare this equation for position as a function of time to the general equation for a parabola, $$ g(t) = a + bt + ct^2 $$ $$ \vec{x}_f = \vec{x}_i + \vec{v}_i\Delta t + \frac{1}{2}\vec{a} \Delta t^2 $$ Hopefully it is clear that when we have constant acceleration, our position vs. time graph will yield a parabola!

Let us now use Python to help us inspect Lee's motion in a more visual way. We will first make some animations that are cute to look at, then we will make some static graphs that will be easier to retrieve information from.




   # Create a graph of position vs time, and animate it

   # import packages needed
   from pylab import figure,plot,xlabel,ylabel,title,show,grid,yticks,xticks,\
        axhline,axvline,subplot,ylim,xlim,rc_context,rcParams,rc,GridSpec
   from numpy import arange,concatenate,delete
   import numpy as np
   import matplotlib.animation as animation
   
   # define a functino that take your initial position, velocity, constant
   # acceleration, a time interval, and time step in as parameters, and returns
   # lists of your positions, velocities, accelerations, and times
   def kinematic(x_i, v_i, a, t_i, t_f, time_step):
       # t_i and t_f in increments of dt
       x_values = []                # our list to fill with positions
       v_values = []                # our list to fill with velocities
       a_values = []                # our list to fill with accelerations
       t_values = []                # our list to fill with times
       time_interval = t_f - t_i
       t = 0.0
       while t <= time_interval:
           # find Lee's position at time t
           x_position = x_i + v_i*t + 0.5*a*t**2  
           x_values.append(x_position)
   
           # find Lee's velocity at time t
           v_value = v_i + a*t
           v_values.append(v_value)
   
           # update our acceleration list to plot
           a_values.append(a)
   
           t_values.append(t + t_i)          # add the time to out list
           t += time_step                    # go to our next time step
   
       return(x_values, v_values, a_values, t_values)
   
   # call the function for the first 7s of Lee's motion, and set the output
   # equal to a vector eta1 = (x, v, a, t)
   dt = 0.05       # our time step
   eta1 = kinematic(0.0, 0.0, 6.75, 0.0, 7.0, dt)
   
   # Now for the next 1.5s of Lee's motion
   eta2 = kinematic(eta1[0][-1], eta1[1][-1], 0.0, 7.0, 8.5, dt)
   
   # Now for the final 4s of Lee's motion
   eta3 = kinematic(eta2[0][-1], eta2[1][-1], -11.81, 8.5-dt, 12.5, dt)
   
   # concatenate our arrays
   x_points = concatenate([eta1[0],eta2[0],eta3[0]])
   v_points = concatenate([eta1[1],eta2[1],eta3[1]])
   a_points = concatenate([eta1[2],eta2[2],eta3[2]])
   t_points = concatenate([eta1[3],eta2[3],eta3[3]])
   
   # add some points at the end of each list to have a still picture
   # at the end of our animations
   x_f = x_points[-1]
   v_f = v_points[-1]
   a_f = a_points[-1]
   t_f = t_points[-1]
   for t in arange(t_f, t_f+8,dt):
       x_points = np.append(x_points, x_f)
       v_points = np.append(v_points, v_f)
       a_points = np.append(a_points, a_f)
       t_points = np.append(t_points, t_f)
   
   # remove every 4th frame to make final gif smaller in memory
   length = len(t_points)
   x_points = delete(x_points, arange(0, length, 4))
   v_points = delete(v_points, arange(0, length, 4))
   a_points = delete(a_points, arange(0, length, 4))
   t_points = delete(t_points, arange(0, length, 4))
   
   # make a list of zeros for animating Lee's car
   zero_points = []
   for t in t_points:
       zero_points.append(0)
   
   # plot/animate
   rcParams.update({'font.size': 16})
   rc('axes', linewidth=2)
   with rc_context({'axes.edgecolor':'white', 'xtick.color':'white', \
                    'ytick.color':'white', 'figure.facecolor':'darkslategrey',\
                    'axes.facecolor':'darkslategrey','axes.labelcolor':'white',\
                    'axes.titlecolor':'white'}):
       # Our figure
       fig = figure(figsize=(14,10))
       fig.subplots_adjust(hspace=0.3,wspace=0.45)
       gs = GridSpec(2,3,figure=fig)
   
       # position vs time
       ax1 = fig.add_subplot(gs[0, :1])
       xlim(-1,13.5)
       ylim(-10, 380)
       axhline(0, color="white",lw=1,ls='--')
       axvline(0, color="white",lw=1,ls='--')
       xlabel("Time (s)")
       ylabel("Position (m)")
       title("Position vs. Time Graph")
   
   
       # velocity vs time
       ax2 = fig.add_subplot(gs[0, 1:2])
       xlim(-1,13.5)
       ylim(-2, 55)
       axhline(0, color="white",lw=1,ls='--')
       axvline(0, color="white",lw=1,ls='--')
       xlabel("Time (s)")
       ylabel("Velocity (m/s)")
       title("Velocity vs. Time Graph")
   
   
       # acceleration vs time
       ax3 = fig.add_subplot(gs[0, 2:3])
       xlim(-1,13.5)
       ylim(-13, 8)
       axhline(0, color="white",lw=1,ls='--',zorder=0)
       axvline(0, color="white",lw=1,ls='--',zorder=0)
       xlabel("Time (s)")
       ylabel("Acceleration (m/s^2)")
       title("Acceleration vs. Time Graph")
   
   
       # Animation of Lee
       ax4 = fig.add_subplot(gs[1, :])
       xlim(-30,360)
       ylim(-1,5)
       xlabel("Position (m)")
       ylabel("")
       title("Lee's New Tesla")
   
   
       # make the animations
       ims = []
       index = 0
       while index <= length + 1:
           # position vs. time graph
           leePosition, = ax1.plot(t_points[:(index+1)], x_points[:(index+1)],\
                               color='lime',lw=2.5)
   
           # velocity vs. time graph
           leeVelocity, = ax2.plot(t_points[:(index+1)], v_points[:(index+1)],\
                               color='cyan',lw=2.5)
   
           # acceleration vs. time graph
           leeAcceleration, = ax3.plot(t_points[:(index+1)], a_points[:(index+1)],\
                               color='magenta',lw=2.5)
           # animation of Lee's carr
           leeMove, = ax4.plot(x_points[index:(index+1)],zero_points[index:(index+1)],\
                               color="orange",marker='s',markersize=45)
   
   
           # add to ims list
           ims.append([leePosition, leeVelocity, leeAcceleration, leeMove])
           index += 1
   
       ani = animation.ArtistAnimation(fig, ims, interval=100, repeat_delay=5, blit=True)
       writer1 = animation.PillowWriter(fps=24)
       ani.save("lee.gif",writer=writer1,dpi=90)
   

Animation of Lee's Tesla

Lee gif

There are a few things worth pointing out here. First, note how our position vs. time graph is indeed not a straight line. Second, perhaps you can already tell that the slope of the velocity vs. time graph is indeed equal to the acceleration. Finally, notice how the acceleration graph has two immediate jumps. This is entirely a nonphysical situation, but it is much simpler to talk about it in this way, as we will shortly see in our discussion with our static graphs.

See the code block below to see how I make the static graphs to study.




   # Create a graph of position vs time, and animate it

   # import packages needed
   from pylab import figure,plot,xlabel,ylabel,title,show,grid,yticks,xticks,\
        axhline,axvline,subplot,ylim,xlim,rc_context,rcParams,savefig
   from numpy import arange
   
   # define a functino that take your initial position, velocity, constant
   # acceleration, a time interval, and time step in as parameters, and returns
   # lists of your positions, velocities, accelerations, and times
   def kinematic(x_i, v_i, a, t_i, t_f, time_step):
       # t_i and t_f in increments of dt
       x_values = []                # our list to fill with positions
       v_values = []                # our list to fill with velocities
       a_values = []                # our list to fill with accelerations
       t_values = []                # our list to fill with times
       time_interval = t_f - t_i
       t = 0.0
       while t <= time_interval:
           # find Lee's position at time t
           x_position = x_i + v_i*t + 0.5*a*t**2  
           x_values.append(x_position)
   
           # find Lee's velocity at time t
           v_value = v_i + a*t
           v_values.append(v_value)
   
           # update our acceleration list to plot
           a_values.append(a)
   
           t_values.append(t + t_i)          # add the time to out list
           t += time_step                    # go to our next time step
   
       return(x_values, v_values, a_values, t_values)
   
   # call the function for the first 7s of Lee's motion, and set the output
   # equal to a vector eta1 = (x, v, a, t)
   dt = 0.05       # our time step
   eta1 = kinematic(0.0, 0.0, 6.75, 0.0, 7.0, dt)
   
   # Now for the next 1.5s of Lee's motion
   eta2 = kinematic(eta1[0][-1], eta1[1][-1], 0.0, 7.0, 8.5, dt)
   
   # Now for the final 4s of Lee's motion
   eta3 = kinematic(eta2[0][-1], eta2[1][-1], -11.81, 8.5, 12.5, dt)
   
   # plot/animate
   rcParams.update({'font.size': 16})
   with rc_context({'axes.edgecolor':'white', 'xtick.color':'white', \
                    'ytick.color':'white', 'figure.facecolor':'darkslategrey',\
                    'axes.facecolor':'darkslategrey','axes.labelcolor':'white',\
                    'axes.titlecolor':'white'}):
       # Our figure
       fig = figure(figsize=(14,12))
       fig.subplots_adjust(hspace=0.4)
   
       # position vs time
       ax1 = subplot(2,2,1)
       # first time interval
       plot(eta1[3],eta1[0],color="lime",lw=2)
       plot(eta1[3][-1],eta1[0][-1],'o',color='magenta',markersize=6,zorder=3)
       # second time interval
       plot(eta2[3],eta2[0],color="cyan",lw=2)
       plot(eta2[3][-1],eta2[0][-1],'o',color='magenta',markersize=6,zorder=3)
       # final time interval
       plot(eta3[3],eta3[0],color="red",lw=2)
   
   
       xlim(-1,13.5)
       ylim(-10, 380)
       axhline(0, color="white",lw=1,ls='--')
       axvline(0, color="white",lw=1,ls='--')
       xlabel("Time (s)")
       ylabel("Position (m)")
       title("Position vs. Time Graph")
   
   
       # velocity vs time
       ax2 = subplot(2,2,2)
       # first time interval
       plot(eta1[3],eta1[1],color="lime",lw=2)
       plot(eta1[3][-1],eta1[1][-1],'o',color='magenta',markersize=6,zorder=3)
       # second time interval
       plot(eta2[3],eta2[1],color="cyan",lw=2)
       plot(eta2[3][-1],eta2[1][-1],'o',color='magenta',markersize=6,zorder=3)
       # final time interval
       plot(eta3[3],eta3[1],color="red",lw=2)
       # shade area under the first time interval
       ax2.fill([0, eta1[3][-1], eta1[3][-1]], [0, eta1[1][-1], 0], "lime", alpha=0.15)
       # shade area under the second time interval
       ax2.fill([eta2[3][0], eta2[3][0], eta2[3][-1], eta2[3][-1]], [0, eta2[1][0],\
                                                                     eta2[1][-1], 0], "cyan", alpha=0.2)
       # shade area under the final time interval
       ax2.fill([eta3[3][0], eta3[3][0], eta3[3][-1]], [0,eta3[1][0], 0], "red", alpha=0.15)
       xlim(-1,13.5)
       ylim(-2, 65)
       axhline(0, color="white",lw=1,ls='--')
       axvline(0, color="white",lw=1,ls='--')
       xlabel("Time (s)")
       ylabel("Velocity (m/s)")
       title("Velocity vs. Time Graph")
   
   
       # acceleration vs time
       ax3 = subplot(2,2,3)
       #first time interval
       plot(eta1[3],eta1[2],color="lime",lw=2)
       plot(eta1[3][-1],eta1[2][-1],'o',color='magenta',markersize=6,zorder=3)
       # first verticle line
       plot([eta1[3][-1], eta1[3][-1]], [eta1[2][-1], eta2[2][0]],'--',color='magenta')
       plot(eta1[3][-1],eta2[2][-0],'o',color='magenta',markersize=6,zorder=3)
       # secon time interval
       plot(eta2[3],eta2[2],color="cyan",lw=2,zorder=2)
       plot(eta2[3][-1],eta2[2][-1],'o',color='magenta',markersize=6,zorder=3)
       # second verticle line
       plot([eta2[3][-1], eta2[3][-1]], [eta2[2][-1], eta3[2][0]],'--',color='magenta')
       plot(eta2[3][-1],eta3[2][0],'o',color='magenta',markersize=6,zorder=3)
       # final time interval
       plot(eta3[3],eta3[2],color="red",lw=2)
       # shade the area under our curve for first interval
       ax3.fill([0,eta1[3][0],eta1[3][-1],eta1[3][-1]], [0,eta1[2][0],eta1[2][-1],0],\
                "lime", alpha=0.15)
       # shade the area under our curve for final interval
       ax3.fill([eta2[3][-1],eta2[3][-1],eta3[3][-1],eta3[3][-1]], [0,eta3[2][-1],\
                                                                    eta3[2][-1],0],"red", alpha=0.15)
       xlim(-1,13.5)
       ylim(-13, 8)
       axhline(0, color="white",lw=1,ls='--',zorder=0)
       axvline(0, color="white",lw=1,ls='--',zorder=0)
       xlabel("Time (s)")
       ylabel("Acceleration (m/s^2)")
       title("Acceleration vs. Time Graph")
   
   savefig("Lee.png")
   

Graphs of Lee's Motion

Lee gif

Let us start with the acceleration vs. time graph, and work our way backwards. Much how the area under a velocity vs. time curve yields the change in position, the area under an acceleration vs. time curve yields a change in velocity! Let us find the area under the acceleration vs time curve in our first time interval (the area of the green rectangle). Well, the width of the rectangle is 7 seconds, and its height is 6.75m/s2. Thus Lee's change in velocity in the first 7 seconds was $$ \Delta\vec{v}_1=\text{Area}=(\text{height})(\text{width}) = \vec{a}\Delta t = (6.75\text{m/s}^2)(7\text{s})=47.25\text{m/s} $$ Precisely what we calculated earlier! Now, since we know that Lee started at rest, and ended at rest, we should expect that their change in velocity throughout the final time interval is -47.25m/s. Let's see if the area of the red rectangle is equal to this quantity, $$ \Delta\vec{v}_3=\text{Area}=(\text{height})(\text{width}) = \vec{a}\Delta t = (-11.81\text{m/s}^2)(4\text{s})=-47.24\text{m/s} $$ Well, we are off by 0.01m/s due to rounding errors, but it still checks out!

Now we turn our attention to the velocity vs. time graph. First note that the slope of our velocity vs. time graph ought to give us the acceleration. Let's find the slope of the velocity vs. time graph for the first time interval (the slope of the green line) and see if it checks out, $$ \vec{a}_1 = \text{slope} = \frac{\text{rise}}{\text{run}}= \frac{\vec{v}_f-\vec{v}_i}{t_f-t_i} =\frac{47.25\text{m/s}-0}{7\text{s}-0}=\frac{47.25\text{m/s}}{7\text{s}}=6.75\text{m/s}^2 $$ Nice! Obviously, the slope of the second time interval (the cyan line) zero, as was the acceleration during that time interval. Now, how about the slope of our final time interval (the slope of the red line)? $$ \vec{a}_3 = \text{slope} = \frac{\text{rise}}{\text{run}}= \frac{\vec{v}_f-\vec{v}_i}{t_f-t_i} =\frac{0-47.25\text{m/s}}{12.5\text{s}-8.5\text{s}}=\frac{-47.25\text{m/s}}{4\text{s}}=-11.81\text{m/s}^2 $$ Astounding!
We have yet to discuss how far Lee has traveled. Let us find out by calculating the area under our velocity vs. time curve. Let us start with the first time interval (the green triangle) $$ \Delta\vec{x}_1=\text{Area}=\frac{1}{2}(\text{height})(\text{base})=\frac{1}{2}\vec{v}_f\Delta t =\frac{1}{2}(47.25\text{m/s})(7\text{s})=165.4\text{m} $$ Now what about our change in position while Lee had constant acceleration (the area of the cyan rectagle)? $$ \Delta\vec{x}_2=\text{Area}=(\text{height})(\text{width})=\vec{v}\Delta t =(47.25\text{m/s})(8.5\text{s}-7\text{s}) $$ $$ \Rightarrow \Delta\vec{x}_2=(47.25\text{m/s})(1.5\text{s}) = 70.9\text{m} $$ Finally, what about Lee's change in position for the final time interval (the area of the red triangle)? $$ \Delta\vec{x}_2=\text{Area}=\frac{1}{2}(\text{height})(\text{base})=\frac{1}{2}\vec{v}_i\Delta t =\frac{1}{2}(47.25\text{m/s})(12.5\text{s}-8.5\text{s}) $$ $$ \Rightarrow \Delta\vec{x}_3= \frac{1}{2}(47.25\text{m/s})(4\text{s})=94.5\text{m} $$ So in the entire 12.5 second experience, Lee traveled a total distance of $$ \Delta\vec{x}_{net} = \Delta\vec{x}_1 + \Delta\vec{x}_2 + \Delta\vec{x}_3 = 165.4\text{m} + 70.9\text{m} + 94.5\text{m} = 330.8\text{m} $$

Finally, let us look at the slope of our position vs. time graph to find our velocity in each time interval... but wait... there is only one time interval with constant velocity (the cyan line), how are we supposed to find the slope of our graph everywhere else? Well, you can find the average slope (average velcotity) over the first and final time intervals, but since the slope is not constant we would need to introduce calculus to find the velocity at any given moment in time -- also known as the instantaneous velocity.



Conclusion

As a conclusion for this section, we will just list the kinematic equations we have covered here. Again, reminding ourselves that kinematic equations are only viable in the case of constant acceleration. I will also add a third kinematic equation that is commonly used, with a derivation following suit. (I am going to drop the vector notation here). $$ x_f = x_i + v_i\Delta t + \frac{1}{2}a\Delta t^2 $$ $$ v_f = v_i + a\Delta t $$ $$ v_f^2 = v_i^2 + 2a\Delta x $$
To derive the third equation, we start by solving the second equation for the change in time. $$ \Delta t = \frac{v_f - v_i}{a} $$ Now we take this expression for the change in time, and plug it into the first equation. $$ (x_f - x_i)=v_i\left( \frac{v_f-v_i} {a} \right) +\frac{1}{2}\left( \frac{(v_f-v_i)^2}{a} \right) $$ $$ \Rightarrow a\Delta x = v_iv_f - v_i^2 + \frac{1}{2}v_f^2 - v_iv_f + \frac{1}{2}v_i^2 $$ $$ \Rightarrow a\Delta x = \frac{1}{2}(v_f^2-v_i^2) $$ $$ \Rightarrow 2a\Delta x + v_i^2 = v_f^2 $$



Back to the top