why integral is not done

1 visualización (últimos 30 días)
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY el 22 de Feb. de 2019
Comentada: Bjorn Gustavsson el 22 de Feb. de 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 comentarios
Torsten
Torsten el 22 de Feb. de 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 el 22 de Feb. de 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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Matrix Computations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by