abucci, to ProgrammingLanguages
@abucci@buc.ci avatar

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:

#C #R

j_bertolotti, to random
@j_bertolotti@mathstodon.xyz avatar

: 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.

j_bertolotti,
@j_bertolotti@mathstodon.xyz avatar

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

j_bertolotti,
@j_bertolotti@mathstodon.xyz avatar

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

j_bertolotti,
@j_bertolotti@mathstodon.xyz avatar

Released into the and uploaded to , together with the script used to generate it: https://commons.wikimedia.org/wiki/File:Bravais_Lattices.gif

j_bertolotti, to random
@j_bertolotti@mathstodon.xyz avatar
j_bertolotti,
@j_bertolotti@mathstodon.xyz avatar

The complete (highly non-optimized and written in 2 minutes) code for you to play with:
nblobs = 15;
paths = Table[
Sum[RandomReal[{1,
10}] {RandomReal[{-1, 1}]*Sin[RandomReal[{-1, 1}] t] +
RandomReal[{-1, 1}]*Cos[RandomReal[{-1, 1}] t],
RandomReal[{-1, 1}]Sin[RandomReal[{-1, 1}] t] +
RandomReal[{-1, 1}]

Cos[RandomReal[{-1, 1}] t]}, {4}] , {nblobs}];
(\sigma) = RandomReal[{0.3, 2.5}, nblobs]
frames =
Table[ContourPlot[
Evaluate[
Sum[E^(-(((x - paths[[j, 1]])^2 + (y - paths[[j, 2]])^2)/(
2 (\sigma)[[j]]^2))), {j, 1, nblobs}]], {x, -12, 12}, {y, -12,
12}, PlotRange -> All, Contours -> {0.8},
ColorFunction -> GrayLevel, Frame -> False, ContourStyle -> None,
PlotPoints -> 50]
, {t, 0, 10, 0.1}];
ListAnimate[frames]

j_bertolotti, to physics
@j_bertolotti@mathstodon.xyz avatar


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.

Schematic drawing of a simple pendulum oscillating, with its quantum version represented as a distribution of pendula with their transparency proportional to the probability to be at a certain position at any given time.

j_bertolotti,
@j_bertolotti@mathstodon.xyz avatar

Released into the , and uploaded it to together with the script used to generate it: https://commons.wikimedia.org/wiki/File:Quantum_simple_pendulum.webm

j_bertolotti, to physics
@j_bertolotti@mathstodon.xyz avatar

#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

Trajectories of a number of points following the Lorenz system equations, rendered as yellow tubes.

j_bertolotti,
@j_bertolotti@mathstodon.xyz avatar

Released into the and uploaded to Wikimedia Commons together with the script used to generate it: https://commons.wikimedia.org/wiki/File:Lorenz_System_Lyapunov_time.webm

gregeganSF, to random
@gregeganSF@mathstodon.xyz avatar

Mathematica must be getting jealous of the LLMs, and has decided to insist on just the right prompts if it’s going to answer sensibly.

1st result: supposedly true for all values of k > 0.
(This is correct.)

2nd result: supposedly true for all values of k > 1.
(Umm ... what?)

Cazzandro,

@gregeganSF for a moment I thought of some AI plugin so clever that could add such advanced captioning on the fly. I think it's time to learn Mathematica.

j_bertolotti, to physics
@j_bertolotti@mathstodon.xyz avatar

:
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.)

Left panel: a yellow point, representing a source, moving on a thin grey Lissajous curve, and emitting circles at regular time intervals, whose radius grows linearly with time. The colour of the circle changes gradually from red for the first circle to blue for the last one. A white dot just above the Lissajous curve represents a detector. Right panel: a plot of time of emission vs time of detection, with each point appearing when one of the coloured circles hit the detector. The dots form a wavy monotone curve.

j_bertolotti,
@j_bertolotti@mathstodon.xyz avatar

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

MichaelEMann, to random
@MichaelEMann@fediscience.org avatar

"Michael Mann on Taking Action to Address the Climate Crisis" | My interview about with : https://www.youtube.com/watch?v=cpp64ab69fs

j_bertolotti, to physics
@j_bertolotti@mathstodon.xyz avatar


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.

Simulation of two groups of double pendula. On the left 20 black double pendula that evolve staying very similar to each other. On the right 20 orange double pendula, whose dynamic quickly diverge from each other.

j_bertolotti,
@j_bertolotti@mathstodon.xyz avatar

Released into the , and uploaded to together with the script used to generate it: https://commons.wikimedia.org/wiki/File:Non_chaotic_double_pendulum.gif

j_bertolotti, to random
@j_bertolotti@mathstodon.xyz avatar

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 script to automatically generate them 🤓

j_bertolotti, to physics
@j_bertolotti@mathstodon.xyz avatar


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.

Many dots move away radially from a centre to represent light. At a distance s small screen block part of the dots/light and move around, with the shape of the shadow following with a lag.

j_bertolotti,
@j_bertolotti@mathstodon.xyz avatar

Released into the and uploaded to , together with the script used to generate it: https://commons.wikimedia.org/wiki/File:Shadow_faster_than_light.webm

sudnadja, to random
@sudnadja@dice.camp avatar

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.

video/mp4

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • rosin
  • InstantRegret
  • ethstaker
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • thenastyranch
  • Youngstown
  • GTA5RPClips
  • slotface
  • Durango
  • khanakhh
  • kavyap
  • megavids
  • everett
  • vwfavf
  • Leos
  • osvaldo12
  • cisconetworking
  • cubers
  • modclub
  • ngwrru68w68
  • tacticalgear
  • provamag3
  • normalnudes
  • tester
  • JUstTest
  • All magazines