Professional Documents
Culture Documents
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
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=