Issues with solve. Cannot solve symbolically. Returning a numeric approximation instead.

1 vue (au cours des 30 derniers jours)
Martha
Martha le 3 Août 2017
Réponse apportée : Torsten le 4 Août 2017
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

Réponses (1)

Torsten
Torsten le 4 Août 2017
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.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by