This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · posts/hasegawa-wakatani-one-rung-at-a-time

The Hasegawa-Wakatani drift-wave model

The Hasegawa-Wakatani equations are the simplest model of drift-wave turbulence at the edge of a tokamak that contains the instability driving it. Five rungs build their linear theory: the drift-wave frequency, the growth rate as the eigenvalue of a 2×2 matrix (0.098684 at , as numpy's eigensolver gives), the return to the drift wave as at the predicted rates and , a zonal flow that keeps of its start as it relaxes, and the one-line change in the modified model that leaves it untouched.

The edge of a magnetically confined plasma has a steep density gradient, and the gradient drives drift waves: ripples in density and electric potential that travel across the magnetic field, along the surfaces of constant density. The Hasegawa-Wakatani equations (1983) describe them with two fields in the plane perpendicular to : the density fluctuation and the electric potential , whose Laplacian is the vorticity of the flow.

is the density gradient, the drive. is the adiabaticity: how fast electrons stream along the field line to keep the density in step with the potential. Everything is dimensionless, with lengths in units of the ion sound gyroradius , and here . The brackets are the nonlinear advection; every rung here is linear, so they drop out.

posts/refs/hasegawa_wakatani.py computes the reference values with numpy.linalg.eigvals and scipy.linalg.expm.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 31–268