desc.magnetic_fields.field_line_integrate

class desc.magnetic_fields.field_line_integrate(r0, z0, phis, field, params=None, grid=None, rtol=1e-08, atol=1e-08, maxstep=1000)Source

Trace field lines by integration.

Parameters:
  • r0 (array-like) – initial starting coordinates for r,z on phi=phis[0] plane

  • z0 (array-like) – initial starting coordinates for r,z on phi=phis[0] plane

  • phis (array-like) – strictly increasing array of toroidal angles to output r,z at Note that phis is the geometric toroidal angle for positive Bphi, and the negative toroidal angle for negative Bphi

  • field (MagneticField) – source of magnetic field to integrate

  • params (dict) – parameters passed to field

  • grid (Grid, optional) – Collocation points used to discretize source field.

  • rtol (float) – relative and absolute tolerances for ode integration

  • atol (float) – relative and absolute tolerances for ode integration

  • maxstep (int) – maximum number of steps between different phis

Returns:

r, z (ndarray) – arrays of r, z coordinates at specified phi angles