Libreria de resolución de sistemas de ecuaciones con algunos métodos matematicos conocidos
Project description
MG23117UNO
Es una libreria para Python que se encarga de resolver sistemas de ecuaciones lineales y encontrar las en funciones las cuales son no lineales. Entonces, los métodos que vamos a encontrar en esta libreria son:
- Eliminación de Gauss (exacta con fracciones)
- Gauss-Jordan (exacta con fracciones)
- Jacobi
- Gauss-Seidel
- Bisección
- Descomposición por Lu
- Crammer
Ejemplos de uso para cada método
Eliminación de Gauss:
from MG23117UNO import gauss_elimination # Corrección de mayúsculas
c = [[2, 6, 1], [1, 2, -1], [5, 7, -4]]
d = [7, -1, 9]
solucion = gauss_elimination(c, d)
if solucion is not None:
print("Solución por Gauss:", solucion)
else:
print("El sistema no tiene solución única.")
Gauss-Jordan
from MG23117UNO import gauss_jordan
coefficients = [[4, 2], [-2, 1]]
ind_terms = [8, -3]
solution = gauss_jordan(coefficients, ind_terms)
print("Solución con Gauss-Jordan:")
print(solution)
Jacobi:
from mg23117uno import jacobi
import numpy as np
A = np.array([[3, -0.1, -0.2],
[0.1, 7, -0.3],
[0.3, -0.2, 10]], dtype=float)
b = np.array([7.85, -19.3, 71.4], dtype=float)
solucion = jacobi(A, b)
print(f"Solución por Jacobi: {solucion}")
Gauss-Seidel
from metodosnumericospy import gauss_seidel
import numpy as np
A = np.array([[4, 1, 2],
[3, 5, 1],
[1, 1, 3]], dtype=float)
b = np.array([4, 7, 3], dtype=float)
solucion = gauss_seidel(A, b)
print(f"Solución por Gauss-Seidel: {solucion}")
Bisección
from metodosnumericospy import biseccion
funcion = lambda x: x**4 + 3*x**3 - 2
raiz, iteraciones = biseccion(funcion, 0, 1)
print(f"Raíz de la función por bisección: {raiz:.6f}, encontrada en {iteraciones} iteraciones.")
Descomposición LU
from MG23117UNO import resolver_lu
A = [[2, 3, 1],
[4, 7, 3],
[6, 18, 5]]
b = [1, 2, 3]
solucion = resolver_lu(A, b)
print("Solución con descomposición LU:", solucion)
Crammer
from MG23117UNO import cramer
A = [[2, -1, 3],
[1, 0, 2],
[3, 1, 4]]
b = [5, 3, 10]
solucion = cramer(A, b)
print("Solución por Cramer:", solucion)
Requisitos previos a usar la libreria
- contar con
numpypreviamente instalado.
¿Cómo instalar la libreria?
la librería se instala desde PyPI usando el siguiente comando:
pip install MG23117UNO
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 mg23117uno-0.1.2.tar.gz.
File metadata
- Download URL: mg23117uno-0.1.2.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07cd91687318013e11acf6de573b76df497651df4f6712fbfae64c3776f08620
|
|
| MD5 |
accaa22347554356588d50594c2b2f8b
|
|
| BLAKE2b-256 |
5cfaaf59af637e64de61f39eb365f1aede45a2ac5176ed9d1cc224554553aa81
|
File details
Details for the file mg23117uno-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mg23117uno-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b814c9de2aa9114b5b546b8e9a8e73052d31a97e127f41bddfc0b6c0aa765f7d
|
|
| MD5 |
f8154290129191df8fb5d74e07574bf9
|
|
| BLAKE2b-256 |
92a0fd61391980db13d6f9fe9f8f3a7c255fab3af2a9dba81f14a5560c3dae40
|