Empty sym: 0-by-1

6 ビュー (過去 30 日間)
Delia Bosshart
Delia Bosshart 2021 年 5 月 24 日
コメント済み: Star Strider 2021 年 5 月 26 日
I don't understand why matlab gives as an output "Empty sym: 0-by-1" to the following equation which I want to solve. I have used this equation many times with other numbers and it has always worked since. Thank you for the help!
syms x1
eqn = (10.5145 - 0.5 + 6.96.*x1 + (6-(31*(232.87.*(x1*12).^(-0.46)))/1000).*x1/60*1000 + 31.*(232.87.*(x1*12).^(-0.46))/1000.*0/60*1000)*0.0086 - 0.1475 - x1 == 0
vpasolve(eqn, x1)

採用された回答

Star Strider
Star Strider 2021 年 5 月 24 日
Exploring the function is often worthwhile. It apparently has a real root at about -0.45, so share that information with vpasolve:
syms x1
eqn = (10.5145 - 0.5 + 6.96.*x1 + (6-(31*(232.87.*(x1*12)^(-0.46)))/1000)*x1/60*1000 + 31*(232.87*(x1*12)^(-0.46))/1000*0/60*1000)*0.0086 - 0.1475 - x1 == 0;
f(x1) = (10.5145 - 0.5 + 6.96.*x1 + (6-(31*(232.87.*(x1*12)^(-0.46)))/1000)*x1/60*1000 + 31*(232.87*(x1*12)^(-0.46))/1000*0/60*1000)*0.0086 - 0.1475 - x1;
x1_s = vpasolve(real(f), -0.5)
x1_s = 
figure
fplot(real(f), [-1 1])
hold on
fplot(imag(f), [-1 1])
hold off
grid
legend('Real','Imag', 'Location','best')
.
  2 件のコメント
Delia Bosshart
Delia Bosshart 2021 年 5 月 26 日
Thank you! Therefore the main problem is that I have a negative number in the root and that is why it can't solve the equation right?
Star Strider
Star Strider 2021 年 5 月 26 日
As always, my pleasure!
One problem is that solve identified 50 roots of that function, so there could be a number of them. However plotting it revealed only one .real root. It is a relatively complicated function. I have no idea what the other roots were, since solve did not calculate them. Plotting the real and imaginary parts of the function demonstrated its behaviour and led to the solution.

サインインしてコメントする。

その他の回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 5 月 24 日
Hi,
There is a typo in your eqn:
...1000.*0/60*1000)*0.0086
Good luck
  1 件のコメント
Delia Bosshart
Delia Bosshart 2021 年 5 月 24 日
does "Empty sym: 0-by-1" mean that it can't solve the equation and that is why you assume that there has to be a typo?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEquation Solving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by