Stress_Curve#
- class PySeismoSoil.class_curves.Stress_Curve(data: ndarray, *, strain_unit: Literal['1', '%'] = '1', stress_unit: Literal['Pa', 'kPa', 'MPa', 'GPa'] = 'kPa', min_strain: float = 0.0001, max_strain: float = 10.0, n_pts: int = 50, log_scale: bool = True, check_values: bool = True)[source]#
Bases:
Curve
Class implementation of a stress curve, as a function of shear strain.
- Parameters:
data (np.ndarray) – A 2D numpy array with 2 columns. Its 0th column contains the strain array, and the 1st column contains the G/Gmax values.
strain_unit (Literal['1', '%']) – The unit of the strain.
stress_unit (Literal['Pa', 'kPa', 'MPa', 'GPa']) – The unit of the stress.
min_strain (float) – Minimum strain value of the strain array. The raw
data
is internally interpolated at a strain array defined bymin_strain
,max_strain
, andn_pts
.max_strain (float) – Maximum strain value of the strain array.
n_pts (int) – Number of points of the desired strain array to do the interpolation.
log_scale (bool) – Whether the strain array for interpolation is in log scale (or linear scale).
check_values (bool) – Whether to assert that all the stress values are non negative.
- raw_data#
The raw data that the user passed in
- Type:
np.ndarray
- strain#
The strain array at which interpolation happens, a 1D numpy array of shape (
n_pts
, ). The unit is percent (unit conversion happens internally if applicable).- Type:
np.ndarray
- stress#
The interpolated damping values; same shape as
strain
. The unit is always ‘kPa’.- Type:
np.ndarray
- Raises:
ValueError – When
stress_unit
is not one of [‘Pa’, ‘kPa’, ‘MPa’, ‘GPa’]
Methods Summary
plot
([plot_interpolated, fig, ax, title, ...])Plot the curve (y axis: values, x axis: strain)
Methods Documentation
- plot(plot_interpolated: bool = True, fig: matplotlib.figure.Figure | None = None, ax: matplotlib.axes._axes.Axes | None = None, title: str | None = None, xlabel: str | None = 'Strain [%]', ylabel: str | None = None, figsize: tuple[float, float] = (3, 3), dpi: float = 100, **kwargs_to_matplotlib: dict[Any, Any]) tuple[matplotlib.figure.Figure, matplotlib.axes._axes.Axes] #
Plot the curve (y axis: values, x axis: strain)
- Parameters:
plot_interpolated (bool) – Whether to plot the interpolated curve or the raw data.
fig (Figure | None) – Figure object. If None, a new figure will be created.
ax (Axes | None) – Axes object. If None, a new axes will be created.
title (str | None) – Title of plot.
xlabel (str | None) – X label of plot.
ylabel (str | None) – Y label of plot.
figsize (tuple[float, float]) – Figure size in inches, as a tuple of two numbers. The figure size of
fig
(if notNone
) will override this parameter.dpi (float) – Figure resolution. The dpi of
fig
(if notNone
) will override this parameter.**kwargs_to_matplotlib (dict[Any, Any]) – Keyword arguments to be passed to
matplotlib.pyplot.plot()
.
- Returns:
fig (Figure) – The figure object being created or being passed into this function.
ax (Axes) – The axes object being created or being passed into this function.