Examples

Preamble

These commands all assume that you have done

julia> using SeisModels

first.

Basic properties

To compute the P-wave velocity at the base of the Earth’s mantle (2750 km depth) in the iasp91, ak135 and PREM models, and compare them all to PREM, you could do

julia> vels = vp.((IASP91, AK135, PREM), 2750, depth=true)(13.658709937215507, 13.650124346076458, 13.682574481505672)
julia> 100 .* (vels .- vels[end]) ./ vels[end](-0.17441559936269008, -0.2371639596998019, 0.0)

(So they all agree to less than a quarter of a percent!)

To retrieve a density profile across the inner core boundary in PREM:

julia> r = 1200:10:1250;
julia> density.(PREM, r)6-element Vector{Float64}: 12.774950441875058 12.769702841631439 12.764411692838081 12.161956678291448 12.15677821054005 12.151565889647408

To get the planetary radius in km of the moon used in Weber et al.’s (2011) model:

julia> surface_radius(MOON_WEBER_2011)1737.1

The shear modulus in the transition zone:

julia> shear_modulus(AK135, 600, depth=true)121.42818931417919

Derived properties

If a model includes density, then things like gravity, moment of inertia, and so on, can be easily calculated.

PREM used as constraining data a couple of gross Earth values: the mass should be $5.974\times10^{24}$kg, and the ratio $I/MR^2$ should be 0.3308. Let’s check how Dziewoński and Anderson did:

julia> ≈(mass(PREM), 5.974e24, atol=0.001e24)true
julia> ≈(moment_of_inertia(PREM)/(mass(PREM)*(1e3*surface_radius(PREM))^2), 0.3308, atol=0.0001)true

To calculate a lookup table of pressure in ak135 for use with another program, you could do:

julia> using DelimitedFiles: writedlm
julia> r = 0:10:63710:10:6370
julia> p = pressure.(AK135, r)638-element Vector{Float64}: 3.626046959480024e11 3.626023286966299e11 3.625952105333531e11 3.6258337932952747e11 3.625668258317165e11 3.6254551389896466e11 3.6251947931130035e11 3.624887176845715e11 3.6245321897415497e11 3.624129902871664e11 ⋮ 2.377758782201305e9 2.0523157484471152e9 1.7270346393467343e9 1.4019134146913335e9 1.0769501465962846e9 7.751329842792506e8 5.0800480968009806e8 2.6459178880708688e8 2.40411774537565e7
julia> writedlm("lookup_table.txt", [r p])