<jupyter_start><jupyter_text>This notebook demonstrates the pipeline for running site response simulations in batch. You can choose to run the simulations using multiple CPU processors.<jupyter_code>from PySeismoSoil.class_ground_motion import Ground_Motion
from PySeismoSoil.class_Vs_profile import Vs_Profile
from PySeismoSoil.class_curves import Multiple_GGmax_Damping_Curves
from PySeismoSoil.class_parameters import HH_Param_Multi_Layer
from PySeismoSoil.class_simulation import Linear_Simulation, Equiv_Linear_Simulation, Nonlinear_Simulation
from PySeismoSoil.class_batch_simulation import Batch_Simulation<jupyter_output><empty_output><jupyter_text>1. Linear simulations in batch<jupyter_code>accel_in = Ground_Motion('../PySeismoSoil/tests/files/sample_accel.txt', unit='gal')
profile_1 = Vs_Profile('../PySeismoSoil/tests/files/profile_FKSH14.txt')
profile_2 = Vs_Profile('../PySeismoSoil/tests/files/profile_P001.txt')
lin_sim_1 = Linear_Simulation(profile_1, accel_in, boundary='rigid')
lin_sim_2 = Linear_Simulation(profile_2, accel_in, boundary='elastic')
batch_lin_sim = Batch_Simulation([lin_sim_1, lin_sim_2])
lin_results = batch_lin_sim.run(parallel=True, n_cores=2, options=dict(every_layer=False, show_fig=True))
lin_results<jupyter_output><empty_output><jupyter_text>2. Equivalent linear simulations in batch<jupyter_code>curves_1 = Multiple_GGmax_Damping_Curves(data='../PySeismoSoil/tests/files/curve_FKSH14.txt')
curves_2 = Multiple_GGmax_Damping_Curves(data='../PySeismoSoil/tests/files/curve_P001.txt')<jupyter_output><empty_output><jupyter_text>(To see how to construct $G/G_{\max}$ and damping curves from $V_S$ profiles, go to [this notebook](./Pipeline_04_Equivalent_Linear_Method.ipynb).)<jupyter_code>equiv_sim_1 = Equiv_Linear_Simulation(profile_1, accel_in, curves_1, boundary='elastic')
equiv_sim_2 = Equiv_Linear_Simulation(profile_2, accel_in, curves_2, boundary='elastic')
batch_equiv_sim = Batch_Simulation([equiv_sim_1, equiv_sim_2])
equiv_results = batch_equiv_sim.run(parallel=True, n_cores=2, options=dict(verbose=True, show_fig=False));
equiv_results<jupyter_output><empty_output><jupyter_text>3. Nonlinear simulations in batch<jupyter_code>hh_g_param_1 = HH_Param_Multi_Layer('../PySeismoSoil/tests/files/HH_G_FKSH14.txt')
hh_g_param_2 = HH_Param_Multi_Layer('../PySeismoSoil/tests/files/HH_G_P001.txt')
hh_x_param_1 = HH_Param_Multi_Layer('../PySeismoSoil/tests/files/HH_X_FKSH14.txt')
hh_x_param_2 = HH_Param_Multi_Layer('../PySeismoSoil/tests/files/HH_X_P001.txt')<jupyter_output><empty_output><jupyter_text>(To see how to construct HH parameters for $G/G_{\max}$ and damping behaviors, go to [this notebook](./Pipeline_05_Nonlinear_Method.ipynb).)<jupyter_code>nonl_sim_1 = Nonlinear_Simulation(profile_1, accel_in, G_param=hh_g_param_1, xi_param=hh_x_param_1, boundary='elastic')
nonl_sim_2 = Nonlinear_Simulation(profile_2, accel_in, G_param=hh_g_param_2, xi_param=hh_x_param_2, boundary='rigid')
batch_nonl_sim = Batch_Simulation([nonl_sim_1, nonl_sim_2])
nonl_results = batch_nonl_sim.run(parallel=True, n_cores=2, options=dict(remove_sim_dir=True, verbose=True, show_fig=False))
nonl_results
nonl_results[1].plot();<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10628321350422007, 'fraction_numerical': 0.019693654266958426, 'mean_word_length': 10.636363636363637, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '465532', 'license': 'FSFAP', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1173, 'n_words': 164, 'path': 'examples/Pipeline_06_Batch_Simulation.ipynb', 'repo_name': 'jsh9/PySeismoSoil', 'size': '3199'}