Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

An Assignment On

Dirac Delta Function In Computation

Submitted by

Pritam Pal
Roll No. - 002020701052

Studying B.Sc. Physics (UG-II)


in
JADAVPUR UNIVERSITY
Kolkata – 700032

May , 2023
Contents

I. Dirac Delta Function - Definition & Properties.

II. Representation of Dirac Delta Function Using Conventional

Functions.

III. Main Program & Different Types of Representations Used.

IV. Tabular Representation of Obtained Results.

V. Discussions.
Dirac Delta Function - Definition & Properties
In mathematical physics, the Dirac delta distribution (δ distribution), also known as
the unit impulse, is a generalized function or distribution over the real numbers, whose value is zero
everywhere except at zero, and whose integral over the entire real line is equal to one. Here we will be
focusing on one dimensional Dirac delta function.

Figure 1 : Schematic representation of the Dirac delta by a line surmounted by an arrow. The height of the arrow is
usually meant to specify the value of any multiplicative constant, which will give the area under the function.

Mathematical definition of δ(x) can be expressed as –


+∞
1
𝛿 (𝑥 ) = ∫ 𝑒 𝑖𝑘𝑥 𝑑𝑘
2𝜋 −∞

And for a shifted delta function, we can write –


+∞
1
𝛿 (𝑥 − 𝑎 ) = ∫ 𝑒 𝑖𝑘(𝑥−𝑎) 𝑑𝑘
2𝜋 −∞

where, ‘a’ is an finite integer.

Two most fundamental properties of delta function are discussed below –


+∞
(1) ∫−∞ 𝛿(𝑥 − 𝑎)𝑑𝑥 = 1 : Area under the δ(x) or δ(x-a) vs x graph is always 1.

+∞
(2) ∫−∞ 𝑓(𝑥)𝛿(x − a)dx = 𝑓(𝑎)

We will be verifying these two properties with the help of computation, where to represent delta function,
we will use some conventional functions within proper limits.
Representation of Dirac Delta Function Using Conventional Functions
The problem with the delta function is that it is, mathematically speaking, not a function but
rather a distribution. Continuum mechanics and the underlying mathematics have trouble with functions
that are non-continuous. This is why we usually try to convert the delta function to a form that we can
treat better mathematically.

(1) Representation using Gaussian distribution within proper limits –

1 𝑥2
− 2
lim e a
a→0 √𝜋a

Where, as ‘a’ approaches to zero, the width of the distribution along x axis decreases and it
acts like delta function.

Figure 2 : Representation of delta function using Gaussian distribution.

(2) Representation using the Poisson kernel within proper limits –

The Poisson kernel is the fundamental solution of the Laplace equation in the
upper half-plane. It represents the electrostatic potential in a semi-infinite plate whose
potential along the edge is held at fixed at the delta function.

1 a
lim
a→0 𝜋 (x 2 + a2 )

Here also, as ‘a’ approaches to zero, the width of the distribution along x axis
decreases and it acts like delta function.
Figure 3 : Representation of delta function using the Poisson kernel.

(3) Representation using the intensity distribution of single slit diffraction within proper
limits –

𝑥
sin ( )
lim 𝑎
a→0 πx

Here also, as ‘a’ approaches to zero, the width of the distribution along x axis
decreases and it acts like delta function.

Figure 4 : Representation of delta function using the intensity distribution of single slit diffraction.
Main Program & Different Types of Representations Used

(A) Main Program : File Name - “delta.f90”

program dirac
real::m,a,b,y,z
do i=0,1
do j=0,3
m=0.05/10**i
b=10.**j ; a=-1.*b
call simpson(a,b,m,y,z)
write(*,9) m, b, z, y
9 format(4(f10.5,3x))
enddo
enddo
end program dirac

subroutine simpson(a,b,m,y,z)
integer::n
real::a,b,y,z,h,m
n=2*10**6
h=(b-a)/n
y=h*(f(a,m)+f(b,m))/3
z=h*(d(a,m)+d(b,m))/3

do i=1,n-1,2
y=y+(4*h/3)*f(a+i*h,m)
z=z+(4*h/3)*d(a+i*h,m)
enddo

do i=2,n-1,2
y=y+(2*h/3)*f(a+i*h,m)
z=z+(2*h/3)*d(a+i*h,m)
enddo
end subroutine simpson

function f(x,m)
real::x,m
f=(6-5*x*x)*d(x,m)
end function f

(1) Function 1 : File Name - “d1.f90”

function d(x,m)
real::x,pi,m
pi=acos(-1.)
d=1/(sqrt(pi)*m)*exp(-(x*x)/(m*m))
end function d
(2) Function 2 : File Name - “d2.f90”

function d(x,m)
real::x,pi,m
pi=acos(-1.)
d=(m/(x*x+m*m))/pi
end function d

(3) Function 3 : File Name - “d3.f90”

function d(x,m)
real::x,pi,m
pi=acos(-1.)

if (abs(x)>0.0005) then
d=sin(x/m)/(pi*x)
else
return
endif

end function d

Form of the Outputs :

Compile : gfortran delta.f90 d1.f90


Run : ./a.out

Output :

0.05000 1.00000 0.99971 5.99232


0.05000 10.00000 0.99998 5.99362
0.05000 100.00000 1.00000 5.99374
0.05000 1000.00000 0.99998 5.99365
0.00500 1.00000 0.99997 5.99983
0.00500 10.00000 1.00000 5.99992
0.00500 100.00000 1.00000 5.99996
0.00500 1000.00000 0.99994 5.99956
Tabular Representation of Obtained Results

+L +L

𝛿(x) a L ∫ 𝛿(x)dx ∫ f(x)𝛿(x)dx


−L −L

0.050 1 0.99971 5.99232


10 0.99998 5.99362
1 𝑥2 100 1.00000 5.99374
− 2
lim ea
a→0 √𝜋a 1000 0.99998 5.99365
0.005 1 0.99997 5.99983
[ 𝑛 = 2 × 106
is used in integration ] 10 1.00000 5.99992
100 1.00000 5.99996
1000 0.99994 5.99956

0.050 1 0.90637 5.38521


10 0.97295 5.22243
1 a 100 0.99168 -9.74844
lim
a→0 𝜋 (x 2 + a2 ) 1000 0.99739 -128.00000
0.005 1 0.97295 5.84439
[ 𝑛 = 2 × 107
is used in integration ] 10 0.99168 5.89730
100 0.99739 5.41367
1000 0.99916 -9.77966

0.050 1 0.98350 5.96552


10 0.99837 6.71332
𝑥
sin ( ) 100 1.00032 0.14620
lim 𝑎
a→0 πx 1000 0.99997 135.51549
0.005 1 0.99837 5.99251
[ 𝑛 = 2 × 106
10 1.00022 5.94085
is used in integration ]
100 0.99991 7.29329
1000 0.99987 22.03043

Note: Simpson’s 1/3rd Rule of numerical integration is used for every case.
Discussions
Here we can see, in most of the cases the required values or very close to required values
are obtained. But for single precision as the computing is restricted up to 8th power of 10,
in the case of the 2nd and 3rd function for higher integration limits (L), the obtained values
are highly deviated. So, to get more accurate values in those cases, we must increase the
precision in integration.

On the other hand, for the 1st function, we got almost accurate results for each and every
case. So, we can conclude that – the Gaussian distribution function within proper limits
represents the Dirac delta function in most optimal way, as it gives more accurate values
and uses less computing power than the others to do so.

You might also like