Unable to solve for a variable
古いコメントを表示
Hi all,
I am trying to solve for a variable 'a' and saving it into an array, However, I am left with an inifinitely long running program. What should I do?
Heres a section of the code:
clc, clear, clear all
J_value=0.5
syms a;
for TonTc=.01:0.01:.99
sig_sigo_1=((2*J_value+1)/2*J_value)*coth((2*J_value+1)/2*J_value)*a-(1/2*J_value)*coth(a/2*J_value);
sig_on_sigo_2=((J_value+1)/3*J_value)*TonTc*a;
z=sig_sigo_1-sig_on_sigo_2;
for k=1:99
val_a(k)=vpasolve(z,a);
end
end
Cheers
採用された回答
その他の回答 (1 件)
David Hill
2021 年 10 月 6 日
What are you solving? You need to set z equal to something.
z=sig_sigo_1-sig_on_sigo_2==0;%what do you want z to be?
3 件のコメント
Actually, solve implicitly assumes zero if you specify nothing. For example
syms X
solve(X-1,X)
So solve implicitly assume the equation was x-1 == 0, despite the lack of any right hand side provided.
David Hill
2021 年 10 月 6 日
Thanks, good to know.
Jonas Freiheit
2021 年 10 月 7 日
カテゴリ
ヘルプ センター および File Exchange で Equation Solving についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!









