Some of my Programs in Physics and Astronomy, and more

Astronomy Programs

Sun, Moon, and Planets

These programs are based on the VSOP87 theory, Variations séculaires des orbites planétaires. VSOP was developed and is maintained (updated with the latest data) by the scientists at the Bureau des Longitudes in Paris.

NEW: Here you can run the programs interactively: Interactive Astro Programs.

hvfSunMoonPlanets-latest.zip is a collection of Python3-programs to show data for Sun, Moon, the Planets, Solstices, Perihels, Moon Phases and Perigees.
Longitude, latitude, right ascension, declination, altitude, azimut, hour angle, time of rising, transition, and setting and other data are calculated for Sun, Moon, and the planets.
It contains the following Python files:

Sun Solstices and Perihelions

Moon Phases, Perigees, Ascending and Descending Nodes, and Maximum Declinations

Top

Planet Events: Conjunctions, Oppositions, Elongations

Top

Programs in Physics

Nfold coupled pendulum

The harmonic oscillator is a standard problem in elementary physics, and a simple pendulum is a populaar application of the harmonic oscillator as long as the amplitude is small such that non-linear effects can still be neglected.
The problem of two or more pendulums hanging on each other is far more complicated. Analytical solutions, even for small amplitudes, are hard to find.
My program Nfold-pendulum.py solves this problem numerically. Using the Lagrange formalism, numerical integration of the equation of motion is performed and a graphical display is produced. The point masses are connected with massless rods. Units are kg for the masses, meter for the rods, and degrees for the angles and degrees/sec for the angular velocities.
The number of pendulums, N, is unlimited.
The gravitational constant g is set to 10 m/s2.
The total energy shown on the display stays constant, this means that the calculations do not lose precision.

Nfold-pendulum.zip contains the code.

This video shows the standard case

        $ Nfold-pendulum.py 2 2 1 1 2 180 -90 0 0
        

And here is a more complicated case with six coupled pendulums

        $ Nfold-pendulum.py 6 2 1 2 1 2 1 1 1 1 1 1 1 180 180 180 180 180 -90 0   0   0   0   0   0
                              <- arms  -> <- masses-> <-      angles       -> <- angular veloc.  ->

        

Top

FEHASHMAC

fehashmac is a collection of 52 publicly known hash algorithms integrated into a command-line utility. FEHASHMAC also contains a set of known test vectors and results for each algorithm such that the correct implementation for each hardware platform and compiler version can directly be verified.

See the README for more information. The current release is also available here.

Top

SUDOKU

Sudoku is a well-known pastime that appealed to my penchant for recursive algorithms. I therefore started in 2005 to write a sudoku PERL script that will be capable to solve any square sudoku problem with either square or rectangular subsets or subsets of any shape. The maximum dimension is limited to 26x26.
Diagonals are also supported.

The script is written in PERL5. Once the input parameters are verified, a Postscript file may be produced with the input configuration for printout, possibly later converted to PDF.

Top

Valid CSS!

© Copyright Harald von Fellenberg (2021)