Manual Pyslope
Manual Pyslope
Release 0.0.1
Jesse Bonanno
1 First steps 3
2 1. Introduction to Examples 5
4 3. Validation of Results 19
4.1 3.1 Validation Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2 3.2 Validation Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3 3.3 Effect of Number of slices on results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.4 3.4 Effectiveness of Slope Search Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5 pySlope Reference 27
5.1 Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.2 Uniform Distributed Load (Udl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.3 Line Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.4 Slope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Index 37
i
ii
pyslope, Release 0.0.1
pySlope is a 2D slope stability module based on bishops method of slices. This module allows for the following
parameters:
• unlimited horizontal geological units
• water table
• uniform loads
• line loads
• slope search limits
This module can return plots for the critical failure slope or plots for all failure slopes below a certain factor of safety.
The pySlope package repository can be found on Github.
INSTALLATION 1
pyslope, Release 0.0.1
2 INSTALLATION
CHAPTER
ONE
FIRST STEPS
• You can also download and install the pySlope package, which runs on Python 3.
– If you do not have a Python 3 interpreter on your machine, you can install the last version following the
instructions in this tutorial.
– Once you have Python 3, you can open a terminal and install the package with this one-liner:
NOTE: You may need to replace python3 above by the path to your Python 3 executable, or simply python
if you are running Windows.
This project is completely open source, and the code can be found in this GitHub repository.
• You can fork the package, which runs on Python 3 to play around with the code in your own coding environment.
3
pyslope, Release 0.0.1
TWO
1. INTRODUCTION TO EXAMPLES
This section demonstrates the core functionality of the pySlope package with examples.
You can follow along with examples online:
5
pyslope, Release 0.0.1
THREE
Let’s walk through a typical use case to investigate the slope shown in the figure below.
A typical use case of the pySlope package involves the following steps:
1. Create a Slope object
2. Create Material objects and assign to Slope
3. Create Udl or PointLoad objects and assign to Slope
4. Set water table
5. Set analysis limits
6. Analyse slope for critical factor of safety
7. Create plots
7
pyslope, Release 0.0.1
3.2.1 Concept
3.2.2 Code
3.2.3 Plot
3.3.1 Concept
3.3.2 Code
3.3.3 Plot
3.4.1 Concept
The creation of a Udl (uniform distributed load) object involves the input of:
• magnitude of load (kPa)
• offset of load from crest of slope (m) (default 0 m)
• length of load (m) (default infinite)
3.4.2 Code
3.4.3 Plot
3.5.1 Concept
3.5.2 Code
# define line load, similiar to Udl except there is no length parameter and magnitude is␣
˓→in units (kN/m)
3.5.3 Plot
3.6.1 Concept
By default there is no water table. The water table is defined by its depth from the top of the slope (m).
3.6.2 Code
s.set_water_table(4)
3.6.3 Plot
3.7.1 Concept
Analysis limits can be specified as a general left and right limit, OR as a set of limits which control the range from
which the top of failures can occur and the bottom of failures can occur.
Currently the model coordinates are dynamic in that the overall model dimensions are based on the size of the slope.
The get_top_coordinates and get_bottom_coordinates methods can be useful to help define limits in reference to the
top and bottom of the slope.
3.7.2 Code
s.set_analysis_limits(s.get_top_coordinates()[0] - 5, s.get_bottom_coordinates()[0] + 5)
3.7.3 Plot
3.8.1 Concept
To analyse the Slope the analyse_slope() method is called. By default 2000 iterations are run with 50 slices per failure
plane.
3.8.2 Code
# The user can change the number of slices and iterations with the method below.
# The line below is implicitly called and only required by the user if they want to␣
˓→change iterations
s.update_analysis_options(
slices=50,
iterations=2500,
tolerance=0.005,
max_iterations=50
)
# run analysis
s.analyse_slope()
3.9.1 Concept
After analysing the slope a plot of results can help to visualise the failure mechanism of the slope. There are three
different types of plots that can be called:
• plot_boundary() - plots only the boundary and may be called without analysis)
• plot_critical() - plots the boundary with the critical failure of the slope, only should be called after analysing
slope
• plot_all_planes(max_fos=i) - plots the boundary with all slope failures below fos i (where i is number)
3.9.2 Code
s.plot_boundary()
s.plot_critical()
s.plot_all_planes(max_fos=2)
3.9.3 Plots
3.10.1 Concept
Instead of standard “static” analysis the user also has the option to make load objects “dynamic”. The user can then
perform a dynamic analysis rather than static, which moves the load in order to determine the required offset for a
minimum factor of safety.
Considering the example above, we can continue and make u1 dynamic.
3.10.2 Code
# now lets add the udl again but this time set the load as 'dynamic'
# for all loads and materials we also have the option to set the color ourselves
# lets try set the color as 'purple'
s.set_udls(
Udl(magnitude=100, length=1, offset=2, dynamic_offset=True, color='purple')
)
# get dictionary of all determined minimum FOS with key value pairing of offset : value
s.get_dynamic_results()
3.10.3 Plot
FOUR
3. VALIDATION OF RESULTS
To simplify validating results the results of pySlope will be compared to other similiar software for a range of cases.
The software to be considered is:
• RocScience Slide v6.0
• Hyrcan Version 1.75
Rocscience is a commercial software for 2D Limit Equilibrium Analysis for Slopes widely used in the industry.
HYRCAN is a free Slope Stability analysis program for Geo-Engineers and can be found at this link: http://www.
geowizard.org/download_hyrcan.html
To be consistent the following settings were normalised across all programs:
• slices = 50
• tolerance = 0.005
19
pyslope, Release 0.0.1
• max_iterations = 15
4.2.1 Description
4.2.2 Code
4.2.3 Results
4.3.1 Description
For case a. pySlope and Slide results were compared for a different range of slices. Both show results are reasonably
close to the result with a large number of slices, however Slide does appear to do better with lower numbers of slices
(it is possible using a more precise method to calculate strip weight rather than an approximation as pySlope does).
4.3.2 Code
for i in slices:
s.update_analysis_options(slices=i)
s.analyse_slope()
print(f'Slices: {i}')
for a in s._search:
print(f'radius: {a["radius"]}, FOS: {a["FOS"]}')
4.3.3 Results
4.4.1 Description
4.4.2 code
ll1 = LineLoad(
magnitude = 5,
offset = 0.5,
)
ll2 = LineLoad(
magnitude=20,
offset = 2.5,
)
s.set_lls(ll1, ll2)
udl1 = Udl(
magnitude=100,
offset = 1,
length =0.5,
)
udl2 = Udl(
magnitude=300,
length=0.5,
offset = 3,
)
s.set_udls(udl1,udl2)
for i in iterations:
s.update_analysis_options(slices=50, iterations = i)
s.analyse_slope()
4.4.3 Results
*Note that for pySlope the factor of safety increases with the search in this case. This is not typical and probability
wise the reverse is more common.
4.4.4 Plots
FIVE
PYSLOPE REFERENCE
5.1 Material
class pyslope.Material(unit_weight: float = 20, friction_angle: int = 35, cohesion: int = 2, depth_to_bottom:
float = 5, name: str = '', color: str = '')
Class representing geological material unit.
Parameters
• unit_weight (float) – material unit weight in kN/m3, by default 20
• friction_angle (int) – material friction angle in degrees, by default 35
• cohesion (int) – material cohesion in kPa, by default 2
• depth_to_bottom (float) – depth to the bottom of the material strata from the top of the
slope, by default 5. Note, materials assigned to a slope must have a unique depth_to_bottom
or an error will be raised.
• name (str (optional)) – name of the strata
• color (str (optional)) – color to be used to represent the strata when plotting. Color
may be provided as a string, standard 3 hex digit or 6 hex digit web compatible representation.
If not provided color automatically assigned.
Examples
>>> Material(20,35,2,5)
Material:(uw=20,phi=35,c=2,d_bot=5)
>>> Material()
Material:(uw=20,phi=35,c=2,d_bot=5)
>>> a = Material()
>>> a.cohesion == 2
True
27
pyslope, Release 0.0.1
class pyslope.Udl(magnitude: float = 0, offset: float = 0, length: Optional[float] = None, color: str = 'red',
dynamic_offset: bool = False)
Class representing uniformly distributed surface pressure in kPa
Parameters
• magnitude (float) – magnitude of UDL force in kPa
• offset (float) – offset of load from slope in m
• length (float) – length of load in m, if 0 or None then assumed continuous. By default
None.
• color (str (optional)) – color to be used to represent the strata when plotting. Color
may be provided as a string, standard 3 hex digit or 6 hex digit web compatible representation.
If not provided color automatically assigned.
• dynamic_offset (bool) – If True then the load offset will be dynamically moved if a “dy-
namic analysis” is run. (For a standard analysis the offset value is still used). By default
False.
Examples
class pyslope.LineLoad(magnitude: float = 0, offset: float = 0, color: str = 'blue', dynamic_offset: bool =
False)
Class representing line load in kN/m
Parameters
• magnitude (float) – magnitude of UDL force in kPa
• offset (float) – offset of load from slope in m
• length (float) – length of load in m, if 0 or None then assumed continuous. By default
None.
• color (str (optional)) – color to be used to represent the strata when plotting. Color
may be provided as a string, standard 3 hex digit or 6 hex digit web compatible representation.
If not provided color automatically assigned.
• dynamic_offset (bool) – If True then the load offset will be dynamically moved if a “dy-
namic analysis” is run. (For a standard analysis the offset value is still used). By default
False.
Examples
5.4 Slope
Examples
5.4. Slope 29
pyslope, Release 0.0.1
Examples
pyslope.Slope.get_top_coordinates(self )
Returns the top coordinate of the slope.
Returns
(x,y) coordinate of the top of the slope.
Return type
tuple
pyslope.Slope.get_bottom_coordinates(self )
Returns the bottom coordinate of the slope.
Returns
(x,y) coordinate of the bottom of the slope.
Return type
tuple
pyslope.Slope.get_external_y_intersection(self, x)
return y coordinate of intersection with boundary for a given x
pyslope.Slope.get_external_x_intersection(self, y)
return x coordinate of intersection with boundary for a given y
Examples
>>> s = Slope()
>>> s.set_water_table(1.2)
>>> s._water_depth
1.2
pyslope.Slope.remove_water_table(self )
Remove water table from model.
Examples
>>> s = Slope()
>>> s.set_water_table(1.2)
>>> s.remove_water_table()
>>> s._water_RL == s._water_depth == None
True
pyslope.Slope.set_udls(self, *udls)
set a surface surcharge on top of the slope.
Parameters
*udls (Udl objects) – Udl object to be assigned to the slope object.
Examples
>>> s = Slope()
>>> u1 = Udl(5)
>>> u2 = Udl(10)
>>> s.set_udls(u1, u2)
>>> len(s._udls) == 2
True
Examples
>>> s = Slope()
>>> u1, u2 = Udl(5), Udl(10)
>>> s.set_udls(u1, u2)
>>> s.remove_udls(u1)
>>> len(s._udls) == 1
True
>>> s.remove_udls(remove_all=True)
>>> len(s._udls) == 0
True
pyslope.Slope.set_lls(self, *lls)
set a surface surcharge on top of the slope
Parameters
*lls (LineLoad objects) – LineLoad object to be assigned to the slope object.
5.4. Slope 31
pyslope, Release 0.0.1
Examples
>>> s = Slope()
>>> ll1 = LineLoad(5)
>>> ll2 = LineLoad(10)
>>> s.set_lls(ll1, ll2)
>>> len(s._lls) == 2
True
Examples
>>> s = Slope()
>>> ll1 = LineLoad(5)
>>> ll2 = LineLoad(10)
>>> s.set_lls(ll1, ll2)
>>> s.remove_lls(ll1)
>>> len(s._lls) == 1
True
>>> s.remove_lls(remove_all=True)
>>> len(s._lls) == 0
True
pyslope.Slope.set_materials(self, *materials)
Assign material instances to the slope instance.
Parameters
*materials (Material (list), optional) – Material instances to be associated with slope.
Raises
• ValueError – If material not instance of Material class error is raised.
• ValueError – If non-unique material depths then error is raised.
Examples
>>> s = Slope()
>>> m1 = Material()
>>> m2 = Material(unit_weight = 18,cohesion=2, friction_angle = 30,depth_to_bottom␣
˓→= 1.32)
Examples
>>> s = Slope()
>>> m1 = Material()
>>> m2 = Material(unit_weight = 18,cohesion=2,friction_angle = 30,depth_to_bottom =␣
˓→1.32)
5.4. Slope 33
pyslope, Release 0.0.1
Examples
>>> s = Slope()
>>> s.update_water_analysis_options(auto=True)
>>> s.update_water_analysis_options(auto=False, H = 0.72)
Examples
>>> s = Slope()
>>> s.update_analysis_options(slices = 25,iterations = 2500,min_failure_dist = 0.2)
>>> s.update_analysis_options(tolerance = 0.005,max_iterations = 50)
Examples
>>> s = Slope()
>>> s.update_boundary_options(MIN_EXT_L = 100)
>>> s._external_length == 100
True
>>> s.update_boundary_options(MIN_EXT_H = 200)
>>> s._external_height == 200
True
pyslope.Slope.analyse_slope(self, max_fos=None)
Analyse many possible failure planes for a slope OR indivually added failure planes if added to slope.
pyslope.Slope.analyse_dynamic(self, critical_fos=1.3)
Analyse slope and offset dynamic loads until critical FOS is achieved
Parameters
critical_fos (float, optional) – minimum required factor of safety, by default 1.3
5.4. Slope 35
pyslope, Release 0.0.1
pyslope.Slope.get_min_FOS(self )
Get min factor of safety for slope model.
Returns
critical factor of safety
Return type
float
pyslope.Slope.get_min_FOS_circle(self )
Get the properties of the circle that gave the critical factor of safety.
Returns
tuple containing (circle x coordinate, circle y coordinate, circle radius)
Return type
tuple
pyslope.Slope.get_min_FOS_end_points(self )
Get the external boundary intersection for the slope that gave the critical factor of safety.
Returns
tuple containing (left coordinate, right coordinate)
Return type
tuple
pyslope.Slope.get_dynamic_results(self )
L
LineLoad (class in pyslope), 28
M
Material (class in pyslope), 27
P
plot_all_planes() (in module pyslope.Slope), 36
plot_boundary() (in module pyslope.Slope), 36
plot_critical() (in module pyslope.Slope), 36
R
remove_analysis_limits() (in module pys-
lope.Slope), 33
remove_individual_planes() (in module pys-
lope.Slope), 35
remove_lls() (in module pyslope.Slope), 32
remove_material() (in module pyslope.Slope), 33
remove_udls() (in module pyslope.Slope), 31
37