conductivity = 3.0 # [W/(m K)] rad_heat = 1.*10**(-7) # radiogenic head generation [W m^-3] cond_var = 0.001 # linear coefficient for conductivity [K^-1] crust_temp = 400. + 273. # temperature at the base of the crust [K] crust_flux = 17.*10**(-3) # heat flux at the base of the crust [W m^-2] crust_depth = 35*10**3 # depth of the base of the crust [m] # Make temperature profiles depths = numpy.arange(35000., 200000., 1000.) pylab.figure(figsize=(11,6)) for cond_var in [-10**(-6)*10**i for i in xrange(4)]: temps = subcrust.synthetic_temp_profile(depths, rad_heat, cond_var, crust_flux, crust_temp, conductivity, crust_depth) pylab.plot(temps - 273., depths*0.001, '-.', label=r"B=%2.1e $K^{-1}$" % (cond_var), linewidth=3) temps = subcrust.synthetic_temp_profile(depths, rad_heat, 0, crust_flux, crust_temp, conductivity, crust_depth) pylab.plot(temps - 273., depths*0.001, '-k', label=r"B=0 $K^{-1}$", linewidth=3) for cond_var in [10**(-6)*10**i for i in xrange(5)]: temps = subcrust.synthetic_temp_profile(depths, rad_heat, cond_var, crust_flux, crust_temp, conductivity, crust_depth)
# Run the inversion results = subcrust.invert_temp_profile(depths, temps, error, initial_radheat, initial_condvar, initial_flux, ref_temp=crust_temp, ref_cond=conductivity, ref_depth=crust_depth, max_it=10000) inv_radheat, inv_condvar, inv_flux, cov, adjusted, goals = results sigma_radheat, sigma_condvar, sigma_flux = numpy.sqrt(numpy.diag(cov)) adjusted = subcrust.synthetic_temp_profile(depths, inv_radheat, inv_condvar, inv_flux, crust_temp, conductivity, crust_depth) residuals = temps - adjusted print "Inversion results:" print " A = %.5g +- %.2g" % (inv_radheat, sigma_radheat) print " B = %.5g +- %.2g" % (inv_condvar, sigma_condvar) print " qc = %.5g +- %.2g" % (inv_flux, sigma_flux) # Plot the results pylab.figure() pylab.plot(temps - 273., depths*0.001, '.k', label="Data (Russell et al, 2001)") pylab.ylim(210, 0.001*crust_depth) pylab.xlabel(r"Temperature [$^\circ$C]") pylab.ylabel("Depth [km]")