Filter löschen
Filter löschen

why solve failed? my error or solve error?

1 Ansicht (letzte 30 Tage)
Erick Miranda
Erick Miranda am 6 Apr. 2015
Beantwortet: Star Strider am 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?

Antworten (2)

Jan
Jan am 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 am 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

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by