Lab (Behind the Scenes)
How The Engine Runs
1) Age interpolation
Functions:
buildAgeCurve, piecewiseLinearInterpolation, naturalCubicSplineInterpolation2) Build constrained allocation
Functions:
buildTargetWeights, applyBounds, computeAllocation3) Root-correct rounded totals
Functions:
correctBudgetAfterRounding, solveBisection, solveNewton4) Diagnose numerical behavior
Functions:
runLabSolvers, perturbAgeSensitivity, l2Norm, linfNormAlgorithm To Function To Output
Numerical accuracy & stability
perturbAgeSensitivity, l2Norm, linfNorm to sensitivity and residual size shown below.Linear algebra (Ax=b)
buildLabSystem, matVecMul, subVec to matrix/vector and residual metrics.Linear solvers
gaussianEliminationPartialPivoting, jacobiSolver, gaussSeidelSolver to comparison and convergence chart.Interpolation for age model
buildAgeCurve (spline/linear) to age-weight curve visual.Root finding for budget correction
correctBudgetAfterRounding (Newton/Bisection safeguards) to budget match status and delta.Live Solver Summary
gaussian
Converged: true
Iterations: 1
||r||2: 0.000e+0
||r||inf: 0.000e+0
jacobi
Converged: false
Iterations: 200
||r||2: 4.977e+64
||r||inf: 4.977e+64
Jacobi did not converge within max iterations.
gaussSeidel
Converged: false
Iterations: 200
||r||2: 2.948e+126
||r||inf: 2.354e+126
Gauss-Seidel did not converge within max iterations.
Show Ax = b
A =
[1.000, 0.000, -1.789]
[0.000, 1.000, -2.372]
[1.000, 1.000, 1.000]
b = [0.000, 0.000, 600.000]
Diagonal dominance: No
Convergence (Iterative Solvers)
Age Interpolation (Live)
Model: spline
Budget Correction (Live)
Method: newton
alpha: 0.992188
Total rounded: $600.00
Budget: $600.00
Difference: $0.00
Status: Exact match
Sensitivity Test (+1 Year Age)
Delta(Aiden) = 0.00
Delta(Mia) = 0.00
Delta(Uncle Chen) = 0.00
Max absolute change: 0.00
Relative residual proxy ||r||/||b||: 0.000e+0
Amplification proxy: 0.000
Floating-point effects: values are double precision approximations.
