Using roots() and poly() for multivariable functions
조회 수: 2 (최근 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!






