Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Geodynamik-Übungen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wegener, Johannes
Geodynamik-Übungen
Commits
38126282
Commit
38126282
authored
2 years ago
by
Heck, Franziska
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of
https://gitlab.rrz.uni-hamburg.de/bax8453/geodynamik-uebungen
parents
a93a8a0c
7da58a40
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
AdamsWilliamsonCMB.py
+15
-15
15 additions, 15 deletions
AdamsWilliamsonCMB.py
with
15 additions
and
15 deletions
AdamsWilliamsonCMB.py
+
15
−
15
View file @
38126282
...
...
@@ -26,7 +26,7 @@ def read_data(file) -> tuple:
def
mass
(
r
:
list
,
rho_r
:
list
)
->
float
:
'''
Calculates difference of actual mass of earth and mass calculated by a given density model.
If density model is not complete, the function returns the mass not yet incorporated in the model.
'''
M_e
=
5.9
74
*
10
**
24
M_e
=
5.9
51e
24
result
=
M_e
for
i
in
range
(
len
(
r
)
-
1
):
result
-=
(
4
/
3
)
*
np
.
pi
*
rho_r
[
i
]
*
(
r
[
i
]
**
3
-
r
[
i
+
1
]
**
3
)
...
...
@@ -82,7 +82,7 @@ def calc_density(rho_0: int, rho_CMB: int, radius: list, vp: list, vs: list) ->
# more discontinuities
# elif depth[i] == 410 and depth[i-1] == 410: # 410km discontinuity
# rho_ex[i] = 39
2
1.
4285714285716
# rho_ex[i] = 39
3
1.
7
# elif depth[i] == 660 and depth[i-1] == 660: # 660km discontinuity
# rho_ex[i] = 4238.7
# elif depth[i] == 2740 and depth[i-1] == 2740: # D" discontinuity
...
...
@@ -92,11 +92,11 @@ def calc_density(rho_0: int, rho_CMB: int, radius: list, vp: list, vs: list) ->
# rho_im = density_expansion_implicit(rho_im, vp, vs, r, i)
return
rho_ex
def
best_inertia_model
(
file
,
n
=
31
,
rho_0_low
=
3
5
00
,
rho_0_high
=
3700
,
rho_CMB_low
=
9
60
0
,
rho_CMB_high
=
99
0
0
):
def
best_inertia_model
(
file
,
n
=
31
,
rho_0_low
=
3
6
00
,
rho_0_high
=
3700
,
rho_CMB_low
=
9
45
0
,
rho_CMB_high
=
99
5
0
):
depth
,
density
,
vp
,
vs
=
read_data
(
file
)
M_0
=
5.9
72
e24
# Masse in 18km Tiefe
I_0
=
8.025
e37
# Moment of Inertia
M_0
=
5.9
51
e24
# Masse in 18km Tiefe
I_0
=
7.964
e37
# Moment of Inertia
, without the uppermost 18km
vp
*=
1000
vs
*=
1000
...
...
@@ -130,16 +130,16 @@ def best_inertia_model(file, n=31, rho_0_low=3500, rho_0_high=3700, rho_CMB_low=
plt
.
figure
()
plt
.
plot
(
density_choice
,
radius_model
,
label
=
'
calculated density profile
'
)
plt
.
plot
(
density
,
radius_model
,
label
=
'
PREM: density profile
'
)
plt
.
xlabel
(
'
density [kg/m³]
'
)
plt
.
ylabel
(
'
radius [
k
m]
'
)
plt
.
legend
()
plt
.
xlabel
(
'
density [kg/m³]
'
,
fontsize
=
20
)
plt
.
ylabel
(
'
radius [m]
'
,
fontsize
=
20
)
plt
.
legend
(
fontsize
=
20
)
plt
.
show
()
def
best_mass_model
(
file
,
n
=
31
,
rho_0_low
=
3700
,
rho_0_high
=
3900
,
rho_CMB_low
=
9
80
0
,
rho_CMB_high
=
10050
):
def
best_mass_model
(
file
,
n
=
31
,
rho_0_low
=
3700
,
rho_0_high
=
3900
,
rho_CMB_low
=
9
95
0
,
rho_CMB_high
=
10050
):
depth
,
density
,
vp
,
vs
=
read_data
(
file
)
M_0
=
5.9
72
e24
# Masse in 18km Tiefe
I_0
=
8.025
e37
# Moment of Inertia
M_0
=
5.9
51
e24
# Masse in 18km Tiefe
I_0
=
7.964
e37
# Moment of Inertia
, without the uppermost 18km
vp
*=
1000
vs
*=
1000
...
...
@@ -173,9 +173,9 @@ def best_mass_model(file, n=31, rho_0_low=3700, rho_0_high=3900, rho_CMB_low=980
plt
.
figure
()
plt
.
plot
(
density_choice
,
radius_model
,
label
=
'
Calculated density profile
'
)
plt
.
plot
(
density
,
radius_model
,
label
=
'
PREM: density profile
'
)
plt
.
xlabel
(
'
density [kg/m³]
'
)
plt
.
ylabel
(
'
radius [
k
m]
'
)
plt
.
legend
()
plt
.
xlabel
(
'
density [kg/m³]
'
,
fontsize
=
20
)
plt
.
ylabel
(
'
radius [m]
'
,
fontsize
=
20
)
plt
.
legend
(
fontsize
=
20
)
plt
.
show
()
...
...
@@ -185,7 +185,7 @@ file = os.getcwd() + r"\VpVs-valuesak135.csv"
print
(
'
Calculating optimal density model in regard to total mass. Depending on the grid size of the search domain this may take a while.
\n
'
)
best_mass_model
(
file
,
n
=
20
,
rho_0_low
=
36
0
0
,
rho_0_high
=
3
80
0
)
best_mass_model
(
file
,
n
=
20
,
rho_0_low
=
36
6
0
,
rho_0_high
=
3
73
0
)
print
(
'
\n
Calculating optimal density model in regard to inertia. Depending on the grid size of the search domain this may take a while.
\n
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment