有一个问题来解决python中的条件号

时间:2018-03-21 23:51:03

标签: python numpy math

def createA(self, n):
    """ this method creates a nxn coefficient """



def main():
    # "points_of_failure_in_L :  point x = L in every n"


    for i in range(0, 12):
        n = 20 * (2**i)

        points_of_failure_in_L = np.abs(brett.fasit_y(n) - brett.finn_y(n))[n - 1]
        condition_Number_A = np.linalg.cond(brett.createA(n).toarray())
        print(n, points_of_failure_in_L, "\t", "condition", condition_Number_A)




if __name__ == '__main__':
    main()

如何与那些A的条件数进行比较 不同的n值。 我遇到问题:points_of_failure_in_L=np.linalg.cond(brett.createA(n).toarray())

打印出来 20 8.144526719711109e-16 condition 282259.21106512705 40 7.64151112178646e-15 condition 4389447.783996872 80 3.42975431041892e-14 condition 69191086.43073456 160 8.638996094011142e-14 condition 1098636697.701042 320 3.9277543890936517e-13 condition 17510431736.872536 640 7.368569980798021e-12 condition 279623343789.7353 1280 9.507172970768204e-11 condition 4469444304850.158 2560 3.463085792795601e-10 condition 71481983012454.66 5120 2.5468403313525705e-11 condition 1139844383400946.2 Process finished with exit code 137 (interrupted by signal 9: SIGKILL)

条件数字不对吗?! 有人能告诉我我做错了什么吗? :)

0 个答案:

没有答案