API Reference
TEQUILA
TEQUILA.solve — Functionsolve(
shot::Shot,
its::Integer;
tol::Real=0.0,
relax::Real=1.0,
debug::Bool=false,
fit_fallback::Bool=true,
concentric_first::Bool=true,
P::Union{Nothing,Tuple{<:Union{FE_rep,Function},Symbol},Profile}=nothing,
dP_dψ::Union{Nothing,Tuple{<:Union{FE_rep,Function},Symbol},Profile}=nothing,
F_dF_dψ::Union{Nothing,Tuple{<:Union{FE_rep,Function},Symbol},Profile}=nothing,
Jt_R::Union{Nothing,Tuple{<:Union{FE_rep,Function},Symbol},Profile}=nothing,
Jt::Union{Nothing,Tuple{<:Union{FE_rep,Function},Symbol},Profile}=nothing,
Pbnd=shot.Pbnd,
Fbnd=shot.Fbnd,
Ip_target=shot.Ip_target
)Solve the equilibrium, initially defined by shot with its iterations. Pressure and current information taken from shot unless provided in keywords
Returns a new Shot, often called refill by convention
Keyword arguments
tol- Relative tolerance for convergence of the magnetic axis flux value to terminate iterations earlyrelax- Relaxation parameter on the Picard iterations.Ψₙ₊₁ = relax * Ψ̃ₙ₊₁ + (1 - relax) * Ψₙdebug=true- Print debugging and convergence informationfit_fallback=true- Use concentric surfaces if any flux surface errors on refitting. Improves robustness in early iterationsconcentric_first=true- Use concentric surfaces for first iteration, which can improve robustness if large changes fromshotis expected
TEQUILA.FSA — FunctionFSA(f::F1, shot::F2, ρ::Real; tid=Threads.threadid()) where {F1,F2<:Shot}Compute flux-surface average of f at ρ for the equilibrium defined in shot
Here f is a function of θ only, so something like f = θ -> F(ρ, θ) may be required
FSA(f::F1, shot::F2, ρ::Real, Vprime::F3; tid=Threads.threadid()) where {F1,F2<:Shot,F3<:FE_rep}Compute flux-surface average of f at ρ for the equilibrium defined in shot, using the given finite-element representation of Vprime
Here f is a function of θ only, so something like f = θ -> F(ρ, θ) may be required
FSA(f::F1, shot::F2, ρ::Real, Vprime::Real; tid=Threads.threadid()) where {F1,F2<:Shot}Compute flux-surface average of f at ρ for the equilibrium defined in shot, using the given value of Vprime
Here f is a function of θ only, so something like f = θ -> F(ρ, θ) may be required
TEQUILA.Ip — FunctionIp(shot::F1; ε::Real=1e-6) where {F1<:Shot}Returns the plasma current of shot
TEQUILA.Shot — TypeShot{
I1<:Integer,
VR1<:AbstractVector{<:Real},
MR1<:AbstractMatrix{<:Real},
MR2<:AbstractMatrix{<:Real},
PT1<:Union{Nothing,Profile},
PT2<:Union{Nothing,Profile},
PT3<:Union{Nothing,Profile},
PT4<:Union{Nothing,Profile},
PT5<:Union{Nothing,Profile},
R1<:Real,
R2<:Real,
IP1<:Union{Nothing,Real},
FE1<:FE_rep,
VFE1<:AbstractVector{<:FE_rep},
Q1<:QuadInfo,
VDC1<:Vector{<:DiffCache},
F1<:Factorization
} <: AbstractEquilibriumThe fundamental data structure for a TEQUILA equilibrium, storing grid, flux-surface, and equilibrium information, as well as preallocated work arrays
shot(R,Z) returns the flux at point (R,Z)
TEQUILA.Vprime — FunctionVprime(shot::F1, ρ::Real; tid=Threads.threadid()) where {F1<:Shot}Compute dV/dρ at ρ for the equilibrium defined in shot
TEQUILA.find_axis — Functionfind_axis(shot::Shot)Returns the location and flux value of the magnetic axis, (Raxis, Zaxis, Ψaxis)
find_axis(Ψ, R0::Real, Z0::Real)Returns the location and flux value of the magnetic axis, (Raxis, Zaxis, Ψaxis), with initial guess (R0, Z0)
TEQUILA.fsa_invR — Functionfsa_invR(shot::F1, ρ; tid=Threads.threadid()) where {F1<:Shot}Compute <R⁻¹> at ρ for the equilibrium defined in shot
TEQUILA.fsa_invR2 — Functionfsa_invR2(shot::F1, ρ; tid=Threads.threadid()) where {F1<:Shot}Compute <R⁻²> at ρ for the equilibrium defined in shot
TEQUILA.psi_ρθ — Functionpsi_ρθ(shot::Shot, ρ::Real, θ::Real)Return the flux from shot at the MXH (ρ, θ)