Skip to main content

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

Reason this release was yanked:

FIX error

Project description

BR23021UNO

Autor: [Joyser Leonel Barrera Romero]
Versión: 1.0.0
Descripción: Librería para resolver sistemas de ecuaciones lineales y no lineales utilizando métodos numéricos. Permite resolver ecuaciones usando los siguientes métodos : Eliminación de Gauss, Gauss-Jordan, Regla de Crammer,Descomposición LU, Jacobi, Gauss-Seidel y Bisección.

Instalación

Para instalar la librería, usa el siguiente comando en tu terminal:

pip install BR23021UNO 

Dependencias

Para que la librería funcione correctamente, asegúrate de instalar las siguiente dependencia:

pip install numpy 

Ejemplos de uso

biseccion:

            #import math
            # Definir la función que queremos evaluar
            funcion = lambda x: x**4 + 0.5*(x**3) - 2*x - 5
            #Llamar a la funcion
            raiz, iteraciones = biseccion(funcion,100,0)

            # Mostrar el resultado con 6 cifras significativas
            print(f"Raiz de funcion por biseccion es igual a {raiz:.6f}, encontrada en un total de {iteraciones} iteraciones.")

            #Salida esperada: 
            #Raiz de funcion por biseccion es igual a 50.000000, encontrada en un total de 0 iteraciones.

crammer:

            # Matriz de coeficientes (A) y vector de términos independientes (b)
            A = [
                [2, 1, 3],
                [3, -2, -1],
                [1, 3, 2]
            ]

            b = [1, 0, 5]

            # Resolver el sistema Ax = b usando la regla de Cramer
            solucion = cramer(A, b)

            print(f"Solución del sistema: {solucion}")

            #Resultado esperado : Solución del sistema: [ 1.  2. -1.]

descomposicion_lu:

            # Definir la matriz de coeficientes (A) y el vector de términos independientes (b)
A = np.array([
    [25, 5, 1],
    [64,  8, 1],
    [144,  12, 1]
], dtype=float)

b = np.array([106.8, 177.2, 279.2], dtype=float)

# Resolver el sistema Ax = b usando la descomposición LU
solucion = lu_solve(A, b)

print("Solución del sistema:", solucion)
 ##Resultado esperado: Solución del sistema: [ 0.29047619 19.69047619  1.08571429]

eliminacion_gauss

    # Definir la matriz de coeficientes A y el vector de términos independientes b
    A = np.array([
    [2, 3, 1],
    [1, 1, 2],
    [1, -1, -1]
    ], dtype=float)

    b = np.array([0, 1, -1], dtype=float)

    # Resolver el sistema Ax = b usando el método de eliminación de Gauss
    solution = gauss_elimination(A, b)

    print(f"Solución del sistema: {solution}")
    ##Salida esperada: Solución del sistema: [-0.33333333 -0.          0.66666667]

gauss_jordan

    # Definir la matriz de coeficientes del sistema Ax = b
    coefficients = [
        [1, 1, -1],
        [1, -2, 3],
        [2, -1, 3]
    ]

    # Definir el vector de términos independientes
    ind_terms = [2, 0, 3]

    # Resolver el sistema mediante el método de Gauss-Jordan
    solution = gauss_jordan(coefficients, ind_terms)

    # Mostrar la solución del sistema
    print("Solución del sistema:", solution)
    #Resultado esperado: Solución del sistema: [1. 2. 1.]

gauss_seidel

    #Definir la matriz
    A = np.array([
        [9, 2, -1],
        [7, 8, 5],
        [3, 4, -10]
    ], dtype=float)

    b = np.array([-2, 3, 6], dtype=float)

    # Resolver el sistema usando el método de Gauss-Seidel
    solution = gauss_seidel(A, b)

    # Mostrar la solución encontrada
    print("La solución aproximada del sistema es:", solution)

    #Resultado esperado: La solución aproximada del sistema es: [-0.48501362  1.01226158 -0.34059946]

jacobi

    #Definimos la matriz
    A = np.array([
        [2, -1, 1],
        [1, 2, -1],
        [1, 1, 1]
    ], dtype=float)

    b = np.array([7, 6, 12], dtype=float)

    # Resolver el sistema Ax = b usando el método de Jacobi
    solution = jacobi(A, b)

    # Mostrar la solución aproximada 
    print("La solución aproximada del sistema es:", solution)

    #Solucion esperada: La solución aproximada del sistema es: [3. 4. 5.]

Contacto

Email: br23021@ues.edu.sv
GitHub: (https://github.com/JoyserB/BR23021UNO)
Universidad de El Salvador

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

br23021uno-1.4.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

br23021uno-1.4.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file br23021uno-1.4.0.tar.gz.

File metadata

  • Download URL: br23021uno-1.4.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for br23021uno-1.4.0.tar.gz
Algorithm Hash digest
SHA256 9a29de848fd7f925bb113ef579053ad3ad8450eff3c94dd66e7b0f41a8f30a2f
MD5 940e4025caee412e0279025f8efbc255
BLAKE2b-256 a4cf0ef9e1d60f02383a3ee1a46f33685fbfea6dec68e9152db72c3143f8f258

See more details on using hashes here.

File details

Details for the file br23021uno-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: br23021uno-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for br23021uno-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b179b172d6c8044d453b3530088a6077e79e485b826fb72d745c5715a0360b87
MD5 8687b97d9c74f73ffca455e2bebae49b
BLAKE2b-256 6f9f68c0d3d80e3106ec10f9be570f0ff3ec2dde26fe6b7c3b8b16e9719b73c4

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