My own experimental implementations of numerical methods as homework.
Use documentation to see how to use, and check test.py for real examples.
- Usage
- Documentation
- Resources
- Testing Package
- Uploading to PyPI
python >= 3.8 is required
import numerica as n
from numerica import f // function definition
from numerica import m // matrix definition
f('expression')
fx = f('3x^2 + 2x + 3')
fx(2)
m(
a11, a12, a13;
a21, a22, a23;
a31, a32, a33
)
matrix = m('1,2,3; 4,5,6; 7,8,9');
n.nl_graph(fx, dx, epsilon, x)
n.nl_bisection(fx, epsilon, a, b)
n.nl_regulafalsi(fx, epsilon, a, b)
n.nl_fixedpoint(hx, epsilon, x)
n.nl_newtonraphson(fx, epsilon, x)
n.nl_secant(fx, epsilon, x0, x1)
m(
a11, a12, a13;
a21, a22, a23;
a31, a32, a33
)
n.m_id(n)
(m, n) = n.m_size(A)
n.m_transpose(A)
n.mi_gaussjordan(A)
n.m_rowconcat(A, B)
n.m_colconcat(A, B)
n.m_rowmap(A, i, iteratee)
n.m_cellmap(A, iteratee)
n.is_matrix(A)
n.m_rowslice(A, start, stop, step)
n.ls_gauss(A, C)
n.ls_jacobi(A, C, X, epsilon=0.001)
n.ls_gaussseidel(A, C, X, epsilon=0.001)
n.itg_trapezoidal(fx, x0, xn, n)
n.itg_simpson(fx, x0, xn, n)
n.diff_backward(fx, x)
n.diff_forward(fx, x)
n.diff_midpoint(fx, x)
n.fd_degree(pair_tuples)
n.fd_degree([(x0,y0), (x1,y1), (x2,y3), ...])
n.itp_lagrange(pair_tuples)
n.itp_lagrange([(x0,y0), (x1,y1), (x2,y3), ...], x)
n.reg_leastsquares(pair_tuples, degree) // returns polynomial
n.reg_leastsquares_solve(pair_tuples, x, degree) // solves polynomial
n.reg_leastsquares_solve([(x0,y0), (x1,y1), (x2,y3), ...], x, deg)
- YTU Numerical Analysis Lecture Notes
- https://mat.iitm.ac.in/home/sryedida/public_html/caimna/index1.html
python3.8 -m numerica
pip3.8 install .
import numerica as n
# ...
python3.8 -i test.py
# ...
python3.8 test.py
pip3.8 install twine
rm -rf build & rm -rf dist & rm -rf numerica.egg-info
python3.8 setup.py sdist bdist_wheel
twine upload dist/*