why integral is not done
1 次查看(过去 30 天)
显示 更早的评论
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
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
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 Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!