Examples

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 Array{Float64,1}:
 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:6371
0:10:6370

julia> p = pressure.(AK135, r)
638-element Array{Float64,1}:
 3.626046959480023e11
 3.626023286966298e11
 3.625952105333528e11
 3.625833793295275e11
 3.625668258317165e11
 3.625455138989647e11
 3.6251947931130023e11
 3.624887176845716e11
 3.62453218974155e11
 3.6241299028716626e11
 ⋮
 2.3777587822013054e9
 2.0523157484471152e9
 1.7270346393467338e9
 1.4019134146913335e9
 1.0769501465962849e9
 7.751329842792505e8
 5.080048096800981e8
 2.6459178880708688e8
 2.40411774537565e7

julia> writedlm("lookup_table.txt", [r p])