resultant
2 つの多項式の終結式
説明
例
2 つの多項式の終結式
2 つの多項式の終結式を求めます。
syms x y p = x^2+y; q = x-2*y; resultant(p,q)
ans = 4*y^2 + y
3 番目の引数を使用して、特定の変数について終結式を求めます。
resultant(p,q,y)
ans = 2*x^2 + x
2 つの変数の多項方程式の求解
2 つの多項式が共通の根を持つ場合、終結式はその根で 0 でなければなりません。1 つの変数について終結式を計算し、その終結式を他の変数について解くことによって、2 つの変数の多項方程式を解きます。
まず、x
について 2 つの多項式の終結式を計算し、y
で多項式を返します。
syms x y p = y^3 - 2*x^2 + 3*x*y; q = x^3 + 2*y^2 - 5*x^2*y; res = resultant(p,q,x)
res = y^9 - 35*y^8 + 44*y^6 + 126*y^5 - 32*y^4
根の y
値に対して終結式を解きます。関数 solve
を使って方程式をシンボリックに解くことで、数値の丸め誤差を回避します。solve
は、root
を使用して解をシンボリックに表します。
yRoots = solve(res)
yRoots = 0 0 0 0 root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 1) root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 2) root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 3) root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 4) root(z^5 - 35*z^4 + 44*z^2 + 126*z - 32, z, 5)
vpa
を使用して数値を計算します。
vpa(yRoots)
ans = 0 0 0 0 0.23545637976581197505601615070637 - 0.98628744767074109264070992415511 - 1.1027291033304653904984097788422i - 0.98628744767074109264070992415511 + 1.1027291033304653904984097788422i 1.7760440932430169904041045113342 34.96107442233265321982129918627
ここでは 5 乗根を調べることにします。5 乗根について、p
と q
に y
値を代入して x
値を計算します。それから x
について多項式を同時に解きます。solve
を使用して方程式をシンボリックに解くことによって数値の丸め誤差を回避します。
eqns = subs([p q], y, yRoots(5)); xRoot5 = solve(eqns,x);
vpa
を使用して 5 乗根の数値を計算します。
root5 = vpa([xRoot5 yRoots(5)])
root5 = [ 0.37078716473998365045397220797284, 0.23545637976581197505601615070637]
root5
を p
と q
に代入し、根が正しいことを検証します。結果は、丸め誤差の範囲内の 0
です。
subs([p q],[x y],root5)
ans = [ -6.313690360861895794753956010471e-41, -9.1835496157991211560057541970488e-41]
入力引数
p
— 多項式
シンボリック式 | シンボリック関数
多項式。シンボリック式またはシンボリック関数として指定します。
q
— 多項式
シンボリック式 | シンボリック関数
多項式。シンボリック式またはシンボリック関数として指定します。
var
— 変数
シンボリック変数
変数。シンボリック変数として指定します。
バージョン履歴
R2018a で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)