why integral is not done

1 回表示 (過去 30 日間)
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY 2019 年 2 月 22 日
コメント済み: Bjorn Gustavsson 2019 年 2 月 22 日
function output=Hplus(Q,W,a,mutilde)
output=integral(@(u) sqrt(1-u.^2)./(exp(0.5.*abs(Q.*u+W)-a.*mutilde)+1),-1,1,'ArrayValued',true,'RelTol',1e-4);
end
syms Q W a mutlide
output=Hplus(Q,W,a,mutilde)
%% I am trying to run this program but error is come as
%%Error using integralCalc/iterateArrayValued (line 159)
%%Inputs must be floats, namely single or double.
%%Error in integralCalc/vadapt (line 130)
%% [q,errbnd] = iterateArrayValued(u,tinterval,pathlen);
%%Error in integralCalc (line 75)
%% [q,errbnd] = vadapt(@AtoBInvTransform,interval);
%%Error in integral (line 88)
%%Q = integralCalc(fun,a,b,opstruct);
%%Error in Hplus (line 2)
%%output=integral(@(u) sqrt(1-u.^2)./(exp(0.5.*abs(Q.*u+W)-a.*mutilde)+1),-1,1,'ArrayValued',true,'RelTol',1e-4);
%%Error in Untitled2 (line 2)
%%output=Hplus(Q,W,a,mutilde)
  4 件のコメント
Torsten
Torsten 2019 年 2 月 22 日
You could try to use MATLAB's "int" (symbolic integration), but I doubt that your function has an analytical antiderivative.
Bjorn Gustavsson
Bjorn Gustavsson 2019 年 2 月 22 日
If you dont manage with the exact symbolic integration you could try to make a Taylor-expansion of the root - then I got some explicit values for the integral: int(p(u)/(exp(u)+1),-1,1). You'd still might need to do some variable transformations to clean up your integrand a bit. Integrals like these is what we used handbooks for when I studied solid state physics (too long a time ago...)
HTH

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by