API Reference
MillerExtendedHarmonic
MillerExtendedHarmonic.MXH
— TypeMXH(
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
(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
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
MillerExtendedHarmonic.copy_MXH!
— Functioncopy_MXH!(mxh1::MXH, mxh2::MXH)
copy all attributes from mxh2 to mxh1
MillerExtendedHarmonic.flat_coeffs
— Functionflat_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
MillerExtendedHarmonic.flat_coeffs!
— Functionflat_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