In Praise of Visualization

Posted on Sat 11 May 2024 in Software • Tagged with simulation, physics, project-management

A little investment into building a GUI for live visualizations and control provides huge improvements in iteration speed.

I recently came across the excellent video Coding Adventure: Simulating Fluids wonderfully explained by Sebastian Lague. The video walks through the steps to build a simple smoothed particle hydrodynamics simulation from nothing …


Continue reading

Communicating with the past and the future

Posted on Fri 10 May 2024 in Software • Tagged with documentation, project-management

Originally written May 2022.

Introduction

In his dialogue Phaedrus, Plato has unflattering things to say about the development of writing, arguing among other things that it weakens the memory:

And so it is that you by reason of your tender regard for the writing that is your offspring have declared …


Continue reading

Are vegans vegetarians? and related questions

Posted on Sun 28 April 2024 in Software • Tagged with logic, type theory

I recently asked the following questions:

Assuming all other requirements are the same:

  1. Is a vegan a vegetarian?
  2. Is a vegetarian a vegan?

To my (somewhat) surprise, this drew quite a lot of interest from colleagues, friends, and even people on Facebook I hadn't talked to for years, with lots …


Continue reading

Self-hosting a minimal website with nginx and HTTPS

Posted on Sat 27 April 2024 in Software • Tagged with backend, nginx, https

This website is now self-hosted on a Raspberry Pi server at home. I had struggled with nginx and HTTPS in the past, so was rather pleasantly surprised to see how straightforward it was.

I couldn't find anything on the web that walked one through the whole process, so here are …


Continue reading

for loops in Python are a bit weird

Posted on Sun 11 February 2024 in Software • Tagged with python, javascript

A quiz:

What does the following JavaScript code print and why?

for (let i = 0; i < 3; i++) {
  console.log(i);
  i -= 3
}

What does the following Python code print and why?

for i in range(3):
    print(i)
    i -= 3


The uncertainty principle and spectrograms

Posted on Tue 09 January 2024 in Teaching • Tagged with physics, music, teaching

In the previous post I discussed how, when measuring the frequency (tempo) of a signal that itself changes in time, there is necessarily a tradeoff between the precision in the measured frequency and precision in the time at which the measurement is taken: A more precise measurement of frequency requires …


Continue reading

The uncertainty principle is obvious to musicians

Posted on Tue 09 January 2024 in Teaching • Tagged with physics, music, teaching

Most people are introduced to the term 'uncertainty principle' in the context of quantum mechanics. It is usually described as the idea that a particle's position and momentum cannot be simultaneously measured to arbitrary precision, but that improved precision in one must be traded off against increased uncertainty in the …


Continue reading

The Bohr model: Some history and context

Posted on Tue 19 December 2023 in Teaching • Tagged with physics, teaching

This page is intended to give a little context behind the "Bohr model" that is introduced in the first Quantum Mechanics sheet.


Background

Like all atomic models, the Bohr model attempts to answer the question "Why do atoms exhibit the properties that they do?", proposing a mechanical or mathematical description …


Continue reading

Historical and philosophical contexts of the calculus of variations

Posted on Tue 19 December 2023 in Teaching • Tagged with physics, teaching

What is a variational principle?

A variational principle is a mathematical or physical law expressed in terms of maximising or minimising a certain quantity. The simplest example was known to ancient Egyptian builders and surveyers: a taut rope stretched between two points takes the shape that minimises its length. This …


Continue reading