vmec_jax.external_fields.coils_jaxΒΆ

Pure-JAX Fourier coils and Biot-Savart external-field sampling.

The Fourier coefficient convention intentionally matches ESSOS:

dofs[..., 0]

constant term.

dofs[..., 2*k-1]

coefficient multiplying sin(2*pi*k*t).

dofs[..., 2*k]

coefficient multiplying cos(2*pi*k*t).

The Biot-Savart normalization also matches ESSOS phase-1 behavior: 1e-7 * current * mean(gamma_dash x (x - gamma) / |x - gamma|^3).

Functions

apply_stellarator_symmetry_to_currents(...)

Expand base currents using ESSOS symmetry ordering.

apply_stellarator_symmetry_to_curves(...)

Expand base Fourier curve coefficients using ESSOS symmetry ordering.

biot_savart_xyz(points_xyz, gamma, ...[, ...])

Evaluate coil Biot-Savart field at Cartesian points.

build_coil_field_geometry(params)

Build symmetry-expanded direct-coil geometry for Biot-Savart sampling.

coil_coil_distance_soft(params[, alpha])

Smooth approximation to the minimum distance between distinct coils.

coil_current_norm(params)

Return Euclidean norm of symmetry-expanded physical currents.

coil_curvatures(params)

Return per-coil, per-segment curvature after symmetry expansion.

coil_lengths(params)

Return per-coil centerline lengths after symmetry expansion.

coil_plasma_distance_soft(params, boundary_xyz)

Smooth approximation to the minimum coil-plasma distance.

compute_gamma_dash(base_curve_dofs, n_segments)

Evaluate d gamma / d t for normalized curve parameter t.

compute_gamma_dashdash(base_curve_dofs, ...)

Evaluate d^2 gamma / d t^2 for normalized curve parameter t.

curvature_penalty(params, maximum[, smoothness])

Smooth squared penalty for coil curvature above maximum.

expanded_coil_geometry(params)

Return full symmetry-expanded gamma, derivatives, and currents.

fourier_curves_to_gamma(base_curve_dofs, ...)

Evaluate Fourier curve centerlines.

length_penalty(params, maximum[, smoothness])

Smooth squared penalty for coil lengths above maximum.

sample_coil_field_cylindrical(params, R, Z, phi)

Sample the direct-coil field at cylindrical coordinates.

sample_coil_field_cylindrical_from_geometry(...)

Sample cylindrical direct-coil field from prebuilt coil geometry.

sample_coil_field_cylindrical_from_geometry_jit(...)

JIT-sample cylindrical field from prebuilt geometry.

sample_coil_field_xyz_from_geometry(...[, ...])

Sample Cartesian direct-coil field from prebuilt coil geometry.