Commit b0eac1fd authored by Navayos Pratumthong's avatar Navayos Pratumthong

sendwork

parent 1f6717fc
# 1. elimination
def Ab2Uc(A, b):
import numpy
A = numpy.array(A,float)
b = numpy.array(b,float)
n = len(b)
for j in range (0,n-1):
for i in range(j+1, n):
lam = A[i, j]/A[j, j]
A[i,j:n] = A[i, j:n] - lam*A[j, j:n]
b[i] = b[i] - lam*b[j]
print('U = ',A)
print('c = ',b)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment