Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
67 views41 pages

Manual Pyslope

pySlope is a 2D slope stability module based on the method of slices, allowing for the analysis of various geological parameters such as water tables and loads. The documentation provides installation instructions, basic usage examples, and detailed steps for defining slopes, materials, loads, and analysis limits. It also includes methods for analyzing slopes and interpreting results through visual plots, making it a comprehensive tool for slope stability analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views41 pages

Manual Pyslope

pySlope is a 2D slope stability module based on the method of slices, allowing for the analysis of various geological parameters such as water tables and loads. The documentation provides installation instructions, basic usage examples, and detailed steps for defining slopes, materials, loads, and analysis limits. It also includes methods for analyzing slopes and interpreting results through visual plots, making it a comprehensive tool for slope stability analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

pyslope

Release 0.0.1

Jesse Bonanno

Sep 15, 2022


INSTALLATION

1 First steps 3

2 1. Introduction to Examples 5

3 2. Basic Usage (Readme example) 7


3.1 2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 2.2 Creating a Slope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3 2.3 Defining Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.4 2.4 Defining Uniform Loads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.5 2.5 Defining Line Loads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.6 2.6 Defining Water Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.7 2.7 Defining Analysis Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.8 2.8 Analysing the slope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.9 2.9 Interpretting Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.10 2.10 Dynamic Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

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

• The easiest way to try this package is using a web-based notebook:

• 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:

python3 -m pip install --user pyslope

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

4 Chapter 1. First steps


CHAPTER

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

6 Chapter 2. 1. Introduction to Examples


CHAPTER

THREE

2. BASIC USAGE (README EXAMPLE)

3.1 2.1 Overview

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 2.2 Creating a Slope

3.2.1 Concept

The creation of a Slope instance involves the input of the:


• slope height (m) and
• angle (deg) or
• length (m)
Only one of the values is used out of the length and angle, the other value should be set to None.

3.2.2 Code

s = Slope(height=3, angle=30, length=None)

3.2.3 Plot

Plot generated using plot_boundary() function.

8 Chapter 3. 2. Basic Usage (Readme example)


pyslope, Release 0.0.1

3.3 2.3 Defining Materials

3.3.1 Concept

The creation of a Material object involves the input of:


• unit weight (kN/m3)
• friction angle
• cohesion (kPa)
• depth from top of slope to bottom of material layer (m)
Once an instance of a Material is created it can then be assigned to the Slope instance.

3.3.2 Code

# Material defined with key word arguments


m1 = Material(
unit_weight=20,
friction_angle=45,
cohesion=2,
depth_to_bottom=2
)

# Material defined with positional arguments


m2 = Material(20, 30, 2, 5)

# An unlimited number of materials can be assigned at one time


s.set_materials(m1, m2)

3.3.3 Plot

Plot generated using plot_boundary() function.

3.4 2.4 Defining Uniform Loads

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.3. 2.3 Defining Materials 9


pyslope, Release 0.0.1

3.4.2 Code

u1 = Udl(magnitude = 100, offset = 2, length = 1)

# by default offset = 0 (m) and length = None.


u2 = Udl(magnitude = 20)

# assign uniform loads to model


s.set_udls(u1, u2)

3.4.3 Plot

Plot generated using plot_boundary() function.

3.5 2.5 Defining Line Loads

3.5.1 Concept

The creation of a LineLoad object involves the input of:


• magnitude of load (kN / m)
• offset of load from crest of slope (m) (default 0 m)

10 Chapter 3. 2. Basic Usage (Readme example)


pyslope, Release 0.0.1

3.5.2 Code

# define line load, similiar to Udl except there is no length parameter and magnitude is␣
˓→in units (kN/m)

p1 = LineLoad(magnitude = 10, offset = 3)

# assign line loads to slope


s.set_lls(p1)

3.5.3 Plot

Plot generated using plot_boundary() function.

3.6 2.6 Defining Water Table

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.6 Defining Water Table 11


pyslope, Release 0.0.1

3.6.2 Code

s.set_water_table(4)

3.6.3 Plot

Plot generated using plot_boundary() function.

3.7 2.7 Defining Analysis Limits

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.

12 Chapter 3. 2. Basic Usage (Readme example)


pyslope, Release 0.0.1

3.7.2 Code

s.set_analysis_limits(s.get_top_coordinates()[0] - 5, s.get_bottom_coordinates()[0] + 5)

3.7.3 Plot

Plot generated using plot_boundary() function.

3.8 2.8 Analysing the slope

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.8 Analysing the slope 13


pyslope, Release 0.0.1

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()

# print out minimum calculated factor of safety


print(s.get_min_FOS())

14 Chapter 3. 2. Basic Usage (Readme example)


pyslope, Release 0.0.1

3.9 2.9 Interpretting Results

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

Plots generated from code above in their respective orders.

3.9. 2.9 Interpretting Results 15


pyslope, Release 0.0.1

16 Chapter 3. 2. Basic Usage (Readme example)


pyslope, Release 0.0.1

3.10 2.10 Dynamic Analysis

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

# remove udl object load from slope


s.remove_udls(u1)

# 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')
)

# run dynamic analysis aiming for a FOS of 1.4


s.analyse_dynamic(critical_fos=1.4)

# get dictionary of all determined minimum FOS with key value pairing of offset : value
s.get_dynamic_results()

# or can print the values out


s.print_dynamic_results()

From this we get the following output results:


• Offset: 0.000 m, FOS: 1.288
• Offset: 0.735 m, FOS: 1.402
• Offset: 1.463 m, FOS: 1.510
• Offset: 5.186 m, FOS: 1.684
We can also get a plot as after running dynamic analysis all plots are based on the final iteration of the dynamic analysis.

3.10.3 Plot

Plot generated using plot_all_planes() function with keyword argument max_fos=2.

3.10. 2.10 Dynamic Analysis 17


pyslope, Release 0.0.1

18 Chapter 3. 2. Basic Usage (Readme example)


CHAPTER

FOUR

3. VALIDATION OF RESULTS

4.1 3.1 Validation Tools

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 3.2 Validation Models

4.2.1 Description

The following models were seperately assessed to validate pySlope:


a. Typical model with no cohesion
b. Case a. + material 2 updated to have cohesion
c. Case b. + water table added in at 0.7 m below ground level
d. Case c. + 20 kPa load offset at 0.5 m with a 2 m length added to slope
e. Case c. + 5 kN/m LineLoad added at offset of 1 m.
For each model specific circular failures where assessed. They were all centred 2.5 m above the toe of the slope with
radii from 2 m up to 6 m.

4.2.2 Code

You can view the models created with pySlope online:

20 Chapter 4. 3. Validation of Results


pyslope, Release 0.0.1

4.2.3 Results

4.3 3.3 Effect of Number of slices on 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

# Effect of slices on results


s = Slope(height=1, angle=None, length=1)

m1 = Material(20, 35, 0, 0.5)


m2 = Material(20, 35, 0, 1)
m3 = Material(18, 30, 0, 5)

s.set_materials(m1, m2, m3)

for r in range(2, 6):


s.add_single_circular_plane(
c_x=s.get_bottom_coordinates()[0],
c_y=s.get_bottom_coordinates()[1] + 2.5,
radius=r,
)

slices = [10, 25, 50, 500, 2000]

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.3 Effect of Number of slices on results 21


pyslope, Release 0.0.1

4.3.3 Results

4.4 3.4 Effectiveness of Slope Search Method

4.4.1 Description

4.4.2 code

s = Slope(height=1, angle=None, length=1.5)

m1 = Material(20, 40, 1, 0.3)


m2 = Material(20, 35, 2, 1)
m3 = Material(18, 30, 0, 1.5)
m4 = Material(16, 28, 0, 5)

s.set_materials(m1, m2, m3, m4)

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)

iterations = [1000, 2000, 5000]

for i in iterations:
s.update_analysis_options(slices=50, iterations = i)
s.analyse_slope()

# plot the critical failure surface


fig_1 = s.plot_all_planes(max_fos=1.4)
# fig_1.write_image(f'./search/pySlope_{i}.png')

22 Chapter 4. 3. Validation of Results


pyslope, Release 0.0.1

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

pySlope 1000 iterations with factor of safety <= 1.4 below.

pySlope 5000 iterations with factor of safety <= 1.4 below.


Slide 1000 iterations with factor of safety <= 1.4 below.
Slide 5000 iterations with factor of safety <= 1.4 below.

4.4. 3.4 Effectiveness of Slope Search Method 23


pyslope, Release 0.0.1

24 Chapter 4. 3. Validation of Results


pyslope, Release 0.0.1

4.4. 3.4 Effectiveness of Slope Search Method 25


pyslope, Release 0.0.1

26 Chapter 4. 3. Validation of Results


CHAPTER

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

5.2 Uniform Distributed Load (Udl)

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

>>> Udl(magnitude = 10, offset = 1, length = 2, color = "pink")


UDL: 10 kPa, offset = 1 m, load length = 2 m
>>> Udl()
UDL: 0 kPa, offset = 0 m, load length continuous
>>> a = Udl()
>>> a.magnitude == 0
True

5.3 Line Load

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.

28 Chapter 5. pySlope Reference


pyslope, Release 0.0.1

Examples

>>> LineLoad(magnitude = 10, offset = 1, color = "pink")


LineLoad: 10 kN/m, offset = 1 m
>>> LineLoad()
LineLoad: 0 kN/m, offset = 0 m
>>> a = LineLoad()
>>> a.magnitude == 0
True

5.4 Slope

class pyslope.Slope(height: float = 1, angle: int = 30, length: Optional[float] = None)


Slope object.
Parameters
• height (float) – height of slope in metres, by default 2
• angle (int, optional) – angle of slope (only used if length None), by default 30
• length (float, optional) – length of slope in metres, by default None

Examples

>>> Slope(height = 1, angle = 50, length = None)


Slope: 1V : 0.839H
>>> Slope(height = 1, angle = 50, length = 2)
Slope: 1V : 2H
>>> Slope(height = 1, angle = None, length = 2)
Slope: 1V : 2H
>>> Slope()
Slope: 1V : 1.732H

5.4.1 Slope: Geometry

pyslope.Slope.set_external_boundary(self, height: float = 1, angle: int = 30, length: Optional[float] =


None)
Set external boundary for model.
Parameters
• height (float, optional) – height of slope in metres, by default 1
• angle (int, optional) – angle of slope in degrees (may be left as none if slope is instead
expressed by length of slope), by default 30
• length (float, optional) – length of slope in metres (may be left as none if slope is
instead expressed by angle of slope), by default None
Raises
ValueError – If input not in required range or of required type

5.4. Slope 29
pyslope, Release 0.0.1

Examples

>>> a = Slope(height = 1, angle = 45, length = None)


>>> a
Slope: 1V : 1.0H
>>> a.set_external_boundary(height = 2, length = 0.5)
>>> a
Slope: 2V : 0.5H

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

5.4.2 Slope: Initialising Parameters

pyslope.Slope.set_water_table(self, depth: float)


set water table value.
Parameters
depth (float) – depth of water from top of slope.

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.

30 Chapter 5. pySlope Reference


pyslope, Release 0.0.1

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

pyslope.Slope.remove_udls(self, *udls, remove_all=False)


Remove udl from model if associated with model.
Parameters
• *udls (Udl objects) – Udl object to be removed from the slope object.
• remove_all (bool, optional) – If true remove all udls, by default False

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

pyslope.Slope.remove_lls(self, *lls, remove_all=False)


Remove udl from model if associated with model.
Parameters
• *lls (LineLoad objects) – LineLoad object to be removed from the slope object.
• remove_all (bool, optional) – if true remove all lls, by default False

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)

>>> s.set_materials(m1, m2)


>>> len(s._materials) == 2
True
>>> s.remove_material(m1)
>>> len(s._materials) == 1
(continues on next page)

32 Chapter 5. pySlope Reference


pyslope, Release 0.0.1

(continued from previous page)


True
>>> s.remove_material(remove_all=True)
>>> len(s._materials) == 0
True

pyslope.Slope.remove_material(self, material: Optional[Material] = None, depth: Optional[float] = None,


remove_all=False)
Remove material from slope.
Parameters
• material (Material, optional) – material object. If specified and exists in materials
associated with slope then will be removed, by default None
• depth (float, optional) – depth in metres of material object. If not None and material
found at indicated depth then will remove the material, by default None
• remove_all (Boolean, optional) – if true all materials removed, default false

Examples

>>> s = Slope()
>>> m1 = Material()
>>> m2 = Material(unit_weight = 18,cohesion=2,friction_angle = 30,depth_to_bottom =␣
˓→1.32)

>>> s.set_materials(m1, m2)


>>> len(s._materials) == 2
True
>>> s.remove_material(m1)
>>> len(s._materials) == 1
True
>>> s.remove_material(remove_all=True)
>>> len(s._materials) == 0
True

pyslope.Slope.set_analysis_limits(self, left_x: Optional[float] = None, right_x: Optional[float] = None,


left_x_right: Optional[float] = None, right_x_left: Optional[float] =
None)
set limits on slope analysis search.
Parameters
• left_x (float) – left x coordinate of search, defines outer edge of top of search
• right_x (float) – right x coordinate search, defines outer edge of bottom of search
• left_x_right (float, optional) – left x coordinate right hand limit of search, defines
inner edge of top of search. If none ignored, by default None
• right_x_left (float, optional) – right x coordinate left hand limit of search, defines
inner edge of bottom of search. If none ignored, by default None
pyslope.Slope.remove_analysis_limits(self )
Reset analysis limits to default (no limits).

5.4. Slope 33
pyslope, Release 0.0.1

5.4.3 Slope: Options

pyslope.Slope.update_water_analysis_options(self, auto: bool = True, H: int = 1)


Update analysis options regarding how water is treated.
Parameters
• auto (bool, optional) – If true calculates pressure head automatically (factor is
cos(a)**2 where a is the angle of slope). If False takes manual factor (H). by default True
• H (int, optional) – factor on water pressure. If 1 water head equals distance between
water table and bottom of slice. If 0 no water pressure is considered. By default 1.

Examples

>>> s = Slope()
>>> s.update_water_analysis_options(auto=True)
>>> s.update_water_analysis_options(auto=False, H = 0.72)

pyslope.Slope.update_analysis_options(self, slices: Optional[int] = None, iterations: Optional[int] =


None, min_failure_dist: Optional[int] = None, tolerance:
Optional[float] = None, max_iterations: Optional[int] = None)
Function to update analysis modelling options.
Parameters
• slices (int, optional) – Slices to take in calculation for each potential circular failure
(between 10 and 500). If None doesnt update the parameter, by default None.
• iterations (int, optional) – Approximate number of potential slopes to check (be-
tween 500 and 100000). If None doesnt update the parameter, by default None.
• min_failure_dist (int, optional) – If specified only failure slopes with a distance
greater than the min failure distance will be assessed, by default None.
• tolerance (float, optional) – Convergance tolerance on bishops. Calculation will stop
when change in factor of safety is less than the tolerance specified. By default None. Inialised
as 0.005.
• max_iterations (int, optional) – Maximum number of iterations for convergence on
bishop factor of safety. By default None. Initialised as 15.

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)

pyslope.Slope.update_boundary_options(self, MIN_EXT_L: Optional[float] = None, MIN_EXT_H:


Optional[float] = None)
Function to update external boundary options.
Parameters
• MIN_EXT_L (float, optional) – Minimum external boundary length. If None doesnt
update the parameter, by default None

34 Chapter 5. pySlope Reference


pyslope, Release 0.0.1

• MIN_EXT_H (float, optional) – Minimum external boundary height. If None doesnt


update the parameter, by default None.

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

5.4.4 Slope: Failure Planes

pyslope.Slope.add_single_circular_plane(self, c_x, c_y, radius)


Add failure plane to be analysed by specifying circle properties.
Parameters
• c_x (float,) – centre of circle x coordinate.
• c_y (float,) – centre of circle y coordinate.
• radius (float) – radius of circle
pyslope.Slope.remove_individual_planes(self )
Remove individually added failure planes.
pyslope.Slope.add_single_entry_exit_plane(self, l_cx, r_cx, num_circles=5)
Add failure plane to be analysed be specifying start and exit point.
Parameters
• l_c (float) – Left x coordinate which represents the top of the failure plane.
• r_c (float) – Right x coordinate which represents the bottom of the failure plane.
• num_circles (int, optional) – number of different circle radii to assess passing through
the entry and exit points, by default 5

5.4.5 Slope: Analysing

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

5.4.6 Slope: Results

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 )

5.4.7 Slope: Plotting

pyslope.Slope.plot_boundary(self, material_table=True, legend=False)


Plot external boundary, materials, limits, loading and water for model.
Return type
plotly figure
pyslope.Slope.plot_critical(self, material_table=True, legend=False)
Plot critical slope (i.e. slope with lowest FOS)
Return type
Plotly figure
pyslope.Slope.plot_all_planes(self, max_fos: float = 5, material_table=True, legend=True)
plot multiple failure planes in the same plot
Parameters
max_fos (float, optional) – maximum factor of safety to display for planes, by default 5.
Return type
plotly figure

36 Chapter 5. pySlope Reference


INDEX

A remove_water_table() (in module pyslope.Slope), 30


add_single_circular_plane() (in module pys-
lope.Slope), 35 S
add_single_entry_exit_plane() (in module pys- set_analysis_limits() (in module pyslope.Slope), 33
lope.Slope), 35 set_external_boundary() (in module pyslope.Slope),
analyse_dynamic() (in module pyslope.Slope), 35 29
analyse_slope() (in module pyslope.Slope), 35 set_lls() (in module pyslope.Slope), 31
set_materials() (in module pyslope.Slope), 32
G set_udls() (in module pyslope.Slope), 31
get_bottom_coordinates() (in module pys- set_water_table() (in module pyslope.Slope), 30
lope.Slope), 30 Slope (class in pyslope), 29
get_dynamic_results() (in module pyslope.Slope), 36
get_external_x_intersection() (in module pys- U
lope.Slope), 30 Udl (class in pyslope), 28
get_external_y_intersection() (in module pys- update_analysis_options() (in module pys-
lope.Slope), 30 lope.Slope), 34
get_min_FOS() (in module pyslope.Slope), 36 update_boundary_options() (in module pys-
get_min_FOS_circle() (in module pyslope.Slope), 36 lope.Slope), 34
get_min_FOS_end_points() (in module pys- update_water_analysis_options() (in module pys-
lope.Slope), 36 lope.Slope), 34
get_top_coordinates() (in module pyslope.Slope), 30

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

You might also like