フィルターのクリア

solve tan(x)+2*x=0

4 ビュー (過去 30 日間)
rakesh kumar
rakesh kumar 2022 年 3 月 27 日
コメント済み: rakesh kumar 2022 年 3 月 27 日
I am trying solve tan(x)+ 2*x=0. however when i checked the result I am not getting the result zero.Please help where I am wrong.
my code is
syms x
for n = 1:10
x1 = (n-1/2)*pi;
x2 = (n)*pi;
v(n) = double(vpasolve(tan(x)+2*x == 0,x,[x1 x2]))
check(n)=tan(180*v(n)/pi)+2*v(n)
end
v =
1.8366 4.8158 7.9171 11.0408 14.1724 17.3076 20.4448 23.5831 26.7222 29.8619
check =
74.6635 9.0421 18.6043 24.2170 40.6395 32.7051 40.4513 47.5085 55.4912 57.0835

採用された回答

Sam Chak
Sam Chak 2022 年 3 月 27 日
I think you are not wrong, but it has infinitely many solutions. The solution v is in radian, but you checked as if v is in degree.
  1 件のコメント
rakesh kumar
rakesh kumar 2022 年 3 月 27 日
thanks a lot,

サインインしてコメントする。

その他の回答 (1 件)

Torsten
Torsten 2022 年 3 月 27 日
Your check must be
check(n)=tan(v(n))+2*v(n)
instead of
check(n)=tan(180*v(n)/pi)+2*v(n)
  1 件のコメント
rakesh kumar
rakesh kumar 2022 年 3 月 27 日
thanks, ihave made the correction. thanks once again

サインインしてコメントする。

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by