Path: blob/main/latex-templates/templates/civil-engineering/soil_mechanics.tex
51 views
unlisted
\documentclass[11pt,a4paper]{article}1\usepackage[utf8]{inputenc}2\usepackage[T1]{fontenc}3\usepackage{amsmath,amssymb}4\usepackage{graphicx}5\usepackage{booktabs}6\usepackage{siunitx}7\usepackage{geometry}8\geometry{margin=1in}9\usepackage{pythontex}10\usepackage{hyperref}11\usepackage{float}1213\title{Soil Mechanics Analysis\\Effective Stress, Bearing Capacity, and Consolidation}14\author{Geotechnical Engineering Research Group}15\date{\today}1617\begin{document}18\maketitle1920\begin{abstract}21This report presents comprehensive geotechnical analysis including effective stress calculations, Mohr-Coulomb failure criteria, bearing capacity design using Terzaghi's theory, one-dimensional consolidation settlement, and slope stability assessment. Computational methods are applied to practical foundation design scenarios with parametric studies examining the influence of soil properties on engineering behavior.22\end{abstract}2324\section{Introduction}2526Soil mechanics forms the foundation of geotechnical engineering, governing the design of structures interacting with earth materials. This analysis examines five critical aspects: (1) effective stress profiles accounting for pore water pressure, (2) shear strength characterization via Mohr-Coulomb failure envelopes, (3) shallow foundation bearing capacity, (4) time-dependent consolidation settlement, and (5) slope stability under various loading conditions.2728The principle of effective stress, first articulated by Terzaghi \cite{terzaghi1943}, remains fundamental to understanding soil behavior. Shear strength parameters (cohesion $c$ and friction angle $\phi$) control failure mechanisms \cite{lambe1969}. Bearing capacity theory provides the basis for safe foundation design \cite{meyerhof1963}, while consolidation analysis predicts settlement magnitudes and time scales \cite{taylor1948}.2930\begin{pycode}31import numpy as np32import matplotlib.pyplot as plt33from scipy.integrate import odeint34from scipy.optimize import fsolve35from scipy import stats36plt.rcParams['text.usetex'] = True37plt.rcParams['font.family'] = 'serif'3839# Global soil parameters40gamma = 18.0 # kN/m³ total unit weight41gamma_sat = 20.0 # kN/m³ saturated unit weight42gamma_w = 9.81 # kN/m³ water unit weight43c = 25.0 # kPa cohesion44phi = 30.0 # degrees friction angle45phi_rad = np.radians(phi)46cv = 2e-7 # m²/s coefficient of consolidation47\end{pycode}4849\section{Effective Stress Distribution}5051The effective stress principle states that soil behavior is controlled by effective stress $\sigma'$, defined as:52\begin{equation}53\sigma' = \sigma - u54\end{equation}55where $\sigma$ is total stress and $u$ is pore water pressure.5657\begin{pycode}58# Effective stress profile59z = np.linspace(0, 20, 100) # depth in meters60water_table = 5.0 # meters below surface6162# Total stress63sigma_total = np.where(z <= water_table, gamma * z,64gamma * water_table + gamma_sat * (z - water_table))6566# Pore water pressure67u = np.maximum(0, gamma_w * (z - water_table))6869# Effective stress70sigma_effective = sigma_total - u7172# Calculate values at specific depths73z_eval = np.array([5, 10, 15, 20])74sigma_t_eval = np.interp(z_eval, z, sigma_total)75u_eval = np.interp(z_eval, z, u)76sigma_e_eval = np.interp(z_eval, z, sigma_effective)7778fig, ax = plt.subplots(figsize=(10, 7))79ax.plot(sigma_total, z, 'b-', linewidth=2.5, label=r'Total stress $\sigma$')80ax.plot(u, z, 'c--', linewidth=2, label=r'Pore pressure $u$')81ax.plot(sigma_effective, z, 'r-', linewidth=2.5, label=r"Effective stress $\sigma'$")82ax.axhline(water_table, color='cyan', linestyle=':', linewidth=1.5, alpha=0.7, label='Water table')83ax.set_xlabel(r'Stress (kPa)', fontsize=12)84ax.set_ylabel(r'Depth (m)', fontsize=12)85ax.set_title(r'Effective Stress Profile with Water Table at 5 m Depth', fontsize=13)86ax.invert_yaxis()87ax.legend(loc='lower right', fontsize=11)88ax.grid(True, alpha=0.3)89plt.tight_layout()90plt.savefig('soil_mechanics_plot1.pdf', dpi=150, bbox_inches='tight')91plt.close()92\end{pycode}9394\begin{figure}[H]95\centering96\includegraphics[width=0.88\textwidth]{soil_mechanics_plot1.pdf}97\caption{Effective stress distribution with depth showing the influence of the water table at 5 m depth. Above the water table, total stress equals effective stress since pore pressure is zero. Below the water table, buoyancy effects reduce effective stress significantly. At 20 m depth, total stress is \py{f"{sigma_t_eval[3]:.1f}"} kPa, pore pressure is \py{f"{u_eval[3]:.1f}"} kPa, and effective stress is \py{f"{sigma_e_eval[3]:.1f}"} kPa. This principle governs compressibility, shear strength, and permeability of saturated soils.}98\end{figure}99100\section{Mohr-Coulomb Failure Criterion}101102The Mohr-Coulomb failure envelope defines shear strength $\tau_f$ as:103\begin{equation}104\tau_f = c + \sigma_n \tan\phi105\end{equation}106where $c$ is cohesion, $\sigma_n$ is normal effective stress, and $\phi$ is the friction angle.107108\begin{pycode}109# Mohr-Coulomb failure envelope110sigma_n = np.linspace(0, 500, 100) # kPa normal stress111112# Failure envelope for different soil types113c1, phi1 = 25, 30 # clayey sand114c2, phi2 = 50, 15 # stiff clay115c3, phi3 = 0, 35 # clean sand116117tau_f1 = c1 + sigma_n * np.tan(np.radians(phi1))118tau_f2 = c2 + sigma_n * np.tan(np.radians(phi2))119tau_f3 = c3 + sigma_n * np.tan(np.radians(phi3))120121# Mohr circles at failure for example stress states122sigma_1_ex = 400 # kPa major principal stress123sigma_3_ex = 100 # kPa minor principal stress124center = (sigma_1_ex + sigma_3_ex) / 2125radius = (sigma_1_ex - sigma_3_ex) / 2126theta_circle = np.linspace(0, np.pi, 100)127circle_x = center + radius * np.cos(theta_circle)128circle_y = radius * np.sin(theta_circle)129130fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))131132# Left panel: failure envelopes133ax1.plot(sigma_n, tau_f1, 'r-', linewidth=2.5, label=f'Clayey sand: $c={c1}$ kPa, $\\phi={phi1}°$')134ax1.plot(sigma_n, tau_f2, 'b-', linewidth=2.5, label=f'Stiff clay: $c={c2}$ kPa, $\\phi={phi2}°$')135ax1.plot(sigma_n, tau_f3, 'g-', linewidth=2.5, label=f'Clean sand: $c={c3}$ kPa, $\\phi={phi3}°$')136ax1.set_xlabel(r'Normal stress $\sigma_n$ (kPa)', fontsize=12)137ax1.set_ylabel(r'Shear stress $\tau_f$ (kPa)', fontsize=12)138ax1.set_title('Mohr-Coulomb Failure Envelopes', fontsize=13)139ax1.legend(loc='upper left', fontsize=10)140ax1.grid(True, alpha=0.3)141ax1.set_xlim([0, 500])142ax1.set_ylim([0, 400])143144# Right panel: Mohr circle with failure envelope145ax2.plot(sigma_n, tau_f1, 'r-', linewidth=2, label='Failure envelope')146ax2.plot(circle_x, circle_y, 'b-', linewidth=2.5, label='Mohr circle')147ax2.plot([sigma_3_ex, sigma_1_ex], [0, 0], 'ko', markersize=8)148ax2.axhline(0, color='k', linewidth=0.8)149ax2.set_xlabel(r'Normal stress $\sigma$ (kPa)', fontsize=12)150ax2.set_ylabel(r'Shear stress $\tau$ (kPa)', fontsize=12)151ax2.set_title(r'Mohr Circle at Failure ($\sigma_1=400$ kPa, $\sigma_3=100$ kPa)', fontsize=13)152ax2.legend(loc='upper left', fontsize=10)153ax2.grid(True, alpha=0.3)154ax2.set_xlim([0, 500])155ax2.set_ylim([0, 250])156157plt.tight_layout()158plt.savefig('soil_mechanics_plot2.pdf', dpi=150, bbox_inches='tight')159plt.close()160\end{pycode}161162\begin{figure}[H]163\centering164\includegraphics[width=0.98\textwidth]{soil_mechanics_plot2.pdf}165\caption{Left: Mohr-Coulomb failure envelopes for three soil types demonstrating how cohesion and friction angle control shear strength. Clayey sand exhibits moderate cohesion and friction. Stiff clay has high cohesion but lower friction. Clean sand has zero cohesion but highest friction angle. Right: Mohr circle representation of stress state at failure tangent to the failure envelope. The principal stresses are \py{f"{sigma_1_ex}"} kPa and \py{f"{sigma_3_ex}"} kPa, giving a deviatoric stress of \py{f"{sigma_1_ex - sigma_3_ex}"} kPa. This graphical method is fundamental for analyzing triaxial test results and determining soil strength parameters.}166\end{figure}167168\section{Bearing Capacity Analysis}169170Terzaghi's bearing capacity equation for a shallow strip footing is:171\begin{equation}172q_u = c N_c + \gamma D_f N_q + \frac{1}{2}\gamma B N_\gamma173\end{equation}174where $q_u$ is ultimate bearing capacity, $D_f$ is embedment depth, $B$ is footing width, and $N_c$, $N_q$, $N_\gamma$ are bearing capacity factors.175176\begin{pycode}177# Bearing capacity factors (Terzaghi for strip footing)178Nc = (1/np.tan(phi_rad)) * (np.exp(np.pi * np.tan(phi_rad)) *179(np.tan(np.pi/4 + phi_rad/2))**2 - 1)180Nq = np.exp(np.pi * np.tan(phi_rad)) * (np.tan(np.pi/4 + phi_rad/2))**2181Ngamma = (Nq - 1) * np.tan(1.4 * phi_rad)182183# Foundation parameters184B_range = np.linspace(0.5, 5, 50) # m footing width185Df = 1.5 # m embedment depth186187# Ultimate bearing capacity for varying width188qu = c * Nc + gamma * Df * Nq + 0.5 * gamma * B_range * Ngamma189190# Factor of safety and allowable bearing capacity191FS = 3.0192qa = qu / FS193194# Parametric study: effect of friction angle195phi_values = [25, 30, 35, 40]196B_study = 2.0 # m197198fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))199200# Left: bearing capacity vs width201ax1.plot(B_range, qu, 'b-', linewidth=2.5, label='Ultimate capacity $q_u$')202ax1.plot(B_range, qa, 'r--', linewidth=2, label=f'Allowable capacity $q_a$ (FS={FS})')203ax1.fill_between(B_range, 0, qa, alpha=0.2, color='green', label='Safe zone')204ax1.set_xlabel('Footing width $B$ (m)', fontsize=12)205ax1.set_ylabel('Bearing capacity (kPa)', fontsize=12)206ax1.set_title(f'Bearing Capacity vs. Footing Width ($c={c}$ kPa, $\\phi={phi}°$)', fontsize=13)207ax1.legend(loc='upper left', fontsize=10)208ax1.grid(True, alpha=0.3)209210# Right: effect of friction angle211qu_phi = []212for phi_i in phi_values:213phi_rad_i = np.radians(phi_i)214Nc_i = (1/np.tan(phi_rad_i)) * (np.exp(np.pi * np.tan(phi_rad_i)) *215(np.tan(np.pi/4 + phi_rad_i/2))**2 - 1)216Nq_i = np.exp(np.pi * np.tan(phi_rad_i)) * (np.tan(np.pi/4 + phi_rad_i/2))**2217Ngamma_i = (Nq_i - 1) * np.tan(1.4 * phi_rad_i)218qu_i = c * Nc_i + gamma * Df * Nq_i + 0.5 * gamma * B_study * Ngamma_i219qu_phi.append(qu_i)220221ax2.plot(phi_values, qu_phi, 'ro-', linewidth=2.5, markersize=10)222ax2.set_xlabel('Friction angle $\\phi$ (degrees)', fontsize=12)223ax2.set_ylabel('Ultimate bearing capacity $q_u$ (kPa)', fontsize=12)224ax2.set_title(f'Effect of Friction Angle ($B={B_study}$ m, $D_f={Df}$ m)', fontsize=13)225ax2.grid(True, alpha=0.3)226227plt.tight_layout()228plt.savefig('soil_mechanics_plot3.pdf', dpi=150, bbox_inches='tight')229plt.close()230231# Calculate specific values for inline reference232qu_2m = np.interp(2.0, B_range, qu)233qa_2m = qu_2m / FS234\end{pycode}235236\begin{figure}[H]237\centering238\includegraphics[width=0.98\textwidth]{soil_mechanics_plot3.pdf}239\caption{Left: Ultimate and allowable bearing capacity variation with footing width showing the significant influence of the size-dependent $N_\gamma$ term. For a 2 m wide footing, ultimate capacity is \py{f"{qu_2m:.0f}"} kPa and allowable capacity is \py{f"{qa_2m:.0f}"} kPa. Right: Bearing capacity sensitivity to friction angle demonstrating exponential increase. A 5° increase from 30° to 35° raises capacity by over 50 percent. These relationships guide foundation sizing in preliminary design. Bearing capacity factors are $N_c=\py{f"{Nc:.2f}"}$, $N_q=\py{f"{Nq:.2f}"}$, $N_\gamma=\py{f"{Ngamma:.2f}"}$ for $\phi=\py{phi}°$.}240\end{figure}241242\section{One-Dimensional Consolidation}243244Terzaghi's one-dimensional consolidation theory predicts settlement and its time development. The degree of consolidation $U$ is:245\begin{equation}246U = 1 - \sum_{m=0}^{\infty} \frac{2}{M^2} \exp\left(-M^2 T_v\right), \quad M = \frac{\pi}{2}(2m+1)247\end{equation}248where the time factor $T_v = c_v t / H_{dr}^2$, with $c_v$ as the coefficient of consolidation and $H_{dr}$ as the drainage path.249250\begin{pycode}251# Consolidation parameters252H = 10 # m layer thickness253H_dr = H / 2 # m drainage path (double drainage)254delta_sigma = 100 # kPa applied load increment255Cc = 0.3 # compression index256e0 = 0.8 # initial void ratio257258# Time range259t_years = np.logspace(-3, 2, 200) # years260t_seconds = t_years * 365.25 * 24 * 3600 # convert to seconds261262# Time factor263Tv = cv * t_seconds / H_dr**2264265# Degree of consolidation (first 10 terms of series)266U = np.zeros_like(Tv)267for m in range(10):268M = (np.pi / 2) * (2 * m + 1)269U += (2 / M**2) * np.exp(-M**2 * Tv)270U = 1 - U271272# Ultimate settlement273sigma0 = gamma * H / 2 # average effective stress274Sc = (Cc / (1 + e0)) * H * np.log10((sigma0 + delta_sigma) / sigma0)275276# Settlement vs time277S_t = U * Sc278279# Different cv values for parametric study280cv_values = [1e-7, 2e-7, 5e-7, 1e-6] # m²/s281282fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))283284# Left: settlement vs time285ax1.semilogx(t_years, S_t * 1000, 'b-', linewidth=2.5)286ax1.axhline(Sc * 1000, color='r', linestyle='--', linewidth=1.5,287label=f'Ultimate settlement = {Sc*1000:.1f} mm')288ax1.axhline(0.5 * Sc * 1000, color='orange', linestyle=':', linewidth=1.5,289label=f'50\\% consolidation')290ax1.set_xlabel('Time (years)', fontsize=12)291ax1.set_ylabel('Settlement (mm)', fontsize=12)292ax1.set_title(f'Consolidation Settlement ($c_v={cv*1e6:.1f}×10^{{-6}}$ m²/s)', fontsize=13)293ax1.legend(loc='lower right', fontsize=10)294ax1.grid(True, alpha=0.3, which='both')295ax1.set_xlim([1e-3, 100])296297# Right: effect of cv on consolidation rate298for cv_i in cv_values:299Tv_i = cv_i * t_seconds / H_dr**2300U_i = np.zeros_like(Tv_i)301for m in range(10):302M = (np.pi / 2) * (2 * m + 1)303U_i += (2 / M**2) * np.exp(-M**2 * Tv_i)304U_i = 1 - U_i305ax2.semilogx(t_years, U_i * 100, linewidth=2.5,306label=f'$c_v={cv_i*1e6:.1f}×10^{{-6}}$ m²/s')307308ax2.axhline(90, color='gray', linestyle='--', linewidth=1, alpha=0.7)309ax2.set_xlabel('Time (years)', fontsize=12)310ax2.set_ylabel('Degree of consolidation $U$ (\\%)', fontsize=12)311ax2.set_title('Effect of Coefficient of Consolidation', fontsize=13)312ax2.legend(loc='lower right', fontsize=10)313ax2.grid(True, alpha=0.3, which='both')314ax2.set_xlim([1e-3, 100])315ax2.set_ylim([0, 100])316317plt.tight_layout()318plt.savefig('soil_mechanics_plot4.pdf', dpi=150, bbox_inches='tight')319plt.close()320321# Calculate t50 and t90322idx50 = np.argmin(np.abs(U - 0.5))323idx90 = np.argmin(np.abs(U - 0.9))324t50 = t_years[idx50]325t90 = t_years[idx90]326\end{pycode}327328\begin{figure}[H]329\centering330\includegraphics[width=0.98\textwidth]{soil_mechanics_plot4.pdf}331\caption{Left: Settlement progression over time under 100 kPa surcharge on a 10 m thick clay layer with double drainage. Ultimate settlement is \py{f"{Sc*1000:.1f}"} mm. Time for 50\% consolidation is \py{f"{t50:.2f}"} years and for 90\% consolidation is \py{f"{t90:.1f}"} years. Right: Consolidation rate sensitivity to coefficient of consolidation showing that doubling $c_v$ halves the time required for a given degree of consolidation. Lower permeability clays ($c_v \sim 10^{-7}$ m²/s) require decades, while silty clays ($c_v \sim 10^{-6}$ m²/s) consolidate in months. This analysis is essential for staged construction and surcharge preloading design.}332\end{figure}333334\section{Slope Stability Analysis}335336Infinite slope stability is analyzed using limit equilibrium. The factor of safety against sliding is:337\begin{equation}338FS = \frac{c + \gamma z \cos^2\beta \tan\phi}{\gamma z \sin\beta \cos\beta}339\end{equation}340where $\beta$ is the slope angle and $z$ is the depth of failure surface.341342\begin{pycode}343# Infinite slope analysis344beta_range = np.linspace(5, 45, 100) # degrees345beta_rad = np.radians(beta_range)346347# Slope depth and soil parameters348z_slope = 5 # m depth to failure plane349350# Factor of safety for dry slope351FS_dry = (c + gamma * z_slope * np.cos(beta_rad)**2 * np.tan(phi_rad)) / \352(gamma * z_slope * np.sin(beta_rad) * np.cos(beta_rad))353354# Factor of safety for saturated slope with seepage355gamma_eff = gamma_sat - gamma_w356FS_sat = (c + gamma_eff * z_slope * np.cos(beta_rad)**2 * np.tan(phi_rad)) / \357(gamma_sat * z_slope * np.sin(beta_rad) * np.cos(beta_rad))358359# Critical slope angle (FS = 1 for cohesionless soil)360beta_crit_dry = phi361beta_crit_sat = np.degrees(np.arctan(gamma_eff / gamma_sat * np.tan(phi_rad)))362363# 2D stability chart: FS vs slope angle and cohesion364beta_2d = np.linspace(5, 45, 50)365c_2d = np.linspace(0, 50, 50)366BETA_2D, C_2D = np.meshgrid(beta_2d, c_2d)367BETA_RAD_2D = np.radians(BETA_2D)368369FS_2D = (C_2D + gamma * z_slope * np.cos(BETA_RAD_2D)**2 * np.tan(phi_rad)) / \370(gamma * z_slope * np.sin(BETA_RAD_2D) * np.cos(BETA_RAD_2D))371372fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))373374# Left: FS vs slope angle375ax1.plot(beta_range, FS_dry, 'b-', linewidth=2.5, label='Dry slope')376ax1.plot(beta_range, FS_sat, 'r-', linewidth=2.5, label='Saturated slope (seepage)')377ax1.axhline(1, color='k', linestyle='--', linewidth=1.5, label='FS = 1 (failure)')378ax1.axhline(1.5, color='green', linestyle=':', linewidth=1.5, label='FS = 1.5 (typical design)')379ax1.axvline(beta_crit_dry, color='b', linestyle=':', linewidth=1, alpha=0.5)380ax1.axvline(beta_crit_sat, color='r', linestyle=':', linewidth=1, alpha=0.5)381ax1.set_xlabel('Slope angle $\\beta$ (degrees)', fontsize=12)382ax1.set_ylabel('Factor of safety FS', fontsize=12)383ax1.set_title(f'Infinite Slope Stability ($c={c}$ kPa, $\\phi={phi}°$)', fontsize=13)384ax1.legend(loc='upper right', fontsize=10)385ax1.grid(True, alpha=0.3)386ax1.set_xlim([5, 45])387ax1.set_ylim([0, 5])388389# Right: 2D contour plot390cs = ax2.contourf(BETA_2D, C_2D, FS_2D, levels=[0, 0.5, 1.0, 1.5, 2.0, 3.0, 5.0, 10.0],391cmap='RdYlGn', extend='max')392contours = ax2.contour(BETA_2D, C_2D, FS_2D, levels=[1.0, 1.5], colors='black', linewidths=2)393ax2.clabel(contours, inline=True, fontsize=10)394plt.colorbar(cs, ax=ax2, label='Factor of safety FS')395ax2.set_xlabel('Slope angle $\\beta$ (degrees)', fontsize=12)396ax2.set_ylabel('Cohesion $c$ (kPa)', fontsize=12)397ax2.set_title('Slope Stability Design Chart', fontsize=13)398399plt.tight_layout()400plt.savefig('soil_mechanics_plot5.pdf', dpi=150, bbox_inches='tight')401plt.close()402403# Evaluate FS at specific slope angles404beta_eval = np.array([15, 30, 45])405FS_eval_dry = np.interp(beta_eval, beta_range, FS_dry)406FS_eval_sat = np.interp(beta_eval, beta_range, FS_sat)407\end{pycode}408409\begin{figure}[H]410\centering411\includegraphics[width=0.98\textwidth]{soil_mechanics_plot5.pdf}412\caption{Left: Factor of safety versus slope angle for infinite slope showing critical importance of groundwater. For a 30° slope, dry conditions give FS = \py{f"{FS_eval_dry[1]:.2f}"} while saturated conditions reduce this to FS = \py{f"{FS_eval_sat[1]:.2f}"}. Critical angle for cohesionless dry soil is \py{f"{beta_crit_dry:.0f}"}° and for saturated soil is \py{f"{beta_crit_sat:.0f}"}°. Right: Design chart showing safe (green) and unstable (red) combinations of slope angle and cohesion. Contours at FS = 1.0 (failure) and 1.5 (typical design minimum) provide rapid assessment. This demonstrates why cohesive soils can sustain steeper slopes and why drainage is critical for slope stability.}413\end{figure}414415\section{Compressibility and Settlement}416417Soil compressibility governs settlement under foundation loads. The compression index $C_c$ and recompression index $C_r$ define the stress-strain relationship.418419\begin{pycode}420# Void ratio vs effective stress (e-log p curve)421sigma_v = np.logspace(1, 3, 100) # kPa422e0_clay = 1.2423Cc_clay = 0.4424Cr_clay = 0.05425sigma_p = 200 # kPa preconsolidation pressure426427# Void ratio calculation428e = np.zeros_like(sigma_v)429for i, sig in enumerate(sigma_v):430if sig <= sigma_p:431e[i] = e0_clay - Cr_clay * np.log10(sig / 50) # reloading432else:433e_p = e0_clay - Cr_clay * np.log10(sigma_p / 50)434e[i] = e_p - Cc_clay * np.log10(sig / sigma_p) # virgin compression435436# Settlement for different OCR values437sigma_v0 = 100 # kPa initial stress438delta_sigma = 150 # kPa load increment439H_layer = 8 # m thickness440OCR_values = [1, 2, 4, 8] # overconsolidation ratio441442settlements = []443for OCR in OCR_values:444sigma_p_i = OCR * sigma_v0445if sigma_v0 + delta_sigma <= sigma_p_i:446# Recompression only447S = (Cr_clay / (1 + e0_clay)) * H_layer * np.log10((sigma_v0 + delta_sigma) / sigma_v0)448else:449# Recompression + virgin compression450S1 = (Cr_clay / (1 + e0_clay)) * H_layer * np.log10(sigma_p_i / sigma_v0)451S2 = (Cc_clay / (1 + e0_clay)) * H_layer * np.log10((sigma_v0 + delta_sigma) / sigma_p_i)452S = S1 + S2453settlements.append(S * 1000) # convert to mm454455fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))456457# Left: e-log p curve458ax1.semilogx(sigma_v, e, 'b-', linewidth=2.5)459ax1.axvline(sigma_p, color='r', linestyle='--', linewidth=1.5,460label=f'Preconsolidation pressure = {sigma_p} kPa')461ax1.set_xlabel('Effective stress $\\sigma_v\'$ (kPa)', fontsize=12)462ax1.set_ylabel('Void ratio $e$', fontsize=12)463ax1.set_title(f'Compressibility Curve ($C_c={Cc_clay}$, $C_r={Cr_clay}$)', fontsize=13)464ax1.legend(loc='upper right', fontsize=10)465ax1.grid(True, alpha=0.3, which='both')466ax1.set_xlim([10, 1000])467468# Right: settlement vs OCR469ax2.bar(range(len(OCR_values)), settlements, color='steelblue', edgecolor='black', linewidth=1.5)470ax2.set_xticks(range(len(OCR_values)))471ax2.set_xticklabels([f'OCR={ocr}' for ocr in OCR_values])472ax2.set_ylabel('Settlement (mm)', fontsize=12)473ax2.set_title(f'Settlement vs. Overconsolidation Ratio ($\\Delta\\sigma={delta_sigma}$ kPa)', fontsize=13)474ax2.grid(True, alpha=0.3, axis='y')475476for i, s in enumerate(settlements):477ax2.text(i, s + 5, f'{s:.1f}', ha='center', fontsize=10, fontweight='bold')478479plt.tight_layout()480plt.savefig('soil_mechanics_plot6.pdf', dpi=150, bbox_inches='tight')481plt.close()482\end{pycode}483484\begin{figure}[H]485\centering486\includegraphics[width=0.98\textwidth]{soil_mechanics_plot6.pdf}487\caption{Left: Void ratio-effective stress relationship showing elastic recompression at low stress (slope $C_r = \py{f"{Cr_clay:.2f}"}$) and virgin compression beyond preconsolidation pressure (slope $C_c = \py{f"{Cc_clay:.2f}"}$). The break in slope at \py{f"{sigma_p}"} kPa indicates stress history. Right: Settlement reduction with increasing overconsolidation ratio (OCR). Normally consolidated clay (OCR=1) settles \py{f"{settlements[0]:.1f}"} mm while heavily overconsolidated clay (OCR=8) settles only \py{f"{settlements[3]:.1f}"} mm under identical loading. This demonstrates why foundation performance depends critically on stress history, motivating preloading and surcharge techniques to reduce post-construction settlement.}488\end{figure}489490\section{Results Summary}491492The computational analysis yields the following key engineering parameters:493494\begin{pycode}495results = [496['Ultimate bearing capacity (B=2m)', f'{qu_2m:.0f} kPa'],497['Allowable bearing capacity (FS=3)', f'{qa_2m:.0f} kPa'],498['Ultimate consolidation settlement', f'{Sc*1000:.1f} mm'],499['Time for 50\\% consolidation', f'{t50:.2f} years'],500['Time for 90\\% consolidation', f'{t90:.1f} years'],501['Bearing capacity factor $N_c$', f'{Nc:.2f}'],502['Bearing capacity factor $N_q$', f'{Nq:.2f}'],503['Bearing capacity factor $N_\\gamma$', f'{Ngamma:.2f}'],504['Slope FS (30°, dry)', f'{FS_eval_dry[1]:.2f}'],505['Slope FS (30°, saturated)', f'{FS_eval_sat[1]:.2f}'],506]507508print(r'\begin{table}[H]')509print(r'\centering')510print(r'\caption{Summary of Computed Geotechnical Parameters}')511print(r'\begin{tabular}{@{}lc@{}}')512print(r'\toprule')513print(r'Parameter & Value \\')514print(r'\midrule')515for row in results:516print(f"{row[0]} & {row[1]} \\\\")517print(r'\bottomrule')518print(r'\end{tabular}')519print(r'\end{table}')520\end{pycode}521522\section{Conclusions}523524This comprehensive analysis demonstrates computational methods for five fundamental aspects of soil mechanics. Effective stress analysis reveals that pore water pressure significantly reduces effective stress below the water table, at 20 m depth reducing effective stress by \py{f"{u_eval[3]/sigma_t_eval[3]*100:.1f}"}\% compared to total stress. Mohr-Coulomb failure analysis shows shear strength is controlled by both cohesion ($c = \py{c}$ kPa) and friction angle ($\phi = \py{phi}°$), with clean sands relying entirely on friction while clays exhibit significant cohesion.525526Bearing capacity calculations using Terzaghi's theory yield ultimate capacity $q_u = \py{f"{qu_2m:.0f}"}$ kPa for a 2 m wide footing, giving allowable capacity $q_a = \py{f"{qa_2m:.0f}"}$ kPa with factor of safety FS = \py{f"{FS:.1f}"}. Parametric studies show bearing capacity increases exponentially with friction angle, emphasizing the importance of accurate shear strength characterization.527528One-dimensional consolidation analysis predicts ultimate settlement of \py{f"{Sc*1000:.1f}"} mm under 100 kPa surcharge, with 90\% consolidation requiring \py{f"{t90:.1f}"} years. This time-dependent behavior governs staged construction schedules and surcharge design. Slope stability analysis demonstrates the critical importance of groundwater, with saturation reducing factor of safety from \py{f"{FS_eval_dry[1]:.2f}"} to \py{f"{FS_eval_sat[1]:.2f}"} for a 30° slope, explaining the prevalence of slope failures during heavy rainfall.529530Compressibility analysis shows that overconsolidation ratio dramatically affects settlement, with OCR = 8 reducing settlement by \py{f"{(1 - settlements[3]/settlements[0])*100:.0f}"}\% compared to normally consolidated soil. This stress history effect is exploited in ground improvement through preloading. The integrated computational framework presented here provides quantitative design tools for foundation engineering, earthwork stability, and settlement prediction, forming the basis for safe and economical geotechnical design.531532\bibliographystyle{plain}533\begin{thebibliography}{99}534535\bibitem{terzaghi1943}536K. Terzaghi, \textit{Theoretical Soil Mechanics}, John Wiley \& Sons, New York, 1943.537538\bibitem{lambe1969}539T. W. Lambe and R. V. Whitman, \textit{Soil Mechanics}, John Wiley \& Sons, New York, 1969.540541\bibitem{meyerhof1963}542G. G. Meyerhof, "Some Recent Research on the Bearing Capacity of Foundations," \textit{Canadian Geotechnical Journal}, vol. 1, no. 1, pp. 16--26, 1963.543544\bibitem{taylor1948}545D. W. Taylor, \textit{Fundamentals of Soil Mechanics}, John Wiley \& Sons, New York, 1948.546547\bibitem{bishop1955}548A. W. Bishop, "The Use of the Slip Circle in the Stability Analysis of Slopes," \textit{Géotechnique}, vol. 5, no. 1, pp. 7--17, 1955.549550\bibitem{skempton1957}551A. W. Skempton, "Discussion: The Planning and Design of New Hong Kong Airport," \textit{Proceedings of the Institution of Civil Engineers}, vol. 7, pp. 305--307, 1957.552553\bibitem{casagrande1936}554A. Casagrande, "The Determination of the Pre-consolidation Load and Its Practical Significance," \textit{Proceedings of the 1st International Conference on Soil Mechanics and Foundation Engineering}, vol. 3, pp. 60--64, 1936.555556\bibitem{bjerrum1967}557L. Bjerrum, "Engineering Geology of Norwegian Normally-Consolidated Marine Clays," \textit{Géotechnique}, vol. 17, no. 2, pp. 81--118, 1967.558559\bibitem{das2010}560B. M. Das, \textit{Principles of Geotechnical Engineering}, 7th ed., Cengage Learning, 2010.561562\bibitem{vesic1973}563A. S. Vesic, "Analysis of Ultimate Loads of Shallow Foundations," \textit{Journal of the Soil Mechanics and Foundations Division}, ASCE, vol. 99, no. SM1, pp. 45--73, 1973.564565\bibitem{janbu1973}566N. Janbu, "Slope Stability Computations," in \textit{Embankment Dam Engineering: Casagrande Volume}, R. C. Hirschfeld and S. J. Poulos, Eds., John Wiley \& Sons, 1973, pp. 47--86.567568\bibitem{holtz1981}569R. D. Holtz and W. D. Kovacs, \textit{An Introduction to Geotechnical Engineering}, Prentice-Hall, 1981.570571\bibitem{craig2004}572R. F. Craig, \textit{Craig's Soil Mechanics}, 7th ed., Spon Press, 2004.573574\bibitem{duncan1970}575J. M. Duncan and C.-Y. Chang, "Nonlinear Analysis of Stress and Strain in Soils," \textit{Journal of the Soil Mechanics and Foundations Division}, ASCE, vol. 96, no. SM5, pp. 1629--1653, 1970.576577\bibitem{schofield1968}578A. N. Schofield and C. P. Wroth, \textit{Critical State Soil Mechanics}, McGraw-Hill, London, 1968.579580\bibitem{roscoe1968}581K. H. Roscoe and J. B. Burland, "On the Generalized Stress-Strain Behaviour of 'Wet' Clay," in \textit{Engineering Plasticity}, J. Heyman and F. A. Leckie, Eds., Cambridge University Press, 1968, pp. 535--609.582583\bibitem{bowles1996}584J. E. Bowles, \textit{Foundation Analysis and Design}, 5th ed., McGraw-Hill, 1996.585586\bibitem{peck1974}587R. B. Peck, W. E. Hanson, and T. H. Thornburn, \textit{Foundation Engineering}, 2nd ed., John Wiley \& Sons, 1974.588589\bibitem{morgenstern1965}590N. R. Morgenstern and V. E. Price, "The Analysis of the Stability of General Slip Surfaces," \textit{Géotechnique}, vol. 15, no. 1, pp. 79--93, 1965.591592\bibitem{wroth1984}593C. P. Wroth, "The Interpretation of In Situ Soil Tests," \textit{Géotechnique}, vol. 34, no. 4, pp. 449--489, 1984.594595\end{thebibliography}596597\end{document}598599600