Issues with solve. Cannot solve symbolically. Returning a numeric approximation instead.
1 回表示 (過去 30 日間)
古いコメントを表示
Hi there,
I'm trying to use 'solve' for 'a' by using 'syms' but I think it always retrieve an answer even if it didn't solve. I'm solving for a vector that is varying gradually so the 'aSolved' variable shall vary gradually but instead I have some points lying outside the range. I have some values in excel and I'm comparing them and for some values the results is exactly the same but in some other cases they are not. Here is where I called the 'solve:
for i=1:q
syms a positive
Ab=(a(i)g(i)).*(((m(i)*(1-cos(a)))-m(i))*(a) + m(i)*sin(a)) + g(i)*pi.*((m(i)*(1-cos(a)))-m(i))==0;
solve_a=solve(eqn1,a);
aSolved(i)=solve_a;
end
If anyone have any idea about what might be happening, I'll appreciate very much if you can give me some guidance on this.
Best, Martha
0 件のコメント
回答 (1 件)
Torsten
2017 年 8 月 4 日
As written, your equation reduces to
a(i)*(-cos(asol)*asol + sin(asol))-cos(asol)*pi==0
where I renamed the solution variable because of the equally named numeric array "a".
I suspect that the above equation might have several roots.
Best wishes
Torsten.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!