フィルターのクリア

How does the MATLAB calculate the arctan?

13 ビュー (過去 30 日間)
Vahid
Vahid 2012 年 2 月 9 日
編集済み: Marc 2013 年 10 月 7 日
Hello all,
I have solved an initial value problem and I have gotten the following equation for that:
theta=(c_0/c_1)- (2/c_1)*atan( exp(-a*c_1*t)*tan((c_0-c_1*theta_0)/2) )
where
c_0=7*pi/6; c_1=0.3; a=0.055; theta_0=0;
and
t=[0:0.01:100];
I do expect the MATLAB returns theta=0 for t=0. In other words what I expect to see is:
theta(1)=0
because for t=0, the first equation can be simplified and as a result we have: theta=theta_0 : independent of c_0,c_1(~=0),and a.
but MATLAB returns something else:
theta(1)=20.9440
I would be grateful if somebody could explain me how I can get what I expect to get?
thanks a lot, Vahid

採用された回答

Matt Tearle
Matt Tearle 2012 年 2 月 9 日
All inverse trigonometry functions return to a specific limited range, because trig functions are periodic. Hence, if x = 9*pi/2, then sin(x) will be 1, so asin(sin(x)) will be pi/2, not 9*pi/2. That's what's happening here -- atan returns values between -pi/2 and pi/2 (see doc atan):
(c_0-c_1*theta_0)/2 % ans = 1.8326 > pi/2
tan((c_0-c_1*theta_0)/2)
atan(tan((c_0-c_1*theta_0)/2))
atan(tan((c_0-c_1*theta_0)/2)) + pi

その他の回答 (1 件)

Wayne King
Wayne King 2012 年 2 月 9 日
Why do you think it simplifies like that?
for t=0 and theta_0= 0, your expression evaluates to
(c_0/c_1)- (2/c_1)*atan(tan(c_0/2))
which is 20.9440
  3 件のコメント
Vahid
Vahid 2012 年 2 月 9 日
Since we have: atan(tan(arg))=arg and because of that I think the answer should be
(c_0/c_1)- (2/c_1)*(c_0/2)
which is equal to 0!
Wayne King
Wayne King 2012 年 2 月 9 日
Oh, I see :), yes, then what Matt said.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by