NumPy + engineering numerical methods cheatcode pack.
Project description
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 representationnp.ieee754_encode(x)/np.ieee754_decode(bits)- IEEE754 componentsnp.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 evaluationnp.divided_differences(x, y)- Newton coefficientsnp.chebyshev_nodes(a, b, n)- Optimal nodesnp.vandermonde_matrix(x)- Construct Vandermonde matrixnp.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 evaluationnp.pretty_polynomial(coeffs)-P(x) = 3x^2 - 2x + 1np.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_diffnp.second_derivative,np.third_derivative,np.nth_derivativenp.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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file numforge-0.5.7.tar.gz.
File metadata
- Download URL: numforge-0.5.7.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b5f179c5e3e7be4b45a1f33a39d76d5580c6b16c1d1f0bf940dcff8b2a9bad0
|
|
| MD5 |
2d6b6a43b71e2dffedf453d8d543b52b
|
|
| BLAKE2b-256 |
5e7d224ccd6116fa1b7df472b8113a0323d6f519b1925157eb04aa0c1a169c07
|
File details
Details for the file numforge-0.5.7-py3-none-any.whl.
File metadata
- Download URL: numforge-0.5.7-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cdefe1dd2e37dab1a1fb9847630edf87cfa9bb0508be2728643cb184cf58e16
|
|
| MD5 |
523f55220896375e467de070b7ec3170
|
|
| BLAKE2b-256 |
3630288da34a42911e21f488b180da2a4795f7ecc0e5a35c7817c97f57c1a87a
|