Simulation_Results#
- class PySeismoSoil.class_simulation_results.Simulation_Results(input_accel: Ground_Motion, accel_on_surface: Ground_Motion, rediscretized_profile: Vs_Profile, *, max_a_v_d: numpy.ndarray | None = None, max_strain_stress: numpy.ndarray | None = None, trans_func: PySeismoSoil.class_frequency_spectrum.Frequency_Spectrum | None = None, trans_func_smoothed: PySeismoSoil.class_frequency_spectrum.Frequency_Spectrum | None = None, time_history_accel: numpy.ndarray | None = None, time_history_veloc: numpy.ndarray | None = None, time_history_displ: numpy.ndarray | None = None, time_history_stress: numpy.ndarray | None = None, time_history_strain: numpy.ndarray | None = None, motion_name: str | None = None, output_dir: str | None = None)[source]#
Bases:
object
Site response simulation results: output ground motion, transfer function, acceleration/velocity/displacement time histories (of every layer).
- Parameters:
input_accel (Ground_Motion) – Input ground motion.
accel_on_surface (Ground_Motion) – Output ground motion.
rediscretized_profile (Vs_Profile) – Vs profile (the re-discretized version that ensures proper representation of wave shapes).
max_a_v_d (np.ndarray | None) – Maximum acceleration, velocity, displacement (during ground shaking) at all layer boundaries.
max_strain_stress (np.ndarray | None) – Maximum strain and stress (during ground shaking) at layer midpoints.
trans_func (Frequency_Spectrum | None) – Transfer function (between the output and input motions). It can be complex-valued or real-valued (i.e., amplitudes only).
trans_func_smoothed (Frequency_Spectrum | None) – The smoothed transfer function (between the output and input motions). It is by default real-valued (i.e., amplitudes only).
time_history_accel (np.ndarray | None) – Time histories of accelerations of all layers (at layer boundaries).
time_history_veloc (np.ndarray | None) – Time histories of velocities of all layers (at layer boundaries).
time_history_displ (np.ndarray | None) – Time histories of displacements of all layers (at layer boundaries).
time_history_stress (np.ndarray | None) – Time histories of shear stresses of all layers (at layer midpoints).
time_history_strain (np.ndarray | None) – Time histories of shear strains of all layers (at layer midpoints).
motion_name (str | None) – The name of the input motion to be used as an identifier in the file names. If
None
, the current time stamp will used.output_dir (str | None) – Directory to which to save the output files. If
None
, the current time stamp will be used.
- Attributes same as inputs
- Raises:
TypeError – If input arguments have incorrect type
Methods Summary
plot
([dpi, save_fig, amplif_func_ylog, ...])Plot simulation results: output vs input motions, transfer functions and maximum acceleration, velocity, displacement, strain, and stress profiles.
to_txt
([save_full_time_history, verbose, ...])Save simulation results (output time history, transfer function, the profile of maximum acceleration/velocity/displacement/stress/train, etc.) as text files to the hard drive.
Methods Documentation
- plot(dpi: float = 100, save_fig: bool = False, amplif_func_ylog: bool = True, output_dir: str | None = None) tuple[tuple[matplotlib.figure.Figure, matplotlib.figure.Figure | None], tuple[matplotlib.axes._axes.Axes, tuple[matplotlib.axes._axes.Axes | None, ...]]] [source]#
Plot simulation results: output vs input motions, transfer functions and maximum acceleration, velocity, displacement, strain, and stress profiles.
- Parameters:
dpi (float) – Figure resolution.
save_fig (bool) – Whether to save figure to
output_dir
.amplif_func_ylog (bool) – Whether to show the Y axis of the amplification function in log scale.
output_dir (str | None) – The directory to save the plots. This overrides the
output_dir
parameter when constructing the this class.
- Returns:
figs (tuple[Figure, Figure | None]) – A tuple of two figure objects.
axes (tuple[Axes, tuple[Axes | None, …]]) – A list of axes objects (or axes lists, if multiple subplots).
- to_txt(save_full_time_history: bool = True, verbose: bool = False, output_dir: str | None = None) None [source]#
Save simulation results (output time history, transfer function, the profile of maximum acceleration/velocity/displacement/stress/train, etc.) as text files to the hard drive.
- Parameters:
save_full_time_history (bool) – Whether to save full time histories (every time step, every layer) of accel/veloc/displ/strain/stress to hard drive. They can take a lot of disk space. Only effective if the full time histories are not
None
.verbose (bool) – Whether to show on the console where the files are saved to.
output_dir (str | None) – The directory to save the files. This overrides the
output_dir
parameter when constructing the class.