Effacer les filtres
Effacer les filtres

why solve failed? my error or solve error?

1 vue (au cours des 30 derniers jours)
Erick Miranda
Erick Miranda le 6 Avr 2015
I used command solve but recently I had a new equation:
f1=cos(x)*(2*x)^(1/2) + sin(x)/(2*x)^(1/2);
I used solve, but the ans was wrong, then I used Newton method an check the answers were ok
ans =
1.8366
ans =
4.8158
used solve:
>> syms x
>> f1=cos(x)*(2*x)^(1/2) + sin(x)/(2*x)^(1/2);
>> sf1=solve(f1,x)
sf1 =
-227.76766260117050148062548433664
the ans obvisuly was wrong
why solve failed? was my method or command solve?

Réponses (2)

Jan
Jan le 6 Avr 2015
The result is obviously correct. Simply try it:
x = -227.76766260117050148062548433664
cos(x)*sqrt(2*x) + sin(x)/sqrt(2*x)
The result is -2.6466e-013i, which is correct inside the expected precision.

Star Strider
Star Strider le 6 Avr 2015
There are infinitely many real and imaginary roots:
figure(1)
ezplot(real(f1), [-100 100]*pi)
hold on
ezplot(imag(f1), [-100 100]*pi)
hold off

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by