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.

조회 수: 29 (최근 30일)
% 定义符号变量
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]);

채택된 답변

Star Strider
Star Strider 2024년 11월 13일 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.
.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2024년 11월 13일 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.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by