Friday, 25th July 2014

In most of the mechanics experiments we are trying to plot multiple graphs ( position, velocity and acceleration or kinetic energy and potential energy etc.)  in one figure. In the figure the axis labels of two graphs are overlapping. These labels should have some spacing between them.

Today, while trying to solve this problem I got the information about tight-layout function from matplotlib (thanks to Google),

Here is the figure without tight-layout() function. The axis labels and titles are overlapped.

Sometimes it can happen that axis labels or titles (or sometimes even ticklabels) go outside the figure area, and are thus clipped. tight_layout() can prevent this and also adjust spacing between subplots to minimize the overlaps.

This figure is obtained using tight-layout() function…

Today I have gathered required apparatus for performing various experiments like resonance and oscillations. Next two days I will set-up almost all planned experiments for my GSoC project.

Thursday, 24th July 2014

Python program ( srf3.py) to fetch data from srf module  and plot graphs needed some modifications to plot velocity and acceleration graphs. Today we could re-write the program to calculate velocity and acceleration. The program also plots position, velocity and acceleration.

Now I am working on smoothing the graphs using filtering techniques. Wrote a program using Savitzky-Golay filtering ( From this source). I could remove all the errors in the program but not getting the plots. Need to work on it.

Here is the screenshot of graphs obtained.

Velocity is calculated using numerical differentiation and acceleration is calculated as the second derivative of position with numerical methods. Wrote following code for velocity and acceleration. Committed the entire program to GIT Repo.

——————————————————————————————————

va = []
aa = []
for i in range(0,len(da)-1):
# Calculate Velocity
v = (da[i+1]-da[i])/(ta[i+1]-ta[i])
va.append(v)
#aa= diff(va)

# Calculate Acceleration
if i < len(da)-2:
a = (da[i+2]-2*da[i+1]+da[i])/((ta[i+2]-ta[i+1])*(ta[i+1]-ta[i]))
aa.append(a)

—————————————————————————————————-

Wednesday, 23rd July 2014

Enjoyed setting-up sound resonance experiments. It really fun doing sound experiments with ExpEYES.

Polished the python code written yesterday. Now it is more flexible, user can digitize sound from any source and get the waveform on the screen. Using Xmgrace frequencies can be obtained.

Curve fitting function in the program is not giving correct results. It needs to be corrected.

Also with the new program we can vary the frequency of sound generated by the buzzer and one it matches with the natural frequency of resonator, a loud sound is generated. Used Helmholtz equation to relate frequency with volume.

Tried the code with different vessels, a bottle, a test tube a pipe and a round bottom flask (borrowed from chemistry lab.) Results are amazing.

Here is some useful information: (Source)

Some small whistles are Helmholtz oscillators. The air in the body of a guitar acts almost like a Helmholtz resonator. An ocarina is a slightly more complicated example, because for the higher notes it has several holes. Loudspeaker enclosures often use the Helmholtz resonance of the enclosure to boost the low frequency response. Here we analyse this oscillation, informally at first. Later, we derive the equation for the frequency of the Helmholtz resonance.

The vibration here is due to the ‘springiness’ of air: when you compress it, its pressure increases and it tends to expand back to its original volume. Consider a ‘lump’ of air at the neck of the bottle . The air jet can force this lump of air a little way down the neck, thereby compressing the air inside. That pressure now drives the ‘lump’ of air out but, when it gets to its original position, its momentum takes it on outside the body a small distance. This rarifies the air inside the body, which then sucks the ‘lump’ of air back in. It can thus vibrate like a mass on a spring . The jet of air from your lips is capable of deflecting alternately into the bottle and outside, and that provides the power to keep the oscillation going.

Tuesday, 22nd July 2014

Today I started working on an interesting experiment of Helmholtz Resonator.

A Helmholtz resonator is generally, a container of gas (usually air) with an open  neck or port. A volume of air in and near the open hole vibrates and produces audible sound with specific frequency. A common example is an empty bottle: the air inside vibrates when you blow across the top (It’s a fun experiment, because of the surprisingly low frequency and loud sound that results.)

I wrote a python program to  digitize sound resulted from different resonators. With this program it is possible to change the frequency of source and when it matches with the natural frequency of resonator, a loud sound is produced.

Tested the code with a bottle ( which resonates at about 200 Hz) and  a test tube (which resonates at about 450 Hz).

Tomorrow I will set up a complete experiment to study the phenomena of volume resonance.

Monday, 21st July 2014

Continued working on GUI for using photo-gates for various experiments. Writing python code for this single GUI with which user can access different experiments involving time measurements.

The program is giving time-out errors while using two photo-gates simultaneously. Need to debug all the errors by tomorrow so that this GUI will be ready.

…. About Light Barrier as Photo sensor ( Source expeyes.in)

A photo-transistor plus LED combination can be used for measuring light transmission and for sensing the timing of mechanical movements. The LED is powered by SQR1. The collector of the photo-transistor is connected to SEN, which is connected to 5 volts through a 5.1k resistor. The voltage at the collector of the photo transistor changes according to the amount of light falling on it. The built-in analog comparator on SEN input is used for timing measurements when the light crosses a certain threshold.

GSoC Weekly Report 9

( From Monday 14th July 2014 to Sunday, 20th July 2014)

This week I started setting up few new experiments with Spring Oscillations and Friction.

Experiment to investigate the damping effect of air, water and other viscous liquids on spring oscillations can be very interesting if done with a computer interface. Currently these set-ups are available for very high cost and come with proprietary and  closed source software. They general use Rotary motion sensors which are costly. We could set up this experiment with low cost apparatus using ExpEYES. Tried using a simple DC motor to fetch the data and plot oscillations. ( we were using this method for digitizing pendulum waveform). After  multiple trials now the setup is ready and got amazing results.

The schematic diagram and my home made set up is here……

Here is the screen-shot of the waveform generated in water.

Repeated the experiment with other liquids like glycerin.

• Oscillations is a very important phenomena in physics and has an extremely wide range of occurrences. They are visible in the swinging and cushioning of cars or suspension bridges. In Nature, oscillation always occur as coupled ones. I started working on setting up an experiment with two spring pendulum to study oscillations of coupled pendulum. In this experiment we will try to get the characteristic frequencies and investigate the phenomenon of beat-vibration with two coupled spring pendulum.

• Conservation of energy is yet another important concept in mechanics. It can be demonstrated easily by calculating total energy of a body at different positions during its motion. We could do this experiment in two ways
1. Using Ultrasocic sensor :  SRF 05 module transmits a burst of ultrasonic pulses. The ultrasonic pulses reflect off a target and return to the face of the sensor.  The sensor measures the time between the trigger rising edge and the echo rising edge. It uses this time and the speed of sound to calculate the distance to the object. To determine velocity, it uses consecutive position measurements to calculate the rate of change of position.
2. Using Photogates : A photogate monitors the motion of objects passing through its gate, counting events as the object breaks the infrared beam. If the size of the object is known, by measuring the time an object blocks the gate, you can determine the velocity.

Also got the apparatus for energy conservation experiment prepared from local carpenter in wood. Its working fine. Wrote python program for the experiment. User can enter the value of initial height of the metal sphere, to calculate Potential energy. When the Sphere roles between two photo-gates, time can be measured with microsecond accuracy and velocity and hence kinetic energy can be calculated. The results show that Initial Potential Energy is equal to final Kinetic Energy and hence proves the Energy Conservation Theorem.

• Did required modifications in the main GUI program ” CROPLUS” written by Dr Ajith Kumar, to access these new experiments. Uploaded this program on my GIT repo. Also started writing a new program for a GUI  to access these mechanics experiments separately.

As of now all the basic requirements i.e. the sensors and the required python programs to access them are ready. Also most of the physical set-ups are ready ( Excluding independent sine wave generator). Now I will be focusing on …redoing the experiments, debugging the errors and polishing and finalizing python code for each experiment.

To Do next week…

1. Finalize  all mechanics and sound experiment.
2. Complete the required documents and publish them in repository.
3. Start working on Integrated GUI for mechanics experiments.

Saturday, 19th July 2014

Today I worked on python programs for Mechanics – friction experiments and documentation of mechanics experiments. Started working on a GUI for using photo-gates for different  time measurements. This can be used for various experiments involving precise time measurement.

Friday, 18th July 2014

today, I could get the apparatus for energy conservation experiment prepared from local carpenter in wood. Its working fine. Wrote python program for the experiment. User can enter the value of initial height of the metal sphere, to calculate Potential energy. When the Sphere roles between two photo-gates, time can be measured with microsecond accuracy and velocity and hence kinetic energy can be calculated. The results show that Initial Potential Energy is equal to final Kinetic Energy and hence proves the Energy Conservation Theorem.

This simple experiment is very useful for high school students.

Did required modifications in the main GUI program ” CROPLUS” written by Dr Ajith Kumar, to access these new experiments. Uploaded this program on my GIT repo.

Now writing a new program for a GUI  to access these mechanics experiments separately.

Next week I will finalize sound experiments.

Thursday, 17th July 2014

Conservation of energy is an important concept in mechanics. It can be demonstrated easily by calculating total energy of a body at different positions during its motion. Today I planned and worked on the set up of   a new and simple experiment to demonstrate this.

The experiment can be done in two ways

1. Using Ultrasocic sensor :  SRF 05 module transmits a burst of ultrasonic pulses. The ultrasonic pulses reflect off a target and return to the face of the sensor.  The sensor measures the time between the trigger rising edge and the echo rising edge. It uses this time and the speed of sound to calculate the distance to the object. To determine velocity, it uses consecutive position measurements to calculate the rate of change of position.
2. Using Photogates : A photogate monitors the motion of objects passing through its gate, counting events as the object breaks the infrared beam. If the size of the object is known, by measuring the time an object blocks the gate, you can determine the velocity.

I could do the experiment with two photogates using a small spherical ball rolling on an inclined plane.

Tomorrow I will get the wooden ramp for this purpose. Program to measure the time and to calculate Kinetic and Potential energy is ready.I will also try to do the same experiment using SRF module.

Wednesday, 16th July 2014

Oscillations is a very important phenomena in physics and has an extremely wide range of occurrences.

They are visible in the swinging and cushioning of cars or suspension bridges. In Nature, oscillation always occur as coupled ones.

Today I started working on setting up an experiment with two spring pendulum to study oscillations of coupled pendulum. In this experiment we will try to get the characteristic frequencies and investigate the phenomenon of beat-vibration with two coupled spring pendulum.