Azzera filtri
Azzera filtri

why solve failed? my error or solve error?

1 visualizzazione (ultimi 30 giorni)
Erick Miranda
Erick Miranda il 6 Apr 2015
Risposto: Star Strider il 6 Apr 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?

Risposte (2)

Jan
Jan il 6 Apr 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 il 6 Apr 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

Categorie

Scopri di più su Mathematics in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by