Dear all
I'm trying to do the below double integral.
The code I'm using is given below
K=75; al=3; de=2/al; N=75.0;
FhI=@(t) (1-hypergeom([1,de],1+de,1-2.^(K./t)));
mu=integral(FhI,1/10,N);
Nnu1=integral2(@(t,u)InteEpstu(t,u,K,de,mu),2,N,2,N);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Ingr]=InteEpstu(tvec,uvec,K,de,mu)
tL=size(tvec); uL=size(uvec); Ingr=zeros(tL(1),tL(2));
for i=1:tL(1)
for j=1:uL(1)
t=tvec(i,j); u=uvec(i,j); Eetat=Competavi(t,K,de,mu); Eetau=Competavi(u,K,de,mu);
thet=(2^(K/t)-1)*Eetat; theu=(2^(K/u)-1)*Eetau;
Ftn=@(y) (1-1./(1+thet*y)./(1+theu*y))./(y.^(1+de));
Htu=integral(Ftn,1/10,1)*de;
Ingr(i,j)=1/(1+Htu);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [Eetk]=Competavi(t,K,de,mu)
FhI=@(x) 1./hypergeom([1,-de],1-de,(1-2.^(K/t./x)).*min(1,mu/t./x));
Fxt=integral(FhI,1/10,1);
Eetk=1-Fxt;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Below is the error message I obtain.
Error using integral2Calc>integral2t/tensor (line 241)
Integrand output size does not match the input size.
Error in integral2Calc>integral2t (line 55)
[Qsub,esub] = tensor(thetaL,thetaR,phiB,phiT);
Error in integral2Calc (line 9)
[q,errbnd] = integral2t(fun,xmin,xmax,ymin,ymax,optionstruct);
Error in integral2 (line 106)
Q = integral2Calc(fun,xmin,xmax,yminfun,ymaxfun,opstruct);
Error in Tphi_2mom (line 11)
Nnu1=integral2(@(t,u)InteEpstu(t,u,K,de,mu),2,N,2,N);
%%%%%%%%%%%%%%%%%%%%%%%%
Any help in identifying the issue would be of great help.
Thanks
Amogh

 采纳的回答

Torsten
Torsten 2018-12-11
编辑:Torsten 2018-12-11

0 个投票

function [Ingr]=InteEpstu(tvec,uvec,K,de,mu)
Ingr=zeros(size(tvec));
for i=1:numel(tvec)
t=tvec(i);
u=uvec(i);
Eetat=Competavi(t,K,de,mu);
Eetau=Competavi(u,K,de,mu);
thet=(2^(K/t)-1)*Eetat;
theu=(2^(K/u)-1)*Eetau;
Ftn=@(y) (1-1./(1+thet*y)./(1+theu*y))./(y.^(1+de));
Htu=integral(Ftn,1/10,1)*de;
Ingr(i)=1/(1+Htu);
end

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

产品

版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by