math4u 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
math4u-0.1.0/LICENSE ADDED
File without changes
math4u-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: math4u
3
+ Version: 0.1.0
4
+ Summary: A mathematics package for calculus and linear algebra
5
+ Requires-Python: >=3.8
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Dynamic: license-file
math4u-0.1.0/README.md ADDED
File without changes
@@ -0,0 +1,13 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "math4u"
7
+ version = "0.1.0"
8
+ description = "A mathematics package for calculus and linear algebra"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+
12
+ [tool.setuptools.packages.find]
13
+ where = ["src"]
math4u-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: math4u
3
+ Version: 0.1.0
4
+ Summary: A mathematics package for calculus and linear algebra
5
+ Requires-Python: >=3.8
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Dynamic: license-file
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/math4u.egg-info/PKG-INFO
5
+ src/math4u.egg-info/SOURCES.txt
6
+ src/math4u.egg-info/dependency_links.txt
7
+ src/math4u.egg-info/top_level.txt
8
+ src/math4u_package/__init__.py
9
+ src/math4u_package/calculus.py
10
+ src/math4u_package/linear_algebra.py
@@ -0,0 +1 @@
1
+ math4u_package
File without changes
@@ -0,0 +1,36 @@
1
+ import sympy as sp
2
+
3
+
4
+ def _parse(expr, variable="x"):
5
+ x = sp.Symbol(variable)
6
+ return x, sp.sympify(expr)
7
+
8
+
9
+ def derivative(expr, variable="x"):
10
+ x, f = _parse(expr, variable)
11
+ return sp.diff(f, x)
12
+
13
+
14
+ def second_derivative(expr, variable="x"):
15
+ x, f = _parse(expr, variable)
16
+ return sp.diff(f, x, 2)
17
+
18
+
19
+ def integrate(expr, variable="x"):
20
+ x, f = _parse(expr, variable)
21
+ return sp.integrate(f, x)
22
+
23
+
24
+ def definite_integral(expr, lower, upper, variable="x"):
25
+ x, f = _parse(expr, variable)
26
+ return sp.integrate(f, (x, lower, upper))
27
+
28
+
29
+ def limit(expr, variable="x", point=0):
30
+ x, f = _parse(expr, variable)
31
+ return sp.limit(f, x, point)
32
+
33
+
34
+ def taylor_series(expr, variable="x", point=0, order=5):
35
+ x, f = _parse(expr, variable)
36
+ return sp.series(f, x, point, order).removeO()
@@ -0,0 +1,24 @@
1
+ import sympy as sp
2
+
3
+ def _matrix(matrix):
4
+ return sp.Matrix(matrix)
5
+
6
+ def matrix_add(A, B):
7
+ return _matrix(A) + _matrix(B)
8
+
9
+ def matrix_multiply(A, B):
10
+ return _matrix(A) * _matrix(B)
11
+
12
+ def determinant(A):
13
+ return _matrix(A).det()
14
+
15
+ def inverse_matrix(A):
16
+ return _matrix(A).inv()
17
+
18
+ def transpose(A):
19
+ return _matrix(A).T
20
+
21
+ def solve_linear_system(A, b):
22
+ A = _matrix(A)
23
+ b = sp.Matrix(b)
24
+ return list(sp.linsolve((A, b)))[0]