Using roots() and poly() for multivariable functions
3 ビュー (過去 30 日間)
古いコメントを表示
How would I go about using poly() and roots() to solve the roots for this multivariable function?
This is my attempt
syms z1 z2
p = poly([1 -.5 -.25 -.25])
r = root(p,z1,z2)
5 件のコメント
Walter Roberson
2023 年 2 月 22 日
Odd. Notice that when you solve for z_2 that it singles out z2 = -1/2 as a specific solution that is always true, but that when you solve for z_1 that it singles out z2 = -1/2 as a specific case in which the z1 solution does not apply.... even though there is no mathematical problem with z2 = -1/2 ...
syms z_1 z_2
Eqn = 1 - 1/2*1/z_1 - 1/4*(1/z_1*1/z_2) - 1/4*1/z_2^2;
sol1 = solve(Eqn, z_1, 'returnconditions', true)
sol1.conditions
sol2 = solve(Eqn, z_2, 'returnconditions', true)
sol2.z_2
sol2.conditions
simplify(sol2.conditions)
Dyuman Joshi
2023 年 2 月 23 日
Walter, for z_2 = -1/2, the equation becomes null, and thus we can't solve for z_1
syms z_1 z_2
Eqn = 1 - 1/2*1/z_1 - 1/4*(1/z_1*1/z_2) - 1/4*1/z_2^2
subs(Eqn,z_2,-1/2)
回答 (1 件)
Walter Roberson
2023 年 2 月 22 日
[N D] = numden(Eqn)
sol = root(N, z_1)
You will get
root(4*z_1*z_2^2 - z_1 - z_2 - 2*z_2^2, z_1)
But you would have followed your requirements that root() specifically be involved in the process.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






