Trainers
Calculations and language exercises. Choose a topic and open a trainer.
Equation roots
2Bisection
Finds a root of f(x)=0. Requires continuity and opposite signs at the endpoints. Stops when half the bracket width ≤ ε; discontinuities can produce a false root bracket.
OpenNewton’s method
Uses xₖ₊₁ = xₖ − f(xₖ)/f′(xₖ). Supply the derivative and initial guess. Checks |f(x)| ≤ ε: a residual, not a guaranteed argument error. Convergence depends on the starting point.
OpenMatrices and eigenvalues
7Linear system: Gaussian elimination
Solves Ax=b. Enter a square matrix A and right-hand side vector b. Uses partial pivoting. The residual is max |Ax−b|.
OpenRectangular matrix norms
The 1-norm is the largest absolute column sum; the infinity norm uses rows; Frobenius is the square root of the sum of squares.
OpenMatrix norms and conditioning
For a nonsingular square matrix, computes the ∞ norm (row sum), 1 norm (column sum), Frobenius norm and κ∞(A)=‖A‖∞·‖A⁻¹‖∞. Some textbooks use different numbering.
OpenDeterminant and trace
Square matrices up to 12×12. Trace is the diagonal sum. The determinant uses elimination with pivoting.
OpenGershgorin discs
The diagonal entry is the centre. The radius sums other absolute entries in the row or column. Intervals are projections onto the real axis.
OpenShifted inverse iteration
Each step solves (A − σI)y = x, then normalises y using the Euclidean norm. Set the shift, initial vector and number of steps.
Open3×3 matrix spectrum
Characteristic polynomial det(λI − A), eigenvalues and the first row of its companion matrix. Complex roots show both components.
OpenInterpolation
3Lagrange interpolation
Evaluates the polynomial through distinct nodes xᵢ and values yᵢ: P(x)=Σ yᵢLᵢ(x). Up to 12 nodes. This interpolates rather than smooths noisy data.
OpenThree-node Newton polynomials
Linear polynomial through the first two nodes and quadratic through all three. Nodes must be distinct.
OpenNewton polynomial for a sum
Builds S(k) = Σ f(i), i = 1…k, at k = 1…n. Coefficients use the basis 1, (x−1), (x−1)(x−2), …
OpenNumerical integration
3Integration: midpoint rule
Computes ∫ₐᵇ f(x)dx using subinterval midpoints. Compares n and 2n grids; method order is 2.
OpenIntegration: trapezoidal rule
Computes ∫ₐᵇ f(x)dx using piecewise linear segments. Compares n and 2n grids; method order is 2.
OpenIntegration: Simpson’s rule
Computes ∫ₐᵇ f(x)dx using quadratic interpolation. The subdivision count n must be even. Compares n and 2n grids; order is 4.
OpenDifferential equations
4ODE: Euler’s method
Solves one ordinary differential equation (ODE), y′=f(x,y), y(a)=y₀. Step h=(b−a)/n; yₖ₊₁=yₖ+h·f(xₖ,yₖ). First-order accuracy.
OpenSecond-order Runge–Kutta
Initial-value problem y′ = f(x,y). Choose Heun, midpoint or Ralston. Exact solution is optional.
OpenODE: Runge–Kutta 4
Solves one ODE y′=f(x,y), y(a)=y₀. Four slope evaluations per step h=(b−a)/n. Fourth-order accuracy for sufficiently smooth problems.
OpenTwo-equation ODE system
y₁′ = f₁(x,y₁,y₂), y₂′ = f₂(x,y₁,y₂). ODE means ordinary differential equation. The step count defines a uniform grid.
OpenOptimization
4Golden-section search
Minimizes a unimodal function on [a,b]: decreasing before the minimum and increasing after it. The bracket shrinks by (√5−1)/2. Stops at half-width ≤ ε.
OpenSteepest descent
Minimizes f(x)=½xᵀAx−cᵀx. The vector is c. A must be symmetric positive definite. Direction −∇f with an exact line-search step. Stops at ‖∇f‖₂ ≤ ε.
OpenConjugate gradients
Minimizes f(x)=½xᵀAx−cᵀx for symmetric positive definite A. The vector is c. Uses the Fletcher–Reeves coefficient, exact quadratic line search and a restart every n iterations.
OpenLinear programming
Maximizes cᵀx subject to Ax≤b and x≥0. The vector is c. All b≥0, so x=0 is initially feasible. Uses simplex with Bland’s rule. Equalities, ≥ constraints and negative b are not supported by this solver.
OpenNumerical errors
14Bisection step bound
n = max(0, ⌈log₂((b−a)/(2ε))⌉). Counts interval halvings needed to bound the midpoint error.
OpenFixed-point step bound
n = max(0, ⌈ln(ε(1−q)/(b−a))/ln(q)⌉), where 0 < q < 1 is a proven contraction bound throughout the interval.
OpenEnumeration step count
n = ⌈(b−a)/h⌉, h = multiplier × ε. A grid including both endpoints has n+1 nodes.
OpenRound to significant digits
Significant digits start at the first nonzero digit. For example, 0.0047287 to three digits is 0.00473.
OpenRound to decimal places
Set the number of decimal places. The answer string preserves trailing zeros, such as 10.0.
OpenError of a difference
Δ(x₁−x₂) ≤ Δx₁ + Δx₂; the relative bound divides this sum by |x₁−x₂|.
OpenCompare relative accuracy
Compares Δx/|x| for two nonzero approximations. Lower relative error means higher accuracy.
OpenSphere volume error
V = 4πR³/3. The linearised estimate includes errors in the radius and the approximation of π.
OpenFunction conditioning
Relative condition number κ = |xf′(x)/f(x)|. At special points, a finite limit is shown where available.
OpenQuadratic coefficient precision
For ay²+by+c=0, estimates the allowed error in c for the requested correct digits in both real roots. a and b are treated as exact.
OpenError from the last decimal place
Shows two conventions: half a unit in the last place for rounding, and one whole unit for the wide convention.
OpenPower error
For y = xᵖ and x > 0: Δy ≈ |p xᵖ⁻¹|Δx, relative error ≈ |p|Δx/x.
OpenRequired correct digits
Finds a digit count so that one unit in the last place is strictly below |x| × tolerance. Uses the wide convention.
OpenLast-place validity
Compares absolute error with one unit in the last place and half that unit. 1 means correct; 0 means not guaranteed.
Open