def test_simplified_rayleigh_vel(): """Test simplified Rayleigh wave velocity.""" # Example from Urzua et al. (2017). Table 1 in Appendix A layers = [ (8, 828, 105), (5, 726, 133), (7, 1039, 120), (8, 825, 120), (5, 951, 137), (65, 1270, 125), (24, 1065, 127), (16, 1205, 119), (9, 1071, 138), (7, 1633, 135), (21, 1223, 138), (25, 2777, 140), ] p = site.Profile([ site.Layer(site.SoilType(unit_wt=unit_wt), thick, vs) for thick, vs, unit_wt in layers ]) assert_allclose( p.simplified_rayliegh_vel(), 1349.076, atol=0.001, )
def test_time_average_vel(depth, expected): """Test time averaged shear-wave velocity.""" st = site.SoilType(unit_wt=17) p = site.Profile([ site.Layer(st, 10, 300), site.Layer(st, 10, 600), site.Layer(st, None, 900), ]) assert_allclose(p.time_average_vel(depth), expected, atol=0.001)
def test_iter_variations(): m = motion.SourceTheoryRvtMotion(6.0, 30, 'wna') m.calc_fourier_amps() profile = site.Profile([ site.Layer( site.DarendeliSoilType(18., plas_index=0, ocr=1, stress_mean=200), 10, 400), site.Layer( site.DarendeliSoilType(18., plas_index=0, ocr=1, stress_mean=200), 20, 600), site.Layer(site.SoilType('Rock', 24., None, 0.01), 0, 1200), ]) calc = propagation.EquivalentLinearCalculator() var_thickness = variation.ToroThicknessVariation() var_velocity = variation.ToroVelocityVariation.generic_model('USGS C') var_soiltypes = variation.SpidVariation(-0.5, std_mod_reduc=0.15, std_damping=0.0030) freqs = np.logspace(-1, 2, num=500) outputs = output.OutputCollection( output.ResponseSpectrumOutput( # Frequency freqs, # Location of the output output.OutputLocation('outcrop', index=0), # Damping 0.05), output.ResponseSpectrumRatioOutput( # Frequency freqs, # Location in (denominator), output.OutputLocation('outcrop', index=-1), # Location out (numerator) output.OutputLocation('outcrop', index=0), # Damping 0.05), ) for profile in variation.iter_varied_profiles(profile, 3, var_thickness=var_thickness, var_velocity=var_velocity, var_soiltypes=var_soiltypes): calc(m, profile, profile.location('outcrop', index=-1)) outputs(calc)