MagneticFieldSHTCExpander.jl

Recreate magnetic field vectors out of spherical harmonic transform coefficients (SHTC).

API Reference

MagneticFieldSHTCExpander.magneticfieldFunction
magneticfield(r, θ, φ, g, h) -> BField

Return the magnetic field at $(r, θ, φ)$ as described by $g_ℓ^m$ and $h_ℓ^m$.

Arguments

  • r: radial distance form the origin (spherical coordinates)
  • θ: polar angle (ISO/physics spherical coordinates)
  • φ: azimuthal angle (ISO/physics spherical coordinates)
  • g, h: arrays (matrices) containing the spherical harmonic transform coefficients (SHTC). g[ℓ,m] should yield $g_ℓ^m$ and h[ℓ,m] should yield $h_ℓ^m$

See also

collectmagneticfield

source
magneticfield(rvec, g, h)

Call magneticfield using a Vector instead of specifying coordinates.

rvec should be a 3-vector containing the $(r, θ, φ)$ components.

source
MagneticFieldSHTCExpander.collectmagneticfieldFunction
collectmagneticfield(rs, θs, φs, g, h) -> Array{BField,3}

Evaluate magneticfield for multiple position vectors. Returns a 3d array containing BField information, where each index corresponds to the index of the rs, θs and φs vectors.

Arguments

  • rs: vector of radial distances form the origin (spherical coordinates)
  • θs: vector of polar angles (ISO/physics spherical coordinates)
  • φs: vector of azimuthal angles (ISO/physics spherical coordinates)
  • g, h: arrays (matrices) containing the spherical harmonic transform coefficients (SHTC). g[ℓ,m] should yield $g_ℓ^m$ and h[ℓ,m] should yield $h_ℓ^m$

Examples

bgrid = collectmagneticfield(rs, θs, φs, g, h)
r = rs[i]
θ = θs[j]
φ = φs[k]
magneticfield(r, θ, φ, g, h) == bgrid[i,j,k]

See also

magneticfield

source

Essentially [magneticfield(r, θ, φ) for φ in φs]

source
MagneticFieldSHTCExpander.BFieldType
struct BField{PotType, FieldType, JacType}

Composite data type containing information about the local magnetic field vector. Note that position information needed for magneticfield, $(r, θ, φ)$ is not stored.

Fields

  • Φ::Any: magnetic potential at $(r, θ, φ)$

  • B::StaticArraysCore.SVector{3}: magnetic field at $(r, θ, φ)$

  • jacobianB::StaticArraysCore.SMatrix{3, 3, JacType, 9} where JacType: Jacobian matrix of magnetic field at $(r, θ, φ)$

source