Lythos LE — examples
Every output is from a real run.
1. The built-in examples
lythosle example| Key | Example |
|---|---|
homogeneous | Homogeneous slope (ACADS 1a): 10 m high 2H:1V embankment, c′ = 3 kPa, φ′ = 19.6°, dry. Published reference FS = 1.00 |
layered_water | Layered slope with a water table: a 15 m cut through weathered fill over stiff clay and dense sand, with a phreatic surface that daylights on the face |
soft_foundation | Embankment on soft clay: su = 12 + 1.8·z kPa, end of construction |
seismic | Pseudo-static case: the layered slope with kh = 0.15 and a 20 kPa road surcharge on the crest |
reinforced | Soil-nailed cut: a steep 9 m cut in silty sand over rock, four rows of nails at 40 kN/m each |
tension_crack | Clay cutting with a tension crack: su = 60 kPa, a water-filled crack at the crest, non-circular optimisation |
2. The ACADS benchmark
lythosle example homogeneousLythos LE - limit equilibrium slope stability
==============================================================
Model : Homogeneous slope
Units : metric
Slope height : 10.00
Average face : 26.6 deg
Materials : Embankment fill
Critical circle : centre (9.14, 29.49), R = 29.49
Entry / exit : x = 31.27 / 10.02
Sliding weight : 897.5 per unit width
Slices : 50
Method FS Equilibrium lambda
--------------------------------------------------------------------
Ordinary / Fellenius 0.953 moment -
Bishop simplified 0.985 moment -
Janbu corrected 0.994 force -
Spencer 0.985 moment + force +0.434
Morgenstern-Price (half-sine) 0.984 moment + force +0.532
Surfaces evaluated: 3773 (1735 rejected)
Notes
- all factors of safety are reported for the critical surface of Bishop simplified
- Janbu correction factor f0 = 1.048
Run time: 1.32 sThe expected relationships show: Ordinary is the most conservative; on a circular surface Bishop sits right next to Spencer; Morgenstern-Price needs a larger λ than Spencer because the half-sine function averages less than one.
3. Your own model from the command line
lythosle analyze model.json --method spencer --method morgenstern_price \
--slices 60 --json result.json --csv slices.csvWith the layered_water model:
Model : Layered slope with groundwater
Materials : Weathered fill, Stiff clay, Dense sand
Groundwater : water table
Critical circle : centre (21.74, 35.12), R = 35.44
Entry / exit : x = 50.91 / 17.04
Method FS Equilibrium lambda
--------------------------------------------------------------------
Spencer 1.138 moment + force +0.385
Morgenstern-Price (half-sine) 1.138 moment + force +0.473The slice table (CSV) holds each slice's weight, base angle, pore pressure, normal force and mobilised shear strength:
index,x,width,alpha_deg,height,weight,base_length,u,cohesion,phi_deg,material,normal_force,normal_stress,shear_strength,shear_mobilised
1,17.2769,0.4821,-7.2415,0.0315,0.2730,0.4859,0.0,5.0,26.0,Weathered fill,1.8681,3.8445,6.8751,6.0388analyze takes either a bare model file or a {"model": ..., "options": ...} file — exactly what the browser's Download button produces. The first --method drives the search.
4. Earthquake and non-circular optimisation
lythosle example seismic --optimizeModel : Pseudo-static analysis
Seismic : kh = 0.15, kv = 0.0
Critical surface : non-circular, 61 vertices
Method FS Equilibrium lambda
--------------------------------------------------------------------
Bishop simplified 1.117 moment -
Janbu corrected 1.084 force -
Spencer 1.134 moment + force +0.494
Morgenstern-Price (half-sine) 1.131 moment + force +0.625
Notes
- non-circular optimisation (Spencer): FS 1.137 -> 1.134 (0.3%) after 272 trial surfaces
- moment-only method on a non-circular surface: the result depends on the moment axisThe optimisation starts from the critical circle and lowers the FS by 0.3 % over 272 trial surfaces. The program itself warns that moment-only methods (Bishop) depend on the moment axis on a non-circular surface — use Spencer or Morgenstern-Price there.
5. The Python API
from lythosle import SlopeModel, AnalysisOptions, analyze
model = SlopeModel.from_dict({
"profile": [[0, 0], [10, 0], [30, 10], [50, 10]],
"materials": [{"name": "fill", "unit_weight": 20, "cohesion": 3,
"friction_angle": 19.6}],
"layers": [{"material": "fill"}],
})
result = analyze(model, AnalysisOptions.from_dict({
"methods": ["bishop", "spencer"],
"n_slices": 60,
"search": {"nx": 16, "ny": 16, "n_tangent": 16, "refine_passes": 4},
}))
print(result.critical_fs) # 0.987
print(result.results["spencer"].lam) # 0.431 — interslice force ratio
print(result.text_report())Lower-level pieces are available too — all eight methods on a given circle:
from lythosle import build_slices, circular_surface, solve_all
surface = circular_surface(model.canonical(), xc=20, yc=30, radius=28)
mass = build_slices(model.canonical(), surface, n_slices=50)
print({k: round(v.fs, 3) for k, v in solve_all(mass).items()}){'ordinary': 1.35, 'bishop': 1.406, 'janbu': 1.346, 'janbu_corrected': 1.417,
'corps_engineers': 1.412, 'lowe_karafiath': 1.413, 'spencer': 1.405, 'morgenstern_price': 1.405}6. A staged fill: a design question
The soft_foundation example (a 6 m fill on soft clay, su = 12 + 1.8·z) fails if raised in one lift. Changing the height and the clay's strength tests staged construction:
import json
from lythosle import SlopeModel, AnalysisOptions, analyze
case = json.load(open("docs/examples/soft_foundation.json"))
options = AnalysisOptions.from_dict(case["options"])
def fs(height, su):
m = json.loads(json.dumps(case["model"]))
run = 2 * height # 1V:2H side slopes
m["profile"] = [[0, 0], [12, 0], [12 + run, height], [44, height],
[44 + run, 0], [70, 0]]
m["materials"][1]["su"] = su
return analyze(SlopeModel.from_dict(m), options).critical_fs
print(f"one lift, 6 m, su0 = 12 kPa : FS = {fs(6.0, 12.0):.3f}")
print(f"stage 1, 3 m, su0 = 12 kPa : FS = {fs(3.0, 12.0):.3f}")
print(f"stage 2, 6 m, su0 = 24 kPa : FS = {fs(6.0, 24.0):.3f}")one lift, 6 m, su0 = 12 kPa : FS = 0.896
stage 1, 3 m, su0 = 12 kPa : FS = 1.362
stage 2, 6 m, su0 = 24 kPa : FS = 1.366If consolidation under the first stage raises the clay's surface strength to 24 kPa, the second stage is safe. That wait is estimated with Lythos Settle's t90 — as in the end-to-end example.