why integral is not done

1 view (last 30 days)
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY on 22 Feb 2019
Commented: Bjorn Gustavsson on 22 Feb 2019
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 Comments
Torsten
Torsten on 22 Feb 2019
You could try to use MATLAB's "int" (symbolic integration), but I doubt that your function has an analytical antiderivative.
Bjorn Gustavsson
Bjorn Gustavsson on 22 Feb 2019
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

Sign in to comment.

Answers (0)

Categories

Find more on Matrix Computations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!