A weird thing about being 50 is that there are programming languages that I've used regularly for longer than some of the software developers I work with have been alive. I first wrote BASIC code in the 1980s. The first time I wrote an expression evaluator--a fairly standard programming puzzle or homework--was in 1990. I wrote it in Pascal for an undergraduate homework assignment. I first wrote perl in the early 1990s, when it was still perl 4.036 (5.38.2 now). I first wrote java in 1995-ish, when it was still java 1.0 (1.21 now). I first wrote scala, which I still use for most things today, in 2013-ish, when it was still scala 2.8 (3.4.0 now). At various times I've been "fluent" in 8086 assembly, BASIC, C, Pascal, perl, python, java, scala; and passable in LISP/Scheme, Prolog, old school Mathematica, (early days) Objective C, matlab/octave, and R. I've written a few lines of Fortran and more than a few lines of COBOL that I ran in a production system once. I could probably write a bit of Haskell if pressed but for some reason I really dislike its syntax so I've never been enthusiastic about learning it well. I've experimented with Clean, Flix, Curry, Unison, Factor, and Joy and learned bits and pieces of each of those. I'm trying to decide whether I should try learning Idris, Agda, and/or Lean. I'm pretty sure I'm forgetting a few languages. Bit of 6502 assembly long ago. Bit of Unix/Linux shell scripting languages (old enough to have lived and breathed tcsh before switching to bash; I use fish now mostly).
When I say passable: in graduate school I wrote a Prolog interpreter in java (including parsing source code or REPL input), within which I could run the classic examples like append or (very simple) symbolic differentiation/integration. As an undergraduate I wrote a Mathematica program to solve the word recognition problem for context-free formal languages. But I'd need some study time to be able to write these languages again.
I don't know what the hell prompted me to reminisce about programming languages. I hope it doesn't come off as a humblebrag but rather like old guy spinning yarns. I think I've been through so many because I'm never quite happy with any one of them and because I've had a varied career that started when I was pretty young.
I guess I'm also half hoping to find people on here who have similar interests so I'm going to riddle this post with hashtags:
#PhysicsFactlet: The "Ashcroft/Mermin Project"
I will try to (likely very slowly) go through the classic textbook "Solid State Physics" by Ashcroft and Mermin and make one or more animation/visualization per chapter.
This will (hopefully) help people digest the topic and/or be useful to lecturers who are teaching about it. As with all my animations, feel free to use them.
The idea is that the animations are a companion to the book, so I will give only very brief explanations here.
Released into the #PublicDomain and uploaded to #WikimediaCommons together with the #Mathematica script used to generate it: https://commons.wikimedia.org/wiki/File:Drude_Model.gif
Released into the #PublicDomain and uploaded to #WikimediaCommons together with the #Mathematica script used to generate it: https://commons.wikimedia.org/wiki/File:Fermi_Gas.gif
Released into the #PublicDomain and uploaded to #WikimediaCommons, together with the #Mathematica script used to generate it: https://commons.wikimedia.org/wiki/File:Bravais_Lattices.gif
#PhysicsFactlet
A quantum simple pendulum.
The pendulum position is spread out, with opacity here being proportional to the probability that the pendulum is at that position at a given time. The average position of the quantum dynamics is the same as the classical pendulum dynamics (Ehrenfest theorem).
Technicalities: I used the Crank-Nicholson method to evolve the system in time. This is a 1D problem, and the only variable I considered was the angle, with the initial state being a Gaussian.
Released into the #PublicDomain, and uploaded it to #WikimediaCommons together with the #Mathematica script used to generate it: https://commons.wikimedia.org/wiki/File:Quantum_simple_pendulum.webm
#PhysicsFactlet
The Lorenz system is a common example of chaotic dynamics and of a strange attractor.
Points with very similar initial conditions initially evolve very similarly to each other, until their trajectories diverge from each other, and start moving on a "butterfly"-shaped fractal. #Physics#Chaos
Released into the #PublicDomain and uploaded to Wikimedia Commons together with the #Mathematica script used to generate it: https://commons.wikimedia.org/wiki/File:Lorenz_System_Lyapunov_time.webm
@gregeganSF for a moment I thought of some #Mathematica AI plugin so clever that could add such advanced captioning on the fly. I think it's time to learn Mathematica.
#PhysicsFactlet:
Signals (e.g. light) move at a finite speed, so there is a time lag between when they are emitted and when they are detected. If the source is moving, the detector will "see" the signal that was emitted at a previous time, not the signal that is being emitted right now, and this time lag can change with time in a complicated way.
(Notice that, as the source is always moving slower than the signal, the detector sees the signals in the same order they were emitted.) #Physics#ITeachPhysics#Electrodynamics#Optics#Relativity
Released into the #PublicDomain and uploaded it to #WikimediaCommons, together with the #Mathematica script used to generate it: https://commons.wikimedia.org/wiki/File:Retarded_time.webm
#PhysicsFactlet
Does a chaotic system always behave chaotically?
Not really, as many chaotic systems have a subset of possible initial conditions that lead to a quasi-periodic motion.
As an example, below are two sets (black and orange) of 20 double pendula each, all with the same initial energy, and each group starting with very similar initial conditions.
The first group (black) spread out a little bit with time, but nearby initial conditions keeps evolving into nearby dynamics, which is typical of integrable systems.
On the other hand the pendula in the second group (orange) also starts with similar initial condition, but after a short transient evolve each very differently from each other, which is a mark of a chaotic system. #Physics#Visualization#Chaos
Released into the #PublicDomain, and uploaded to #WikimediaCommons together with the #Mathematica script used to generate it: https://commons.wikimedia.org/wiki/File:Non_chaotic_double_pendulum.gif
My son (5y/o) suddenly developed a passion for labyrinths. After drawing a ton of them by hand over the weekend, today I decided to write a small #Mathematica script to automatically generate them 🤓
#PhysicsFactlet
Can shadows move faster than light?
Not really. There is nothing moving sideways, so nothing is moving faster than light (which, incidentally, mean you can't use shadows to communicate faster than light).
But the edges of the projection of the shadow can indeed appear to move arbitrarily fast. #ITeachPhysics#Visualization#Physics#Optics
Released into the #PublicDomain and uploaded to #WikimediaCommons, together with the #Mathematica script used to generate it: https://commons.wikimedia.org/wiki/File:Shadow_faster_than_light.webm
2019 LD2 plotted in a frame co-rotating with Jupiter. All Jupiter Trojans (blue) and Hildas (red) are plotted as well. Jupiter is represented by the orange dot and 2019 LD2 represented by the purple dot. #NBody#Mathematica