Author: Phil

  • Satellite Orbit Fun

    Play Now

    I made this ‘game’ in 2014, literally from Scratch, based on the physics of gravity.

    Click the green flag to start.

    A satellite is orbiting the planet. It has four thrusters for manoeuvring.

    You need a keyboard for this.

    • Fire the thrusters using the four Up/Down/Left/Right arrow keys. (See below: action and reaction.)
    • Try to maintain a safe orbit, without crashing into the planet, or getting lost in outer space!
    • Optional controls: Trace orbit with pen [u]p [d]own [c]lear. [g]row or [s]hrink the size (not mass) of the planet.
    • Experiment with the sliders to vary the effect of gravity strength ‘G’ and planet mass ‘M’. Gravity is so weak that we only notice it with massive objects like planets. Actual value of G = 0.0000000000667384 (SI units).

    How it works

    The original is at https://scratch.mit.edu/projects/824757/

    See inside how it works here.

    The Satellite object runs an endless loop to update its position. The Planet object has a method that responds to ‘crash’ events!

    It is a simulation of Isaac Newton’s laws:

    F = m a = G M m / d2

    The satellite motion comes from the acceleration ‘a’, caused by the gravity force ‘F’, which depends on its distance ‘d’ from the centre of the planet. The direction of acceleration is always towards the centre. That’s called an ‘inverse square law’.

    The mass ‘m’ of the satellite does not affect the orbit because it appears on both sides of the equation. (But why inertial mass = gravitational mass?)

    The simulation computes the change in position of the satellite in small time steps. (It’s a ‘finite difference’ method to approximate the underlying vector calculus.)

    • velocity is rate of change of displacement (position)
    • acceleration is rate of change of velocity

    Isaac Newton

    The three laws of motion were first compiled by Isaac Newton in his PhilosophiƦ Naturalis Principia Mathematica (Mathematical Principles of Natural Philosophy), first published in 1687.

    1. An object will not change its motion unless a force acts on it (First Law).
    2. The force on an object is equal to its mass times its acceleration (Second Law).
    3. For every action, there is an equal and opposite reaction (Third Law).

    Newton showed that these laws of motion, combined with his law of universal gravitation, explained Kepler’s laws of planetary motion.

    Motivation

    In 2014 I was working as a software engineer, supporting an Educational project at the European Space Agency, using some tools like Orekit.

    At the same time I was also thinking about how to bring physics and computing to younger students in the context of STEM.

    Then I discovered Scratch, a fun visual programming environment from MIT, and was inspired to see what could be done with the application of some school Physics.

  • A Generative Music Patch

    Recently I found a new way to configure my modular synthesizer to generate semi-random musical parts. Hear is an example…

    The somewhat oriental flavour comes from constraining all notes to a major pentatonic scale: C, D, E, G, A. All the sounds were made using a replica of the famous 1970’s ‘Minimoog‘.

    Only the main tune (heard at the beginning) was actually played by hand. All the other parts were generated automatically using variations on the system below.

    Like all analogue synthesizers, it relies on the principle of “Voltage Control” proposed by Dr Robert Moog in his 1964 paper. For example, pitch is calibrated at 1 volt per octave.

    • The Sequencer, a replica of the ARP 1027 module, is stepped slowly, say every 4 beats (whole note), to produce a different Control Voltage (CV) at each step.
    • This CV is modified by a voltage processor (based on MATHS), to produce a smoothly varying CV, say in the range 3-5 volts (equivalent to 2 octaves).
    • Next, a Quantizer is used to repeatedly sample the CV, say at each half beat (eighth note), picking the nearest note from the chosen scale, and holding for the duration of the note.
    • Finally, this modified CV controls the pitch of the ‘Model D’ replica monophonic synthesizer. The sounds can be further triggered and timbre modulated independently.

    All the timing is controlled by four Low Frequency Oscillators (LFO), synchronised in different ratios to drive the various components at different rates.