Exact Bohr model in all two-electron atoms, ions.

Simple C program to calculate all two-electron atoms (ions) by real Bohr's model with two perpendicuar orbits.

top page
Back to chemistry page

Copy & paste the program computing all helium-like atoms ions.

If you copy and paste the program source code below into a text editor, you can easily compile and run this.
(This program is simple c language, so save this text editor as "filename.c" and compile it.)

Input atomic number Z or choose atoms

In this program, we first choose a two-electron atom or ion whose energy we want to calculate, and input the chosen two-electron ion's atomic number Z = 2 (= He = helium ), 3 (= Li+ = singly-ionized lithium ), 4 (= Be2+ = doubly-ionized beryllium ), 5 (= B3+ ), 6 (= C4+ ), 7 (= N5+ ), 8 (= O6+ ), 9 (= F7+ ), 10 (= Ne8+ ), 11 (= Na9+ ), 12 (= Mg10+ ), 13 (= Al11+ ). 14 (= Si12+ ), 15 (= P13+ ), or 16 (= S14+ )...

Input energy of the target atom or ion.

Input absolute energy value |E| of the chosen atom or ion, and the temporal initial electron-1's x-coordinate (= r1 )

Next we input the initial x-coordinate r1 (in unit MM = 1.0 × 10-14 meter ) of electron 1, and the absolute value of the total energy |E| (in eV) of the two-electron atoms (ions) that we want to calculate.

Output de Broglie wavelength of 1/4 orbit

From the input atomic energy, this program outputs de Broglie wavelength of 1/4 orbit, and last velocity of the electron-1 after it has moved its 1/4 orbit from x-axis to y-axis.

From the inputted values of atomic energy and initial coordinate, this program outputs the total de Broglie wavelength (= WN ) of 1/4 orbit, and the last x,y-velocity (= VX, VY ) of the electron-1, after the electron-1 has moved its 1/4 orbit from the initial x-axis to y-axis, by updating electrons' coordinate and velocity at short time intervals.

Here we use new convenient units of time = 1 SS = 1 × 10-23 second,  length = 1 MM = 1 × 10-14 meter,  velocity = 1MM/SS = 1 × 109 m/s,  acceleration 1MM/SS^2 = 1032 m/s^2.

The initial electron-1's x-coordinate (= r1 ) is automatically increased per calculation until r1 +100 (= there is only one r1 which gives the last VY velocity being zero in each chosen atomic energy |E| ).

 


#include <stdio.h>
#include <math.h>

int main(void) 
 {

/* all two-electron atoms, ions */


   int i;
   double Z,r,E,nucle,nuclee,rm,Ene;
   double vya,vyb,poten,VX,VY,prexx,preyy,WN,ra,rb;
   double xx,yy,vk,leng,wav,ac;

/* me = electron mass (kg),  pai = pi,  
  epsi = electric constant,  
   h = Planck constant,  
  ele = electron's charge

*/

   double me=9.1093826e-31;
   double pai=3.141592653589793; 
   double epsi=8.85418781787346e-12;
   double h=6.62606896e-34; 
   double ele=1.60217653e-19;  
  
 /* input atomic number Z */  
                              
   printf("Atomic number Z ? (He=2, Li+=3, Be2+=4, B3+=5, C4+=6, N5+=7...) ");  
   scanf("%lf",&Z);

/* input electron-1's initial x-coordinate r1 */

   printf("r1 between nucleus and electron 1 (MM)? ");  
   scanf("%lf",&r);

/* inutput absolute value of total energy of a two-electron atom or ion */

   printf("absolute value of total energy |E| of two-electron atom (eV) ? ");  
   scanf("%lf", &E);

/* rm = reduced mass is used only in light helium He and lithium ion Li+ with their nuclear mass = nucle  */
 
   nucle=2.0*me; nuclee=0.0;
  if (Z < 2.5 ) { nucle = 6.64465650e-27; nuclee=nucle;}   /* He alpha particle */
  if (Z > 2.5 && Z < 3.5 ) { nucle = 1.1646e-26; nuclee=nucle;}   /* Li7 nucleus */
   rm=(2.0*me*nucle)/(2.0*me+nuclee); 
   rm=rm*0.5;  

/* all two-electron ions except for He and Li+ use ordinary electron mass instead of reduced mass  */

/* display old wrong Bohr's two-electron atomic energy (= Ene ) with one circular orbit */

   Ene=-((4.0*Z-1)*(4.0*Z-1)*ele*ele*ele*ele*me)/(64.0*epsi*epsi*h*h);
   Ene=Ene*6.241509e18; 
   printf("Old wrong helium model's energy (eV) = %.3f\n", Ene); 

 printf(" \n");   

 
   for (i=1; i < 100 ;i++) {      

/* repeat until electron-1's initial r1 x-coordinate increases to r1+100  */
                                
 /*  poten = initial Coulomb potential energy (J) */

    poten=-(2.0*Z*ele*ele)/(4.0*pai*epsi*r*1.0e-14)+(ele*ele)/(4.0*pai*epsi*2.0*r*1.0e-14);
                             
 /* vya = total energy - potential energy (J) */  

    vya=-(E*1.60217646e-19)-poten; 
   if (vya > 0) {

/* vyb=electron initial velocity (m/sec) */ 

   vyb=sqrt(vya/me); 

/* VX,VY = electron-1's x,y-velocity (= MM/SS = 10^9 m/s )*/

   VY=vyb*1.0e-9;   VX=0.0;

/* prexx,preyy = electron-1's x,y-coordinate */
        
   prexx=r;  preyy=0.0;

/* WN = number of de Broglie wavelength */

 WN=0.0;
   
  
  do {

/* xx,yy = electron-1's x,y-coordinate after 1SS (= 1x10^-23 second ) */

    xx=prexx+VX; yy=preyy+VY;        

    vk=VX*VX+VY*VY;

/* leng = electron's moving distance (= meter) for 1SS */
                  
    leng=sqrt(vk)*1.0e-14; 

/* wave = de Broglie wavelength = h/mv (meter) */
    
     wav=h/(rm*sqrt(vk)*1.0e9); 

/* WN = sum of de Broglie wavelength */
 
    WN=WN+leng/wav;                
                                
/* ra = distance between electron-1 and nucleus */

    ra=sqrt(prexx*prexx+preyy*preyy); 

/* rb = distance between two electrons */

    rb=sqrt(4.0*prexx*prexx+2.0*preyy*preyy); 

/* change unit of length from MM into meter */
                                   
    ra=ra*1.0e-14; rb=rb*1.0e-14;    
    prexx=prexx*1.0e-14; preyy=preyy*1.0e-14;

    ac=(ele*ele)/(4.0*pai*epsi*rm);
                                   
/* calculating acceleration (= 1MM/SS^2 = 10^32 m/s^2 ) */

/* update electron-1's x,y-velocity VX,VY from Coulomb force */

    VX=VX+1.0e-32*ac*prexx*(-Z/(ra*ra*ra)+2.0/(rb*rb*rb));   
    VY=VY+1.0e-32*ac*preyy*(-Z/(ra*ra*ra)+1.0/(rb*rb*rb));

    prexx=xx;preyy=yy;
  
   } while (xx >= 0);            

/* until electron-1 has moved its 1/4 orbit to reach y-axis */


/* display electron-1's initial x-coordinate r1 */       
  
  printf("r1= %.2f ", r );

/* display electron-1's last velocity VX,VY */

  printf("VX= %.6f ", VX);
  printf("VY= %.6f ", VY);

/* display the total de Broglie wavelength (= WN )  of 1/4 orbit  */
 
  printf("WN= %.6f\n", WN);
    
   }  r=r+1;
   }  return 0;
   }