笛卡尔坐标中的双整数而不是(R,Theta) [英] Double integral in cartesian coordinate instead of (R,Theta)

查看:175
本文介绍了笛卡尔坐标中的双整数而不是(R,Theta)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我以前的)。不同的值归因于不同的缩放比例(极坐标积分中省略了2 pi,2因为我在这里使用贝塞尔函数的和形式)。



例如,对于从-1..1到两个方向的平方面积在平方面积上的归一化功率(除以上述全功率值)是:

 >> 4 * scipy.integrate.nquad(f,[[[0,1],[0,1]])[0] / 12.565472446489999 
0.27011854108867

因此,大约27%的入射光照射到方形光电探测器上。






当涉及常量时,似乎缺少某些东西(至少单位)。我的猜测:




  • 波长:550 nm

  • 圆形孔径:0.0055 = 0.14 mm

  • 从孔径到传感器的距离:2.8毫米

  • 方形传感器尺寸5.4 um x 5.4 um



我刚从图像中猜到的最后一个,由于传感器尺寸远小于距离,sin(ϴ)非常接近 y / d ,其中 d 是距离和距光轴的 y 位移,通过使用这些数字 x = ka sin(ϴ)= kay / d ≈1.54。对于该数字,强度积分大约为0.52(或52%)。



如果将其与实验值进行比较,请记住有很多误差源。像面上的图像是光圈的傅立叶变换。开口边缘可能会改变产生的斑点。通风环很少像天文学家认为的那样美丽。



只是为了好玩:




my previous question (Integral of Intensity function in python)

you can see the diffraction model in image below:

I want to calculate integral of intensity in each pixel (square), so I can't use R and Theta as variable. How can I do this in X-Y coordinate.

Our function:

instead of sin(theta) we can use:

sintheta= (np.sqrt((x)**2 + (y)**2)/(np.sqrt((x)**2 + (y)**2 + d**2)))

Other constants:

lamb=550*10**(-9)
k=2.0*np.pi/lamb
a=5.5*2.54*10**(-2)
d=2.8

when you plot function, the result is something like this:(The image above is a view from top)

the method in previous topic: calculate integrate of function in (0.0, dist) and after that * (2*np.pix) which x = ka*np.sin(theta), But now I want integrate in each pixel. which the previous method doesn't work, because this is X-Y coordinate , not polar.

解决方案

Actually, the integration in Cartesian coordinates is rather straightforward. Now that you have the intensity function, you have to express the radius r by coordinates x and y. A trivial thing which you have actually done in your question.

So, the function to be integrated (without some constants) is:

from scipy import special as sp

# Fraunhofer intensity function (spherical aperture)
def f(x,y):
    r = np.sqrt(x**2 + y**2)
    return (sp.j1(r)/r)**2

Or by using the fact that 2 J1(x)/x = J0(x) + J2(x) [thanks, Jaime!]:

def f(x,y):
    r = np.sqrt(x**2 + y**2)
    return (sp.j0(r) + sp.jn(2,r))**2

This form is better in the sense that it does not have a singularity anywhere.

Now, I do not use any constant factors. You may add them if you want, but I find it easier to normalize with the integration result over infinite area. Otherwise it is too easy to just forget some constant (I do, usually).

The integration can be carried out with scipy.integrate.nquad. It accepts a multi-dimensional function to integrate. So, in this case:

import scipy.integrate

integral = scipy.integrate.nquad(f, ([-d/2, d/2], [-d/2, d/2]))[0]

However, as your function is very clearly symmetric, you might consider integrating over one quadrant only and then multiply by four:

4. * scipy.integrate.nquad(f, ([0, d/2], [0, d/2]))[0]

By using these the full intensity is:

>>> 4. * scipy.integrate.nquad(f, [[0,inf],[0,inf]])[0]
12.565472446489999

(Which looks very much like 4 pi, BTW.) Of course, you can also use the polar coordinates to calculate the full value, as the function has circular symmetry (as outlined in Integral of Intensity function in python). The different values are due to different scaling (2 pi omitted in the polar integration, 2 because I am using the sum form of the bessel functions here).

For example for a square area from -1..1 on both directions the normalized (divided by the above full power value) power over the square area is:

>>> 4*scipy.integrate.nquad(f, [[0,1],[0,1]])[0] / 12.565472446489999
0.27011854108867

So, approximately 27 % of the incoming light shines onto the square photodetector.


When it comes to your constants, it seems that something (at least units) is missing. My guess:

  • wavelength: 550 nm
  • circular aperture diameter: 0.0055" = 0.14 mm
  • distance from the aperture to the sensor: 2.8 mm
  • square sensor size 5.4 um x 5.4 um

The last one I just guessed from the image. As the sensor size is very much smaller than the distance, sin(ϴ) is very close to y/d, where d is distance and y displacement from the optical axis. By using these numbers x = ka sin(ϴ) = kay / d ≈ 1.54. For that number the intensity integral gives approximately 0.52 (or 52 %).

If you are comparing this to some experimental value, remember that there are numerous error sources. The image on the image plane is a fourier transform of the aperture. If there are small imperfections in the aperture edge, they may change the resulting spot. Airy rings are seldom as beautiful as astronomers think...

Just for fun:

这篇关于笛卡尔坐标中的双整数而不是(R,Theta)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆