Using roots() and poly() for multivariable functions
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Walter Roberson
am 22 Feb. 2023
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
am 23 Feb. 2023
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)
Antworten (1)
Walter Roberson
am 22 Feb. 2023
[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 Kommentare
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






