Python中的Numpy线性求解器

时间:2014-10-28 06:49:13

标签: python numpy

我使用numpy.linalg.solve来解决一组线性方程组,系数矩阵a是

a = [[  1.00000000e+00   0.00000000e+00   0.00000000e+00 ...,   0.00000000e+00
        0.00000000e+00   0.00000000e+00]
    [   0.00000000e+00   1.00000000e+00   0.00000000e+00 ...,   0.00000000e+00
        0.00000000e+00   0.00000000e+00]
    [   0.00000000e+00   0.00000000e+00   1.00000000e+00 ...,   0.00000000e+00
        0.00000000e+00   0.00000000e+00]
    ..., 
    [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,   1.19206809e+12
       -1.22559480e+12   3.46092750e+11]
    [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,  -1.80896480e+14
       2.54068164e+12  -8.65658340e+12]
    [  0.00000000e+00   0.00000000e+00   0.00000000e+00 ...,   6.92185500e+11
       4.23578160e+12  -6.79632634e+12]]

和b矩阵是

      [0.0, 0.0, 0.0, 0.0 ..........................150000]

我想它应该输出像[0.0,0.0]

这样的矩阵

但是,实际结果是非零值,任何人都可以帮我弄清楚原因吗?

提前谢谢。

0 个答案:

没有答案