フィルターのクリア

why solve failed? my error or solve error?

1 回表示 (過去 30 日間)
Erick Miranda
Erick Miranda 2015 年 4 月 6 日
回答済み: Star Strider 2015 年 4 月 6 日
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?

回答 (2 件)

Jan
Jan 2015 年 4 月 6 日
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 2015 年 4 月 6 日
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

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by