# Magnetic Field Line

Curve · (x, y, z) = f(u, t)

`((3 + cos(ι · u + t)) · cos(u),  sin(ι · u + t),  (3 + cos(ι · u + t)) · sin(u))`

[Open in the app](https://www.wavelace.com/app#p=175) · [This page](https://www.wavelace.com/presets/magnetic-field-line)

### What it draws

Read `3 + cos(ι u + t)` as a distance from the vertical axis: it runs between `2` and `4`. The `cos(u)` and `sin(u)` it multiplies place the point at that distance and at the angle `u` around the axis. The second expression, `sin(ι u + t)`, is the height, between `−1` and `1`.

Distance and height share the angle `ι u + t`, so the point never leaves a torus: a central circle of radius `3` lying flat, and a tube of radius `1`. The angle the long way round is `u`, and the angle round the tube is `ι u + t`. Each turn the long way carries the line `ι` of a turn round the tube.

### Rotational transform

In a fusion machine the plasma is held by a magnetic field whose lines wind round a torus like this one. The number of turns round the tube per turn the long way is the rotational transform, written `ι`. A field running only the long way lets the plasma drift out to the wall; the twist carries each line between the top and the bottom of the tube, and the drift cancels on average.

When `ι` is a fraction `m/n`, the line closes after `n` turns the long way. Here `ι = 0.7 = 7/10`, so the line closes after ten turns, seven times round the tube, which is why `Turns of u` opens at 10. When `ι` is irrational the line never closes, and it passes as near as you like to every point of the torus. That torus is a flux surface, and a machine nests many of them, one inside the next.

The clock only shifts the tube angle. Since `ι u + t = ι(u + t/ι)`, the line slides along itself, and the whole curve turns about the vertical axis at `1/0.7 ≈ 1.43` radians per second at Speed 1.

### History

Lyman Spitzer proposed the stellarator at Princeton in 1951. Its field gets its twist from the shape of the coils alone, where a tokamak drives a current through the plasma for it.

### Try

- Set `ι` to 0.5: the line closes after two turns the long way, and the other eight turns only retrace it.
- Set `ι` to 0: the line is a flat circle round the axis, and the clock walks it round the tube. There is no twist left to carry it between top and bottom.
- Change each `ι u` to `u/√2` and set `Turns of u` to 24: the transform is now irrational, the line never closes, and its strands creep over the whole surface.
- Set `Turns of u` to 3: the line stops a little past two turns round the tube, the start of the covering.

### Read more

- [Stellarator](https://en.wikipedia.org/wiki/Stellarator)
- [Tokamak](https://en.wikipedia.org/wiki/Tokamak)
- [Magnetic confinement fusion](https://en.wikipedia.org/wiki/Magnetic_confinement_fusion)
- [Irrational rotation](https://en.wikipedia.org/wiki/Irrational_rotation)
- [Torus knot](https://en.wikipedia.org/wiki/Torus_knot)
