fit_H4_x_single_layer#
- PySeismoSoil.helper_mkz_model.fit_H4_x_single_layer(damping_data_in_pct: ndarray, *, use_scipy: bool = True, pop_size: int = 800, n_gen: int = 100, lower_bound_power: float = - 4, upper_bound_power: float = 6, eta: float = 0.1, seed: int = 0, show_fig: bool = False, verbose: bool = False, suppress_warnings: bool = True, parallel: bool = False, n_cores: int | None = None) dict[str, float] [source]#
Perform H4_x curve fitting for one damping curve using the genetic algorithm.
- Parameters:
damping_data_in_pct (np.ndarray) – Damping data. Needs to have 2 columns (strain and damping ratio). Both columns need to use % as unit.
use_scipy (bool) – Whether to use the “differential_evolution” algorithm in scipy (https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.differential_evolution.html) to perform the optimization. If
False
, use the algorithm in the DEAP package.pop_size (int) – The number of individuals in a generation. A larger number leads to potentially better curve-fitting, but a longer computing time.
n_gen (int) – Number of generations that the evolution lasts. A larger number leads to potentially better curve-fitting, but a longer computing time.
lower_bound_power (float) – The 10-based power of the lower bound of all the 9 parameters. For example, if your desired lower bound is 0.26, then set this parameter to be numpy.log10(0.26).
upper_bound_power (float) – The 10-based power of the upper bound of all the 9 parameters.
eta (float) – Crowding degree of the mutation or crossover. A high
eta
will produce children resembling to their parents, while a loweta
will produce solutions much more different.seed (int) – Seed value for the random number generator.
show_fig (bool) – Whether to show the curve fitting results as a figure.
verbose (bool) – Whether to display information (statistics of the loss in each generation) on the console.
suppress_warnings (bool) – Whether to suppress warning messages. For this particular task, overflow warnings are likely to occur.
parallel (bool) – Whether to use multiple processors in the calculation. All CPU cores will be used if set to
True
.n_cores (int | None) – The number of CPU cores to use in the curve fitting
- Returns:
best_param – The best parameters found in the optimization.
- Return type:
dict[str, float]