def beta(x,H): # compute basal resistance coefficient: tau_b = - beta(x,H) u if ground(H) & (x <= exactsolns.L0): Hexact, _, _ = exactsolns.exactBod(x) gover = exactsolns.rho * exactsolns.g * Hexact # grounded overburden pressure return exactsolns.k * gover else: return 0.0
def getsides(x): if x <= xg: H, u, _ = exactBod(x) T, B = exactBodBueler(x) dH, du = ddx_exactBod(x) LL = np.array([[(2.0/n)*B*H*du**q, 0, 0], [H, u, 0], [0, -rg*H, 1]]) RR = np.array([[0, -2.0*B*du**(1.0/n), 1], [-dH, -du, 0], [-k*rg*H, -k*rg*u+rg*dH, 0]]) else: H, u = exactVeen(x) dH, du = ddx_exactVeen(x) LL = np.array([[(2.0/n)*Bg*H*du**q, 0, 0], [H, u, 0], [0, -omega*rg*H, 1]]) RR = np.array([[0, -2.0*Bg*du**(1.0/n), 1], [-dH, -du, 0], [0, omega*rg*dH, 0]]) return LL, RR
def M(x): # compute mass balance for location if x <= exactsolns.xg: _, _, Mexact = exactsolns.exactBod(x) return Mexact else: return exactsolns.Mg
r"B(x) ($10^8\, \mathrm{Pa} \mathrm{s}^{-1/3}$) (dashed)") ax1fig2.set_xlim(0.0,(xoceanend-exactsolns.xa)/1000.0) ax2fig2.set_xlim(0.0,(xoceanend-exactsolns.xa)/1000.0) ax1fig2.set_ylim(-5.0,5.0) ax2fig2.set_ylim(0.0,5.0) imagename = nameroot + '-M-B.pdf' plt.savefig(imagename) print ' image file %s saved' % imagename #plt.show() # sliding resistance beta in figure 4 fig = plt.figure(figsize=(6,4)) bbeta = np.zeros(np.shape(H)) for j in range(len(H)): if x[j] <= exactsolns.L0: Hexact, _, _ = exactsolns.exactBod(x[j]) bbeta[j] = exactsolns.k * exactsolns.rho * exactsolns.g * Hexact else: bbeta[j] = 0.0 ax1fig3, ax2fig3 = plottwo(fig,(x-exactsolns.xa)/1000.0,bbeta/1.0e10,T/1.0e8, r"$\beta$(x) ($10^{10} \,\mathrm{Pa}\, \mathrm{s}\, \mathrm{m}^{-1}$) (solid)", r"$T$(x) ($10^8 \,\mathrm{Pa}\, \mathrm{m}$) (dashed)") ax1fig3.set_ylim(-0.1,2.1) ax2fig3.set_ylim(0.0,2.0) bbeta[x > exactsolns.xg] = 0.0 ax1fig3.plot((x-exactsolns.xa)/1000.0,bbeta/1.0e10,'k:',lw=1.5) imagename = nameroot + '-beta-T.pdf' plt.savefig(imagename) print ' image file %s saved' % imagename #plt.show()