How to solve this equations using matlab code,I use solve but I have obtained a wrong and strange solution, and I don't know why.

30 views (last 30 days)
% 定义符号变量
syms Q t
% 第一个方程
eqn1 = 19/Q + 1/(2*50*10^(-6)) - 5/(24*t^2);
% 第二个方程
eqn2 = (5 + 0.5*(Q/(50*10^(-6))))*(Q - 7.02*10^(-6)) - (24 + Q/(50*10^(-6)))*t;
% 求解方程组
[solQ, solt] = solve([eqn1, eqn2], [Q, t]);

Accepted Answer

Star Strider
Star Strider on 13 Nov 2024 at 3:23
It would help to have your code.
See if using the vpa function will produce a moree understandable reesult, specifically:
Qvpa = vpa(s.Q)
That should produce numerical values for your system of degre polynomials.
You can use double on that result:
Qd = double(Qvpa)
if you want values to use in other parts of your script.
.

More Answers (1)

Walter Roberson
Walter Roberson on 13 Nov 2024 at 3:47
eqn1 = 19/Q + 1/(2*50*10^(-6)) - 5/(24*t^2);
solving for Q involves t^2
eqn2 = (5 + 0.5*(Q/(50*10^(-6))))*(Q - 7.02*10^(-6)) - (24 + Q/(50*10^(-6)))*t;
There is Q times Q and Q times t. Because the solution for Q involves t^2, you can be sure that eqn2 involves at least (t^2)*2 --> t^4. In fact, the expression for eqn2 turns out to involve t^5 in the numerator.
So you end up working with a polynomial of degree 5. The root(z^5 + etc) is the Symbolic Engine's way of representing solutions of polynomials.
In mathematics, the Abel–Ruffini theorem (also known as Abel's impossibility theorem) states that there is no solution in radicals to general polynomial equations of degree five or higher with arbitrary coefficients.
With there being no explicit solutions to the roots of the polynomial of degree 5, the Symbolic Engine introduces placeholders for the roots.
You can vpa() to get numeric approximations for the roots.

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!