API Reference

MillerExtendedHarmonic

MillerExtendedHarmonic.MXHType
MXH(
pr::AbstractVector{<:Real},
pz::AbstractVector{<:Real},
MXH_modes::Integer=5;
θ=nothing,
Δθᵣ=nothing,
dθ=nothing,
Fm=nothing,
optimize_fit=false,
spline=false,
rmin=0.0,
rmax=0.0,
zmin=0.0,
zmax=0.0)

Compute Fourier coefficients for Miller-extended-harmonic representation:

R(r,θ) = R(r) + a(r)*cos(θᵣ(r,θ)) where θᵣ(r,θ) = θ + C₀(r) + sum[Cᵢ(r)*cos(i*θ) + Sᵢ(r)*sin(i*θ)]
Z(r,θ) = Z(r) - κ(r)*a(r)*sin(θ)

Where pr,pz are the flux surface coordinates and MXH_modes is the number of modes. Spline keyword indicates to use spline integration for modes

source
(mxh::MXH)(N::Int=100; adaptive::Bool=true)

Returns (r,z) vectors of given MXH

If adaptive, the number of points is specified for the perimeter of a unit circle

source
MillerExtendedHarmonic.MXH!Function
    MXH!(
    mxh::MXH,
    pr::AbstractVector{<:Real},
    pz::AbstractVector{<:Real};
    θ=nothing,
    Δθᵣ=nothing,
    dθ=nothing,
    Fm=nothing,
    optimize_fit=false,
    spline=false,
    rmin=0.0,
    rmax=0.0,
    zmin=0.0,
    zmax=0.0)

like MXH() but operates in place

source
MillerExtendedHarmonic.flat_coeffsFunction
flat_coeffs(mxh::MXH)

return all mxh coefficients as an array of floats of length 5 + 2L where L is the number of sin/cos coefficients

NOTE: autodiff compatible

source
MillerExtendedHarmonic.flat_coeffs!Function
flat_coeffs!(flat::AbstractVector{<:Real}, mxh::MXH)

return all mxh coefficients as an array of floats of length 5 + 2L where L is the number of sin/cos coefficients

NOTE: operates in place on flat input vector and is not autodiff compatible

source