Aksha Bajpai
Aksha Bajpai
ANANTAPUR CAMPUS
Department of Physics
Python Project Work
6th Semester
Paper Title: Software Laboratory
Paper Code: UPHY-608
Submitted by:
Aksha Bajpai
Reg. no: 172208
OBJECTIVE:
At the core of the NumPy package, is the ndarray object. This encapsulates n-
dimensional arrays of homogeneous data types, with many operations being
performed in compiled code for performance. There are several important
differences between NumPy arrays and the standard Python sequences:
NumPy arrays have a fixed size at creation, unlike Python lists (which can
grow dynamically). Changing the size of an ndarray will create a new
array and delete the original.
The elements in a NumPy array are all required to be of the same data
type, and thus will be the same size in memory. The exception: one can
have arrays of (Python, including NumPy) objects, thereby allowing for
arrays of different sized elements.
NumPy arrays facilitate advanced mathematical and other types of
operations on large numbers of data. Typically, such operations are
executed more efficiently and with less code than is possible using
Python’s built-in sequences.
A growing plethora of scientific and mathematical Python-based packages
are using NumPy arrays; though these typically support Python-sequence
input, they convert such input to NumPy arrays prior to processing, and
they often output NumPy arrays. In other words, in order to efficiently use
much (perhaps even most) of today’s scientific/mathematical Python-
based software, just knowing how to use Python’s built-in sequence types
is insufficient - one also needs to know how to use NumPy arrays.
(b) Matplotlib:
Matplotlib 2.0.x supports Python versions 2.7 through 3.6. Python 3 support
started with Matplotlib 1.2. Matplotlib 1.4 is the last version to support Python
2.6.] Matplotlib has pledged to not support Python 2 past 2020 by signing the
Python 3 Statement.
THEORY:
Radioactive Decay
The atom particles cannot be bounded because there is no energy due to the
presence of an unstable nucleus in the element’s radioisotope. There is a
constant decay in the isotopes in order to stabilize itself with a release of a lot
of energy in the form of radiations.
1. Alpha
2. Beta
3. Gamma.
1. Alpha decay:
When an alpha particle emits from a nucleus, the process is called alpha decay.
The energy of alpha decay is given as:
E=(m −mf−mp)c2
i
Where,
The nucleus of helium is taken as the alpha particle which is very stable. It has a
group of two protons and two neutrons. For example, alpha decay of uranium-
238 is shown below
92
U238→9oTh234+2He4
2. Beta Decay:
Th234→91Pa234+e0−1
90
3. Gamma Decay:
The nucleus has orbiting electrons which indeed have some energy, and when
an electron jumps from a level of high energy to a level of low energy, there is
an emission of a photon. The same thing happens in the nucleus: whenever it
rearranges into a lower energy level, a high-energy photon is shot out which is
known as a gamma ray.
Radioactive Decay Law
Suppose the gold nucleus in the scattering experiment has a radius R. An alpha
particle trajectory can be specified by its impact parameter b.
Clearly b>R, due to less coulomb repulsion, the deflection of alpha particles is
also less.
When b<R, the alpha particle goes through the nuclear positive charge
distribution and so the nuclear charge above the trajectory and one below the
trajectory work in opposite directions and hence again the deflection produced
is very small. When the alpha particles just graze the nucleus, the Coulumb
repulsion becomes the maximum and for b~R the deflection of alpha particle is
maximum.
F=(1/4πέo)*(2Ze2/b2)
If the particle has velocity v,The time during which the force operates is
Δt=b/v
F=Δp/ Δt
Δp=FΔt=(1/4πεo)*(2Ze2/b2)*( b/v)
Thus,
b=(1/4πεo)*(2Ze2/mv2)/ θ
R =(1/4πεo)*(2Ze2/mv2)
This is an extremely small distance. When compared with the atomic radius,
which is 10-10, we see that it is smaller by a factor of 104.
Nuclear Fusion
Nuclear fusion is a reaction through which two or more light nuclei collide with
each other to form a heavier nucleus. This reaction takes place with elements
which have a low atomic number, such as Hydrogen. It is the opposite of
nuclear fission reaction in which heavy elements diffuse and form lighter
elements. Both nuclear fusion and fission produce a massive amount of
energy.
Every star in the universe, including the Sun, is alive due to nuclear fusion. It is
through this process that they produce such a mind-boggling amount of heat
and energy. The pressure at the core of any star is tremendously high and that
is where the nuclear fusion reaction takes place.
For example, the temperature at the core of the sun is around 15 million
degrees Celsius. At this temperature,Coupled with very high pressure, two
isotopes of Hydrogen, Deuterium and Tritium, fuse to form Helium and releases
the massive amount of energy in the form of heat. Around 600 million tons of
hydrogen is converted into Helium every second in the Sun.
These two are the major nuclear reactions that take place. The basic differences
between Nuclear Fission and Nuclear Fusion are:
If utilized properly, nuclear fusion is the answer to the world’s power crisis
problem. It is clean and produces a minimal amount of nuclear waste as
compared to fission reactions. The fuel for fusion, Deuterium, and Tritium, are
also readily available in nature. Scientists are hopeful that in the coming
centuries, fusion will be a viable alternative power source
PROGRAMS
Aim: To plot the radioactivity curve using the Euler’s Method of solving
differential equations.
Requirements:
Algorithm:
Step 2: Write a program for the outline of the plot that comprises of heading,
background, face colours, font weight, font styles and annotations.
1)Define the variables ‘fig’ and ‘ax’ in order to set the outlines with respect to
these two functions.
2)For setting up all types of outlines, write the colours, font styles, font weight
etc. accordingly with the conventional codes assigned to each of them.
3) To write the equation in a box and to annotate, define the coordinates and
other necessary outlines i.e. font weight, font style, face colour, shrink etc. and
type the contents.
2) Initialize a while loop for a specific range and write the equations under it
considering all the data points for that particular range using append.
Input:
Output:
(2) Rutherford’s scattering
Aim: To find the total number of alpha particles which underwent reflection in
Rutherford’s Gold Foil experiment.
Requirements:
(b)Required Modules:
Random and math (under math: square root, cos, sin and pi)
Algorithm:
Step 1: Import the necessary modules i.e. square root, cos, sin, pi and random.
Step 2: Define the magnitude of the constants taking account of signs as well.
Step 3: Set a large value for the total number of alpha particles falling on the
Gold foil.
(a)Assign a zero value to the initial count of the total number of alpha particles
that are getting reflected.
(b) Set up a FOR Loop in the range of N (i.e. total number of alpha particles
bombarded on the gold foil)
(c) Get the value of impact parameter ‘b’ from the random number function
loop.
(e) At the end of the loop, print the count (i.e. the total number of alpha
particles which underwent reflection)
Input:
Output:
Nuclear Fusion
Requirements:
Algorithm:
Step 1: Import the necessary modules i.e. square root, cos, sin, pi and random.
Step 2: Define a variable ‘fig’ and give the syntax for giving a subtitle.
Step 3: Initialize the seed as 0 from the module random and specify the number
of points required.
Step 4: Give x,y as an array using linspace and z as griddata from grid data
module.
Step 5: For getting a circular shape (i.e. the atom), define a variable to plot the
contour mentioning the three axes x.y and z with the desired linewidth and
colour.
Step 6: To show the arrow marks, to indicate deuterium and tritium define a
variable ‘ax’ with subplot (111) by using appropriate syntax.
Step 7: To write and annotate use the variable ‘ax’ by writing ax.text and
ax.annotate to write on the image of the nuclei.
Result:
Output:
References: