I am pleased to announce another package in my suite of applications for civil engineers, TerraLapsus. TerraLapsus is a Wolfram Language paclet for analyzing soil slope stability using limit equilibrium methods across layered ground, pore water pressure, seepage, surface loads, and tension cracks. You can find more details, documentation, and installation instructions on the TerraLapsus Paclet Repository Page. See last section for all related packages in this suite.
Slopes sometimes collapse. Either quickly, almost instantaneously or within a few hours. At other times they may take years to fully stabilise. For instance railway cuttings in the south of England have often failed 100 years or more after their construction. When dealing with development on, or near, slopes it is important to know if they are fully stable or not, or, if they are not, what form a slip may take and how susceptible it is due to changing conditions. TerraLapsus is a tool which may be used for answering these questions.
TerraLapsus is a paclet containing a suite of functions for investigating slope stability. Currently limited to limit equilibrium methods of calculating the factor of safety, it is intended to extend the functions to finite element analysis that will show the failure geometry and map the movement using re meshing. Although largely written, this future work requires an upgrade to Mathematica’s finite element solver before it can be issued.
In the meantime, TerraLapsus will solve any slope with any number of materials using all common methods i.e. Bishop Simplified Method for initial circular searches that solve moment equilibrium and Janbu’s Simplified method for initial, non circular searches that solve for force equilibrium, either by modifying a circular search or by undertaking a cuckoo or block search. These searches can then be used as a starting point for either Morgernstern-Price or Spencer methods that maintain full equilibrium of both moments and forces and are therefore often described as rigorous. Finally Sarma’s method, with vertical slices, is also used. This is also a method that is in full equilibrium and returns a critical horizontal acceleration as well as a factor of safety. It is particularly useful for seismic problems.
All methods can use several methods for defining the pore water pressure, ranging from hydrostatic pressure, which can be related to strata, or a Ru value to a full pore water pressure field calculated by TerraPercolatio.
They can also carry loads anywhere on the model and there is a special water loading function that will automatically include loads normal to a sloping face eg. from water impounded in a reservoir.
Tension cracks can also be included. These can be dry or water filled and either a prescribed depth, an automatic depth defined by the cohesion, or a critical depth where the depth is increased by the water pressure within it.
Finally, a contour plot of all failure surfaces below a prescribed figure can be shown.
In the meantime, TerraLapsus will solve any slope with any number of materials using all common methods i.e. Bishop Simplified Method for initial circular searches that solve moment equilibrium and Janbu’s Simplified method for initial, non circular searches that solve for force equilibrium, either by modifying a circular search or by undertaking a cuckoo or block search. These searches can then be used as a starting point for either Morgernstern-Price or Spencer methods that maintain full equilibrium of both moments and forces and are therefore often described as rigorous. Finally Sarma’s method, with vertical slices, is also used. This is also a method that is in full equilibrium and returns a critical horizontal acceleration as well as a factor of safety. It is particularly useful for seismic problems.
All methods can use several methods for defining the pore water pressure, ranging from hydrostatic pressure, which can be related to strata, or a Ru value to a full pore water pressure field calculated by TerraPercolatio.
They can also carry loads anywhere on the model and there is a special water loading function that will automatically include loads normal to a sloping face eg. from water impounded in a reservoir.
Tension cracks can also be included. These can be dry or water filled and either a prescribed depth, an automatic depth defined by the cohesion, or a critical depth where the depth is increased by the water pressure within it.
Finally, a contour plot of all failure surfaces below a prescribed figure can be shown.
Here is a simple slope with a weak layer in the foundation, first analysed in the dry. Then with the water upstream at 18m and downstream at 13m
The pwp are analysed in TerraPercolatio (from within TerraLasus)
Out[]=
and the new fos from Bishop calculated
However, a non circular search will find a lower fos affecting a much greater mass of material.
The fos using Morgernstern Price, Spencer or Sarma could also be found.
Note that, like TerraPercolatio, this paclet consists of a set of related functions that cover the setting up and solution of the models. They can be called within your own nb at any stage as easily as using a standard function like Sin[]. See the guide pages for details.
Examples
Examples
In[]:=
Needs["MalcolmWoodruff`TerraLapsus`"];
TerraLapsus 1.1.1 loaded. TerraLapsusHelp[] for a summary.
Example 1
Example 1
In[]:=
geom=<|"Height"->10.,"SlopeAngle"->26.57Degree,(*2:1*)"FoundationDepth"->10.,"CrestLength"->22.,"ToeLength"->22.,"XStart"->-12.|>;
In[]:=
mat=<|"Regions"->{<|"Name"->"Clay","Base"->0.,"UnitWeight"->20.,"Cohesion"->10.,"FrictionAngle"->20.Degree|>}|>;
In[]:=
model=SlopeModel[geom,mat,"StrengthFactor"->1.];
In[]:=
resB=BishopCriticalCircle[model,"Grid"->12,"Parallel"->True];resJ=JanbuCritical[model,"Grid"->12,"Parallel"->True];
In[]:=
resMP=MorgensternPriceFoS[model,resB];resSp=SpencerFoS[model,resB];resSa=SarmaFoS[model,resB,"Psi"->"Sarma"];
In[]:=
Dataset[{<|"method"->"Bishop simplified","F"->resB["FoS"],"satisfies"->"moment"|>,<|"method"->"Janbu simplified","F"->resJ["FoS"],"satisfies"->"force"|>,<|"method"->"Morgenstern-Price","F"->resMP["FoS"],"satisfies"->"both"|>,<|"method"->"Spencer","F"->resSp["FoS"],"satisfies"->"both"|>,<|"method"->"Sarma (1973)","F"->resSa["FoS"],"satisfies"->"both"|>}]
Out[]=
In[]:=
SlipCirclePlot[model,resB]
Out[]=
Example 2 - Slope with seepage
Example 2 - Slope with seepage
geom=<|"Height"->10.,"SlopeAngle"->26.57Degree,"FoundationDepth"->10.,"CrestLength"->22.,"ToeLength"->22.,"XStart"->-12.|>;mat=<|"Regions"->{<|"Name"->"Fill","Base"->6.,"UnitWeight"->20.,"Cohesion"->10.,"FrictionAngle"->25.Degree,"Permeability"->1.*^-6|>,<|"Name"->"Clay","Base"->Automatic,"UnitWeight"->20.,"Cohesion"->15.,"FrictionAngle"->20.Degree,"Permeability"->{2.*^-8,5.*^-9}|>}|>;(*kx,ky-4:1*)model=SlopeModel[geom,mat,"StrengthFactor"->1.];
Plot the geometry
SlopeModelPlot[model]
Out[]=
Specify upstream and downstream water levels and calculate porewater pressure etc using TerraPercolatio functions
Combine porewater pressure from seepage calcs with model
Note warnings may be given
Example 3 Dam Multiple materials and weak layer
Example 3 Dam Multiple materials and weak layer
Calculate seepage
Add seepage to dry model
Add seepage and water loads to dry model
Calculate fos on both dry and wet models and plot wet
But, due to the weak layer the critical slope may be non circular so do a block search and plot that
Related packages in this suite
Related packages in this suite
An Introduction to Mathematica for Civil Engineers :
https://www.notebookarchive.org/an-introduction-to-mathematica-for-civil-engineers--2025-03-cx2tujb/
https://www.notebookarchive.org/an-introduction-to-mathematica-for-civil-engineers--2025-03-cx2tujb/
Using finite elements to analyse structures in Mathematica:
https://www.notebookarchive.org/using-finite-elements-to-analyse-structures--2026-01-dtiqavj/
https://www.notebookarchive.org/using-finite-elements-to-analyse-structures--2026-01-dtiqavj/
Framica:- 3D space frame analysis
https://resources.wolframcloud.com/PacletRepository/resources/MalcolmWoodruff/Framica/
https://resources.wolframcloud.com/PacletRepository/resources/MalcolmWoodruff/Framica/
LineTerra:- Terrain data, earthworks, section design and quantification toolkit https://resources.wolframcloud.com/PacletRepository/resources/MalcolmWoodruff/LineTerra
TerraPercolatio:- Groundwater seepage analysis
https://resources.wolframcloud.com/PacletRepository/resources/MalcolmWoodruff/TerraPercolatio/
https://resources.wolframcloud.com/PacletRepository/resources/MalcolmWoodruff/TerraPercolatio/
TerraLapsus:- Limit equilibrium slope stability analysis
https://resources.wolframcloud.com/PacletRepository/resources/MalcolmWoodruff/TerraLapsus/
https://resources.wolframcloud.com/PacletRepository/resources/MalcolmWoodruff/TerraLapsus/
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
TerraLapsus geotechnics package: limit equilibrium analysis of the stability of slopes
by Malcolm Woodruff
Wolfram Community, STAFF PICKS, October 8, 2026
https://community.wolfram.com/t/28252
by Malcolm Woodruff
Wolfram Community, STAFF PICKS, October 8, 2026
https://community.wolfram.com/t/28252