Skip to main content

Librería para resolver sistemas de ecuaciones lineales y no lineales. Corto CAD135

Project description

GG14054UNO

Una librería Python para resolver sistemas de ecuaciones lineales y no lineales. Corto #1 de la materias CAD135.

Instalación

pip install GG14054UNO

Uso

Sistemas lineales

import numpy as np
from GG14054UNO import gauss_elimination, gauss_jordan, cramer, lu_decomposition, jacobi, gauss_seidel

# Definir el sistema de ecuaciones Ax = b
A = np.array([[4, 1, -1], 
              [2, 7, 1], 
              [1, -3, 12]])
b = np.array([3, 19, 31])

# Resolver utilizando diferentes métodos
x1 = gauss_elimination(A, b)
x2 = gauss_jordan(A, b)
x3 = cramer(A, b)
x4 = lu_decomposition(A, b)
x5 = jacobi(A, b)
x6 = gauss_seidel(A, b)

print("Solución por eliminación de Gauss:", x1)
print("Solución por Gauss-Jordan:", x2)
print("Solución por regla de Cramer:", x3)
print("Solución por descomposición LU:", x4)
print("Solución por método de Jacobi:", x5)
print("Solución por método de Gauss-Seidel:", x6)

Sistemas no lineales

from GG14054UNO import bisection

# Resolver una ecuación no lineal f(x) = 0
f = lambda x: x**2 - 4  # Ecuación x^2 - 4 = 0 (raíces en x = -2 y x = 2)

# Usar bisección para encontrar la raíz en el intervalo [1, 3]
root = bisection(f, 1, 3)
print("Raíz encontrada:", root)  # Debería ser aproximadamente 2

Métodos Implementados

  1. Eliminación de Gauss - Resuelve sistemas lineales mediante eliminación hacia adelante y sustitución hacia atrás.
  2. Gauss-Jordan - Resuelve sistemas lineales reduciendo la matriz a su forma escalonada reducida.
  3. Regla de Cramer - Utiliza determinantes para resolver sistemas lineales.
  4. Descomposición LU - Factoriza la matriz en matrices triangulares inferior y superior.
  5. Método de Jacobi - Método iterativo para sistemas lineales.
  6. Método de Gauss-Seidel - Método iterativo con convergencia más rápida que Jacobi.
  7. Método de Bisección - Encuentra raíces de ecuaciones no lineales.

Requisitos

  • NumPy
  • SciPy
pip install numpy scipy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gg14054uno-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gg14054uno-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file gg14054uno-0.1.0.tar.gz.

File metadata

  • Download URL: gg14054uno-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for gg14054uno-0.1.0.tar.gz
Algorithm Hash digest
SHA256 06205387ca127b5f774221e19d3cb18456c76b53501f54d47bd26c0ee7520334
MD5 ac9acee2ab7c3a505d0721219d10399f
BLAKE2b-256 83a4538fb833d4b5666efc678a79f4bceded2769808089a5b3302a9bdd15a0f8

See more details on using hashes here.

File details

Details for the file gg14054uno-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gg14054uno-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for gg14054uno-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a33dd168f67490eedf10846249d29a1bc16b3161b658972258c43fb97cc473a7
MD5 4842ff36fa2d0b173a24fa5be0fb4033
BLAKE2b-256 390ce4fedea487bfd4d79e2dec3afc90d8b28f82fc97253261af9292ecad60a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page