Warning: Non-finite result. The integration was unsuccessful. Singularity likely.

115 views (last 30 days)
Hi i run a code thta include two doyble integration i recieve e message Warning: Non-finite result. The integration was unsuccessful.
but the final resulta are finite what happen ? the results are reliably ?
the main code is
currentMoM()
f = 300000000
N = 40
ra = 1
k0 = 6.2832
Z0 = 376.9911
lambda = 1
ans = NaN + NaNi
Warning: Non-finite result. The integration was unsuccessful. Singularity likely.
ans = NaN + NaNi
Unrecognized function or variable 'Efieldin'.

Error in solution>@(x)(4./(Z0.*k0)).*triangle_basisn(x,index_i).*Efieldin(x) (line 37)
func=@(x)(4./(Z0.*k0)).*triangle_basisn(x,index_i).*Efieldin(x);

Error in integralCalc>iterateScalarValued (line 334)
fx = FUN(t);

Error in integralCalc>vadapt (line 148)
[q,errbnd] = iterateScalarValued(u,tinterval,pathlen, ...

Error in integralCalc (line 77)
[q,errbnd] = vadapt(vfunAB,interval, ...

Error in integral (line 87)
Q = integralCalc(fun,a,b,opstruct);

Error in solution>currentMoM (line 38)
gm(index_i) =integral(func,Phi0(index_i),Phi0(index_i)+2*pi/N);
function [Is]=currentMoM()
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
[f,N,ra,k0,Z0,lambda] = parameter()
gamma_const=1.781;
%Phi0=zeros(N);
e=exp(1);
dftm=2.*pi./N;
for jj = 1:N
Phi0(jj)=(jj-1).*dftm;
end
% delta_c(i) = sqrt((pos(i,1) - pos(i+1,1))^2 + (pos(i,2) - pos(i+1,2))^2);
lmn = zeros(N);
%zmn = zeros(N);
gm = zeros(1,N);
zmn = zeros(N);
%vim = zeros(1,N);
%vsn = zeros(1,N);
coeif=(Z0.*k0./4).*ra.*dftm;
coeifn=(Z0./2).*sin(k0.*ra.*dftm./2);
for index_i = 1:N
for index_j = 1:N
if index_i == index_j
funa = @(x,y)triangle_basisn(x,index_i).*triangle_basisn(y,index_j).*ra.*(1-j.*(2/pi).*log((gamma_const./2).*k0.*ra.*sqrt(2-2.*cos(x-y)))) ;
funa(Phi0(index_i),Phi0(index_j))
lmn(index_i,index_j) =integral2(funa,Phi0(index_i),Phi0(index_i)+2*pi/N,Phi0(index_j),Phi0(index_j)+2*pi/N);
lmn(index_i,index_j)
else
funb = @(x,y)triangle_basisn(x,index_i).*triangle_basisn(y,index_j).*ra.*besselh(0,2,k0.*ra.*sqrt(2-2.*cos(x-y)));
lmn(index_i,index_j) =integral2(funb,Phi0(index_i),Phi0(index_i)+2*pi/N,Phi0(index_j),Phi0(index_j)+2*pi/N);
func=@(x)(4./(Z0.*k0)).*triangle_basisn(x,index_i).*Efieldin(x);
gm(index_i) =integral(func,Phi0(index_i),Phi0(index_i)+2*pi/N);
zmn(index_i,index_j) = lmn(index_i,index_j) ;
end
%vim(index_i) = delta_c(index_i) * exp(j*k0*(xm(index_i)*cos(phi_i)+ym(index_i)*sin(phi_i)));
%vsn(index_i) = delta_c(index_i) * exp(j*k0*(xm(index_i)*cos(phi_s)+ym(index_i)*sin(phi_s)));
end
end
W = linsolve(zmn,gm');
for ii=1:N
Is(ii)=W(ii);
end
y= Is;
end
function [f,N,ra,k0,Z0,lambda] = parameter()
%UNTITLED Summary of this function goes here
c0=3e8;
Z0=120.*pi;
ra=1;
N=40;
f=300e6;
lambda=c0./f;
k0=2*pi./lambda;
end
function z=triangle_basisn(phi,kk)
[~,N,ra,k0,Z0,lambda] = parameter();
%Phin=zeros(N)
dftm=2.*pi./N;
%for jj = 1:N+1
%Phi0(jj)=(jj-1).*dftm;
%end
%Phin=Phi0
if ( phi >=(kk-1).*dftm ) & ( phi <=kk.*dftm);
z=(phi-(kk-1).*dftm)./dftm;
elseif (phi >= kk.*dftm) & (phi <= (kk+1).*dftm);
z=((kk+1).* dftm -phi)./dftm;
else
z=0 ;
end
end
thank you
Goerge
  32 Comments

Sign in to comment.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!