Processed online by Toolvito
Numerical Methods Calculator
Run a numerical method step by step: find a root with Newton–Raphson, bisection, the secant method, false position or fixed-point iteration; integrate with the trapezoidal rule, Simpson’s rules, the midpoint rule, Riemann sums or Romberg; solve A·x = b by Jacobi, Gauss–Seidel or SOR; or approximate a derivative by finite differences. Every iteration is in the table and every answer is compared with an independent reference.
How to use it
- Choose the task: Root finding, Numerical integration, Linear system (iterative) or Finite differences.
- Type the function, such as x^3 - x - 2 or e^(-x^2), and the numbers the method needs: an interval a, b where f changes sign (bisection, false position), a start x₀ (Newton, fixed point), two starts a and b (secant), the limits and the number of intervals n (integration), or the matrix A and the right side b.
- Choose the method, the tolerance and the largest number of steps.
- Select Run. Read the answer, the iteration table, why the method stopped and the checks.
Methods
- Bisection halves the interval and keeps the half where f changes sign; it always converges, one binary digit per step. False position (regula falsi) uses the secant through the ends instead of the midpoint.
- Newton–Raphson: xₙ₊₁ = xₙ − f(xₙ)/f′(xₙ), with f′ found exactly; fast near a simple root, but it can fail when f′ is 0 or the start is far away. Secant: the same idea with a difference quotient from the last two points.
- Fixed-point iteration xₙ₊₁ = g(xₙ): type g, for example cos(x) to solve x = cos x; it converges when |g′| < 1 near the root. The page says when a method does not converge.
- Integration: trapezoidal rule (error like h²), Simpson’s 1/3 rule (n even, error like h⁴) and 3/8 rule, the midpoint rule, left and right Riemann sums, Romberg integration (Richardson extrapolation of the trapezoidal rule) and n-point Gauss–Legendre quadrature, with the table of points and weights and the textbook error bound.
- Jacobi, Gauss–Seidel and SOR for A·x = b up to 10 × 10, with diagonal dominance and the spectral radius of the iteration matrix (below 1 means convergence).
- Finite differences: forward, backward and central differences for f′ and f″, with the error as h is halved (the order of the method shows in the ratios).
Checks
- Roots are checked by f at the answer and by SciPy’s Brent method; integrals against a 30-digit mpmath reference (and the exact value when SymPy finds one), with the actual error; iterative solutions against NumPy’s direct solver; differences against the exact derivative.
- Floating-point arithmetic has about 16 significant digits; a tolerance below about 10⁻¹⁴ cannot be reached for most functions. Exact algebraic roots of polynomials are in the Equation & Inequality Solver; Gauss–Jordan elimination and LU decompositions in the Matrix Calculator; Euler and Runge–Kutta for differential equations in the Differential Equation Solver.