用牛顿法计算程序的收敛速度

2024-09-27 09:30:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我的任务是编写一个计算方法收敛速度的程序。我不得不用牛顿法来近似求根。这部分代码是好的,工作良好,但我会孵化它。在

x0 : start value

F: function

DF: jacobi matrix

tol : tolerance rate of the approximation. If it is reached the loop shall be stopped --> that`s why I calculate with count

maxit: maximum iterations

重要的是,我试着在任何n维上都这样做。在

^{pr2}$

主要部分:

if __name__ == "__main__":


    p = konv(x0, F, DF, tol, maxit)
    print(p)

我得到的结果是:

[ 0.39384945  0.03214274] 6
<function konv.<locals>.<lambda> at 0x0000023312A82268>

这是什么意思?它不是应该返回一个数字吗?为什么我的返回值中有字母?在


Tags: the代码程序dfvaluefunctionstart速度

热门问题