rock = own_material() # seismic model for comparison: (see burnman/seismic.py) seismic_model = burnman.seismic.PREM() # pick from .prem() .slow() .fast() number_of_points = 20 # set on how many depth slices the computations should be done depths = np.linspace(700e3, 2800e3, number_of_points) # depths = seismic_model.internal_depth_list(mindepth=700.e3, # maxdepth=2800.e3) seis_p, seis_rho, seis_vp, seis_vs, seis_vphi = seismic_model.evaluate( ['pressure', 'density', 'v_p', 'v_s', 'v_phi'], depths) temperature = burnman.geotherm.brown_shankland(depths) # The next line is not required here, because the method is set # automatically by defining 'equation_of_state' in mineral.params. This # shows an alternative way to set the method later, or reset the method to # a different one. rock.set_method(method) print("Calculations are done for:") rock.debug_print() mat_rho, mat_vs, mat_vphi = \ rock.evaluate(['density', 'v_s', 'v_phi'], seis_p, temperature) [vs_err, vphi_err, rho_err] = \ burnman.compare_chifactor( [mat_vs, mat_vphi, mat_rho], [seis_vs, seis_vphi, seis_rho]) print(vs_err, vphi_err, rho_err)
temperature = burnman.geotherm.brown_shankland(seis_p) print "Calculations are done for:" rock.debug_print() moduli_list = burnman.calculate_moduli(rock, seis_p, temperature) moduli = burnman.average_moduli(moduli_list, burnman.averaging_schemes.VoigtReussHill()) mat_vp, mat_vs, mat_vphi = burnman.compute_velocities(moduli) mat_K = np.array([m.K for m in moduli]) mat_G = np.array([m.G for m in moduli]) mat_rho = np.array([m.rho for m in moduli]) [vs_err, vphi_err, rho_err] = burnman.compare_chifactor ( [mat_vs,mat_vphi,mat_rho],[seis_vs,seis_vphi,seis_rho]) # PLOTTING # plot vs plt.subplot(2,2,1) plt.plot(seis_p/1.e9,mat_vs/1.e3,color='b',linestyle='-',marker='o', \ markerfacecolor='b',markersize=4,label='computation') plt.plot(seis_p/1.e9,seis_vs/1.e3,color='k',linestyle='-',marker='o', \ markerfacecolor='k',markersize=4,label='reference') plt.title("Vs (km/s)") plt.xlim(min(seis_p)/1.e9,max(seis_p)/1.e9) plt.ylim(5.1,7.6) plt.legend(loc='lower right') plt.text(40,7.3,"misfit= %3.3f" % vs_err)
# alternatively, we could use the values where prem is defined: # depths = seismic_model.internal_depth_list(mindepth=700.e3, # maxdepth=2800.e3) seis_p, seis_rho, seis_vp, seis_vs, seis_vphi = seismic_model.evaluate( ['pressure', 'density', 'v_p', 'v_s', 'v_phi'], depths) temperature = burnman.geotherm.brown_shankland(depths) print("Calculations are done for:") rock.debug_print() mat_rho, mat_vp, mat_vphi, mat_vs, mat_K, mat_G = rock.evaluate( ['density', 'v_p', 'v_phi', 'v_s', 'K_S', 'G'], seis_p, temperature) [vs_err, vphi_err, rho_err] = burnman.compare_chifactor([mat_vs, mat_vphi, mat_rho], [seis_vs, seis_vphi, seis_rho]) # PLOTTING # plot vs plt.subplot(2, 2, 1) plt.plot(seis_p / 1.e9, mat_vs / 1.e3, color='b', linestyle='-', marker='o', markerfacecolor='b', markersize=4, label='computation') plt.plot(seis_p / 1.e9, seis_vs / 1.e3, color='k',