Making mechanics less mechanical
Kripa Gowrishankar and Richard Fernandes
Galileo is credited with discovering the laws of the simple pendulum. It is a much told story that he observed the swinging of the lantern in the cathedral of Pisa (whose bell tower is the famous Leaning Tower) during a church service. He is said to have timed it against his pulse, which one presumes he had suspected to be of uniform temporal nature.
Galileo also studied the motion of objects rolling down an inclined plane. Once again, he used ingenuous methods for timing, like water dropping from a hole in a can.
Among his many fundamental contributions to physics was his famous assertion that two objects dropped from the same height reach the ground at the same time regardless of their mass. He used a variety of arguments to support this assertion to the discomfiture of the then authorities of physics. It is however easy to see the difficulty these authorities had. Pose this question to a class of students who have not been “taught” this and chances are that the vast majority will suggest that the heavier object will fall faster. Now, perform this experiment. It does not take much equipment – just two stones of different masses and the ear. Ask the students to drop them at the same time. The resounding thud the two stones produce when they hit the ground simultaneously is worth more than an hour of painfully teaching at the blackboard.
Four hundred years ago, Galileo, with his observation of the simple pendulum laid the foundation for the careful keeping of time that has evolved from the pendulum clocks to the modern pendulums made of oscillating crystals, electrons in atoms, etc. A related development of technology gave us the motion picture camera and this has evolved into the video camera.
Video cameras are now commonplace. They are bundled hardware on cell phones. The video camera on an entry level smart phone operates at 30 frames per second (fps), which means that it takes a snap shot of a scene once every 1/30th of a second. The actual exposure time of this snapshot is varied and could be about 1/500th of a second or less. So, it means that when we take a video of a scene, we have records of the scene 1/30th of a second apart. Laptop webcams have a slightly lower frame rate of 20 fps. The older or very basic cell phones usually use a much lower frame rate.
We describe in this article ways you can use this common gadget to enhance the learning experience in physics for your students and make the study of motion less mechanical and abstract. We make use of open source and free software like libreoffice paint/calc (available for both windows and ubuntu/linux), forevid (windows), ffmpeg (ubuntu) and tracker (windows/ubuntu). The experiments can be class based or do-it-yourself-at-home.
The experimental setup consists of a securely and rigidly mounted cell phone. If you have a cell phone stand, the type used to mount the phone on a car dashboard, use it. We fashioned a simple one using the side of a box and some double sided tape. Place this on a table or stand and secure it to the surface using adhesive tape or any tacky material such as putty or bubble
gum. The camera should be placed so that it is approximately in the centre of the motion you wish to record.
Choose a well lit area. Avoid working against a cluttered background. A uniformly painted wall works best. The object whose motion is being studied should contrast the background; if it is dark, the object should be light coloured and vice versa. Start the camera a few seconds before initiating the motion being recorded. To quantify measurements, you will need to measure the distance between fiducial markers placed near the motion being recorded. The height of the background board in our case is a convenient reference. The coincidence of the fiducial markers with the plane of motion is important if one wishes to reduce parallax errors and achieve greater accuracy.
We present two methods of analysis of the motion videos. The first, though tedious, develops the technique of analysis and is necessary for understanding the processes involved. The second uses an application that is more of a “black box” but is valuable for its speed and ease of use.
Manual recording of positions from individual frames: Free fall
Let us begin with the simplest of motions: free fall under gravity. A tennis ball is dropped from a convenient height (about 1.8 metres in our case) and the video of its motion is recorded for a couple of bounces.
Video files are generally stored in the mp4 format. In ubuntu, the ‘cheese’ program helps you capture videos using a webcam but will store them in the ‘webm’ format. To change the format to mp4, use the command-line based program ‘ffmpeg’. To convert movie.webm to movie.mp4 in ubuntu, open a terminal and type in ‘ffmpeg -i movie.webm -qscale 0 movie.mp4’.
Libreoffice paint can read images stored in jpeg/png or any other image format, and so Forevid or ffmpeg are used to fragment the mp4 files into individual image files.
In Windows, use Forevid to extract the individual frames from the video. In the first screen, click on New Project and enter the desired documentary information. Click on “OK”. The main screen opens. Import the video of interest using “File>Open Video …”, browse to the video clip of interest and click “Open”. The video is now loaded and ready for editing.
The next step is to extract the individual frames for analysis. To do this, move to a frame where the motion is impending using the >, >> and << buttons at the bottom of the screen. Click on the “{‘’ button to select the start point. Now scroll to the last required frame and click the “}” button. The portion selected will be highlighted on the time line. Now, click File>Export and select the “Select frame as images” menu item. A dialog box “Export Images” will appear. Browse to a folder where you wish the individual frames to be stored and click “OK”. If you now open the folder using a File Explorer, you will find that there are a large number of image files, with sequentially numbered image frames.
In Ubuntu, use ffmpeg to fragment the movie into images. Open a terminal, type: ffmpeg -i movie.mp4 -f image2 image-%3d.jpg, and press ‘enter’. The number after the ‘%’ sign tells you the maximum number of digits the frame index can have. For instance, if you have up to 99 frames, then the number is 2. You will find the separated image files with sequentially numbered frames listed in your working directory.
Next, read the frames in Libreoffice Paint by clicking ‘File’ and then ‘Open’. Select the first image file to open and click ‘Open’. You can now find the position of the tennis ball by hovering the mouse over the ball and noting down the positions using the x and y guides (the first entry of the bottom-most panel) of the paint program. Note down the y coordinate as this represents the height of the ball in a libreoffice spreadsheet. Repeat this process for the next few images until you find that the tennis ball in the image has bounced off the floor at least twice.
The data can then be analyzed using libreoffice calc. In the first column, record the `y’ position in the arbitrary units that paint supplies. These units will have to be converted to units of length, in metres.
The resolution of the smartphone camera is 30 fps and the webcam is 20 fps. So each consecutive frame advances by 1/30=0.033 sec (smartphone) or 1/20=0.05 sec (webcam). Record the time as (frame index)*0.033 seconds (or 0.05 seconds for the webcam) in the second column, where the frame index starts at 0 for the first image and increases by 1 for consecutive images.
Measure the distance L, between the fiducial markers. In our case, the height of the board in the background is 1.81 meters. Note down the y coordinate of the top and bottom of the board as ytop and ybot. To read the positions of the ball in units of metres, apply the conversion factor
y (in metres)={(y (in arbitrary units)-ybot) * (L)}/(ytopybot).
Record the height in metres in the third column. Calculate the velocity for the frame ‘n’ using
velocity(n)= {height(n)-height(n-1)}/{time(n)-time(n-1)}.
Record the velocity in the fourth column.
Finding acceleration due to gravity (g)
The acceleration can be calculated as well, using
acceleration(n) = {velocity(n)-velocity(n-1)}/{time(n)-time(n-1)}
But you will notice that the traces of height vs time, velocity vs time and acceleration vs time become progressively more jagged, making it difficult to calculate the acceleration. Notice however that velocity trace is a well-defined straight line (with some random noise), verifying that the acceleration due to gravity is a constant. To find the value of acceleration, the position vs time trace can be fit to the function h=gt2/2 using least squares fitting.
Least squares’ fitting of data to a known function means that the sum of the squares of the errors (E) at every point in time is minimized. In our case, the data is the height as a function of time and the known function is the quantity gt2/2 as a function of time. The quantity to be minimized is E = S(h(t)-gt2/2)2. The value of the parameter ‘g’ can be calculated by equating the derivative of E with respect to g to 0. After a little algebra, you will see that this gives g=S[h(t)*t2]/S[t4]
Using the first 15 frames of our video, we found the value of g to be 10.0 m/s2.
As an alternate method, one can use the table to find the distance travelled over a few frames, say 10, and using the equation g=2h/t2.
Software aided recording of position: The simple pendulum
The mp4 movies can be analyzed directly using Tracker, available for both windows and ubuntu. This reduces the tedium of the manual method and allows students to focus more on the phenomena being studied rather than on the method of analysis. Load the video of interest from File>Import>Video. The first frame appears in the panel.
Right click on the axis label on the graph to select the desired parameters to be displayed. Click on the “Create” button and select “Point Mass” from the drop down menu. The cursor changes to a cross hair when the “Shift” key is pressed. Keep the shift key pressed and move the cross hair to the mass point of interest and select it by clicking the left mouse button. The x and y coordinates of the point will appear in the table on the right and the selected variable will appear on the graph. The displayed frame will also automatically advance and the process is repeated till the entire video is completed.
We have used this to analyze the motion of a simple pendulum.
The sinusoidal nature of the motion is evident from the automatically plotted data. The velocity and acceleration traces can also be displayed by selecting the appropriate ordinate. It is also possible to export the raw data from File>Export>Data File.. >Save As. The data can then be imported into libreoffice calc for further analysis and display.
We have also used Tracker to study the free fall of two balls of different masses. The movie clearly shows that the two balls reach the floor at the same time. You could extend the exercise to calculate coefficients of restitution of the two balls by recording the maximum heights reached in consecutive bounces.
Recommendations for future work
We hope to have demonstrated the methods of using these simple and readily available tools and techniques to make the mechanics class more exciting for students. This is only the beginning and these techniques can be applied to any experiment or demonstration where time dependent phenomena are studied. Here are a few suggestions to get you started:
- Study of two dimensional projectile motion.
- Use the camera to record the reading of an alcohol or mercury thermometer to study the rate of cooling of an object in free air (Newton’s law of cooling).
- Study underdamped, critically damped and overdamped motion by recording the light spot of a moving coil galvanometer.
These are just examples to get you going. Your imagination is the limit!
Software sources
ffmpeg is a versatile video encoder and decoder available on https://www.ffmpeg.org/download.html.
The download instructions for Tracker are available on https://www.cabrillo.edu/~dbrown/tracker/.
LibreOffice is available at https://www.libreoffice.org/download/libreoffice-fresh/.
Forevid is available at http://sourceforge.net/projects/forevid/files/Releases/1.2.1/.
The authors are with the School of Liberal Studies, Azim Premji University. They can be reached at kripa.gowrishankar@apu.edu.in and richard.fernandes@apu.edu.in respectively.