Skip to main content

numforge 🧬

NumPy + engineering numerical methods cheatcode pack.

numforge (built as numpyy internally) is a lightweight Python library designed for engineering students. It wraps NumPy and adds essential numerical methods, formulas, and code snippets taught in introductory numerical analysis courses.

Installation

pip install numforge

Import Style

import numpyy as np

Why numforge?

Feature NumPy numforge
Numerical methods ❌ ✅
Formula database ❌ ✅
Exam snippets ❌ ✅
Educational explanations ❌ ✅
Step-by-step tables ❌ ✅
Exam-ready representations ❌ ✅
Lab Assistant Mode ❌ ✅
TP Report Generation ❌ ✅

🧪 Lab Assistant Mode

Need a quick workflow for your lab or project? Use solve_tp:

import numpyy as np
np.solve_tp("interpolation")

Want to generate a professional Markdown report for your results?

findings = [
    {'method': 'Simpson', 'result': 0.3333, 'error': 1e-7},
    {'method': 'Trapezoidal', 'result': 0.3437, 'error': 0.01}
]
np.tp_report("Integration Lab", "Student Name", findings)

🎓 Educational Features

Educational Mode

See intermediate steps, formulas, and error warnings:

np.set_mode("educational") # Global
np.simpson(f, 0, 1, educational=True) # Per call

Help & Summary

np.explain("simpson") # Instant revision guide
np.exam_formula_sheet() # Compact printable revision page 😭

🛠 Modules & Functions

1. Floating Point & Errors (np.floating)

  • np.float_repr(x) - Exam Clutch: Sign, Exponent, Mantissa representation
  • np.ieee754_encode(x) / np.ieee754_decode(bits) - IEEE754 components
  • np.cancellation_demo() / np.absorption_demo() - Precision loss demos
  • Constants: np.EPSILON, np.FLOAT32_EPSILON, np.FLOAT64_EPSILON

2. Interpolation (np.interpolation)

  • np.lagrange(x_pts, y_pts) / np.newton_interpolation(x_pts, y_pts)
  • np.newton_polynomial(x_pts, coeffs) - Newton form evaluation
  • np.divided_differences(x, y) - Newton coefficients
  • np.chebyshev_nodes(a, b, n) - Optimal nodes
  • np.vandermonde_matrix(x) - Construct Vandermonde matrix
  • np.legendre(n) - Legendre coefficients via recurrence

3. Approximation & Stability (np.approximation)

  • np.least_squares(x, y, degree) / np.least_squares_origin(x, y)
  • np.normal_equations(x, y, degree) - Returns $(A^T A, A^T y)$
  • np.condition_number(A) / np.is_ill_conditioned(A) - Stability checks

4. Polynomials (np.polynomials)

  • np.horner(coeffs, x) / np.horner_steps(coeffs, x) - Horner's evaluation
  • np.pretty_polynomial(coeffs) - P(x) = 3x^2 - 2x + 1
  • np.taylor(f, a, n) - Taylor series coefficients

5. Numerical Integration (np.integration)

  • Methods: np.rectangle, np.midpoint, np.trapezoidal, np.simpson
  • Composite: np.composite_trapezoidal, np.composite_simpson, np.composite_midpoint
  • Error Formulas: np.trapezoidal_error, np.simpson_error, etc.
  • Gauss: np.gauss_legendre(f, a, b, n)

6. Numerical Differentiation (np.differentiation)

  • np.forward_diff, np.backward_diff, np.centered_diff
  • np.second_derivative, np.third_derivative, np.nth_derivative
  • np.optimal_h(f, x) / np.taylor_error(...)

7. ODE Solvers (np.ode)

  • np.euler, np.rk4, np.adams_bashforth, np.adams_moulton

📊 Plotting Helpers

np.plot_interpolation(f, poly, x_pts, y_pts, a, b)
np.plot_runge_phenomenon(n_points)
np.plot_convergence(ns, errors)
np.plot_integration(f, a, b, method="simpson")

🚀 Examples

Check demo.py for a complete tour of the library.

Metadata

Release files for numforge 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for numforge 0.6.0
File Size Uploaded
numforge-0.6.0.tar.gz 7.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for numforge 0.6.0
File Interpreter ABI Platform
numforge-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 MB

Release files / numforge-0.6.0.tar.gz

Download URL numforge-0.6.0.tar.gz
Size 7.8 MB
Tags Source
SHA-256 checksum
How to use checksums
902d905411650da2d4b645b01a22401094fd43192f6c5ed1ee9765bdae0b361e
BLAKE2b-256 checksum
How to use checksums
50d170db5bd98f571e143f765fc687bddc5cf3a6f3ce759747ffc8800778f091
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / numforge-0.6.0-py3-none-any.whl

Download URL numforge-0.6.0-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6cfffa7bced371ad1344f9a8c116ef05f2469bd84a78514ba8e9815d7b4983a
BLAKE2b-256 checksum
How to use checksums
a8bd5c5300d161eca45eb19de033b4f3665f667c9dc30f368e49da7ae5dad6c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.95

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page