Empty sym: 0-by-1

13 ビュー (過去 30 日間)
Nikos Gavalakis
Nikos Gavalakis 2020 年 6 月 17 日
コメント済み: Star Strider 2020 年 6 月 17 日
Hello, I'm new to matlab so any help would be appreciated! I needed matlab to solve some equation systems for my finite element class.
The method I used to use worked until this 4x4 system. I'm not sure what's the best way to solve this and with my way i get "Empty sym: 0-by-1" as an answer.
(the "P(u3)" is just a symbol, not a multiplication. P(u3)=p....and also E*A/L=5*10^7)
syms u2 v2 u3 p
e1= (5*10^7)*(2/4*u2 - 1/4*u3 + 3/4*u3)==0;
e2= (5*10^7)*(6/4*v2+sqrt(3)/4*u3-3*sqrt(3)/4*u3)==19613;
e3= (5*10^7)*(-1/4*u2+sqrt(3)/4*v2+1/4*u3-3/4*u3)==p;
e4= (5*10^7)*(sqrt(3)/4*u2-3/4*v2-sqrt(3)/4*u3+3*sqrt(3)/4*u3)==sqrt(3)*p;
result = solve(e1,e2,e3,e4)
result =
struct with fields:
p: [0×1 sym]
u2: [0×1 sym]
u3: [0×1 sym]
v2: [0×1 sym]
vpa(result.p)
ans =
Empty sym: 0-by-1

採用された回答

Star Strider
Star Strider 2020 年 6 月 17 日
Your error was in not leaving it in the original matrix form.
This works, however I am confused by your notation, so this may need to be corrected:
syms u2 v2 u3 p
Mtx = 5E+7 * [2/4 0 -1/4 +3/4;
0 6/4 sqrt(3)/4 -3*sqrt(3)/4;
-1/4 +sqrt(3)/4 +1/4 -3/4;
sqrt(3)/4 -3/4 -sqrt(3)/4 +3*sqrt(3)/4];
Vct = [0; 19613; p; sqrt(3)*p];
V = [u2; v2; u3; p];
S = vpasolve(Mtx * V == Vct);
Sp = S.p
Su2 = S.u2
Su3 = S.u3
Sv2 = S.v2
producing:
Sp =
-5661.785414808065059658960697873
Su2 =
17115934194006.985529996788305132
Su3 =
34231868371028.614815569381431287
Sv2 =
-9881889214341.853390449609171597
.
  2 件のコメント
Nikos Gavalakis
Nikos Gavalakis 2020 年 6 月 17 日
Thank you very much m8!! I'm going to solve matrices this way from now on.
Btw I might have done something else wrong because i wasnt expecting u2,v2,u3 to be such large numbers :(
Star Strider
Star Strider 2020 年 6 月 17 日
As always, my pleasure!
Since the matrix is multiplied by 5E+7, the large numbers do not surpise me.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by