我有一个多项式取决于x
和y
在matlab中,当我找到它的不同根时x
,有时多项式中根的替换不是几乎为零的值,有什么问题?
问问题
569 次
1 回答
1
当缩放比例不佳时x
,可能会出现数值问题。y
例如,如果您的根(x,y)
具有非常大的值,则机器精度可能会阻止您获得精确的根。尝试将您的功能扩展到一个紧凑的域(0,0)
(通常[-1,1]x[-1,1]
是一个很好的起点)。
%// let mx and my be upper bounds to |x| and |y| respectively
nx = x / mx; %// change of variables
ny = y / my;
%// express your polynom in nx and ny and solve for them
%// let nrx and nry be a root of the polynom in the new changed variables, then:
rx = nrx * mx; %// root in original varialbes
ry = nry * my;
%// if you want to verify that the roots indeed brings your polynom to zero, you should try it in the scaled domain with rnx, rny.
于 2012-12-18T07:39:32.277 回答