Is it possible to solve this equation without symbolics?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi all, I am doing research involving numerical computations. Obviously symbolics are expensive to compute. So I am trying to compute something without using symbolics. Here is my sample code:
F1=1725;
F2=228;
F6=76;
syms F0;
s_12=[-0.875*F0;-0.625*F0; 0.21651*F0];
temp1=((s_12(1,1))^2/(F1)^2)+((s_12(2,1))^2/(F2)^2)+((s_12(3,1))^2/(F6)^2)-((s_12(1,1)*(s_12(2,1)))/(F1)^2);
a=double(solve(temp1==1,F0));
Can anyone suggest me a way to solve this equation without using symbolics? Thanks in advance.
0 件のコメント
採用された回答
Star Strider
2014 年 3 月 13 日
編集済み: Star Strider
2014 年 3 月 13 日
Another method, using the equations you provided:
F1=1725;
F2=228;
F6=76;
s_12= @(F0) [-0.875*F0;-0.625*F0; 0.21651*F0];
temp1= @(s_12) ((s_12(1,1))^2/(F1)^2)+((s_12(2,1))^2/(F2)^2)+((s_12(3,1))^2/(F6)^2)-((s_12(1,1)*(s_12(2,1)))/(F1)^2);
fcn = @(F0) temp1(s_12(F0))-1;
a = [];
for k1 = [-500 500]
S0 = fzero(fcn,k1);
a = [S0; a];
end
The for loop uses two different starting values to get both roots, stored in vector a.
5 件のコメント
その他の回答 (1 件)
Roger Stafford
2014 年 3 月 13 日
K = (-0.875/F1)^2+(-0.625/F2)^2+(0.21651/F6)^2-(-0.875)*(-0.625)/(F1)^2;
F0 = sqrt(1/K);
or (Two solutions)
F0 = -sqrt(1/K);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Special Values についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!