G is a numerical integration,the codes are as following. I found that the curve of the output is not smooth and seems like noise. This is because the integrand Abs[A2]^2 has singular point. How to solve this problem? Many thanks!
afa=4/20;
(*all your other code down to but not including the NIntegrate and last two lines*)
Plot3D[Re[k Sin[x] Abs[A2]^2], {x, 0, Pi/2}, {y, -Pi/6, Pi/6}]
and you can substitute other values up to about 1/2 for afa and see similar results.
It looks like you only have one denominator in your code and afa appears repeatedly in that denominator. I expect that denominator going to zero is responsible for this behavior.
With some experimentation, can you verify this is the source of the problem?
Knowing that, is there anything you can do about that denominator going to zero?
Thanks very much for your reply.
Yes, the meaning of the singular points in my original discussion just means that the denominator going to zero. However, even the denominator may go to zero for some points, the integration indeed converges, and the curve with varying afa should not seem like noise. I want to know what can I do to solve this problem. Many thanks!
You may try a change of integration variables that makes the singularity simpler. Your function depends only on Sin[x] Cos[y] and Sin[x] Sin[y], if I am not mistaken. You may take these as new variables. I have not tried it myself.