( From Monday 21st July 2014 to Sunday, 27th July 2014)
I am happy with the work that I could do this week. Planning and basic set-up of almost all planned experiments for my GSoC project is complete. Gathered the required apparatus and set-ups are ready. Still some work on python programs for these experiments and documentation is to be done. In another week I will be able do complete the work. Then I can focus on polishing the code and finalizing everything.
Things we could do this week…..
Completed python program for using photo-gates for time measurements in various experiments. ( Some issues like timeout error are to be solved)
Started working on an interesting experiment of Helmholtz Resonator.
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).
Python program ( srf3.py) to fetch data from srf module and plot graphs needed some modifications to plot velocity and acceleration graphs. Now the basic program is complete and plots position, velocity and acceleration. 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.
- 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. Studied different functions available in python. I found tight-layout() function from matplotlib to be very easy and useful. 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.
- The experiments of resonator and resonance tube are generally performed with tuning forks. Since tuning fork produces very low intensity sound, it is not clearly audible and the frequency is fixed. therefore the length of the resonance pipe must be changed to adjust with the frequency of tuning fork. We used a speaker connected to SQR1 of ExpEYES. frequency of SQR1 can be varied till we get sound of resonance. a wide range of frequencies is available from ExpEYES therefore it is easy to do this experiment with various sizes of tubes and resonators. We used a mic to study the amplitude. Wrote a python program to change frequency of SQR1 and to plot the frequency v/s amplitude graph. The program for frequency response study of pizzo buzzer was already available. Just made few modifications required for this experiment. I did experimental trials with a measuring flask, plastic pipe, conical flask and a round bottom flask. Resonant frequency is between 300Hz to 750 Hz which varies with length of tube and volume of resonator.
Difficulties faced and things TO DO next week….
- 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.
- Ultrasonic sensor giving time-out error when used with get-echo program with SQR2 and IN1. It is working fine with SQR1 and SEN. Need to solve this issue.
- Need to write a separate GUI for time, Speed and acceleration measurements using Photo-gates.
- Complete Coupled pendula experimental set-up and python program.
- Continue working on documentation.
This week ( From Monday 9th to Sunday, 15th June 2014) we really accelerated working with experiments and coding.
Constant encouragement and guidance from my mentors, Mario Behling and Dr. Ajith Kumar really helped me to keep going.
What We Could Do….
- Attempted to use two Ultrasonic sensors simultaneously to detect position. Used two srf05 modules to plot graphs. Both the graphs were out of phase as expected. This is very much useful for momentum transfer experiments involving collision. Uploaded the code to Github Repo.
- Explored different methods of determining velocity and acceleration. Used the same set up of linear track in inclined position at about 45 degrees. Allowed vehicle to glide downwards and plotted position-time graph. Got straight line with positive slope as expected. For this used SRF05 module.
- Then used photo-gate with ExpEYES kit and could make time measurements.
- Designed a pickup device for use with photogate. ( Thanks to Open Educational Resources on the web)
- This can generate a square wave as it passes through photogate. Acceleration can be determined using the signal generated. Excited to see its working. Some proprietary closed source devices use this method……….( of course they come at a very high cost price). This will result in a very low cost setup
- This is the photo gate used. (photo from www.expeyes.in)
- Modified the photo-gate design so that it will be easy to use with linear air track set-up.
- Today tried to measure acceleration due to gravity using motion of glider on an inclined plane. Used the pickup i designed yesterday and photo-gate to measure acceleration. The results are very good and are in close agreement with theoretical calculations. For motion on an incline acceleration along the inclined plane is g’ = g sin(theta) where (theta) is the angle on inclination. wrote a small python code using time measurement functions of ExpEYES library.
- Used these time measurement functions:
- p.multi_r2rtime(3) # time for 1 cycle
- p.multi_r2rtime(3,2) #time for 4 cycles, 2 rising edges are skipped
- Now we can do the acceleration due to gravity measurement with two different methods
- By using motion sensor …. the data is recorded with uniform time intervals.
- By using Photo-gates …… the time intervals are not uniform. time taken for traveling different distances can be measured and data can be used to calculate acceleration.
- Worked on plotting 2D graphs using ‘matplotlib’ library. Matplotlib is a python 2D plotting library which produces publication quality figures in a variety of formats and interactive environments across platforms. I found it to be a very powerful tool for teaching and learning physics. Wrote code for plotting different graphs useful for mechanics experiments. Here are some screen shots….
- Data ( time and position) obtained from Ultrasonic sensor is stored in a file srf.dat and then plotted. I just moved a piece of paper to and fro, in-front of the sensor. Plot is reasonably good. In another trial fetched data from the file and plotted….matplotlib is amazing …
- Tried plotting Lissajous figures…..this code will be useful for my sound experiments……beautiful yet simple….its python…
- Numerical Differentiation for calculation in mechanics
- Acceleration Graphs are scattered and lack accuracy in measurement.
- Calculation of acceleration using Photo-gate and pickup device
To Do Next Week
- Coming week I will be focusing giving finishing touch to the individual experiments….
- Documentation with experimental procedure for the experiments developed
- Taking Photos/Videos of set up and also upload screen shots.
- Develop code to Access all the experiments through single GUI
- Finalize the codes for individual experiments on Github
- Prepare for mid-term evaluation
here is my git activity for this week https://github.com/wavicles/Plugins-for-ExpEYES/commits/master
Coding …. coding and Coding…
Since yesterday I am working on Plotting Graphs.
Here are some screen shots of my trials
Data ( time and position) obtained from Ultrasonic sensor is stored in a file srf.dat and then plotted. I just moved a piece of paper to and fro, in-front of the sensor. Plot is reasonably good.
In another trial fetched data from the file and plotted….matplotlib is amazing … 🙂
Need to debug the errors…..to get subplots…
Also tried plotting Lissajous figures…..this code will be useful for my sound experiments…….beautiful yet simple….its python… 🙂
Coming week I will be focusing giving finishing touch to the experiments….
here is my git activity for today https://github.com/wavicles/Plugins-for-ExpEYES/commits/master
My experimental setup for few mechanics experiments is ready and I am getting good results in terms of motion graphs.
Today studied and tried plotting 2D graphs using ‘matplotlib’ library. Matplotlib is a python 2D plotting library which produces publication quality figures in a variety of formats and interactive environments across platforms. I found it to be a very powerful tool for teaching and learning physics. Here are some screen shots……
A simple Position -time graph
Here is an example showing relation between Uniform circular motion and Simple Harmonic Motion. Projection of UCM is SHM
Here is the link for these programs on my Github repository