Python and Geotech
Python and Geotech
1
[email protected], [email protected],
2
[email protected], [email protected]
Abstract. Soil is a natural material that suffers from intrinsic spatial variability resulting from natural factors and
their influence on the soil. It became controversial and debated how to estimate the characteristic value of soils to
obtain a reliable geotechnical design with low cost and less effort. Usually, foundations are not built on the same
site as the screening; investigations are carried out to excavate a little at essential sites. In this paper (423), test
wells were collected in the study area to be obtained and tabulated in Excel. The kriging statistics is applied using
a python script to predict the values of geotechnical site properties and reliability of the method in estimating
spatially varying soil properties values based on measurement data and prior knowledge. The program implements
probabilistic kriging statistics and predicts the desired value by entering the coordinates of the locations whose
properties you want to know and based on the previously prepared Excel file of known points, coordinates, and
property values. The program will be used in two soil sites in the city of Nasiriyah to predict its properties. These
points were selected from the examination of soil investigation reports to determine the reliability and accuracy of
the program in predicting values. To get more reliable probability values using the kriging method and python
scripts. A huge database of prepared and analyzed engineering soil properties has been created based on field
investigation reports for projects in Nasiriyah.
Keywords: python script; kriging statistics; Reliability; Characteristic values; Nasiriyah city.
1. Introduction
Soil is a natural material whose properties change with spatial variance. Therefore, geotechnical site
characterization is essential in civil engineering, as it aims to demonstrate the spatial distribution of
geotechnical properties through laboratory tests. An accurate description of site requests requires deep
study. Reporting measurements are usually limited and scattered due to many limitations that are
difficult to take advantage of in characterizing the site as needed[1]. Experienced engineers tend to much
less than the mean, perhaps less than one standard deviation[2]. Accurate estimation of corresponding
to cohesion and soil friction angle plays an essential role in integrity decision-making. Conservatively
reliable values are obtained when the combined behaviour of soil shear parameters follows a normal
distribution[3][4]. Geotechnical engineers usually seek to describe the soils' engineering properties to
be analyzed and designed[5].
The world has recently witnessed a wide trend towards reliability in construction, which directly impacts
the development of buildings. The availability of data and requationuationuirements for the python
programming language leads to many instances of machine learning, automation, and visualization that
Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
enhance building productivity. Geotechnical engineering is the most damaging sector of civil
engineering. Using Python forces geotechnical engineers to use a data-driven decision-making tool,
leading to reliable and economical geotechnical design[6]. The application of statistical models has
become a significant concern for studying complex engineering problems using computers in the past
era. Interpolation methods are often used to solve complex engineering problems repetitively because
they create an effective tool for modelling and optimizing multiple engineering objectives[7][8].
Probability theory predictors determine the uncertainty associated with distorted values and have a
statistical basis. Statistical models depend on the data used, and the data is often too complex to describe
mathematically. The kriging model that can be represented in a python script is readily available[9].
Although ARC GIS contains interpolation tools such as kriging methods and others when implementing
different values are assigned to parameters until the need arises to get more reliability of geostatistical
interpolation methods a python script[11][12]. Python package can simulate soil with a single python
script, saving you effort and money and providing reliable results[13][14]. The statistical model is
implemented using a highly accurate, reliable, and easy-to-use python script for soil simulation[10].
This paper adds the kriging method to show the usefulness of using Python in everyday geotechnical
applications. In some areas of the soil layer, the average spatial characteristics of the soil represent the
relevant soil parameters in geotechnical judgment. It is estimated that the spatial mean of soil properties
includes statistical uncertainty, inherent spatial uncertainty, and regular uncertainty. The resulting
variance can be evaluated utilizing a random field[15]. This work presents a challenge in geotechnical
design codes because a small amount of data does not produce meaningful statistics, making choosing
an appropriate property value very difficult. One of the most critical problems facing a geotechnical
engineer is soil layers' spatial variation and characteristics. Despite the geographical location and the
economic and cultural importance of Nasiriyah city, located in the southeastern part of Mesopotamia, it
lacks the study of geotechnical characteristics of this type. Furthermore, there have been few studies
available by some researchers on the geotechnical characteristics of some of the southern provinces of
Mesopotamia. Therefore, site investigations cannot be considered a valuable tool for a geotechnical
engineer unless thoroughly studied. Engineering practice is clearly described in comparison with
traditional methods. In this paper, the geotechnical properties of Nasiriyah soil were collected. Then it
was tabulated in an Excel file to create a reliable database from which soils could be simulated to
produce probability values using the Kriging Stats script in Python. The previous data were added to the
investigations examination to estimate the Nasiriyah soil's design values and establish a reliable
database, which saves effort and money. It has been concluded that the kriging script effectively
determines the characteristic value city of Nasiriyah, and a reliable database of soil properties can be
made in any area with minimal cost and effort.
2. Methodology
2
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
northwest, and wind speeds are characterized by their high, especially in the summer, where the average
annual value of wind speed is 5 or more due to the flatness of the earth's surface [31].
3
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
2.3. Software
In this paper, a Python script is designed to store, retrieve, display, manage and analyze all kinds of
geospatial data. The excel file prepared as a database contains the values of the measured properties of
the location and the coordinates. It also includes all the tables that have the data that was used in the
analysis process. This file was then used within the Python program to analyze and predict the
geotechnical site values using the kriging method and produce the maps. The pykriging library in Python
was used for this purpose. Finally, the site values were predicted by entering the geotechnical site
coordinates. The Python script displays the characteristic value and produces the geotechnical map of
soil properties in any area of Nasiriyah city.
2.4. Kriging
It is a probabilistic predictor, which is the name given to a particular class of statistical techniques. It
has been used in different countries and areas where a statistical data model is assumed to determine the
uncertainty associated with expected values. Match the actual values with the predictor kriging. Kriging
is a typeface that, depending on the measurement model, can be precise or homogeneous. It is very
flexible and enables you to study spatial graphs, spatial and cross-relationship. Kriging uses statistical
models for various output areas, including forecasts, standard prediction errors, probabilities, and
quantities. Kriging's flexibility can requationuationuire a large amount of decision-making. Kriging
assumes that the data comes from a static random process, and specific methods assume that the data is
usually distributed[20]. The purpose of studying kriging, also known as the best linear bias estimate
(BLUE), is to obtain the best estimate of any soil characteristic at a given point based on known data.
The basic idea of this theory is to estimate X(x) at any point using a linear set computed from the values
4
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
of X at each observation point. Suppose X1, X2… Xn is the random observations of the field, X(x) at the
point x1, x2…. xn. Then the BLUE at X(x) at x is expressed by the equation.
Where ak is the unknown coefficients and g1(x)=1,g2(x)=x ,g3(x)=x2 and m=2 ,and so on in a one
dimensions. In two dimensions, the corresponding mean function is linear, with g1(x)=1, g2(x)=x1,
g3(x)=x2 and g4(x)=x1x2.Asimilar approach is used in higher dimensions [21].
Then the unknown weights can be obtained from the matrix, equation
𝐾𝛽 = 𝑀 (3)
𝛽1 𝐶1𝑥
𝛽2 𝐶2𝑥
. .
. .
. .
𝛽𝑛 𝐶𝑛𝑥
𝛽= , M= (4)
−ƞ1 𝑔1 (𝑥)
−ƞ2 𝑔2 (𝑥)
. .
. .
. .
{−ƞ𝑚 } { 𝑔𝑚 (𝑥)}
The quantities Ƞi are Lagrangian parameters used to solve the variance reduction problem subject to
bias conditions. That the k-matrix is just a function of matching control points and common variations,
as it can be flipped once. Then equations (3) and (4) were used iteratively at different spatial points to
get the best estimates for each spatial point where the M vector changes with the weight vector. This
5
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
method depends on knowing how the mean differs moderately with the position, which means it must
be determined g1, g2…and knowledge of the covariance structure of the field is usually an assumption
of an M=1,g1=1,a1=µx constant, or a suitable linear variable[22] [23].
To define K and M (with, perhaps some interpolation of common heterogeneities is not directly
estimated). When there is insufficient data, the coefficient of the covariance function is often executed.
A typical model is one in which the exponential covariance diminishes the separation distance.
2|𝜏𝑖𝑗 |
𝐶𝑖𝑗 = 𝜎𝑥2 𝑒𝑥𝑝 {− } (6)
𝜃
The parameter 𝜃 is called the scale of fluctuation. This model requationuationuires the estimation of
only two 𝑎𝑛𝑑 𝜎𝑥2 Parameters assume that the field is statistically homogeneous and is often suitable for
soils displaying strata.
6
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
coordinates E N E N
590716.00 3485034.00 591067.03 3484104.26
Site 1 Site 2
characteristic
investigation investigation
Python Python
report report
SPT-N (0-2) m 5 4 7 6
SPT (2-4) m 3 4 3 3
SPT (14-16) m 6 7 6 7
SPT (18-20) 24 23 24 25
CC (0-2) m 0.19 0.2 0.19 0.18
Cc(8-12) 0.24 0.235 0.25 0.26
Cohesion 26 27.5 26 25.4
Figure 6 shows the SPT value at a depth of (2-4) m at site 2, estimated at 3 boreholes. A decrease in the
number of boreholes was observed, which indicates that the soil of this layer is less solid than the soil
that preceded it, and its bearing rate does not exceed 50 kN / m2. In Figure 7, the value of SPT-N at a
depth of (14-16) m is shown as 6 boreholes. A noticeable increase in the number of boreholes was
observed, meaning that the greater the depth, the greater the number of boreholes. There is a direct
relationship between the number of wells and depth, and there is a relationship between the number of
wells and the bearing capacity of the soil. The limit in this category does not exceed 100 kN/m2. In
addition, it can be seen that the values of the probability graph and the limitations they take are an
estimate of the most appropriate value. The results of the SPT-N examination program at a depth of (18-
20)m also showed the about 24 boreholes, and this value is very logical since an increase in the value
of the number of boreholes with depth was observed. The maximum soil tolerance based on SPT-N
values range between (200-400)kN/m2.
7
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
8
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
9
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
Estimating the value of the compression index helps the geotechnical engineer in the appropriate
planning for building structures on the soil without the need to conduct all tests to determine the
properties of the soil. Other aspects such as time, cost and effort are invested based on previous data to
determine the soil and statistics kriging the required property of the soil. The results obtained from this
study indicate that the pressure index values are typical for the soil of the city of Nasiriyah, as the soil
is clay with silt. When uniformity testing is not possible, kriging with a Python script is an excellent
way to add the previous data for guesswork and get the average value for predicting soil Cc parameters.
10
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
4. Conclusion
In this work, a Python script was created to know the characteristic value of soil properties directly.
Using the statistical kriging method to obtain a safe structure when designing is checked and compared
with the measured values, it is very close to the site and can be adopted. In a simple Python script, it is
11
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
possible to determine the characteristic value of any property in any part of Nasiriyah city based on the
measured values of the location. This work poses a challenge in the world of geotechnical engineering
design. Python has proven to be a powerful tool in probabilistic characterization and addressing spatial
uncertainty in geotechnical engineering, as indicated by the sample site for the studied projects. It can
process data efficiently and automate repetitive data easily. Python can help geotechnical engineers
make a decision based on historical data. Neighbouring projects can get economical and reliable
geotechnical design. Python scripts have many advantages for future work by adding additional data to
an Excel file or applying it to another study area. There is no problem with changing the property
parameters of the interpolation method in Python script files.
ACKNOWLEDGEMENTS
Thanks and appreciation to the Deanship of the College of Engineering and its laboratories for their
assistance in preparing the official books to obtain the reports formally and legally. Special thanks to
the Engineering Construction Laboratory and the Multidisciplinary Laboratory for submitting
investigation reports.
python script
from pyKriging.krige import kriging
import numpy as np
import pandas as pd
import os
fixed_path = os.path.join(os.path.expanduser ('~'),"desktop")
target_path = input('Enter folder name then the file name ex:folder\data.xlsx:\n')
full_path = fixed_path +'\\'+target_path
# We generate our observed values based on our sampling plan and the test function
data = pd.read_excel(full_path)
x = data.iloc[:, :-1].values
y = data.iloc[:, -1].values
y = np.array(y).flatten()
print('Setting up the Kriging Model')
# Now that we have our initial data, we can create an instance of a kriging model
k = kriging(x, y, name='simple')
k.train(optimizer='ga')
# #And plot the model
print('Now plotting final results...')
k.plot()
print(k.predict())
References
[1] J. Xu, L. Zhang, Y. Wang, C. Wang, J. Zheng, and Y. Yu, "Probabilistic estimation of cross-
variogram based on Bayesian inference," Eng. Geol., vol. 277, no. July, p. 105813, 2020, doi:
10.1016/j.enggeo.2020.105813.
[2] S. Lacasse, F. Nadim, I. Centre, N. Geotechnical, and I. Ngi, "OTC 19117 Statistical
Description of Characteristic Soil Properties," no. January, 2007, doi: 10.4043/19117-MS.
[3] X. Z. Wu, "Modelling dependence structures of soil shear strength data with bivariate copulas
and applications to geotechnical reliability analysis," Soils Found., vol. 55, no. 5, pp. 1243–
1258, 2015, doi: 10.1016/j.sandf.2015.09.023.
[4] L. Di, M. Daniela, and V. Remo, "Laboratory shear strength parameters of cohesive soils :
variability and potential effects on slope stability," pp. 101–106, 2013, doi: 10.1007/s10064-
013-0459-6.
[5] T. T. Bakala and S. Thanappan, "Study on the shear strength and some of index properties of
12
ICAUC_ES 2021 IOP Publishing
IOP Conf. Series: Earth and Environmental Science 961 (2022) 012004 doi:10.1088/1755-1315/961/1/012004
13