フィルターのクリア

Infinite or Not-a-Number function value encountered.

1 回表示 (過去 30 日間)
MinHyung
MinHyung 2013 年 8 月 20 日
Originally I tried to calculate
int(int((sin(q*A*sin(phi)/2)*sin(q*B*sin(phi)/2)*4/(q^2*A*B*sin(phi)*cos(phi)))^2*sin(q*C*cos(theta)/2)*2/(C*q))^2*sin(theta),theta,0,pi/2),phi,0.pi/2)
however MATLAB fail to show proper equation. So I change to use 'quad' function instead of 'int'
I just put A=B=C=7 and q=0.1 and tried to calculate...but failed. How can I calculate this equation?
-(183750365601059840*sin((7/20*sin(phi))).^4)./(8477503880968187*sin(phi).^2.*(sin(phi).^2. - 1) --> this equation comes from int((sin(q*A*sin(phi)/2)*sin(q*B*sin(phi)/2)*4/(q^2*A*B*sin(phi)*cos(phi)))^2*(sin(q*C*cos(theta)/2)*2/(C*q))^2*sin(theta),theta,0,pi/2) and put A, B, C, q values.
------------------------------------------------------------------------------------------
quad(@(phi) -(183750365601059840*sin((7/20*sin(phi))).^4)./(8477503880968187*sin(phi).^2.*(sin(phi).^2. - 1)),0.0001,pi/2)
Warning: Infinite or Not-a-Number function value encountered.
> In quad at 109
ans =
NaN

採用された回答

David Sanchez
David Sanchez 2013 年 8 月 20 日
Besides the parenthesis unbalanced, you are dividing by zero.
for phi = pi/2
(8477503880968187*sin(phi)).^2.*(sin(phi).^2. - 1) = 0
Then:
r=-(183750365601059840*sin((7/20*sin(phi))).^4)/...
(8477503880968187*sin(phi)).^2.*(sin(phi).^2. - 1)
will yield NaN.
  1 件のコメント
MinHyung
MinHyung 2013 年 8 月 20 日
Thank you very much!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by