Mathematics / LU Decomposition
FREE TO EXPLORE
LABORATORY 12 · MATHEMATICS

LU Triangular Matrix Factorization and Forward-Backward Substitution

Factorize square non-singular matrices A into unit lower-triangular matrix L and upper-triangular matrix U (PA = LU) using Doolittle and Crout algorithms, solve multiple right-hand-side vectors in O(n²) time via forward and back substitution, and extract the asymptotic factorization constant C = 2/3 ≈ 0.667 via linear regression. Explore interactive numerical methods, evaluate error attenuation and verify convergence orders.

COMPUTE · CONVERGE · ANALYSE

Your virtual mathematics laboratory.

LU FACTORIZATION OPERATIONS—
COMPUTATION STATUS

Ready to execute n = 20.0.

20.0 rows
Factorization Algorithm: Doolittle PA = LU with unit diagonal on L (l_{ii} = 1.0).

Adjust n, 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

Dense LU factorization requires (2/3)n³ operations and O(n²) memory, becoming impractical for massive systems without sparsity. The numerical simulation model executes in-place Doolittle LU factorization across dense systems from n = [10, 20, 30, 40, 50, 60]. Normalized cubic coordinate: x = n³/1000 = [1.00, 8.00, 27.00, 64.00, 125.00, 216.00]. Theoretical factorization operations: FLOPs(n) = (2/3)n³ = [0.667, 5.333, 18.000, 42.667, 83.333, 144.000] kFLOPs. Ordinary least-squares linear regression on these coordinates produces an empirical slope C = 0.66667 and Y-intercept b = 0.000 with coefficient of determination R² = 1.000000. The empirical factorization multiplier C = 0.667 matches the theoretical benchmark C = 2/3 = 0.66667 within 0.0000% deviation.

Computational tools & numerical modules.

Compact In-Place LU Factorization Unit

Overwrites matrix A with L (strictly lower) and U (upper triangular) to eliminate auxiliary memory allocation.

Permutation Vector Register P

Maintains integer pivot indices P = [p₁, p₂, ..., p_n] to apply row swaps to subsequent right-hand side vectors.

Dual-Phase Triangular Solver

Executes forward substitution Ly = Pb followed by backward substitution Ux = y in 2n² FLOPs.

Factorization FLOP Accumulator

Tracks the (2/3)n³ operations required to compute outer products and Schur complements.

Interactive LU Heatmap Canvas

Displays L and U triangular factors with color-coded entry magnitudes and sparsity patterns.

Matrix Determinant Extractor

Computes det(A) = det(P) · ∏_{i=1}^n u_{ii} directly from the diagonal of U in O(n) time.

FOLLOW THE METHOD

A reason behind every step.

Factorize square non-singular matrices A into unit lower-triangular matrix L and upper-triangular matrix U (PA = LU) using Doolittle and Crout algorithms, solve multiple right-hand-side vectors in O(n²) time via forward and back substitution, and extract the asymptotic factorization constant C = 2/3 ≈ 0.667 via linear regression. Standardized input settings: 10.0, 20.0, 30.0, 40.0, 50.0, 60.0 rows.

01

System Dimension Initialization

Select matrix dimension n ∈ {10, 20, 30, 40, 50, 60}. Initialize n×n dense matrix A and permutation vector P = [1, 2, ..., n].

02

Pivot Selection and Row Exchange

At stage k, locate pivot row p maximizing |a_{p,k}| for p ≥ k. Swap row k and row p in both A and P.

03

Doolittle Factorization Recurrence

For i = k+1 to n, compute multiplier l_{i,k} = a_{i,k} / a_{k,k} and store it directly in a_{i,k}. For j = k+1 to n, update u_{i,j} = a_{i,j} ← a_{i,j} − l_{i,k} · a_{k,j}.

04

Repeat Across All Columns

Continue the recurrence for k = 1 to n − 1. Upon completion, the upper triangle contains U and the strictly lower triangle contains L.

05

Dual-Phase Substitution for Solutions

Given vector b, permute Pb. Solve Ly = Pb via forward substitution in n² operations. Solve Ux = y via back substitution in n² operations.

06

Linear Regression and Scaling Extraction

Plot factorization operations against normalized cubic coordinate n³/1000. Perform least-squares regression to extract empirical slope C = 0.667, confirming (2/3)n³ factorization complexity.

YOUR NOTEBOOK · 0 OBSERVATIONS

Turn measurements into mathematical insight.

See a complete example report ↗

Points are your recorded observations. The solid regression line validates LU Decomposition mathematical scaling.

LINEAR ASYMPTOTIC FIT · y = mx + b
\text{FLOPs}(n) = C \cdot \frac{n^3}{1000} \implies C = \frac{2}{3} \approx 0.667
#Matrix Dimension n (rows)LU Factorization Operations (kFLOPs)Normalized Dimension Cubic n³/1000Factorization Operations (kFLOPs)Remove

No readings yet. Execute a computation and record it.

Calculate it yourself.

CHECK YOUR UNDERSTANDING

Explain what the mathematical metrics mean.

In Doolittle LU factorization, what are the diagonal entries of the L matrix?

Once A is factored into PA = LU, how many operations are required to solve Ax = b for a new vector b?

How is det(A) computed from the LU decomposition PA = LU?

What is the primary operational advantage of LU decomposition over repeating Gaussian elimination for 50 right-hand sides?