geolib_plus.shm package¶
Submodules¶
geolib_plus.shm.general_utils module¶
geolib_plus.shm.nkt_utils module¶
- class geolib_plus.shm.nkt_utils.NktMethod(value)¶
Bases:
IntEnum
An enumeration.
- REGRESSION = 1¶
- STATISTICS = 2¶
- class geolib_plus.shm.nkt_utils.NktUtils¶
Bases:
BaseModel
This class contains utility functions which are used to determine Nkt and the characteristic value and probabilistic parameters. All methods are according to [11].
- static get_characteristic_value_nkt_from_statistics(su: ndarray, q_net: ndarray, std_loc: Optional[float] = None) float ¶
Gets characteristic value of N_kt through statistics.
The characteristic value of N_kt is calculated by using the following formula:
- Parameters:
su – iterable of undrained shear strength
q_net – iterable of net cone resistance
std_loc – local standard deviation of log N_kt, if None: std_loc = 0.5 std_total
- Returns:
characteristic value of N_kt
- static get_characteristic_value_nkt_from_weighted_regression(su: ndarray, q_net: ndarray, vc_loc: Optional[float] = None) float ¶
Gets characteristic value of nkt from weighted regression.
The characteristic value of N_kt is calculated by using the following formula:
- Parameters:
su – iterable of undrained shear strength
q_net – iterable of net cone resistance
vc_loc – local variation coefficient of q_net/N_kt, if None: vc_loc = 0.5 vc_total
- Returns:
characteristic value of N_kt
- static get_default_nkt(is_saturated: Optional[Union[ndarray, bool]])¶
Gets default Nkt values.
For saturated soil: mean Nkt is 20 and variation coefficient is 0.25 For unsaturated soil: mean Nkt is 60 and variation coefficient is 0.25
- Parameters:
is_saturated – boolean or numpy array with booleans which indicate of the soil/soils is/are saturated
- Returns:
mean of Nkt, std of Nkt
- static get_nkt_from_statistics(su: ~numpy.ndarray, q_net: ~numpy.ndarray) -> (<class 'float'>, <class 'float'>)¶
Calculates log mean of N_kt and total log standard deviation of N_kt through statistics
- Parameters:
su – iterable of undrained shear strength
q_net – iterable of net cone resistance
- Returns:
mean of Ln Nkt, total standard deviation of Ln Nkt
- static get_nkt_stats_from_weighted_regression(su: ~numpy.ndarray, q_net: ~numpy.ndarray) -> (<class 'float'>, <class 'float'>)¶
Gets Nkt statistics from weighted regression. With this method, the mean of Nkt and the variation coefficient of q_net/Nkt are found through weighted regression where the variation coefficient is minimised.
The function to be minimised is:
- Parameters:
su – iterable of undrained shear strength [kPa]
q_net – iterable of net cone resistance [kPa]
- Returns:
mean of Nkt, variation coefficient of q_net/Nkt
- static get_prob_nkt_parameters_from_statistics(su: ~numpy.ndarray, q_net: ~numpy.ndarray, log_std_loc: ~typing.Optional[float] = None) -> (<class 'float'>, <class 'float'>)¶
Get Nkt parameters for probabilistic analysis through statistics.
Firstly, statistics are used to get the mean and standard deviation of the log Nkt values. Afterwards, the mean and standard deviation for probabilistic analysis are calculated, where the student T distribution is taken into account.
- Parameters:
su – iterable of undrained shear strength
q_net – iterable of net cone resistance
log_std_loc – local standard deviation of log N_kt, if None: std_loc = 0.5 std_total
- Returns:
mean of N_kt and variation coefficient of q_net/N_kt for probabilistic analysis
- static get_prob_nkt_parameters_from_weighted_regression(su: ~numpy.ndarray, q_net: ~numpy.ndarray, vc_loc: ~typing.Optional[float] = None) -> (<class 'float'>, <class 'float'>)¶
Get Nkt parameters for probabilistic analysis through weighted regression.
Firstly, weighted regression is used to get the mean of the Nkt values and the variation coefficient of q_net / N_kt. Afterwards, the variation coefficient is adjusted for the number of samples with the student T distribution
- Parameters:
su – iterable of undrained shear strength
q_net – iterable of net cone resistance
vc_loc – local variation coefficient of q_net/N_kt, if None: vc_loc = 0.5 vc_total
- Returns:
mean of N_kt and variation coefficient of q_net/N_kt for probabilistic analysis
geolib_plus.shm.prob_utils module¶
- class geolib_plus.shm.prob_utils.ProbUtils¶
Bases:
BaseModel
Class contains probabilistic utilities for parameter determination following the methodology as described in [11].
- static calculate_characteristic_value_from_dataset(data: ndarray, is_local: bool, is_low: bool, is_log_normal: bool = True, char_quantile: float = 0.05)¶
Calculates the characteristic value of the dataset. A normal distribution or a lognormal distribution can be assumed for the dataset. The student-t distribution is taken into account. And the spread reduction factor is taken into account.
The characteristic value is calculated as follows:
where:
is the characteristic value is the student t factor at 5 quantile with n-1 degrees of freedom is the spread reduction factor; 0.75 if data collection is regional, 1.0 if data collection is local- Parameters:
data – dataset, X
is_local – true if data collection is local, false if data collection is regional
is_low – true if low characteristic value is to be calculated, false if high characteristic value desired
is_log_normal – True if a log normal distribution is assumed, false for normal distribution
char_quantile – Quantile which is considered for the characteristic value
- Returns:
characteristic value of the dataset
- static calculate_characteristic_value_from_prob_parameters(mean: float, std: float, n: int, char_quantile=0.05, a=0)¶
Calculates characteristic values from probabilistic parameters.
- Parameters:
mean – mean of x
std – standard deviation of x
n – number of data points
char_quantile – quantile of characteristic value (default = 0.05)
a – spread reduction factor (default = 0)
- Returns:
characteristic value of X
- static calculate_log_stats(data: ndarray)¶
Calculates mean and std of LN(X)
- Parameters:
data – dataset, X
- Returns:
mean and std of LN(X)
- static calculate_normal_stats(data: ndarray)¶
Calculates mean and std of X
- Parameters:
data – dataset, X
- Returns:
mean and std of X
- static calculate_prob_parameters_from_lognormal(data: ndarray, is_local: bool, quantile=0.05)¶
Calculates probabilistic parameters mu and sigma from a lognormal dataset, as required in D-stability. This function takes into account spread reduction factor and the student t factor.
Firstly the standard deviation of LN(X) is corrected for the number of test samples and type of samples (local or regional), secondly, the mean and standard deviation of X are calculated from the mean and corrected standard deviation of LN(X)
- Parameters:
data – dataset, X
is_local – true if data collection is local, false if data collection is regional
quantile – quantile where the student t factor should be calculated
- static calculate_std_from_vc(mean: float, vc: float)¶
Calculates standard deviation from variation coefficient
- Parameters:
mean – mean of distribution
vc – variation coefficient of distribution
- static calculate_student_t_factor(ndof: int, quantile: float) float ¶
Gets student t factor from student t distribution at a specific quantile.
- Parameters:
ndof – number of degrees of freedom
quantile – quantile where the student t factor should be calculated
- Returns:
Student t factor
- static calculate_vc_from_std(mean: float, std: float)¶
Calculates variation coefficient from standard deviation
- Parameters:
mean – mean of distribution
std – standard deviation of distribution
- static correct_std_with_student_t(ndof: int, quantile: float, std: float, a: float = 0) float ¶
Calculates corrected standard deviation at a quantile with the student-t factor. This includes an optional spread reduction factor. The corrected standard deviation is calculated as follows:
where:
is the student t factor at 5 quantile with n-1 degrees of freedom is the value of the standard normal distribution at the 5 quantile is the spread reduction factor; 0.75 if data collection is regional, 1.0 if data collection is local- Parameters:
ndof – number of degrees of freedom
quantile – quantile where the student t factor should be calculated
std – standard deviation
a – spread reduction factor, 0.75 for regional sample collection; 1.0 for local sample collection
- Returns:
corrected standard deviation
- static get_log_mean_std_from_normal(mean: float, std: float)¶
Calculates mean and standard deviation of LN(X) from the mean and std of X
- Parameters:
mean – mean of X
std – std X
- Returns:
mean and std of LN(X)
- static get_mean_std_from_lognormal(log_mean: float, log_std: float)¶
Calculates normal mean and standard deviation from the mean and std of LN(X)
- Parameters:
log_mean – mean of LN(X)
log_std – std of LN(X)
- Returns:
mean and std of X
geolib_plus.shm.shansep_utils module¶
- class geolib_plus.shm.shansep_utils.ShansepUtils¶
Bases:
BaseModel
Class contains shansep utilities for parameter determination following the methodology as described in [11].
- static calculate_characteristic_shansep_parameters_with_linear_regression(OCR: ~typing.Union[float, ~numpy.array], su: ~typing.Union[float, ~numpy.array], sigma_effective: ~typing.Union[float, ~numpy.array], S: ~typing.Optional[float] = None, m: ~typing.Optional[float] = None) -> (<class 'float'>, <class 'float'>)¶
Calculates characteristic values of parameters s and m, according to [11]. This methodology assumes a log normal distribution of S and a normal distribution of m Optionally with a given S or m.
- Parameters:
OCR – Union[float, np.array], over consolidation ratio [-]
su – Undrained shear strength [kPa]
sigma_effective – Effective stress [kPa]
S – S value, shear strength ratio [-]
m – m value, strength increase component [-]
- Returns:
characteristic value of S and m
- static get_shansep_prob_parameters_with_linear_regression(OCR: ~typing.Union[float, ~numpy.array], su: ~typing.Union[float, ~numpy.array], sigma_effective: ~typing.Union[float, ~numpy.array], S: ~typing.Optional[float] = None, m: ~typing.Optional[float] = None) -> ((<class 'float'>, <class 'float'>), (<class 'float'>, <class 'float'>), <class 'numpy.ndarray'>)¶
Determines shansep parameters s and m with linear regression according to [11]. This methodology assumes a log normal distribution of S and a normal distribution of m. Parameter S or m can also be given as an input.
- Parameters:
OCR – Union[float, np.array], over consolidation ratio [-]
su – Undrained shear strength [kPa]
sigma_effective – Effective stress [kPa]
S – S value, shear strength ratio [-]
m – m value, strength increase component [-]
- Returns:
(mean and std of S), (mean and std of m), covariance matrix
geolib_plus.shm.shm_tables module¶
- class geolib_plus.shm.shm_tables.ShmTables(*, soils: List = [])¶
Bases:
BaseModel
“Schematiseringshandleiding macrostability” tables: 7.1, 7.2, 7.3, 7.4.
- load_shm_tables(path_table: Path = PosixPath('resources'), filename: str = 'shm_tables.json') None ¶
Function that reads the shm tables json file.
- Parameters:
path_table – Path to the tables file
filename – Name of the tables file
- Returns:
Dictionary with the NEN data structure
- soils: List¶
geolib_plus.shm.soil module¶
- class geolib_plus.shm.soil.DistributionType(value)¶
Bases:
IntEnum
An enumeration.
- Deterministic = 4¶
- LogNormal = 3¶
- Normal = 2¶
- Undefined = 0¶
- class geolib_plus.shm.soil.Soil(*, name: ~typing.Optional[str] = None, unsaturated_weight: ~typing.Optional[~typing.Union[float, ~geolib_plus.shm.soil.StochasticParameter]] = StochasticParameter(is_probabilistic=False, mean=None, standard_deviation=0, distribution_type=<DistributionType.Normal: 2>, correlation_coefficient=None, low_characteristic_value=None, high_characteristic_value=None, low_design_value=None, high_design_value=None, limits=None), saturated_weight: ~typing.Optional[~typing.Union[float, ~geolib_plus.shm.soil.StochasticParameter]] = StochasticParameter(is_probabilistic=False, mean=None, standard_deviation=0, distribution_type=<DistributionType.Normal: 2>, correlation_coefficient=None, low_characteristic_value=None, high_characteristic_value=None, low_design_value=None, high_design_value=None, limits=None), shear_strength_ratio: ~typing.Optional[~typing.Union[float, ~geolib_plus.shm.soil.StochasticParameter]] = StochasticParameter(is_probabilistic=False, mean=None, standard_deviation=0, distribution_type=<DistributionType.Normal: 2>, correlation_coefficient=None, low_characteristic_value=None, high_characteristic_value=None, low_design_value=None, high_design_value=None, limits=None), strength_increase_exponent: ~typing.Optional[~typing.Union[float, ~geolib_plus.shm.soil.StochasticParameter]] = StochasticParameter(is_probabilistic=False, mean=None, standard_deviation=0, distribution_type=<DistributionType.Normal: 2>, correlation_coefficient=None, low_characteristic_value=None, high_characteristic_value=None, low_design_value=None, high_design_value=None, limits=None), cohesion: ~typing.Optional[~typing.Union[float, ~geolib_plus.shm.soil.StochasticParameter]] = StochasticParameter(is_probabilistic=False, mean=None, standard_deviation=0, distribution_type=<DistributionType.Normal: 2>, correlation_coefficient=None, low_characteristic_value=None, high_characteristic_value=None, low_design_value=None, high_design_value=None, limits=None), dilatancy_angle: ~typing.Optional[~typing.Union[float, ~geolib_plus.shm.soil.StochasticParameter]] = StochasticParameter(is_probabilistic=False, mean=None, standard_deviation=0, distribution_type=<DistributionType.Normal: 2>, correlation_coefficient=None, low_characteristic_value=None, high_characteristic_value=None, low_design_value=None, high_design_value=None, limits=None), friction_angle: ~typing.Optional[~typing.Union[float, ~geolib_plus.shm.soil.StochasticParameter]] = StochasticParameter(is_probabilistic=False, mean=None, standard_deviation=0, distribution_type=<DistributionType.Normal: 2>, correlation_coefficient=None, low_characteristic_value=None, high_characteristic_value=None, low_design_value=None, high_design_value=None, limits=None), pop_layer: ~typing.Optional[~typing.Union[float, ~geolib_plus.shm.soil.StochasticParameter]] = StochasticParameter(is_probabilistic=False, mean=None, standard_deviation=0, distribution_type=<DistributionType.Normal: 2>, correlation_coefficient=None, low_characteristic_value=None, high_characteristic_value=None, low_design_value=None, high_design_value=None, limits=None))¶
Bases:
SoilBaseModel
Schematisation manual macrostability soil class
- cohesion: Optional[Union[float, StochasticParameter]]¶
- dilatancy_angle: Optional[Union[float, StochasticParameter]]¶
- friction_angle: Optional[Union[float, StochasticParameter]]¶
- name: Optional[str]¶
- pop_layer: Optional[Union[float, StochasticParameter]]¶
- saturated_weight: Optional[Union[float, StochasticParameter]]¶
- shear_strength_ratio: Optional[Union[float, StochasticParameter]]¶
- strength_increase_exponent: Optional[Union[float, StochasticParameter]]¶
- static transfer_soil_dict_to_class(soil_dict, soil)¶
Transfers items from dictionary to soil class if the item is not None :param soil_dict: soil dictionary :param soil: geolib_plus soil class soil in model
Returns:
- unsaturated_weight: Optional[Union[float, StochasticParameter]]¶
- class geolib_plus.shm.soil.SoilBaseModel¶
Bases:
BaseModel
- classmethod fail_on_infinite(v, values, field)¶
- class geolib_plus.shm.soil.StochasticParameter(*, is_probabilistic: bool = False, mean: Optional[float] = None, standard_deviation: Optional[float] = 0, distribution_type: Optional[DistributionType] = DistributionType.Normal, correlation_coefficient: Optional[float] = None, low_characteristic_value: Optional[float] = None, high_characteristic_value: Optional[float] = None, low_design_value: Optional[float] = None, high_design_value: Optional[float] = None, limits: Optional[List] = None)¶
Bases:
SoilBaseModel
Stochastic parameters class
- correlation_coefficient: Optional[float]¶
- distribution_type: Optional[DistributionType]¶
- high_characteristic_value: Optional[float]¶
- high_design_value: Optional[float]¶
- is_probabilistic: bool¶
- limits: Optional[List]¶
- low_characteristic_value: Optional[float]¶
- low_design_value: Optional[float]¶
- mean: Optional[float]¶
- standard_deviation: Optional[float]¶