integral3 reached limit error
古いコメントを表示
Hi;
I have a complex numerical integration and i get the following error : "Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 2.1e+138. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy."
My Matlab codes as
function trns2
clc
global kpp;
global teta;
global eta;
%**************************************************************
%********************P A R A M E T E R S***********************
%**************************************************************
lmd=1.55e-6; %wavelength
%L=50; %distance
k=2*pi/lmd;
%******************oceanic parameters**********************
eta_s=1e-3; %kolmogorov microscale length
x_t=1e-6; %rate of dissipation of mean-squared temperature
eps=1e-4; %rate of dissipation of kinetic energy per unit mass of fluid
%w=-1; %ratio of temperature to salinity contributions to the refractive index spectrum
A_t=1.863e-2;
A_s=1.9e-4;
A_ts=9.41e-3;
%***************************************************************
%***************************************************************
%***************************************************************
p1x=0.02;
p1y=0;
p2x=0.02;
p2y=0;
w1=-1;
w2=-2;
w3=-5;
coeff1=0.388*pi*(1e-8)*k*k*(eps^(-1/3))*x_t/(w1*w1);
coeff2=0.388*pi*(1e-8)*k*k*(eps^(-1/3))*x_t/(w2*w2);
coeff3=0.388*pi*(1e-8)*k*k*(eps^(-1/3))*x_t/(w3*w3);
j=1;
for L=10:10:50
f1=@(eta,kpp,teta)((kpp.^(-8/3)).*(1+2.35*((kpp*eta_s).^(2/3))).*...
(w1*w1*exp(-A_t*(8.284*((kpp*eta_s).^(4/3))+12.978*((kpp*eta_s).^2)))+exp(-A_s*(8.284*((kpp*eta_s).^(4/3))+12.978*((kpp*eta_s).^2)))-2*w1*exp(-A_ts*(8.284*((kpp*eta_s).^(4/3))+12.978*((kpp*eta_s).^2)))).*...
((exp(1i*k*(p1x*p1x+p1y*p1y-p2x*p2x-p2y*p2y)./(L-eta)).*exp(1i*kpp.*cos(teta)*(p1x-p2x)).*exp(1i*kpp.*sin(teta)*(p1y-p2y)))-(exp(1i*k*(p1x*p1x+p2x*p2x+p1y*p1y+p2y*p2y)./(L-eta)).*exp(1i*kpp.*cos(teta)*(p1x-p2x)).*exp(1i*kpp.*sin(teta)*(p1y-p2y)).*exp(1i*(eta-L).*kpp.*kpp/k))));
Bx1=integral3(f1,0,L,0,inf,0,2*pi);
BxR1(j)=coeff1*(real(Bx1))
f2=@(eta,kpp,teta)((kpp.^(-8/3)).*(1+2.35*((kpp*eta_s).^(2/3))).*...
(w2*w2*exp(-A_t*(8.284*((kpp*eta_s).^(4/3))+12.978*((kpp*eta_s).^2)))+exp(-A_s*(8.284*((kpp*eta_s).^(4/3))+12.978*((kpp*eta_s).^2)))-2*w2*exp(-A_ts*(8.284*((kpp*eta_s).^(4/3))+12.978*((kpp*eta_s).^2)))).*...
((exp(1i*k*(p1x*p1x+p1y*p1y-p2x*p2x-p2y*p2y)./(L-eta)).*exp(1i*kpp.*cos(teta)*(p1x-p2x)).*exp(1i*kpp.*sin(teta)*(p1y-p2y)))-(exp(1i*k*(p1x*p1x+p2x*p2x+p1y*p1y+p2y*p2y)./(L-eta)).*exp(1i*kpp.*cos(teta)*(p1x-p2x)).*exp(1i*kpp.*sin(teta)*(p1y-p2y)).*exp(1i*(eta-L).*kpp.*kpp/k))));
Bx2=integral3(f2,0,L,0,inf,0,2*pi);
BxR2(j)=coeff2*(real(Bx2))
f3=@(eta,kpp,teta)((kpp.^(-8/3)).*(1+2.35*((kpp*eta_s).^(2/3))).*...
(w3*w3*exp(-A_t*(8.284*((kpp*eta_s).^(4/3))+12.978*((kpp*eta_s).^2)))+exp(-A_s*(8.284*((kpp*eta_s).^(4/3))+12.978*((kpp*eta_s).^2)))-2*w3*exp(-A_ts*(8.284*((kpp*eta_s).^(4/3))+12.978*((kpp*eta_s).^2)))).*...
((exp(1i*k*(p1x*p1x+p1y*p1y-p2x*p2x-p2y*p2y)./(L-eta)).*exp(1i*kpp.*cos(teta)*(p1x-p2x)).*exp(1i*kpp.*sin(teta)*(p1y-p2y)))-(exp(1i*k*(p1x*p1x+p2x*p2x+p1y*p1y+p2y*p2y)./(L-eta)).*exp(1i*kpp.*cos(teta)*(p1x-p2x)).*exp(1i*kpp.*sin(teta)*(p1y-p2y)).*exp(1i*(eta-L).*kpp.*kpp/k))));
Bx3=integral3(f3,0,L,0,inf,0,2*pi);
BxR3(j)=coeff3*(real(Bx3))
j=j+1;
end
plot(L,BxR1,L,BxR2,L,BxR3);
If you could help me to solve this problem, it will be a big pleasure for me.
Thanks a lot in advance.
2 件のコメント
Walter Roberson
2013 年 8 月 26 日
It seems to me that if the bound on error is 2.1e+138 then you probably have something that is approaching infinity.
Walter Roberson
2013 年 8 月 26 日
In all three of your functions, teta drops out when the expression is simplified, so you are doing a 3 dimensional integral of an expression with two free variables. That is certainly allowed, but suggests that possibly you might have an error in your equations.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!