Mathematics / Finite Difference BVPs
FREE TO EXPLORE
LABORATORY 35 · MATHEMATICS

Finite Difference Methods for Two-Point Boundary Value Problems

Discretize second-order linear two-point boundary value problems using central finite difference stencils, assemble the tridiagonal stiffness-mass system, enforce Dirichlet and Neumann boundary conditions, and verify the second-order O(h²) global error convergence. Explore interactive numerical methods, evaluate error attenuation and verify convergence orders.

COMPUTE · CONVERGE · ANALYSE

Your virtual mathematics laboratory.

MAXIMUM BVP GRID ERROR ||Y - Y_NUM||_∞—
COMPUTATION STATUS

Ready to execute Step = 1.

1 step
Model differential equation: -y''(x) + 4 y(x) = 16 x, on x ∈ [0, 1] with Dirichlet boundary conditions y(0) = 0, y(1) = 4

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.

Numerical assumptions and limits

Finite difference methods are naturally suited for simple rectangular or tensor-product geometries; complex curved boundaries require finite elements or coordinate mappings. The simulation solves the two-point BVP -y'' + 4y = 16x on [0, 1] with Dirichlet boundary conditions across grid spacings h = 0.20 / 2^{k-1}. The maximum nodal error is measured against the exact analytic solution. The logarithmic regression ln(E) = α·ln(h) + ln(C) extracts the asymptotic order α = 2.000 with R² = 1.000000.

Computational tools & numerical modules.

One-Dimensional Domain Discretizer

Partitions [0, 1] into N sub-intervals with uniform grid spacing h = 1/N and interior nodes x_i = i · h.

Central Difference Stencil Generator

Replaces derivatives with second-order central difference operators: y' ≈ (y_{i+1} - y_{i-1})/(2h), y'' ≈ (y_{i+1} - 2y_i + y_{i-1})/h².

Tridiagonal Matrix Assembler

Constructs the sparse banded coefficient matrix A and load vector b incorporating Dirichlet boundary data.

Thomas Algorithm Solver

Solves the symmetric strictly diagonally dominant tridiagonal BVP system in O(N) operations without pivoting.

Analytic Reference Evaluator

Computes exact closed-form solution y(x) = 4x + (sinh(2x) / sinh(2)) · (4 - 4) ... to measure exact nodal errors.

Log-Log Error Convergence Engine

Performs linear regression on (ln(h), ln(E_max)) to verify the theoretical second-order slope α = 2.000.

FOLLOW THE METHOD

A reason behind every step.

Discretize second-order linear two-point boundary value problems using central finite difference stencils, assemble the tridiagonal stiffness-mass system, enforce Dirichlet and Neumann boundary conditions, and verify the second-order O(h²) global error convergence. Standardized input settings: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 step.

01

Define Boundary Value Problem

Set up -y'' + 4y = 16x on [0, 1] with boundary conditions y(0) = 0 and y(1) = 4, verifying the analytic solution y(x) = 4x.

02

Configure Mesh Discretization Schedule

For refinement levels k = 1 to 6, set grid intervals N = 5 · 2^{k-1} with spacing h = 1.0 / N.

03

Assemble Discrete Tridiagonal System

Set interior matrix rows: -y_{i-1}/h² + (2/h² + 4) y_i - y_{i+1}/h² = 16 x_i for i = 1, ..., N-1.

04

Enforce Boundary Conditions

Substitute known boundary values y_0 = 0 and y_N = 4 into the first and last equations, transferring knowns to vector b.

05

Solve via Thomas Algorithm & Measure Error

Execute TDMA forward sweep and back substitution to obtain nodal vector y, computing maximum error E_max = ||y - y_exact||_∞.

06

Fit Asymptotic Order of Convergence

Plot ln(E_max) versus ln(h) and compute the linear regression slope to verify α = 2.000 with R² = 1.000000.

YOUR NOTEBOOK · 0 OBSERVATIONS

Turn measurements into mathematical insight.

See a complete example report ↗

Points are your recorded observations. The solid regression line validates Finite Difference BVPs mathematical scaling.

LINEAR ASYMPTOTIC FIT · y = mx + b
ln(E_max) = α · ln(h) + ln(C)
#Grid Refinement Level (k) (step)Maximum BVP Grid Error ||y - y_num||_∞ (error norm)Logarithmic Mesh Spacing ln(h)Logarithmic Maximum Error ln(E_max)Remove

No readings yet. Execute a computation and record it.

Calculate it yourself.

CHECK YOUR UNDERSTANDING

Explain what the mathematical metrics mean.

What is the global truncation error order α of the standard central finite difference method for second-order BVPs?

What matrix structure arises from central difference discretization of a 1D second-order differential equation?

What technique preserves second-order O(h²) accuracy when discretizing Neumann boundary conditions?

Which linear system algorithm solves an N × N tridiagonal BVP system in optimal O(N) operations?