提高在 MATLAB 中查找多项式根的精度



我有一个多项式依赖于 matlab 中的xy,当我找到不同x的根时,有时多项式中的根的替换不是几乎为零的值,有什么问题?

xy缩放不佳时,可能会出现数值问题。例如,如果根(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.

最新更新