Bases
Basis functions
AstroBasis
currently offers four different types of bases.
3d (Spherical)
- Clutton-Brock (1973), which is a match to the Plummer (1911) profile.
- Hernquist & Ostriker (1992), which is a match to the Hernquist (1990) profile.
2d (Razor-Thin Discs)
- Clutton-Brock (1972), which is a 2d match to a Plummer profile.
- Kalnajs (1976), which is a spiral basis.
–
Spherical bases
Clutton-Brock (1973)
AstroBasis.CB73Basis
— TypeCB73Basis <: SphericalBasis
A structure for accessing the radial basis elements of Clutton-Brock (1973).
Fields
name::String
: Basis name (default CB73).lmax::Int64
: Maximal harmonic/azimuthal index (starts at 0).nradial::Int64
: Number of radial basis elements (≥ 1).G::Float64
: Gravitational constant (default 1.0).rb::Float64
: Radial extension (default 1.0).tabPrefU::Array{Float64,2}
: Potential prefactors array.tabPrefD::Array{Float64,2}
: Density prefactors array.tabUl::Array{Float64,1}
: Potential elements value array.tabDl::Array{Float64,1}
: Density elements value array.
Description
The CB73Basis
structure is used to access the radial basis elements as defined by Clutton-Brock (1973).
Example
```julia using Random
Creating an instance of CB73Basis
cb73 = CB73Basis( "CB73", # name 10, # lmax 5, # nradial 1.0, # G 1.0, # rb rand(10, 5), # tabPrefU rand(10, 5), # tabPrefD rand(5), # tabUl rand(5) # tabDl )
Accessing fields
println(cb73.name) println(cb73.lmax) println(cb73.G)
Warning
Ensure that the prefactor arrays (tabPrefU and tabPrefD) and the element value arrays
(tabUl and tabDl) have compatible dimensions to avoid runtime errors.
Hernquist (1992)
AstroBasis.HernquistBasis
— TypeHernquistBasis <: SphericalBasis
A structure for interfacing with the radial basis elements from Hernquist & Ostriker (1992).
Fields
name::String
: Basis name (default Hernquist).lmax::Int64
: Maximal harmonic/azimuthal index (starts at 0).nradial::Int64
: Number of radial basis elements (≥ 1).G::Float64
: Gravitational constant (default 1.0).rb::Float64
: Radial extension (default 1.0).tabPrefU::Array{Float64,2}
: Potential prefactors array.tabPrefD::Array{Float64,2}
: Density prefactors array.tabUl::Array{Float64,1}
: Potential elements value array.tabDl::Array{Float64,1}
: Density elements value array.
Description
The HernquistBasis
structure is used to access the radial basis elements as defined by Hernquist & Ostriker (1992).
Razor-thin bases
Clutton-Brock (1972)
AstroBasis.CB72Basis
— TypeCB72Basis <: RazorThinBasis
A structure for interfacing with the radial basis elements of Clutton-Brock (1972).
Fields
name::String
: Basis name (default CB72).lmax::Int64
: Maximal harmonic/azimuthal index (starts at 0).nradial::Int64
: Number of radial basis elements (≥ 1).G::Float64
: Gravitational constant (default 1.0).rb::Float64
: Radial extension (default 1.0).tabPrefU::Array{Float64,2}
: Potential prefactors array.tabPrefD::Array{Float64,2}
: Density prefactors array.tabUl::Array{Float64,1}
: Potential elements value array.tabDl::Array{Float64,1}
: Density elements value array.
Description
The CB72Basis
structure is the interface to the radial basis elements as defined by Clutton-Brock (1972).
Kalnajs (1976)
AstroBasis.K76Basis
— TypeK76Basis <: RazorThinBasis
A structure for interfacing with the radial basis elements of Kalnajs (1976).
Fields
name::String
: Basis name (default K76).lmax::Int64
: Maximal harmonic/azimuthal index (starts at 0).nradial::Int64
: Number of radial basis elements (≥ 1).G::Float64
: Gravitational constant (default 1.0).rb::Float64
: Radial extension (default 1.0).kKA::Int64
: Basis index specific to Kalnajs (1976).tabPrefU::Array{Float64,2}
: Potential prefactors array.tabPrefD::Array{Float64,2}
: Density prefactors array.tabUl::Array{Float64,1}
: Potential elements value array.tabDl::Array{Float64,1}
: Density elements value array.
Description
The K76Basis
structure is used to access the radial basis elements as defined by Kalnajs (1976).
Example
using Random
# Creating an instance of K76Basis
k76 = K76Basis(
"K76", # name
10, # lmax
5, # nradial
1.0, # G
1.0, # rb
2, # kKA
rand(10, 5), # tabPrefU
rand(10, 5), # tabPrefD
rand(5), # tabUl
rand(5) # tabDl
)
# Accessing fields
println(k76.name)
println(k76.lmax)
println(k76.kKA)