-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path9.phase_diagram.py
More file actions
executable file
·158 lines (142 loc) · 5.47 KB
/
9.phase_diagram.py
File metadata and controls
executable file
·158 lines (142 loc) · 5.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 18 09:48:29 2021
@author: ji-chingchen
"""
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["font.family"] = "Times New Roman"
fig1 = 0
if fig1:
###===============================basalt and eclogit ==========================
x = np.linspace(0,514)
y = -0.0375 * x + 20.1
basalt_change = (50/255, 200/255, 180/255)
fig,ax = plt.subplots(1,1,figsize=(10,10))
ax.plot(x,y,c=basalt_change,lw=8)
x = np.linspace(515,1000)
y = 0.0022 * x - 0.3
ax.plot(x,y,c=basalt_change,lw=8,label='basalt-eclogite')
ax.set_ylim(0,8)
ax.tick_params(axis='x', labelsize=26)
ax.tick_params(axis='y', labelsize=26)
ax.set_xlabel('Temperature ($^\circ$C)',fontsize=26)
ax.set_ylabel('Pressure (GPa)',fontsize=26)
ax.text(80,3.5,'Basalt',fontsize=36)
ax.text(570,5.5,'Eclogite',fontsize=36)
ax.text(480,2.5,'Phase boundary from',fontsize=26)
ax.text(520,2.1,'Hacker et al. (2003)',fontsize=26)
bwith = 5
ax.spines['bottom'].set_linewidth(bwith)
ax.spines['top'].set_linewidth(bwith)
ax.spines['right'].set_linewidth(bwith)
ax.spines['left'].set_linewidth(bwith)
# ax.set_title('metamorphosed MORB ',fontsize=25)
# fig.savefig('/Users/ji-chingchen/OneDrive - 國立台灣大學/ThesisNTU/figures/'+'basalt_phase_diagram'+'.pdf')
###====================perdotite and serpentinite =============================
phase_change = (140/255, 20/255, 70/255)
# fig2,ax = plt.subplots(1,1,figsize=(10,14))
x = np.linspace(500,730)
tt1 = 2.1 +(7.5-2.1)* (x - 730)/ (500-730)
ax.plot(x,tt1,c=phase_change,label = 'perdotite-serpentinite')
x = np.linspace(670,730)
ttold = 2.1 + (0.6-2.1) * (x-730)/(670-730)
ax.plot(x,ttold,c=phase_change)
ax.tick_params(axis='x', labelsize=16 )
ax.tick_params(axis='y', labelsize=16 )
ax.set_xlabel('Temperature ($^\circ$C)',fontsize=20)
ax.set_ylabel('Pressure (Gpa)',fontsize=20)
###====================sediment to schist =============================
# fig3,ax = plt.subplots(1,1,figsize=(10,14))
depth = np.linspace(0,100000)
pressure=3000*10*depth/1e9 # (GPa) static pressutr = density(mantle) * g * depth
dd=20*1e3
dpressure = 3000*10*dd/1e9
ax.plot([650,650],[dpressure,8],'r--',label='sediment-schist')
ax.set_ylim(0,8)
ax.set_xlim(0,1000)
ax.tick_params(axis='x', labelsize=16 )
ax.tick_params(axis='y', labelsize=16 )
ax.set_xlabel('Temperature ($^\circ$C)',fontsize=20)
ax.set_ylabel('Pressure (Gpa)',fontsize=20)
ax.legend(fontsize=20)
##=========================plot seeting ==================================
fig2,ax2 = plt.subplots(1,1,figsize=(10,10))
depth = np.linspace(0,120000,100)
pressure=3000*10*depth/1e9 # (GPa)
sss=np.zeros(len(depth))
for q,dd in enumerate(depth):
ss1 = 680+0.6e-3*(dd-140e3)
ss2=930-313*(1-np.exp(-dd/7e3))
sss[q] = max(ss1,ss2)
ax2.plot(sss,depth/1e3,c='#FF9900',lw=5)
BB = 24*depth/1e3-190
with_plot = (BB>600)*(BB<780)
ax2.plot(BB[with_plot],depth[with_plot]/1e3,c='#FF6699',lw=5)
AA=-17*depth/1e3+2030
with_plot = (depth/1e3<82)*(depth/1e3>70)
ax2.plot(AA[with_plot],depth[with_plot]/1e3,c='#FF6699',lw=5)
#--------------------------------------------------------------------
depth = np.linspace(20e3,100000,100)
rC = np.zeros(len(depth))
for q,dd in enumerate(depth):
rC1=2030/3+7/3*dd/1e3
rC2=880
rC[q] = min(rC1,rC2)
# with_plot = (rC>710)*(rC<840)
ax2.plot(rC,depth/1e3,c='purple',lw=5)
ax2.set_xlim(0,1500)
ax2.set_ylim(120,0)
ax2.set_xlabel('Temperature ($^\circ$C)',fontsize=30)
ax2.set_ylabel('Depth (km)',fontsize=30)
bwith = 5
ax2.spines['bottom'].set_linewidth(bwith)
ax2.spines['top'].set_linewidth(bwith)
ax2.spines['right'].set_linewidth(bwith)
ax2.spines['left'].set_linewidth(bwith)
ax2.tick_params(axis='x', labelsize=26)
ax2.tick_params(axis='y', labelsize=26)
# fig2.savefig('/Users/ji-chingchen/OneDrive - 國立台灣大學/master03/Seminar/my present/sediment_phase_diagram.pdf')
##=========================plot seeting ==================================
fig3,ax3 = plt.subplots(1,1,figsize=(10,10))
depth = np.linspace(0,200000,100)
pressure=3000*10*depth/1e9 # (GPa)
sss=np.zeros(len(pressure))
for q,dd in enumerate(pressure):
if dd<1:
ss=1050-420*(1-np.exp(-dd*3.3))
elif dd>2.38:
ss=(dd+14)*43
else:
ss=630+26*((-dd)**2)/2
sss[q] = ss
ax3.plot(sss,pressure,c='#FF9900',lw=5)
#-------------------------------------------------------
### additional water-out line
#x = np.linspace(720,1040)
#y = 1.4/(-320) * x + 5.85
# ax3.plot(x,y,c='#708090',lw=5)
#x = np.linspace(670,1040)
#y = 0.6/370 * x + 0.7-670*0.6/370
# ax3.plot(x,y,c='#708090',lw=5)
#-------------------------------------------------------
x = np.linspace(0,514)
y = -0.0375 * x + 20.1
basalt_change = (50/255, 200/255, 180/255)
ax3.plot(x,y,c=basalt_change,lw=8)
x = np.linspace(515,1000)
y = 0.0022 * x - 0.3
ax3.plot(x,y,c=basalt_change,lw=8,label='basalt-eclogite')
ax3.set_xlim(0,1200)
ax3.set_ylim(0,8)
ax3.set_xlabel('Temperature ($^\circ$C)',fontsize=30)
ax3.set_ylabel('Depth (km)',fontsize=30)
bwith = 5
ax3.spines['bottom'].set_linewidth(bwith)
ax3.spines['top'].set_linewidth(bwith)
ax3.spines['right'].set_linewidth(bwith)
ax3.spines['left'].set_linewidth(bwith)
ax3.tick_params(axis='x', labelsize=26)
ax3.tick_params(axis='y', labelsize=26)
# fig3.savefig('/Users/ji-chingchen/OneDrive - 國立台灣大學/master03/Seminar/my present/sediment_phase_diagram.pdf')