empty sym: 0-by-1 for Simultaneous equation

1 回表示 (過去 30 日間)
Jacob Short
Jacob Short 2021 年 1 月 14 日
回答済み: Walter Roberson 2021 年 1 月 18 日
I'm trying to solve for these values but it keeps resulting in empty sym: 0-by-1. Any suggestions?
>> syms a b c d e x
>> equ1 = a + b == (0.83/12);
>> equ2 = c == (0.036/2);
>> equ3 = (0.048/16) + 2*0.21*x == 2*a + b + c + 2*d;
>> equ4 = 0.79*x == e;
>> equ5 = (a/(a + b + d + e)) == 0.109;
>> equ6 = (b/(b + a + d + e)) == 0.010;
>> equ7 = (d/(d + a + b + e)) == 0.071;
>> equ8 = (e/(e + a + b + d)) == 0.810;
>> sol = solve([equ1,equ2,equ3,equ4,equ5,equ6,equ7, equ8],[a,b,c,d,e,x]);

回答 (2 件)

Walter Roberson
Walter Roberson 2021 年 1 月 18 日
You are trying to solve 8 equations for 6 variables, but they are not consistent for all 8 equations.
syms a b c d e x
equ1 = a + b == (0.83/12);
equ2 = c == (0.036/2);
equ3 = (0.048/16) + 2*0.21*x == 2*a + b + c + 2*d;
equ4 = 0.79*x == e;
equ5 = (a/(a + b + d + e)) == 0.109;
equ6 = (b/(b + a + d + e)) == 0.010;
equ7 = (d/(d + a + b + e)) == 0.071;
equ8 = (e/(e + a + b + d)) == 0.810;
sol = solve([equ1,equ2,equ3,equ4,equ5,equ6],[a,b,c,d,e,x]);
subs(equ7, sol), vpa(ans)
ans = 
ans = 
subs(equ8, sol), vpa(ans)
ans = 
ans = 

Shashank Gupta
Shashank Gupta 2021 年 1 月 18 日
Hi Jacob,
If the solve function returns empty object then there is no solution exist for the given set of equations. I suggest you to check the feasibility of solution and equation first and then reform the equation and try.
Cheers.

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by