Visualizations

Here are some visualizations I've been working on recently experimenting with Claude Code


Wave Plates

Drag the plot to rotate the view

Electromagnetic wave entering different material at normal incidence


Interference

Δx = 0.00 λ  (phase 0.00π)

Reflection off solar panels

Incident →
Reflected ←
Transmitted →

Rotations

Drag the tip of z′ (the axis of maximum moment of inertia) to orient the box. Drag the tip of ω to change its direction, and its shaft to change its length (the spin rate). Drag the black z axis to rotate the view. Press Play to rotate the box about ω.


Free Rigid Body Rotation

In the xyz frame
I =
In the x′y′z′ frame
I′ =

Set the initial orientation and ω by dragging, as above, and drag the black z axis to rotate the view. Press Play to evolve the box as a torque-free rigid body: L stays fixed in space while ω moves through the body. The box has mass 1 and half-widths 1.3, 0.8, 0.35; L is drawn scaled by 1.25/I3.


Euler Angles

Starting with the body axes x′y′z′ on top of xyz, the orientation is built from three rotations, each about an axis carried along by the earlier ones (the z-x-z convention): φ about z, which swings the x axis around to the line of nodes N; then θ about N, which tilts z to z′; then ψ about z′, which turns N to x′. N is where the xy and x′y′ planes intersect. Use Step to do the rotations one at a time and Play all to run the whole sequence. Drag anywhere to rotate the view.


Dipole Radiation

+0−

Dipole Radiation: The Plane-Wave Limit

+0−
Zoomed view

The Driven Pendulum as a Model for Chaos

A pendulum whose pivot is shaken up and down once per unit time. Each term in $\dot v$ is a wave, and each dial shows that wave's phase as seen by the pendulum. Click the phase plane to launch an orbit.

$$\dot\theta = v, \qquad \dot v = -\alpha\sin\theta - \epsilon\left[\sin(\theta-2\pi t)+\sin(\theta+2\pi t)\right]$$

Click to launch an orbit

The pendulum

$v=0$ resonance
$\dot v \propto -\sin(\theta)$

$v=2\pi$ resonance
$\dot v \propto -\sin(\theta-2\pi t)$

$v=-2\pi$ resonance
$\dot v \propto -\sin(\theta+2\pi t)$

Click on the phase plane to launch an orbit.

The Driven Pendulum: Surface of Section

Keep only the state $(\theta, v)$ at $t = 0, 1, 2, \dots$, once per drive period. Because the equations repeat every period, the state at $t = n$ completely determines the state at $t = n+1$, so this is a well-defined, area-preserving map of the plane to itself. Click anywhere to launch an orbit and plot its crossings. Then read the plot:

  • Smooth curve: a regular orbit, a slice through an invariant torus. Some approximate conserved quantity survived, even though energy didn't.
  • Closed loops around a point: a resonance island. Compare its size with the shaded band (the pendulum estimate $2\sqrt{\alpha}$ or $2\sqrt{\epsilon}$).
  • Chains of small islands (e.g. near $v \approx \pm 3$): secondary resonances, created by the interaction of the primary waves.
  • Scattered cloud filling an area: a chaotic orbit. Chaos appears first near separatrices.

Populate launches a grid of orbits for a quick overview. Changing $\alpha$ or $\epsilon$ clears the plot.

Click on the plot to launch an orbit.

The Driven Pendulum: Sensitive Dependence on Initial Conditions

The surface of section tells regular and chaotic orbits apart by their shape: curves versus scattered clouds. The other defining property of chaos is sensitive dependence on initial conditions. Click the left panel to launch two orbits that start a tiny distance $d_0$ apart (they differ only in $\theta_0$). On the left, orbit A is solid with a filled dot and orbit B is dashed with an open dot. On the right, the distance between them in phase space, $d(t) = \sqrt{\Delta\theta^2 + \Delta v^2}$ (with $\Delta\theta$ taken modulo $2\pi$), is traced out in sync.

  • Regular orbit (on a curve or inside an island): the two orbits drift apart only slowly, roughly linearly in time, so on a linear scale $d(t)$ stays glued to zero.
  • Chaotic orbit: $d(t)$ looks flat for a while, then explodes, growing like $e^{\lambda t}$ until the orbits are as far apart as the chaotic region allows.

Try $\theta_0 = \pi$, $v_0 \approx 0.5$ (in the chaotic layer near the unstable fixed point) against $\theta_0 = 0.8$, $v_0 = 0$ (deep in the central island). Each new click keeps earlier distance curves, faded, for comparison. Tick log scale to see that chaotic growth is a straight line, whose slope is the Lyapunov exponent $\lambda$.

Two nearby orbits

The two pendulums

Separation of the two orbits

Click on the left panel to launch a pair of nearby orbits.

Why is the Planetary 3-body Problem Chaotic?

Visualization by Aron Zhou.

Phase spaceclick to start an orbit

Two Earthsclick or drag to move the box

Zoom-indrag to pan, scroll to zoom

Click the Namouni map to start an orbit.

Stellar Atmospheres

Hydrogen Energy Levels & Ionization States

Temperature: 10000 K

Stellar Type

Balmer Line Strength

Fraction of Neutral H in n=2

Neutral H Fraction

Fraction of all H in n=2


Size of the Universe (Flat Space)

t = -13.8 Gyr

Size of the Universe (Expanding)

t = -13.8 Gyr
a = 0.05