In [1]:
#
# common python library
import matplotlib.pyplot as plt
In [13]:
# west-east
dX = 250
nX = 15
npX = 5
fsX = 1.5
#
ix = []
for i in range(0,nX):
ix.append(dX)
#
for i in range(0,npX):
dX *= fsX
ix.append(dX)
ix.insert(0,dX)
#
# print(ix)
In [14]:
# north-south
dY = 250
nY = 15
npY = 5
fsY = 1.5
#
iy = []
for i in range(0,nY):
iy.append(dY)
#
for i in range(0,npY):
dY *= fsY
iy.append(dY)
iy.insert(0,dY)
#
# print(iy)
In [15]:
# top-bottom
dZ = 10
nZ = 28
fsZ = 1.2
iz = []
iz.append(dZ)
for i in range(0,nZ):
dZ *= fsZ
iz.append(dZ)
# depth = 0
# for i in range(0,nZ):
# depth+=iz[i]
# # print(i,'\t',iz[i],'\t',depth)
# print("%4i %4.2f %6.2f" % (i+1, iz[i], depth))
In [16]:
temp = 0
dx = []
dx.append(temp)
for i in ix:
temp += i
dx.append(temp)
temp = 0
dy = []
dy.append(temp)
for i in iy:
temp += i
dy.append(temp)
temp = 0
dy_r = []
dy_r.append(temp)
for i in list(reversed(iy)):
temp += i
dy_r.append(temp)
temp = 0
dz = []
dz.append(temp)
for i in iz:
temp += i
dz.append(temp)
In [32]:
fig, ax = plt.subplots(1,figsize=(8,8))
for i in dx:
ax.plot([i,i], [min(dy),max(dy)],'b', linewidth=0.3)
for i in dy_r:
ax.plot([min(dx),max(dx)], [i,i],'b', linewidth=0.3)
In [33]:
ax.set_xlabel('easting')
ax.set_ylabel('northing')
ax.set_title('Mesh 2D Discretization')
ax.set_aspect('equal')
ax.set_xlim([min(dx)-1,max(dx)+1])
ax.set_ylim(min(dy)-1,max(dy)+1)
plt.show()
In [50]:
fig, ax = plt.subplots(2,1,figsize=(20,20))
for i in dx:
ax[0].plot([i,i], [min(dz),max(dz)],'b', linewidth=0.3)
for i in dy:
ax[1].plot([i,i], [min(dz),max(dz)],'b', linewidth=0.3)
for i in dz:
ax[0].plot([min(dx),max(dx)], [i,i],'b', linewidth=0.3)
ax[1].plot([min(dy),max(dy)], [i,i],'b', linewidth=0.3)
ax[0].set_xlabel('x')
ax[0].set_ylabel('depth (km)')
ax[0].set_title('West-East')
# ax[0].set_aspect('equal')
ax[0].set_xlim(min(dx),max(dx))
ax[0].set_ylim(-max(dz)/5,max(dz))
ax[0].invert_yaxis()
ax[1].set_xlabel('y')
ax[1].set_ylabel('depth (km)')
ax[1].set_title('North-South')
# ax[1].set_aspect('equal')
ax[1].set_xlim(min(dy),max(dy))
ax[1].set_ylim(-max(dz)/5,max(dz))
ax[1].invert_yaxis()
plt.show()
In [ ]: