How to avoid running into "Failed precision goal. Try using 'MaxFunctionCalls' error?

24 次查看(过去 30 天)
Hi,
This question is in continuity to my previous question (Numerical integration of double integral with two variables) where the below given expression is solved using numerical integration.
In the expression Im is the imaginary part, i is the imaginary number, x and y are variables while a, b, c and Q are constants that are greater than 0.
Here is the script to solve this.
a = 3;
b = 0.0024;
c = 0.0040;
Q = 15;
syms x y;
fun = @(x,y)(1i.*x.*y)./(y.^a-1i.*x);
I = vpaintegral(@(x)imag(exp(-1i.*x.*c+b.*vpaintegral(fun,y,0,Q)))./x,x,0,inf);
For some values of a, b, c and Q this script works well but with others I get the error, "Failed precision goal. Try using 'MaxFunctionCalls'." I have read about 'RelTol' and 'AbsTol' concept in vpaintegral functions. I have tried to set different levels of tolerance but if I set any tolerance value less than 1e-1 it runs into the same problem. If I set tolerance to 1e-1, the results are highly inaccurate from the expected results.
My question is should there be some additional check on the values of input constants such as a, b, c and Q due to the usage of vpaintegral? If so then how to find that because during the mathematical derivation of these expressions there is no such restriction on the values of a, b, c and Q except that they have to be greater than 0.
Thanks.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by