ge.soil — API reference¶
void_ratio
¶
Compute void ratio from one of several input combinations.
The void ratio is the ratio of the volume of voids to the volume of solids in a soil mass.
.. math::
e = \frac{V_v}{V_s} \quad\text{[Das Eq. 3.1]}
e = \frac{n}{1 - n} \quad\text{[Das Eq. 3.5]}
e = \frac{w \cdot G_s}{S} \quad\text{[Das Eq. 3.10]}
| PARAMETER | DESCRIPTION |
|---|---|
n
|
Porosity, dimensionless, in (0, 1).
TYPE:
|
w
|
Water content, dimensionless (decimal, not %).
TYPE:
|
Gs
|
Specific gravity of solids, typically 2.60–2.80.
TYPE:
|
S
|
Degree of saturation, dimensionless, in (0, 1].
TYPE:
|
Vv
|
Volume of voids (any consistent unit).
TYPE:
|
Vs
|
Volume of solids (same unit as Vv).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray
|
Void ratio (dimensionless, ≥ 0). |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If inputs are physically invalid or insufficient. |
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Eqs. 3.1, 3.5, 3.10.
Examples:
Source code in geoeq/soil/properties.py
porosity
¶
Compute porosity from void ratio or volumes.
.. math::
n = \frac{V_v}{V} = \frac{e}{1 + e} \quad\text{[Das Eq. 3.3]}
| PARAMETER | DESCRIPTION |
|---|---|
e
|
Void ratio, dimensionless (≥ 0).
TYPE:
|
Vv
|
Volume of voids (any consistent unit).
TYPE:
|
V
|
Total volume (same unit as Vv).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray
|
Porosity, dimensionless, in [0, 1). |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If inputs are physically invalid or insufficient. |
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Eq. 3.3.
Examples:
Source code in geoeq/soil/properties.py
specific_gravity
¶
Compute specific gravity of soil solids.
.. math::
G_s = \frac{M_s}{V_s \cdot \rho_w}
= \frac{\gamma_s}{\gamma_w} \quad\text{[Das Ch. 3]}
| PARAMETER | DESCRIPTION |
|---|---|
Ms
|
Mass of solids (grams).
TYPE:
|
Vs
|
Volume of solids (cm³).
TYPE:
|
gamma_w
|
Unit weight of water. Not used in mass/volume calculation but kept for API consistency. Default 9.81 kN/m³.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray
|
Specific gravity (dimensionless, typically 2.60–2.80). |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If Ms or Vs are not positive. |
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Ch. 3.
Examples:
>>> from geoeq.soil import properties as sp
>>> sp.specific_gravity(Ms=265.0, Vs=100.0)
2.65
Source code in geoeq/soil/properties.py
density
¶
Compute unit weight or density from phase properties.
.. math::
\gamma_d = \frac{G_s \cdot \gamma_w}{1 + e}
\quad\text{[Das Eq. 3.13]}
\gamma = \frac{(G_s + S e)\,\gamma_w}{1 + e}
\quad\text{[Das Eq. 3.14]}
\gamma_{sat} = \frac{(G_s + e)\,\gamma_w}{1 + e}
\quad\text{[Das Eq. 3.15]}
\gamma' = \gamma_{sat} - \gamma_w
= \frac{(G_s - 1)\,\gamma_w}{1 + e}
\quad\text{[Das Eq. 3.16]}
| PARAMETER | DESCRIPTION |
|---|---|
Gs
|
Specific gravity of solids (typically 2.60–2.80, allow 1.0–4.0).
TYPE:
|
e
|
Void ratio (typically 0.3–1.5, allow 0.0–15.0).
TYPE:
|
S
|
Degree of saturation, in [0, 1]. Required for
TYPE:
|
mass
|
Total mass (kg). Alternative to (Gs, e).
TYPE:
|
volume
|
Total volume (m³). Alternative to (Gs, e).
TYPE:
|
kind
|
TYPE:
|
unit
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray or dict
|
Unit weight / density value. If |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If inputs are invalid or insufficient. |
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Eqs. 3.13–3.16.
Examples:
Dry unit weight (Das Example 3.2, Gs=2.67, e=0.72):
Saturated unit weight:
All unit weights at once:
>>> sp.density(Gs=2.65, e=0.70, S=0.8, kind="all")
{'dry': ..., 'saturated': ..., 'submerged': ..., 'bulk': ...}
Source code in geoeq/soil/properties.py
| Python | |
|---|---|
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | |
saturation
¶
Compute the degree of saturation.
.. math::
S = \frac{V_w}{V_v} = \frac{w \cdot G_s}{e} \quad\text{[Das Eq. 3.6, 3.10]}
| PARAMETER | DESCRIPTION |
|---|---|
w
|
Water content, dimensionless (decimal).
TYPE:
|
Gs
|
Specific gravity of solids.
TYPE:
|
e
|
Void ratio.
TYPE:
|
Vw
|
Volume of water.
TYPE:
|
Vv
|
Volume of voids.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray
|
Degree of saturation, dimensionless, in [0, 1]. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If computed saturation exceeds 1.0 (physically impossible) or inputs are insufficient. |
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Eqs. 3.6, 3.10.
Examples:
>>> from geoeq.soil import properties as sp
>>> sp.saturation(w=0.25, Gs=2.65, e=0.80)
0.828125
Source code in geoeq/soil/properties.py
water_content
¶
Compute gravimetric water content.
.. math::
w = \frac{M_w}{M_s} = \frac{S \cdot e}{G_s} \quad\text{[Das Eq. 3.7, 3.10]}
| PARAMETER | DESCRIPTION |
|---|---|
S
|
Degree of saturation, in [0, 1].
TYPE:
|
Gs
|
Specific gravity of solids.
TYPE:
|
e
|
Void ratio.
TYPE:
|
Mw
|
Mass of water (any consistent unit).
TYPE:
|
Ms
|
Mass of solids (same unit as Mw).
TYPE:
|
Ww
|
Weight of water (any consistent unit).
TYPE:
|
Ws
|
Weight of solids (same unit as Ww).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray
|
Gravimetric water content (dimensionless, ≥ 0). |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If inputs are physically invalid or insufficient. |
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Eqs. 3.7, 3.10.
Examples:
>>> from geoeq.soil import properties as sp
>>> sp.water_content(Mw=20.0, Ms=100.0)
0.2
Source code in geoeq/soil/properties.py
| Python | |
|---|---|
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |
relative_density
¶
relative_density(e=None, e_max=None, e_min=None, rho=None, rho_max=None, rho_min=None, kind='void')
Compute relative density (density index).
.. math::
D_r = \frac{e_{\max} - e}{e_{\max} - e_{\min}}
\quad\text{[Das Eq. 3.22]}
D_r = \frac{\rho_d - \rho_{d,\min}}
{\rho_{d,\max} - \rho_{d,\min}}
\cdot \frac{\rho_{d,\max}}{\rho_d}
\quad\text{[Das Eq. 3.23]}
| PARAMETER | DESCRIPTION |
|---|---|
e
|
Current void ratio.
TYPE:
|
e_max
|
Maximum void ratio (loosest state).
TYPE:
|
e_min
|
Minimum void ratio (densest state).
TYPE:
|
rho
|
Current dry density.
TYPE:
|
rho_max
|
Maximum dry density (densest).
TYPE:
|
rho_min
|
Minimum dry density (loosest).
TYPE:
|
kind
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray
|
Relative density, clamped to [0, 1]. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If inputs are invalid or Dr is far outside [0, 1]. |
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Eqs. 3.22–3.23.
Examples:
>>> from geoeq.soil import properties as sp
>>> sp.relative_density(e=0.60, e_max=0.90, e_min=0.50)
0.75
>>> sp.relative_density(rho=1600, rho_max=1800, rho_min=1400, kind="density")
0.5625
Source code in geoeq/soil/properties.py
| Python | |
|---|---|
570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 | |
atterberg
¶
Compute Atterberg-limit indices: PI, LI, or CI.
.. math::
PI = LL - PL \quad\text{[Das Ch. 4]}
LI = \frac{w - PL}{PI} \quad\text{[Das Ch. 4]}
CI = \frac{LL - w}{PI} \quad\text{[Das Ch. 4]}
| PARAMETER | DESCRIPTION |
|---|---|
LL
|
Liquid limit (%).
TYPE:
|
PL
|
Plastic limit (%).
TYPE:
|
w
|
Natural water content (%, same scale as LL/PL).
TYPE:
|
kind
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float, ndarray, or dict
|
Requested index or dict of all indices. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If PL > LL or insufficient inputs. |
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Ch. 4.
Examples:
>>> from geoeq.soil import properties as sp
>>> sp.atterberg(LL=45, PL=22, kind="PI")
23.0
>>> sp.atterberg(LL=48, PL=22, w=35, kind="all")
{'PI': 26.0, 'LI': 0.5, 'CI': 0.5}
Source code in geoeq/soil/properties.py
| Python | |
|---|---|
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 | |
activity
¶
Compute the activity of clay.
.. math::
A = \frac{PI}{CF} \quad\text{[Skempton, 1953]}
where CF is the clay-size fraction (% finer than 2 µm, expressed as a percentage, e.g. 25 for 25 %).
| PARAMETER | DESCRIPTION |
|---|---|
PI
|
Plasticity index (%).
TYPE:
|
clay_fraction
|
Clay-size fraction (%), i.e. % finer than 2 µm.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray
|
Activity (dimensionless). |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If PI < 0 or clay_fraction ≤ 0. |
Notes
Classification (Skempton 1953):
- A < 0.75 → Inactive
- 0.75 ≤ A ≤ 1.25 → Normal
- A > 1.25 → Active
References
Skempton, A. W. (1953). The colloidal "activity" of clays. Proc. 3rd ICSMFE, 1, 57–61.
Examples:
>>> from geoeq.soil import properties as sp
>>> sp.activity(PI=30, clay_fraction=40)
0.75
Source code in geoeq/soil/properties.py
sensitivity
¶
Compute the sensitivity of clay.
.. math::
S_t = \frac{S_{u(\text{undisturbed})}}{S_{u(\text{remolded})}}
\quad\text{[Das Ch. 4]}
| PARAMETER | DESCRIPTION |
|---|---|
Su_undisturbed
|
Undrained shear strength of undisturbed clay (kPa).
TYPE:
|
Su_remolded
|
Undrained shear strength of remolded clay (kPa).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray
|
Sensitivity (dimensionless, ≥ 1). |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If either strength is not positive. |
Notes
Classification (Das Ch. 4):
- St = 1 → Insensitive
- 1 < St ≤ 4 → Medium sensitive
- 4 < St ≤ 8 → Sensitive
- St > 8 → Extra sensitive / Quick clay
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Ch. 4.
Examples:
>>> from geoeq.soil import properties as sp
>>> sp.sensitivity(Su_undisturbed=100, Su_remolded=25)
4.0
Source code in geoeq/soil/properties.py
liquidity_index
¶
Compute the liquidity index (standalone convenience function).
.. math::
LI = \frac{w - PL}{PI} \quad\text{[Das Ch. 4]}
| PARAMETER | DESCRIPTION |
|---|---|
w
|
Natural water content (%).
TYPE:
|
PL
|
Plastic limit (%).
TYPE:
|
PI
|
Plasticity index (%).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float or ndarray
|
Liquidity index (dimensionless). |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If PI ≤ 0 (non-plastic soil). |
Notes
- LI < 0 → soil is in a semi-solid / solid state
- 0 ≤ LI ≤ 1 → soil is in the plastic range
- LI > 1 → soil is in the liquid state
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Ch. 4.
Examples:
>>> from geoeq.soil import properties as sp
>>> sp.liquidity_index(w=35, PL=22, PI=26)
0.5
Source code in geoeq/soil/properties.py
classify_uscs
¶
classify_uscs(LL=None, PL=None, gravel=0.0, sand=0.0, fines=None, Cu=None, Cc=None, organic=False)
Classify a soil using the Unified Soil Classification System (USCS).
Implements the flowchart in ASTM D2487-17 and Das (2021), Fig. 4.8.
| PARAMETER | DESCRIPTION |
|---|---|
LL
|
Liquid limit (%).
TYPE:
|
PL
|
Plastic limit (%).
TYPE:
|
gravel
|
Gravel fraction (% retained on No. 4 / 4.75 mm sieve). Default 0.
TYPE:
|
sand
|
Sand fraction (% passing No. 4 and retained on No. 200 / 0.075 mm). Default 0.
TYPE:
|
fines
|
Fines content (% passing No. 200). If not given, computed as
TYPE:
|
Cu
|
Uniformity coefficient. Required when fines < 12 %.
TYPE:
|
Cc
|
Coefficient of curvature. Required when fines < 12 %.
TYPE:
|
organic
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If required inputs for the classification path are missing, or grain-size fractions do not sum to ≈ 100 %. |
References
ASTM D2487-17 (2017). Standard Practice for Classification of Soils for Engineering Purposes.
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Ch. 4, Fig. 4.8.
Examples:
Well-graded sand:
>>> classify_uscs(gravel=5, sand=90, fines=5, Cu=8, Cc=2)
{'symbol': 'SW', 'name': 'Well-graded sand'}
Fat clay:
>>> classify_uscs(LL=70, PL=30, fines=80, gravel=5, sand=15)
{'symbol': 'CH', 'name': 'Fat clay'}
Source code in geoeq/soil/classification.py
| Python | |
|---|---|
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |
classify_aashto
¶
Classify a soil using the AASHTO system (M145).
Follows the left-to-right elimination procedure of Das (2021), Table 4.4.
| PARAMETER | DESCRIPTION |
|---|---|
LL
|
Liquid limit (%).
TYPE:
|
PL
|
Plastic limit (%).
TYPE:
|
gravel
|
% retained on No. 10 (2.0 mm) sieve. Default 0.
TYPE:
|
sand
|
% passing No. 10 and retained on No. 200. Default 0.
TYPE:
|
fines
|
% passing No. 200. If not given, computed as
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If LL or PL is missing. |
References
AASHTO M145-91 (2012). Standard Specification for Classification of Soils and Soil-Aggregate Mixtures for Highway Construction Purposes.
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Ch. 4, Table 4.4.
Examples:
>>> from geoeq.soil.classification import classify_aashto
>>> classify_aashto(LL=45, PL=22, fines=60)
{'group': 'A-7-6', 'group_index': 13, 'description': 'Clayey soils'}
Source code in geoeq/soil/classification.py
| Python | |
|---|---|
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | |
plasticity_chart
¶
Plot the Casagrande plasticity chart with A-line and U-line.
Plots the Casagrande A-line and U-line and (optionally) plots soil samples on the chart for visual USCS classification.
.. math::
\text{A-line:} \quad PI = 0.73\,(LL - 20) \quad\text{[Das Fig. 4.8]}
\text{U-line:} \quad PI = 0.9\,(LL - 8) \quad\text{[Das Fig. 4.8]}
| PARAMETER | DESCRIPTION |
|---|---|
LL
|
Liquid limit(s) (%) for data points to plot.
TYPE:
|
PL
|
Plastic limit(s) (%) for data points to plot.
TYPE:
|
labels
|
Labels for each data point.
TYPE:
|
ax
|
Axes to draw on. If
TYPE:
|
save
|
File path to save the figure (e.g.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Axes
|
The axes with the chart. |
References
Das, B. M. (2021). Principles of Geotechnical Engineering, 10th ed., Ch. 4, Fig. 4.8.
Examples:
>>> from geoeq.soil.classification import plasticity_chart
>>> ax = plasticity_chart(LL=[35, 60], PL=[18, 25])
Source code in geoeq/soil/classification.py
| Python | |
|---|---|
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |