One-Dimensional Thermal Bar Grid
Discretizes the continuous spatial domain [0, π] into N uniform sub-elements with node spacing Δx = π/N.
Implement the implicit Crank-Nicolson scheme for the one-dimensional unsteady heat conduction PDE ∂u/∂t = α ∂²u/∂x², demonstrate unconditional numerical stability, and verify second-order temporal and spatial convergence O(Δt² + Δx²). Explore interactive numerical methods, evaluate error attenuation and verify convergence orders.
Ready to execute Step = 1.
Adjust Step, then execute computation.
Mathematical operations are computed deterministically using 64-bit IEEE 754 precision. Residuals reflect ordinary least-squares regression across successive observations.
While Crank-Nicolson is A-stable, it is not L-stable: it does not damp stiff high-frequency error components as rapidly as backward Euler or BDF2. The simulation executes the implicit Crank-Nicolson scheme across coupled mesh spacings h = 0.20 / 2^{k-1} on the thermal diffusion PDE ∂u/∂t = ∂²u/∂x². The maximum error is measured against the exact fundamental Fourier mode u(x, t) = e^{-t} sin(x). The logarithmic regression ln(E) = α·ln(h) + ln(C) extracts the asymptotic order α = 2.000 with R² = 1.000000.
Discretizes the continuous spatial domain [0, π] into N uniform sub-elements with node spacing Δx = π/N.
Assembles the tridiagonal system (I - 0.5 r δ_x²) u^{n+1} = (I + 0.5 r δ_x²) u^n where r = Δt / Δx².
Inverts the strictly diagonally dominant implicit matrix at each time step in O(N) operations.
Calculates the Fourier amplification factor G(k) = (1 - 2r sin²(kΔx/2)) / (1 + 2r sin²(kΔx/2)) showing |G| ≤ 1 for all r.
Computes exact decaying solution u(x, t) = e^{-t} sin(x) to evaluate exact spatial and temporal error fields.
Performs linear regression on (ln(h), ln(E_max)) to verify the theoretical second-order slope α = 2.000.
Implement the implicit Crank-Nicolson scheme for the one-dimensional unsteady heat conduction PDE ∂u/∂t = α ∂²u/∂x², demonstrate unconditional numerical stability, and verify second-order temporal and spatial convergence O(Δt² + Δx²). Standardized input settings: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 step.
Set up ∂u/∂t = ∂²u/∂x² on [0, π] with initial condition u(x, 0) = sin(x) and exact solution u(x, t) = e^{-t} sin(x).
For test levels k = 1 to 6, set spatial grid spacing h = Δx = 0.20 / 2^{k-1} and time step Δt proportional to h.
Construct tridiagonal matrices with diagonal 1 + r and off-diagonals -r/2 on the left, and diagonal 1 - r and off-diagonals r/2 on the right.
At each time step t_n → t_{n+1}, multiply current state by right matrix and solve tridiagonal system via the Thomas algorithm.
At final time t = 0.5, compute absolute errors |u(x_i, 0.5) - u_i^N| across all nodes and extract supremum error E_max.
Plot ln(E_max) versus ln(h) and compute the linear regression gradient to verify α = 2.000 with R² = 1.000000.
Points are your recorded observations. The solid regression line validates Crank-Nicolson Heat PDE mathematical scaling.
| # | Grid Spacing Level (k) (step) | Global PDE Solution Error ||u - u_exact||_∞ (error norm) | Logarithmic Mesh Spacing ln(h) | Logarithmic Global Error ln(E_max) | Remove |
|---|
No readings yet. Execute a computation and record it.