MATLAB Answers

'Solve' 2 equations simultaneously symbolically; one is a 6th order polynomial, answer in the form of z

1 view (last 30 days)
I am working on solving two equations simultaneously using the 'solve' command with the 'ReturnConditions'. One equation is a 6th order and another a 4th order polynomial. I am also using the 'MaxDegree' command but still the answer comes out in the form of z. Following are my code:
syms alpha1 alpha2 sigma1 sigma2 mu1 mu2 w1 w2 omega eps f2
syms a1 a2 positive
eq1=subs(eqn1,[sigma1, sigma2],[s1, s2]);
eq2=subs(eqn2,[sigma1, sigma2],[s1, s2]);
For sol.a1, there's 9 symbolic solution, among them 3 are just 'x'. Could anyone be able to explain what this 'x' is ? One of the answers of a1_sol also yields the following z term,
-(alpha1*eps*z^3*(eps^2*mu1^2 + 9*omega^2 - 6*omega*w1 + w1^2)^(1/2))/(8*(eps^2*mu1^2*w1 + 9*omega^2*w1 - 6*omega*w1^2 + w1^3))
I was hoping if anyone can suggest an approach to resolve this issue. I really appreciate the help.

Accepted Answer

Surya Talluri
Surya Talluri on 11 Aug 2020
I understand that you are getting solution of a1, a2 in terms of x, y, z.
If there are infinitely many solutions for an equation, the solve returns the solution in terms of parameters. You can find parameters by below command.
ans =
[x, y, z]
You can refer to following documentation for further understanding on parametric equations -
  1 Comment
Walter Roberson
Walter Roberson on 11 Aug 2020
At first this did not seem to me to be the correct response, but after some working with the equations, I realized that it is correct.
What is going on is that there are combinations of values for your variables such that both expressions become zero. In such cases, any values of a1 and a2 are acceptable as long as they satisfy the "positive" constraint you put in.
So 5 of the results you are getting are listing combinations of variables such that your equations become 0, leading to all positive a1 a2 becoming solutions.
The other four solutions are more meaningful solutions.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by