Open-access Simulation of diffraction patterns of annular apertures

Abstract

In this paper, Fraunhofer diffraction patterns generated by square and circular annular apertures are studied. The annular region is defined as the difference between two concentric areas of equal geometry: an outer fixed aperture and an inner closed obstacle, whose size is varied by a scaling parameter h. This parameter modifies the geometry of the aperture and, consequently, the shape and energy distribution in the diffraction pattern. Exact equations for intensity and analytical expressions for the fraction of energy contained in the region of maximum intensity are derived. For visualization and numerical analysis, codes are implemented in Maple 25, and a graphical user interface is designed in Python 3.13 that allows the evolution of diffraction patterns to be observed through animation as h varies. The study developed may be useful in optical applications, particularly in imaging systems.

Keywords:
Fraunhofer diffraction; annular aperture; Maple simulation; Python interface; diffraction patterns


1. Introduction

Diffraction is a characteristic effect of wave phenomena [1]; it occurs when a portion of a wavefront is intercepted by obstacles or openings [2]. As a result of this interaction, multiple segments of the wavefront are generated which, when propagating beyond the obstacle, interfere with each other, producing a characteristic energy distribution known as a diffraction pattern that acts as a fingerprint of the object [3], providing information about its geometry. This property explains the importance and wide applicability of the phenomenon in various scientific disciplines. Using diffraction, the structure of crystals, molecules, hormones, nucleic acids, enzymes, proteins, and viruses has been determined [4].

In acoustic engineering, this phenomenon is particularly important when barriers are used to create an acoustic shadow behind them. The acoustic shadow effect is commonly applied in outdoor environments to reduce noise from roads or railroads [5]. In optics, diffraction effects are of great significance in the detailed understanding of devices that contain lenses, diaphragms, slits, mirrors, and other elements. Even if all aberrations in a lens system were eliminated, the final sharpness of the image would still be limited by diffraction [6].

Historically, the study of diffraction at apertures has been classified into two main categories: Fresnel diffraction and Fraunhofer diffraction [7, 8]. The distinction between the two lies in the curvature of the incident and diffracted wavefronts. In this work, we focus specifically on Fraunhofer diffraction, where both the incident and diffracted wavefronts can be approximated as planar because they are considered in the far-field limit [9, 10].

In particular, we address the diffraction of a plane wave incident on square and circular apertures, both of which are widely documented in the literature [3, 8, 11, 12]. The main motivation is to visualize, through simulation, how the intensity distribution of the diffracted wave evolves when the degree of openness of such apertures is modulated. To this end, a concentric obstacle with the same geometry as the aperture is introduced. In this way, the space between the aperture and the obstacle defines an annular region whose degree of aperture is controlled by a geometric scale parameter h that varies between 0 and 1, where h=0 represents a completely clear aperture and h=1 a completely obstructed one.

As a result of integrating the Fraunhofer diffraction integral over the annular region, exact expressions are obtained for the field and intensity of the diffracted waves as a function of h. When evaluated at h=0, the intensity expressions reduce to the particular cases of the classical diffraction patterns of square and circular apertures. Once the intensity is determined, the energy distribution reaching an observation screen is calculated, and analytical expressions are derived for the fraction of energy contained around the region of maximum intensity. Thus, the parameter h allows controlling the fraction of energy transmitted through the aperture and, consequently, observing how the diffraction pattern changes.

The equations obtained for the intensity, although exact, involve a non-trivial mathematical analysis that requires numerical methods, such as the calculation of optimal values. Likewise, the visualization of diffraction patterns requires specialized graphical tools, and the evaluation of analytical expressions for the energy fraction must be performed using numerical integration. For these reasons, we used Maple 25 as the main simulation tool. This software allows for user-friendly symbolic and numerical computation, as its built-in functions eliminate the need to develop structured numerical algorithms, as would be necessary with other computational tools [13]. Its use is based on commands that execute symbolic and numerical calculations according to the specified operation, reducing computational complexity to a few lines of code [14]. In addition, it provides high-resolution graphics that offer a deeper perspective on the phenomenon under study. However, Maple presents a limitation in terms of accessibility and reproducibility due to its commercial nature, since its use requires the acquisition of a license [15].

As a freely accessible educational alternative, the simulation is implemented in Python 3.13, a language that, thanks to its accessibility and widespread adoption, has become an effective tool for simulating physical phenomena [16]. An interactive graphical user interface has been designed, allowing the user to select, using radio buttons, the type of pattern to be observed (square or circular) and the desired graphical perspective (3D or profile), as well as a slider to dynamically visualize the evolution of the diffraction pattern as h varies, taking advantage of Python’s capabilities to facilitate the understanding of physical phenomena through interactive visualization [17]. Although the code used for the interface includes extensive computational logic, both the code and the interface are provided through an open-access link, ensuring their availability to the academic community and their direct implementation in the classroom.

The exact equations obtained for the intensity and the analytical expressions for calculating the energy fraction complement the theoretical study of diffraction in square and circular apertures. In particular, as Hecht and Zajac [6] point out, the calculation of the energy fraction is a topic of interest but is highly complex. This calculation is rarely reported in textbooks, the most common case being that of the circular aperture without an obstacle [11]. These results may be of particular interest in optics, especially in applications related to the resolution and design of imaging systems [12, 18]. From a pedagogical perspective, the two computational implementations presented constitute teaching tools that can be directly integrated into the classroom, providing students with a detailed visualization of the phenomenon and revealing how, beyond the mathematical complexity of physical modeling, the results highlight the beauty and depth of the behavior of the diffraction phenomenon in nature.

2. Theory

2.1. Scalar wave diffraction

Diffraction is a characteristic effect of wave phenomena. It occurs when a portion of the wavefront is obstructed by an obstacle or aperture. That is, consider a scalar wave Ψ(r,t) propagating freely in the half-space z<0 with velocity v. The wave, along its path, interacts with an obstacle that has a small opening. The obstacle constitutes a portion of the closed surface Ω that bounds a volume Ω. In the half-space z>0 (the interior of Ω), the field satisfies the wave equation:

(1) 2 Ψ ( r , t ) = 1 v 2 t 2 Ψ ( r , t ) ,

with prescribed values on the boundary Ω. According to the method of separation of variables, a solution of the form

(2) Ψ ( r , t ) = ψ ( r ) T ( t )

can be assumed. By substituting this expression into equation (1), we obtain:

(3) ( 2 + k 2 ) ψ ( r ) = 0 , ( t 2 + ω 2 ) T ( t ) = 0 ,

with ω the separation constant and k=ω2/v2 the wave number.

For a causally propagating wave (i.e., propagating forward in time), T(t)eiωt. As for the solution ψ(r), which corresponds to a solution of the interior problem in Ω specified by the Helmholtz equation [19], it is given by:

(4) ψ ( r ) = Ω [ ψ ( r ) G ( r , r ) n G ( r , r ) ψ ( r ) n ] d a ,

where n denotes the differentiation along the normal to Ω and G(r,r) is the Green’s function associated with the problem:

(5) ( 2 + k 2 ) G ( r , r ) = δ ( r r ) r Ω , r Ω .

Next, suppose that the boundary Ω is composed of two rigid surfaces. The first, S1, corresponds to the diffracting surface – the obstacle with an opening 𝒜 – located in the plane z=0, while S2 extends along the edge of a sector of the half-space z>0. When the wave strikes the aperture in S1, the field at any point inside Ω can be considered as the superposition of the field diffracted by S1 and the field reflected by S2. However, if we assume that S2 is sufficiently far from S1, the contribution from reflection vanishes (radiation condition1) [20]:

(6) ψ | S 2 e i k r r .

Thus, from equation (4) one has:

(7) ψ ( r ) = S 1 [ ψ ( r ) G ( r , r ) n G ( r , r ) ψ ( r ) n ] d a ,

where r represents the observation point and r the source point at the aperture. This expression is known in the literature as the Helmholtz–Kirchhoff integral [11].

To solve equation (7), it is necessary to specify either Dirichlet or Neumann boundary conditions on S1, but not both simultaneously. In the case of Dirichlet boundary conditions, one has:

(8) ψ | 𝒜 = ψ 0 and ψ | S 1 𝒜 = 0 .

Here, the Green’s function G(r,r) must cancel out the term in the integral of equation (7) involving nψ, which implies the condition:

(9) G D ( r , r ) | S 1 = 0 .

On the other hand, under Neumann conditions, we have:

(10) n ψ | 𝒜 = n ψ 0 and n ψ | S 1 𝒜 = 0 .

In this case, the Green’s function G(r,r) must cancel the term containing ψ(r), leading to:

(11) n G N ( r , r ) | S 1 = 0 .

A special case in which the Green’s function satisfies the conditions stated in equations (9) and (11) is when S1 is an infinite flat screen located at z=0 [20]. In this configuration, the Green’s function is given by:

(12) G D , N ( r , r ) = 1 4 π e i k | r r | | r r | 1 4 π e i k | r r ′′ | | r r ′′ | .

This equation is constructed using the method of images, considering the geometric arrangement illustrated in Fig. 1. The subscripts D and N are associated with the and + signs, respectively. In this formulation, r′′ represents the position of the image source with unit magnitude. The point P corresponds to the location where the scalar field is evaluated by superposition of the contributions from the source and its image. Since the screen is at z=0, the normal derivative reduces to the derivative with respect to z. If we evaluate at z=0 in terms of cartesian coordinates, we obtain:

(13)|rr|=|rr′′|=(xx)2+(yy)2+(z)2.

Figure 1
Point source and its image.

It follows that GD cancels out, and its derivative with respect to z turns out to be:

(14) G D ( r , r ) z | z = 0 = 1 2 π ( 1 | r r | i k ) z | r r | 2 e i k | r r | .

On the other hand, in the Neumann case, we have that zGN cancels out, and the Green’s function takes the form:

(15) G N ( r , r ) | z = 0 = 1 2 π e i k | r r | | r r | .

Finally, by substituting equation (14) into equation (7), the diffracted scalar field under Dirichlet conditions is expressed as:

(16) ψ D ( r ) = 1 2 π 𝒜 ψ ( r ) ( 1 | r r | i k ) z | r r | 2 e i k | r r | d a .

Similarly, for Neumann conditions, by substituting equation (15) into equation (7), one obtains:

(17) ψ N ( r ) = 1 2 π 𝒜 z ψ 0 e i k | r r | | r r | d a .

These expressions are known in the literature as the Rayleigh–Sommerfeld integrals [19]. Note that in equation (16), we have zz. The coordinate z corresponds to the position of the source, adjacent to the aperture plane, used in the construction of the Green’s function. When substituted into equation (7), this coordinate corresponds to the z-component of the point at which the scalar field is evaluated.

Fig. 2 illustrates the diffraction geometry described by equations (16) and (17), with the origins of the vectors r and r located at the center of the aperture. In particular, it shows a plane wave of wavelength λ that is normally incident on an aperture of characteristic size a. The diffracted wave changes its shape as it propagates into the half-space z>0 and acquires a more defined structure as it moves away from the aperture. At a sufficiently large axial distance L, the wavefronts reaching the observation point P are almost flat. This far-field region corresponds to the Fraunhofer regime, where the distance L satisfies the condition:

La2λ.

Figure 2
Diffracted scalar wave.

Next, the behavior of the diffracted wave in the far-field limit is analyzed.

2.2. Fraunhofer diffraction

This work considers the diffraction of a plane wave by an aperture, as illustrated in Fig. 2. The diffracted wave is evaluated on a screen, referred to as the observation plane, located in the far field at a distance z=L from the center of the aperture.

Mathematically, the incident plane wave is modeled as:

(18) ψ i ( r , t ) = ψ 0 ( r ) e i ( k z ω t ) ,

where ψ0 represents the amplitude of the wave, k=2π/λ is the wavenumber associated with the wavelength λ, and ω is the angular frequency. In the plane over 𝒜 (z=0), the spatial part of the incident wave reduces to:

(19) ψ i ( r ) | z = 0 = ψ 0 .

This indicates that the field intensity distribution over 𝒜 is uniform.

The diffraction of a plane wave, or any type of wave, occurs when the characteristic size of the aperture is comparable to or smaller than the wavelength, that is, when kr1[1]. Under these conditions, the intensity distribution on the diffracted wavefront contains information about the geometry of the aperture, which becomes clearly observable in the far field, when the wavefront reaching the screen is approximately flat. Since r defines all observation points on the screen and r all source points in the aperture, in the far-field regime it holds that rr[6]. This relationship between the magnitudes of the vectors r and r allows us to simplify the differences |rr| in the algebraic terms of the integrals (16) and (17). However, the phase term k|rr| determines the curvature of the wavefront and, therefore, must be approximated with greater care in the far-field limit. The objective of this approximation is to identify the phase term corresponding to a plane wave arriving at the screen. To perform this approximation, the binomial expansion [21] is used as a mathematical tool:

(20) ( 1 x ) α = 1 α x + α ( α 1 ) 2 x 2 + ; α , | x | < 1 .

We apply this expansion to the phase term k|rr| of equation (16). Rewriting the phase:

k | r r | = k ( r 2 + r 2 2 r r ) 1 / 2 = k ( r 2 + r 2 2 r r ) 1 / 2

Expanding to second order, we obtain:

(21) k | r r | = k r k r 2 ( 2 r u r r r 2 r 2 ) + k r 8 ( 2 r u r r r 2 r 2 ) 2 + = k r k r u r + k r 2 [ r 2 + ( r u r ) 2 ] +

From this equation, we will consider only the first two terms, which are those that define Fraunhofer diffraction [19]. The higher-order terms are considered negligible compared to unity and tend to vanish as r tends to infinity.

Substituting the above result, equation (21), together with equation (19), into equation (16), we obtain:

(22) ψ ( r ) = ψ 0 2 π 𝒜 ( 1 | r r | i k ) z e i k r | r r | 2 e i k r u r d a .

Since rr, the term 1/|rr|0 and |rr|2r2. Consequently, equation (22) reduces to:

(23) ψ ( r ) = i k ψ 0 2 π 𝒜 z e i k r r 2 e i k r u r d a = i k ψ 0 z e i k r 2 π r 2 𝒜 e i k r u r d a .

From Fig. 2, it is seen that the square of the modulus of the vector r is given by:

r 2 = z 2 ( 1 + x 2 + y 2 z 2 ) = z 2 ( 1 + tan 2 θ ) ,

where θ is the angle between the vector r and the z-axis. For large values of z, the angle θ is small, which implies that tan2θ1. Consequently, when the observation plane is at a sufficiently large distance z=L, we have rL.

Considering these approximations, and expanding the scalar product urr(xx+yy)/L, equation (23) simplifies as:

(24) ψ ( x , y ) i k ψ 0 e i k L 2 π L 𝒜 e i k L ( x x + y y ) d a .

This equation is the Fraunhofer diffraction integral [8, 11, 12], which represents the Fourier transform of the aperture function and is used in the study of diffraction by small apertures in the far-field regime. The term eikL indicates that the fields in the plane z=L behave like plane waves. In this domain, the aperture acts as a continuous distribution of secondary sources whose waves interfere constructively and destructively in the observation plane.

3. Square and Circular Annular Aperture

Fig. 3 shows the apertures considered in this study. The first corresponds to a square annular aperture, defined between sides a and b, while the second represents a circular annular aperture, bounded between radii a and b.

Figure 3
Annular apertures: a) square, b) circular.

The square annular region, Fig. 3a, is mathematically expressed as:

𝒜 s = { ( x , y ) | a 2 x a 2 , a 2 y a 2 } { ( x , y ) | b 2 x b 2 , b 2 y b 2 } .

Evaluating the Fraunhofer integral, equation (24), we obtain:

(25) ψ ( x , y ) = i k ψ 0 e i k L 2 π L [ a 2 a 2 a 2 a 2 e i k L ( x x + y y ) d x d y b 2 b 2 b 2 b 2 e i k L ( x x + y y ) d x d y ] .

Integrating equation (25), results in:

(26) ψ ( x , y ) = i k ψ 0 e i k L 2 π L 4 L 2 x y k 2 [ sin ( k x a 2 L ) sin ( k y a 2 L ) sin ( k x b 2 L ) sin ( k y b 2 L ) ] .

Here, we have used the identity 2isin(θ)=(eiθeiθ). For simplicity, the dimensionless coordinates x¯=(kxa/2L) and y¯=(kya/2L) are defined, turning equation (26) into:

(27) ψ ( x ¯ , y ¯ ) = i k ψ 0 e i k L 2 π L ( a 2 b 2 ) a 2 ( a 2 b 2 ) x ¯ y ¯ [ sin ( x ¯ ) sin ( y ¯ ) sin ( b a x ¯ ) sin ( b a y ¯ ) ] .

Finally, the parameter h is introduced as a scaling factor defining the ratio between the inner and outer dimensions of the aperture. In particular, it is defined as b=ha, with 0h1, where h=0 represents a completely clear aperture, while h=1 indicates a completely closed aperture. With this definition, equation (27) is rewritten as:

(28) ψ ( x ¯ , y ¯ ) = i k A s ψ 0 e i k L 2 π L ( 1 h 2 ) x ¯ y ¯ [ sin ( x ¯ ) sin ( y ¯ ) sin ( h x ¯ ) sin ( h y ¯ ) ] ,

with As=(a2b2) being the area of the aperture. The equation gives the scalar field diffracted by a square annular aperture in terms of the dimensionless coordinates x¯ and y¯.

In the case of the circular annular aperture, depicted in Fig. 3b, the symmetry of the problem suggests the use of polar coordinates. Therefore, the circular annular region is mathematically expressed as:

𝒜 c = { ( r , θ ) b r a , 0 θ < 2 π } .

Thus, considering the aperture plane, the Cartesian coordinates are expressed as x=rcosθ and y=rsinθ, while in the observation plane we define x=ρcosΘ and y=ρsinΘ. With these changes, equation (24) is rewritten as:

(29) ψ ( r , Θ ) = i k ψ 0 e i k L 2 π L b a 0 2 π e i k ρ r L cos ( θ Θ ) r d r d θ ,

where the trigonometric identity corresponding to the difference of angles in the cosine function2 has been applied, and the area element has been rewritten in its polar form, da=rdrdθ. Due to the complete axial symmetry of the system, the solution must be independent of Θ. This allows us to consider the particular case Θ=0 without loss of generality. Therefore, the portion of the double integral associated with the variable θ is evaluated as:

(30) 0 2 π e i k ρ r L cos θ d θ = 2 π J 0 ( k ρ r L ) ,

where J0 is the zeroth-order Bessel function. Applying this result to equation (29), we obtain:

(31) ψ ( ρ ) = i k ψ 0 e i k L L b a J 0 ( k ρ r L ) r d r .

Applying the change of variable u=kρr/L, and using the recurrence relation of Bessel functions, Du[umJm(u)]=umJm1(u) for m=1, the final result of the integral is:

(32) ψ ( ρ ) = i k ψ 0 e i k L L [ L a k ρ J 1 ( k ρ a L ) L b k ρ J 1 ( k ρ b L ) ] = i k ψ 0 e i k L 2 π L 2 π ( a 2 b 2 ) ( a 2 b 2 ) [ L a k ρ J 1 ( k ρ a L ) L b k ρ J 1 ( k ρ b L ) ] .

In this equation, analogous to equation (26), we define the dimensionless radial coordinate ρ¯=kaρ/L and the parameter h as a scaling factor that determines the ratio between the inner and outer radii of the aperture, i.e., b=ha, yielding:

(33) ψ ( ρ ¯ ) = i k ψ 0 A c e i k L 2 π L 2 ( 1 h 2 ) ρ ¯ [ J 1 ( ρ ¯ ) h J 1 ( h ρ ¯ ) ] ,

with Ac=π(a2b2) being the area of the aperture. The equation gives the scalar field diffracted by a circular annular aperture in terms of the dimensionless coordinate ρ¯.

Equations (28) and (33) describe the spatial distribution of the diffracted wave. Since these functions are generally complex, their evaluation requires considering the physical field, i.e., the part of the wave that is observable or detectable. In practice, it is more convenient to analyze the field intensity rather than the field itself. For example, in optics, the high frequencies of electromagnetic waves make direct field measurement impractical; therefore, we work with irradiance, measured in units of power per unit area (W/m2), which is proportional to the real part of the square of the electric field modulus.

Similarly, for scalar waves in general, the quantity of interest is the intensity I, defined in terms of the square of the modulus of the scalar field:

(34) I ψ 2 .

Substituting equation (28), we obtain the expression for the relative intensity in the square annular aperture:

(35) I ( x ¯ , y ¯ ) I 0 = 1 ( 1 h 2 ) 2 [ sin ( x ¯ ) sin ( y ¯ ) x ¯ y ¯ sin ( h x ¯ ) sin ( h y ¯ ) x ¯ y ¯ ] 2 ,

and from equation (33), the expression for the circular annular aperture:

(36) I ( ρ ¯ ) I 0 = 4 ( 1 h 2 ) 2 [ J 1 ( ρ ¯ ) ρ ¯ h J 1 ( h ρ ¯ ) ρ ¯ ] 2 .

Here, I0=(ikAψ0eikL/2πL)2 represents a normalization constant proportional to the total scalar wave energy measured at a reference point P0 in the observation plane. The ratio I/I0 characterizes the relative intensity Ir, which constitutes the Fraunhofer diffraction pattern. The parameter h modulates the shape of the pattern, allowing us to analyze the effect that the geometry of the aperture has on the distribution of the diffracted energy.

When evaluating at h=0, equations (35) and (36) reduce to the classical cases of diffraction by square and circular apertures, respectively:

I r ( x ¯ , y ¯ ) = [ sin ( x ¯ ) sin ( y ¯ ) x ¯ y ¯ ] 2 , I r ( ρ ¯ ) = [ 2 J 1 ( ρ ¯ ) ρ ¯ ] 2 .

In this limit, the parameter h no longer influences the intensity distribution, and the resulting pattern corresponds to that of a simple aperture.

It is important to note that the harmonic structures of equations (35) and (36) generate regions in the plane where the energy is maximized and minimized until it cancels out completely. Given this behavior, it is relevant to study the fraction of incident energy F contained in a region D, bounded by optimal points.

This energy fraction is calculated by the following expression [12]:

(37) F = D I r d a ¯ + + I r d a ¯ ,

where Ir represents the relative intensity and da¯ is the area element in dimensionless coordinates.

For the case of the square annular aperture, the integration of equation (35) over the entire plane is considered. The corresponding integral is:

+ + 1 ( 1 h 2 ) 2 [ sin ( x ¯ ) sin ( y ¯ ) x ¯ y ¯ sin ( h x ¯ ) sin ( h y ¯ ) x ¯ y ¯ ] 2 d x ¯ d y ¯ .

Expanding the binomial and taking advantage of the symmetry of the relative intensity with respect to x¯ and y¯, Ir(x,y)=Ir(x,y), the expression is rewritten as:

4 ( 1 h 2 ) 2 [ 0 0 sin 2 ( x ¯ ) sin 2 ( y ¯ ) x ¯ 2 y ¯ 2 + sin 2 ( h x ¯ ) sin 2 ( h y ¯ ) x ¯ 2 y ¯ 2 2 sin ( x ¯ ) sin ( y ¯ ) sin ( h x ¯ ) sin ( h y ¯ ) x ¯ 2 y ¯ 2 ] .

The factored form of the integrands allows the integrals to be solved separately, reducing them to the product of integrals of the type [22]:

0 sin ( a u ) sin ( b u ) u 2 d u = b π 2 , with 0 < b a .

Applying this identity to the integral expressions above, we obtain:

(38) 4 ( 1 h 2 ) 2 [ π 2 4 + π 2 h 2 4 π 2 h 2 2 ] = π 2 1 h 2 .

Therefore, if D is a rectangular region of the observation plane defined by the domain R=[x¯1,x¯2]×[y¯1,y¯2], then by substituting equation (38) in the denominator into equation (37), the energy fraction is expressed as:

(39) F ( x ¯ , y ¯ ) = 1 h 2 π 2 x ¯ 1 x ¯ 2 y ¯ 1 y ¯ 2 I r ( x ¯ , y ¯ ) d x ¯ d y ¯ = 1 π 2 ( 1 h 2 ) x ¯ 1 x ¯ 2 y ¯ 1 y ¯ 2 [ sin ( x ¯ ) sin ( y ¯ ) sin ( h x ¯ ) sin ( h y ¯ ) x ¯ y ¯ ] 2 d x ¯ d y ¯ .

On the other hand, for the circular annular aperture, the integration of equation (36) in polar coordinates is considered. The integral over the entire domain is:

0 0 2 π [ 4 ( 1 h 2 ) 2 ( J 1 ( ρ ¯ ) ρ ¯ h J 1 ( h ρ ¯ ) ρ ¯ ) 2 ] ρ ¯ d θ ¯ d ρ ¯ .

Integrating with respect to the variable θ¯ and expanding the binomial, we obtain:

8 π ( 1 h 2 ) 2 [ 0 J 1 2 ( ρ ¯ ) ρ ¯ + h 2 J 1 2 ( h ρ ¯ ) ρ ¯ 2 h J 1 ( ρ ¯ ) J 1 ( h ρ ¯ ) ρ ¯ d ρ ¯ ] .

Each of these integrals is of the type [23]:

0 J 1 ( a u ) J 1 ( b u ) u d u = b 2 a , b a .

Applying this identity, we obtain the following result:

(40) 8 π ( 1 h 2 ) 2 [ 1 2 + h 2 2 h 2 ] = 4 π 1 h 2 .

Finally, if D is a circular region of radius ρ¯ in the observation plane, the contained energy fraction is obtained by substituting the result of equation (40) into the denominator of equation (37). The expression is:

(41) F ( ρ ¯ ) = 1 h 2 4 π 0 ρ ¯ 2 π I r ( ρ ¯ ) ρ ¯ d ρ ¯ = 2 1 h 2 0 ρ ¯ [ J 1 ( ρ ¯ ) h J 1 ( h ρ ¯ ) ρ ¯ ] 2 d ρ ¯ .

Since the exact analytical solutions of equations (3) and (41) are not trivial, we resort to numerical implementation in Maple 25 and Python 3.13 to evaluate the fraction of contained energy in different regions of interest and analyze its behavior as a function of h.

4. Diffraction Patterns

The Maple 25 software was used, as the first option, to simulate the diffraction patterns of the apertures under study. Fig. 4 and Fig. 5 present the surface plots and diffraction patterns corresponding to the square annular and circular annular apertures, respectively, for h values of 0, 0.495, and 0.825. The code used in the Maple worksheet to generate these plots is shown in Fig. 6.

Figure 4
Relative intensity and diffraction patterns of the square annular aperture.
Figure 5
Relative intensity and diffraction patterns of the circular annular aperture.
Figure 6
Maple code for simulation of diffraction patterns.

For the visualization and animation of the plots, the packages with(plots) and with(animate) were used. The variables IR and IC represent equations (35) and (36), respectively. The execution of the commands plot3d and densityplot, together with animate, allows observing the evolution of the intensity distribution and diffraction pattern as the parameter h varies in the interval 0h<0.99.

In the simulation, we set h=0.99 as the upper bound instead of h=1. This was done in order to ensure the proper execution of the code by avoiding potential errors that may arise due to the singularity of the 1/(1h2) term in equations (35) and (36).

These figures show that the relative intensity decays rapidly with distance, presenting a central peak of maximum intensity normalized to unity. The results obtained for h=0 are consistent with the diffraction patterns of square and circular apertures reported in the literature [3, 8, 11, 12].

The parameter h significantly modifies the geometry of the diffraction pattern. As h increases in the square annular aperture, the pattern evolves into a more complex configuration with the appearance of square dark edges around the central maximum. In the circular annular aperture, on the other hand, the increase in h mainly alters the distribution of the concentric rings, making them more pronounced.

Fig. 7 shows the intensity cross-sectional profiles, highlighting the first three intensity maxima and minima. The corresponding optimal values are shown in Tables 1 and 2.

Figure 7
Relative intensity Ir for different values of the scale factor h: a) Square annular aperture, b) Circular annular aperture.
Table 1
Intensity maxima and minima of the square annular aperture.
Table 2
Intensity maxima and minima of the circular annular aperture.

It is observed that, with increasing h, the primary minima shift toward the center, reducing the width of the main peak. In addition, the secondary maxima intensify and also shift their positions toward the center.

From the primary minima, the fraction of total incident energy contained in the central maximum peak is calculated using equations (3) and (41). Table 3 presents the width of the central peak and the fraction of incident energy contained in it.

Table 3
Fraction of incident energy in the central maximum of annular apertures for different values of h.

In the region bounded by the first primary minima, most of the incident energy is concentrated. This energy fraction reaches its maximum value when the aperture is completely clear. The geometry of the aperture plays a fundamental role in the redistribution of the diffracted energy; in particular, the fraction of energy contained in the central region is greater for the circular aperture than for the square one.

As our analysis demonstrates, the presence of an obstacle modifies the geometry of the aperture and, consequently, the energy distribution in the diffraction pattern. As the effective area of the aperture is reduced, the width of the central peak decreases, leading to a reduction in the fraction of energy confined to this region.

In the case of the square aperture, the decrease in energy concentration at the central maximum is compensated by an increase in the intensity of the local maxima. For the circular aperture, the same effect manifests as an increase in the intensity of the concentric rings adjacent to the central disk. The plots in Fig. 8 show the loss of energy concentration at the central maximum as the value of the parameter h increases. When the reduction in the aperture area is more pronounced, the energy is more evenly distributed among the local maxima.

Fig. 9 presents the code used in the Maple worksheet to obtain the tabulated values. These results come from the graphical and numerical analysis of the density profile. The package with(optimization) provides tools for the direct computation of the optimal points. The commands Maximize and Minimize allow the determination of the intensity maxima and minima together with their coordinates.

Figure 8
Fraction of energy contained in the central maximum as a function of the parameter h, for the annular apertures: (a) square and (b) circular.
Figure 9
Maple code for calculating the energy fraction in the central maximum.

By combining these commands with evalf, the user can select the number of significant figures with which the result is to be displayed. Since the calculation of optimal values requires the specification of an interval, it is conveniently chosen based on the visualization of the graph generated with the plot command.

Notice that, for the intensity in the square aperture, the limit of IR as y0 is used as the analysis variable, which converts IR into its one-dimensional form. Finally, the variables FR and FC are used to calculate the fraction of energy contained in the central peak by integrating the intensity in the region bounded by the first minima, according to equations (3) and (41).

5. Simulation in Python: Graphical User Interface

As noted in the previous section, Maple allows good results to be obtained in the simulation of diffraction patterns with few lines of code. However, the commercial and proprietary nature of the software limits the reproducibility of the simulation and its numerical analysis by the academic community. This motivated the development of an open-access alternative implemented in Python.

This section presents the design of a graphical user interface (GUI) in Python. Through these environments, users interact with a computer or software application using visual elements such as icons, menus, and buttons, rather than typing commands into a text-based interface [24]. The result of this interaction is to display abstract and complex ideas in mathematics and physics in pictorial or graphical forms, such as those developed in various educational works [25, 26, 27]. These interfaces are particularly suitable for the university level because of their ease of use and immediacy in displaying results.

Fig. 10 shows the interface developed in Python 3.13. The diffraction patterns are displayed in the upper left corner, while the relative intensity distribution graphs are shown in the upper right corner. The lower part of the interface contains the interactive controls: in the lower left corner, there are two sets of radio buttons, and in the lower center, there is a slider to control the parameter h.

Figure 10
Graphical user interface in Python 3.13. (a) View for a square aperture with h=0, showing the diffraction pattern and 3D intensity distribution. (b) View for a circular aperture with h=0.34, showing the diffraction pattern and intensity profile with a table of optimal values.

The first set of radio buttons allows the user to select the type of pattern to observe: square aperture or circular aperture. The second set allows the user to choose the type of graphical perspective for the intensity distribution: three-dimensional visualization in space (depending on the selected aperture type) or density profile. This latter option highlights the point of maximum intensity, the first two local maxima, the first three local minima, and the integration region around the maximum intensity zone considered for the calculation of the energy fraction along the central peak. The profile graph is accompanied by a table with the identified optimal values and a box showing the width of the central peak and the energy fraction contained within it.

The slider continuously modulates the parameter h from its initial value h=0 (unobstructed aperture) to values close to complete obstruction. As the control is moved, the interface displays an animated representation of how the diffraction pattern evolves, the change in relative intensity, the shift in local maxima and minima, the variation in the width of the central peak, and the redistribution of energy within it. In this way, the interface presents all the results considered in this study in an integrated and interactive manner.

The integration of interactive components, the color contrast gradient in the diffraction patterns, the numerical optimization and integration calculations, and the handling of special functions such as Bessel functions require the implementation of specialized Python library packages and a considerable number of lines of code. To ensure the automatic reproducibility of all results, an open-access link is provided with the interface in .py format for direct execution from any computer with Python installed, as well as the code in .txt format for readers interested in reproducing the simulation or adapting the logic to other software environments of their choice.

6. Conclusions

In this study, Fraunhofer diffraction patterns generated by square and circular annular apertures were simulated. The annular aperture was defined as the open space between an aperture of fixed size and an inner concentric obstacle of the same geometry, whose area is varied by a scaling parameter h. This parameter modifies the geometry of the aperture and, consequently, the shape and energy distribution in the diffraction pattern.

Using Maple 25 and Python 3.13 software, the evolution of the relative intensity distribution and the diffraction pattern was visualized with the increase of the parameter h, providing a detailed and highly informative perception of the diffraction phenomenon. It was observed that, regardless of the value of h, all diffraction patterns of the annular apertures studied exhibit a central intensity maximum. Taking advantage of the versatility of both platforms for performing numerical calculations, the width of the central maximum and the fraction of incident energy contained in this region were determined.

The results revealed that both the width and energy concentration of the central maximum decrease as the aperture area is reduced. This loss of energy concentration is compensated by an increase in the intensity of the secondary maxima and other peaks in the pattern. The control exerted by h over the diffraction pattern may have useful applications, for example, in optics and imaging systems.

The implementation in Maple 25 and Python 3.13 presents results that are consistent with each other and with those reported in the literature for unobstructed apertures. In this sense, the choice of one program or another depends on factors such as institutional accessibility, computational ease, and user familiarity with each platform. Maple offers advantages in terms of implementation simplicity due to its built-in functions, while Python ensures accessibility and reproducibility because of its open-source nature. From a pedagogical perspective, the implemented codes and the interactive graphical interface developed in Python constitute valuable tools for courses on waves or optics, particularly in online teaching modalities that lack a physical laboratory or in institutions with financial limitations for acquiring experimental equipment. The incorporation of interactive digital tools enriches the educational process by capturing students’ attention and facilitating the understanding of complex physical phenomena through dynamic visualization.

Data Availability

The Python 3.13 graphical interface developed for this study is openly available at: https://doi.org/10.5281/zenodo.17401425 If any difficulty arises in accessing the file, it may be requested directly from the corresponding author.

Referências

  • [1] J.M. Alvarado Reyes, A. Santos Aguilar and C.M.S. Reimer López, Rev. Mex. Fis. E 18, 50 (2021).
  • [2] O. Helene, Í.S. Fernandes and T.G.S. Martins, Rev. Bras. Ens. Fis. 45, e20220281 (2023).
  • [3] E. Hecht, Optics (Pearson Education, London, 2017), 5 ed.
  • [4] M. Martínez-Ripoll and P. Román-Polo, An. Quím. 108, 225 (2012).
  • [5] J. Piechowicz, Acta Phys. Pol. A 119, 1040 (2011).
  • [6] E. Hecht and A. Zajac, Óptica (Addison-Wesley Iberoamericana, Wilmington, 1986).
  • [7] F.F. Medina, Rev. Mex. Fis. 31, 311 (1984).
  • [8] J.W. Goodman, Introduction to Fourier Optics (Macmillan Learning, New York, 2017), 4 ed.
  • [9] D.M. Reis, E.M. Santos and A.V. Andrade-Neto, Rev. Bras. Ens. Fis. 37, 2312 (2015).
  • [10] F.S. Crawford Jr., Ondas (Editorial Reverté, Barcelona, 1994), v. 3.
  • [11] M. Born and E. Wolf, Principles of Optics (Cambridge University Press, Cambridge, 1997), 7 ed.
  • [12] A. Ghatak, Optics (McGraw-Hill, New York, 2010).
  • [13] E. Alvarado-Anell, M. Sosa and M. Moreles, Rev. Mex. Fis. E 51, 102 (2005).
  • [14] G. Ortigoza Capetillo, Rev. Mex. Fis. E 53, 56 (2007).
  • [15] G. Ortigoza and R.I. Ponce de la Cruz Herrera, Rev. Mex. Fis. E 20, 020209 (2023).
  • [16] E.I.B. Rodrigues, Rev. Bras. Ens. Fís. 47, e222 (2025).
  • [17] S.R. Oliveira, Rev. Bras. Ens. Fís. 46, e20240060 (2024).
  • [18] J.E. Harvey and C. Ftaclas, Appl. Opt. 34, 6337 (1995).
  • [19] J.D. Jackson, Electrodinámica Clásica (Wiley, Madrid, 1980), 3 ed.
  • [20] M.L. Calvo Padilla, Óptica Avanzada (Ariel, Barcelona, 2002).
  • [21] J. Stewart, Cálculo de una Variable (Cengage Learning, Ciudad de México, 2008), 6 ed.
  • [22] I.S. Gradshteyn and I.M. Ryzhik, Table of Integrals, Series, and Products (Elsevier, New York, 2007), 7 ed.
  • [23] G.N. Watson, A Treatise on the Theory of Bessel Functions (Cambridge University Press, Cambridge, 1966), 2 ed.
  • [24] M.Y. Tufail and S. Gul, Rev. Mex. Fis. E 22, 010208 (2025).
  • [25] F. Arriaga, J.P. Staneck, F. Lanzini and O. Fornaro, Anales AFA 30, 77 (2018).
  • [26] D.H. Penalver-Vidal, D.L. Romero-Antequera and F.S. Granados-Agustín, Rev. Mex. Fis. E 59, 18 (2013).
  • [27] A. Razzak and Z. Uddin, Rev. Mex. Fis. E 20, 010208 (2023).
  • 1
    This assumption corresponds to Sommerfeld’s radiation condition, which physically excludes any incoming or reflected waves from infinity. Sommerfeld formulated the radiation condition to ensure the uniqueness of the solution to the Helmholtz equation in the exterior domain.
  • 2
    cos ( α β ) = cos α cos β + sin α sin β

Edited by

Publication Dates

  • Publication in this collection
    09 Jan 2026
  • Date of issue
    2025

History

  • Received
    01 Aug 2025
  • Reviewed
    22 Oct 2025
  • Accepted
    20 Nov 2025
location_on
Sociedade Brasileira de Física - SBF Rua do Matão, travessa R, 187 - Edifício Sede - Cidade Universitária, São Paulo, SP, Brasil, CEP 05508-090, Tel: +55 (11) 3034-0429 - São Paulo - SP - Brazil
E-mail: rbef@sbfisica.org.br, marcellof@unb.br
rss_feed Stay informed of issues for this journal through your RSS reader
Go to top Report error