You are on page 1of 7

DETERMINATION OF BOND LENGTH

OF A DIATOMIC MOLECULES

NAME : A.Thirulogachandru
ROLL NO : 19PHY34
CLASS : II-M.Sc. Physics
DATE : 27-02-2020
DETERMINATION OF THE BOND LENGTH OF A
DIATOMIC MOLECULES

AIM:
To develop a program in C++ to calculate the bond length of diatomic molecule
by minimizing the potential energy.

THEORY:
There are many problems in physics to find the value of x which the function
f(x) is zero. We identify the value of x as the root or zero of the equation. Bisection
method , Newton method and Secant method are a few numerical methods to find the
zeros or roots of an equation.

SECANT METHOD:
The analytical expression of the first derivative of the function is needed to find
the root of function in the Newton method. But the analytical expression of the first
derivative may not exist or difficult to obtain. In such cases, Secant method, popularly
known as the discrete Newton method, is often used. The iterative formula to determine
the root of a function by Secant method is

𝒙𝒌+𝟏 = 𝒙𝒌 − (𝒙𝒌 − 𝒙𝒌−𝟏 )𝒇𝒌 /(𝒇𝒌 − 𝒇𝒌−𝟏 )


All the root search schemes can be generalised to search for the extreme of a
single variable function. However at each step of updating the value of x,we need to
make a judgement as to whether 𝑓 (𝑥𝑘+1 ) is decreasing (or increasing) if we are
searching for a minimum (or maximum) of the function. If it is not decreasing, we
reverse the update,i.e instead of using, we should use 𝑥𝑘+1 = 𝑥𝑘 − ∆𝑥𝑘 . In the Secant
method, the change in bondlength is ∆𝑥𝑘 = −(𝑥𝑘 − 𝑥𝑘−1 )𝑓𝑘 /(𝑓𝑘 − 𝑓𝑘−1 ).
PROCEDURE:
A programme in c++ is developed to determine the bond length of a diatomic
molecule by the Secant method, a method to find the zero of a function. The programme
has the constant integer, ‘Maximum iteration’ that is said to 20. It limits the number of
iteration in the Secant method in computation of the bond length. Another ‘double’
constant data, precision, holds the value of the precision to which the bond length should
be calculated. The next ‘double’ data,’change in bond lengths’ holds the changes in the
computed bond length during the computation. A class ‘bond’ is developed with three
data members and five member functions for the determination of the bond length of a
diatomic molecule using Secant method.

The data member ‘bond length’ holds the bond length value after evaluation. It
also holds the initial value of the bond length for calculation. The next data member,
v0, holds the potential constant for estimating the potential of a diatomic molecule.
Another data member, r0, holds the radial constant for estimating the potential of the
diatomic molecule. The 2member function collectdata() initialises the data members by
reading through the keyboard. The member function processdata() calls another
member function. Secant method() to compute the bond length by minimizing the
potential energy using the Secant method. The member function function(double) finds
the derivative of the potential. It willalso we called by the member functions, Secant
minimum(). The member function, displaydata(), displays the bond length of the
diatomic molecule at equilibrium.

The main programme creates an object ‘b’ of the class ‘bond’. Then it calls the
collectdata() to initialise the variables to carry out minimisation of the potential energy.
The member function Secantminimum() is called by the member function.
Processdata() function to compute the bond length by minimising the potential energy.
The member functions double function() and double derivative () are called by the
member function. Secantminimum() to evaluate the value of the potential and it is
derivative at the given point. The developed programme is compiled and executed under
TURBO C++ environment.
PROGRAM:
#include<iostream.h>
#include<math.h>
#include<conio.h>
#include<stdlib.h>
const double e2=14.4;
class bond
{
Double del,r,dr,r0,v0;
public:
bond();
void secant2(int);
double g(double);
double f(double);
voiddisplayresult();
};
void main()
{
clrscr();
bond b;
int n=20;
b.secant2(n);
b.displayresult();
getch();
}
bond::bond()
{
del=1.0e-6;
r=2;
dr=0.1;
cout<<”Enter the value of equilibrium separation:”<<endl;
cin>>r0;
cout<<”Enter the value of potential:”<<endl;
cin>>v0;
}
void bond::secant2(int n)
{
int k=0;
double x,dx,x1,x2,g0,g1,g2,d;
x=r;
dx=dr;
x1=x+dx;
x2=0;
g0=g(x);
g1=g(x1);
if(g1>g0);
x1=x-dx;
while((fabs(dx)>del)&&(k<n))
{
d=f(x1)-f(x);
dx=-(x1-x)*f(x1)/d;
x2=x1+dx;
g2=g(x2);
if(g2>g1)
x2=x1-dx;
x=x1;
x1=x2;
g1=g2;
k++;
}
if(k==n)
{
cout<<"Convergence not found even after"<<n<<"iteration"<<endl;
exit(1);
}
r=x1;
}
double bond::g(double x)
{
return -e2/x+v0*exp(-x/r0);
}
double bond::f(double x)
{
return(-e2/(x*x)+v0*exp(-x/r0)/r0);
}
void bond::displayresult()
{
cout<<"The bond length is "<<r<<" in angstroms"<<endl;
}

OUTPUT :

1) NaI:
Enter the value of equilibrium separation 0.345
Enter the value of potential 1580
The bond length is 2.6403 in Angstroms

2) KI:
Enter the value of equilibrium separation 0.348
Enter the value of potential 2850
The bond length is 2.963653 in Angstroms
3) LiBr:
Enter the value of equilibrium separation 0.340
Enter the value of potential 5910
The bond length is 3.204541 in Angstroms

4) LiCl:
Enter the value of equilibrium separation 0.330
Enter the value of potential 4900
The bond length is 3.018912 in Angstroms

5) RbI:
Enter the value of equilibrium separation 0.348
Enter the value of potential 3990
The bond length is 3.115529 in Angstroms

REPORT:-
Equilibrium
S.No Element separation of Potential value
diatomic molecules Bond length
𝑟0 = v0=

1) NaI 0.345 1580 2.66403

2) KI 0.348 2850 2.963653

3) LiBr 0.340 5910 3.204541

4) LiCl 0.330 4900 3.018912

5) RbI 0.348 3990 3.11529

You might also like