首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Newton

包含的模块:LUSolve,Jacobian

newton.rb

用牛顿法求解非线性代数方程组f = 0。该程序不依赖于BigDecimal。

To call:

代码语言:javascript
复制
  n = nlsolve(f,x)
where n is the number of iterations required,
      x is the initial value vector
      f is an Object which is used to compute the values of the equations to be solved.

它必须提供以下方法:

f.values(x)

返回x处所有函数的值

f.zero

returns 0.0

f.one

returns 1.0

f.two

returns 2.0

f.ten

returns 10.0

f.eps

返回用于确定两个值是否相等的收敛准则(ε值)。如果| ab | ε,这两个值被认为是相等的。

在退出时,x是解决方案向量。

公共实例方法

nlsolve(f,x) 显示源代码

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com