solving an equation with a condition

조회 수: 51 (최근 30일)
Mohamed Asaad
Mohamed Asaad 2020년 12월 6일
댓글: Walter Roberson 2020년 12월 7일
Is there any way to find a value to z that makes the solution of this equation consisting of only negative real numbers or negative real numbers with imaginary numbers?
x^4+z*x^2+z*x+50=0

채택된 답변

Walter Roberson
Walter Roberson 2020년 12월 7일
syms X Z
eqn = X^4+Z*X^2+Z*X+50==0
eqn = 
syms X_r X_i Z_r Z_i real
assume(X_r < 0 & Z_r < 0)
eqn2 = subs(eqn, [X, Z], [X_r+1i*X_i, Z_r+1i*Z_i])
eqn2 = 
sol = solve(eqn2, [X_r, X_i, Z_r, Z_i], 'returnconditions', true, 'MaxDegree', 4)
sol = struct with fields:
X_r: [4×1 sym] X_i: [4×1 sym] Z_r: [4×1 sym] Z_i: [4×1 sym] parameters: [1×3 sym] conditions: [4×1 sym]
Xsol = sol.X_r + 1i*sol.X_i
Xsol = 
So the x are all different, but follow a typical pattern for roots of a polynomial of degree 4.
Important note for this Xsol and the Zsol: the any x, y, z you see in the outputs are not the x and z of the original question. The x and z of the original question were written into the problem in terms of X and Z (complex valued, capitalized) and X_i X_r Z_i Z_r (capitalized, individual real or imaginary components of their corresponding complex variables.)
Any x, y, z (lower-case) you see in the solutions are auxillary variables generated by MATLAB to help express the solutions.
Zsol = sol.Z_r + 1i*sol.Z_i
Zsol = 
Meanwhile the Z are all the same.
sc = simplify(sol.conditions)
sc = 
So the auxillary variables x and y must be real-valued and the auxillary variable z must be negative (even though it is not specified explicitly that z must be real-valued, the < 0 forces it to be real-valued in context). The ^ means "and". The "i" is sqrt(-1) . The σ are sub-expressions that are broken out to allow the structure of the solution to be expressed more clearly; the individual meaning of the sigma variables is given in the where section.
The sigma variables are messy, and refer to each other. This is common for the solutions to a polynomial of degree 4.
sol.parameters
ans = 
The names of the auxillary variables can change; I list them here
So where does this leave you?
To be honest... not really any further ahead. You are looking for a detailed description of the behaviour of system of two complex variables when the system is a multinomial with maximum degree 4. The solutions to a multinomial of degree 4 are really messy.
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 12월 7일
We can proceed graphically to get an idea of how bad the solutions are.
syms X Z
eqn = X^4+Z*X^2+Z*X+50==0
eqn = 
That is a multinomial that is degree 4 in X, so we can solve for X to get 4 roots based upon Z. Then we can look at real() of the roots to see where they are negative. We can do that by breaking Z up into real and imaginary components, and drawing a surface. And because real(z) < 0 by requirement, we can skip plotting for positive real(z)
syms X_r X_i Z_r Z_i real
assume(X_r < 0 & Z_r < 0)
sol = (solve(eqn,X, 'maxdegree', 4));
R = (subs(real(sol),Z,Z_r + 1i*Z_i))
R = 
Messy, but for the moment we only have to plot, not make sense symbolically of the results.
zivec = linspace(-100, 100, 500);
zrvec = linspace(-20,0, 250);
[ZI, ZR] = ndgrid(zivec, zrvec); %real component < 0
figure(1);
R1fun = matlabFunction(R(1), 'vars', [Z_i, Z_r]);
R1 = R1fun(ZI, ZR);
surface(zrvec, zivec, R1, 'edgecolor', 'none'); xlabel('Z real'); ylabel('Z imag'); zlabel('X real'); title('root 1'); view(3)
Although it is not immediately obvious from the plot, all real(X) < 0 for this first root
figure(2);
R2fun = matlabFunction(R(2), 'vars', [Z_i, Z_r]);
R2 = R2fun(ZI, ZR);
surface(zrvec, zivec, R2, 'edgecolor', 'none'); xlabel('Z real'); ylabel('Z imag'); zlabel('X real'); title('root 2'); view(3)
Portions of real(X) are > 0 for this second root, but most is negative
figure(3);
R3fun = matlabFunction(R(3), 'vars', [Z_i, Z_r]);
R3 = R3fun(ZI, ZR);
surface(zrvec, zivec, R3, 'edgecolor', 'none'); xlabel('Z real'); ylabel('Z imag'); zlabel('X real'); title('root 3'); view(3)
Portions of real(x) are < 0 for this third root, but most is positive
figure(4);
R4fun = matlabFunction(R(4), 'vars', [Z_i, Z_r]);
R4 = R4fun(ZI, ZR);
surface(zrvec, zivec, R4, 'edgecolor', 'none'); xlabel('Z real'); ylabel('Z imag'); zlabel('X real'); title('root 4'); view(3)
Although it is not completely obvious from this plot, real(X) > 0 for all values for this fourth root.
So:
  • when we take the first root of the multinomial of degree 4, and we restrict ourselves to Z that have real(Z) < 0, then all real(X) < 0; so for any given Z with real(Z) < 0, there is a corresponding X that solves the equation and real(x) < 0. The value of X is given by substituting Z into sol(1)
  • when we take the fourth root of the multinomial of degree 4, and we restrict ourselves to Z that have real(Z) < 0, then there are no solutions for this case
  • when we take the second root of the multinomial of degree 4, and we restrict ourselves to Z that have real(z) < 0, then most real(X) < 0. However, for some real(Z) > -15 or so, there are places where real(X) > 0 which is not desired.
  • when we take the third root of the multinomial of degree 4, and we restrict ourselves to Z that have real(Z)<0, then most real(X)>0 . However, for some real(Z) > -15 or so, there are places where real(X) < 0 as desired
A question would then be whether you can come up with an equation that defines the boundaries of the "wings". I would say... Maybe? But it would take a bunch of study of the roots of the multinomial of degree 4 to figure out which subclause is generating the discontinuities in order to get the equations of the boundaries.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

David Hill
David Hill 2020년 12월 7일
I ran this I could not find any cases where all real root parts are negative.
z=-1e6;
while sum(sign(real(roots([1 0 z z 50]))))~=-4
z=z+1;
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 12월 7일
I do not think that is the question. I think the question is to find (x,z) such that real(x)<0 and real(z) < 0 and f(x,z) == 0

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Formula Manipulation and Simplification에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by