site logo Advanced Physics Projects for School & Home
open source science on a budget
Home Projects Blog Downloads About

Short Programs written by a student for a Physics P.A.G.

Three programs, written in C under Linux as part of Saul's physics PAG discussing 'The Modelling of Continous Events'.

  • 'PAGThing' - a simple simulation of a mass-string system demonstating how time-step based simulations can drift from the true results. Uses the GTK 3.0 library.
  • '2dHeatSim' - a simple program using the Euler method of differential equation approximation to simulate heat flow in a 2d object. Uses the GTK 3.0 library.
  • 'Proper1dheatSim' - Displays an animated graph showing the changing heat distribution along a 1d object using the Euler method and the actual 1d heat equation (for when either end has a temperature of 0)
simulation 1
discrete sim. vs continous function
simulation 2d heat flow
2d heat flow sim.
simulation 1
1d heat flow sim.
Download files

Last updated 4/8/22

---------------------------

Infrasound Analyser Program

Infrasound Analyser program plus instructions, sample data and ammended sonify program.

Last updated 19/7/22) -

Download files

Just Instructions

---------------------------

Photos for Articles

Here are some photos of the construction of our Infrasound Monitor - specifically one being built for a researcher in the Netherlands who plans to use it for mobile surveys in Greenland later in 2022.

---------------------------

Simple Sieve of Erastothenes in Python and Fortran

One of my sons coded a prime number generator using the ancient Sieve of Eratosthenes algorithm in python. This and conversations about programming languages led me to a speed-test of such a numerically intensive task in python vs. Fortran.

A program was developed first in Fortran, then translated to python attempting to maintain the same data-types and loop methodology. No significant attempt was made to optimise the algorithm. Note, these programmes do not output the results, this to eliminate language differences in write times.

For results in python and fortran see Blog page post on 30/1/22.

Last updated (30/1/22) - Download

---------------------------

Seismic Data to Audio Converter

sonify_mseed is a simple python program which converts seismic data in .mseed format to an audio file with the seismic values mapped onto a frequency range.

The code can read in either a single .mseed file or an entire directory which it then concatenates. Data are mapped onto a frequency range and the time may be compressed by some user defined factor. e.g a day compressed by a factor of 1000 results in about 80 sec of audio.

The code is not very elegant in its use of python though has been written to hopefully be easy to follow and adapt.

Last updated (9/1/22) - Download

Precision Digital Protractor

A project to build and interface a precision digital protractor to a Prismatic-H82 Faceter (similar to a Polyhedron Scintillator) giving a resolution of 1/40 degree. The system employs a US Digital E6 Optical Encoder, Arduino Nano and Waveshare 1.5" colour OLED display.

This may be of interest to those interested in adding such a system to a faceting machine or any device where the angle of rotation needs to be measured . The code may be adapted to read from other rotarty optical encoders. It also may provide a template for those wishing to drive the Waveshare OLED display for other projects.

n.b. the Arduino sketch is adapted from Tom Herbst's excellent code described in his highly recommended 'Amateur Gemstone Faceting vol 2' -link. Any errors introduced are my own.

  • Arduino Sketch
  • Article Draft
  • Notes

(updated 31/12/20) - Download

---------------------------

Raspberry Seismic

Stable well-tested code suitable for long-term recording of such as seismic data. This be easily adapted to record a range of input signals periodically producing plots for uploading to the web. Data are saved timestamped .mseed format for ease of analysis by standard seismic software.

  • Seismic Monitoring Code Description
  • rpiseismic.py - runs on Raspberry Pi to records and plots data
  • Software License - opensource but minor geographical limitation
Download

Infrasound Monitor

An opensource educational project this involves the construction of a static or portable high resolution Infrasound monitoring station.

The software & hardware has been tested over the past couple of years and is solid..

updated 30/8/21 - Download

Contains ...

  • InfrasoundReport1.pdf - draft paper
  • Getting Started - guide to circuitry and setting up the PI
  • TestRed.py - little python script to check that the PI is reading from the sensor
  • InfraSoundMonitor.py - main python Code to run on PI which records and plots data
  • InfraSoundMonitorMobile.py - mobile version of above, simply stores data every minute or so without plotting
  • V3 BOM - components list
  • Software License - opensource but minor geographical limitation

---------------------------

Aurora Monitor

This is a well-established opensource project to build a nT resolution earth field magnetometer. The system effectively monitors changes in the solar wind and could be used to predicit aurora as well as being a testbed for further development.

updated 25/4/21 - Download

Contains ...

  • Updated IOP paper
  • Getting Started - guide to circuitry and and setting up the PI
  • FreqMonitor - Python hardware test code, simply monitors the signal sent by Arduino
  • EFMv3.py - Raspberry PI python code to record and plot data
  • fcounter6.ino - Arduino program to record frequency of FGM sensor
  • Software License - opensource but minor geographical limitation

---------------------------