예제 #1
0
def main():
    n = int(raw_input('Grado del sistema: '))
    if n > 1:
        print 'Matriz A'
        A = array(leer_matriz_cuadrada(n))
        print 'Vector b'
        b = array(leer_vector(n))
        print 'Vector x0'
        x0 = array(leer_vector(n))
        x = jacobi(A, b, x0)
        print 'Raices'
        print x
예제 #2
0
def main():
    n = int(raw_input('Grado del sistema: '))
    if n > 1:
        print 'Matriz A'
        A = array(leer_matriz_cuadrada(n))
        print 'Vector b'
        b = array(leer_vector(n))
        print 'Vector x0'
        x0 = array(leer_vector(n))
        x = jacobi(A, b, x0)
        print 'Raices'
        print x
예제 #3
0
def main():
    n = int(raw_input('Grado del sistema: '))
    if n > 1:
        print 'Matriz A'
        A = array(leer_matriz_cuadrada(n))
        print 'Vector b'
        b = array(leer_vector(n))
        x = gauss_jordan(A, b)
        print 'Raices'
        print x
예제 #4
0
def main():
    n = int(raw_input('Grado del sistema: '))
    if n > 1:
        print 'Matriz A'
        A = array(leer_matriz_cuadrada(n))
        print 'Vector b'
        b = array(leer_vector(n))
        x = gauss_jordan(A, b)
        print 'Raices'
        print x
예제 #5
0
def main():
    n = int(raw_input('Grado del sistema: '))
    if n > 1:
        print 'Matriz A'
        A = array(leer_matriz_cuadrada(n))
        print 'Vector b'
        b = array(leer_vector(n))
        A_inversa = inversa(A)
        x = dot(b, A_inversa)
        print 'Raices'
        print x
예제 #6
0
def main():
    n = int(raw_input('Grado del sistema: '))
    if n > 1:
        print 'Matriz A'
        A = array(leer_matriz_cuadrada(n))
        print 'Vector b'
        b = array(leer_vector(n))
        L, U = doolittle(A)
        z = sustitucion_progresiva(L, b)
        x = sustitucion_regresiva(U, z)
        print 'Raices'
        print x
예제 #7
0
def main():
    n = int(raw_input('Grado del sistema: '))
    if n > 1:
        print 'Matriz A'
        A = array(leer_matriz_cuadrada(n))
        print 'Vector b'
        b = array(leer_vector(n))
        L, U = doolittle(A)
        z = sustitucion_progresiva(L, b)
        x = sustitucion_regresiva(U, z)
        print 'Raices'
        print x