previous page

© Copyright 1993 Mario Hilgemeier

Pseudocode 2:
     Compute the abundances of the elements


      To compute the abundances of the elements (in table 1) the 
following code has been used (in  C-language). The code lines like 
"new = old ..." can be taken directly from figure 4. There is a 
vector abd that stores the old and new abundances. All initial 
abundances are set to 1.0 . On my machine, I needed 330 iterations 
before the growth factor gf converged. Here gf is computed from the 
rarest element (33As) but you could use any element for the 
computation. To avoid overflow, the abundances are normalized to 1.
0 . When you print the final abundances multiply by 1,000,000 to get 
ppm (parts per million).


for (i=0; i<iterations; i++)
{
      abd[1].new = abd[2].old + abd[58].old + abd[21].old + abd[73].old 
                 + abd[31].old + abd[40].old + abd[1].old;
      abd[2].new = abd[3].old;
      abd[3].new = abd[2].old + abd[4].old;
      abd[4].new = abd[5].old;
      abd[5].new = abd[6].old;
      abd[6].new = abd[7].old;
      abd[7].new = abd[8].old;
      abd[8].new = abd[9].old;
      abd[9].new = abd[10].old;
      abd[10].new = abd[11].old;
      abd[11].new = abd[12].old + abd[33].old;
      abd[12].new = abd[13].old;
      abd[13].new = abd[14].old;
      abd[14].new = abd[15].old + abd[25].old;
      abd[15].new = abd[16].old;
      abd[16].new = abd[17].old;
      abd[17].new = abd[18].old;
      abd[18].new = abd[19].old;
      abd[19].new = abd[20].old;
      abd[20].new = abd[21].old + abd[69].old + abd[73].old + abd[75].old
                + 2*abd[31].old + abd[40].old + abd[4].old  + abd[2].old 
                  + abd[44].old + abd[52].old + abd[62].old 
                  + abd[64].old + abd[58].old;
      abd[21].new = abd[22].old;
      abd[22].new = abd[23].old;
      abd[23].new = abd[24].old;
      abd[24].new = abd[25].old;
      abd[25].new = abd[26].old;
      abd[26].new = abd[27].old;
      abd[27].new = abd[28].old + abd[69].old + abd[21].old 
                  + abd[64].old + abd[58].old;
      abd[28].new = abd[29].old;
      abd[29].new = abd[30].old;
      abd[30].new = abd[31].old + abd[62].old + abd[28].old; 
      abd[31].new = abd[32].old;
      abd[32].new = abd[33].old + abd[4].old + abd[75].old;
      abd[33].new = abd[34].old;
      abd[34].new = abd[35].old;
      abd[35].new = abd[36].old;
      abd[36].new = abd[37].old;
      abd[37].new = abd[38].old;
      abd[38].new = abd[39].old;
      abd[39].new = abd[40].old;
      abd[40].new = abd[41].old;
      abd[41].new = abd[42].old;
      abd[42].new = abd[43].old;
      abd[43].new = abd[44].old + abd[40].old;
      abd[44].new = abd[45].old;
      abd[45].new = abd[46].old;
      abd[46].new = abd[47].old;
      abd[47].new = abd[48].old;
      abd[48].new = abd[49].old;
      abd[49].new = abd[50].old;
      abd[50].new = abd[51].old;
      abd[51].new = abd[52].old;
      abd[52].new = abd[53].old;
      abd[53].new = abd[54].old;
      abd[54].new = abd[55].old;
      abd[55].new = abd[56].old;
      abd[56].new = abd[57].old;
      abd[57].new = abd[58].old;
      abd[58].new = abd[59].old;
      abd[59].new = abd[60].old;
      abd[60].new = abd[61].old;
      abd[61].new = abd[62].old + abd[12].old + abd[51].old 
                  + abd[83].old + abd[68].old;
      abd[62].new = abd[63].old;
      abd[63].new = abd[64].old + abd[52].old + abd[44].old + abd[31].old;
      abd[64].new = abd[65].old;
      abd[65].new = abd[66].old;
      abd[66].new = abd[67].old;
      abd[67].new = abd[68].old + abd[15].old + abd[65].old 
                  + abd[45].old + abd[53].old 
                  + abd[21].old + abd[86].old + abd[32].old;
      abd[68].new = abd[69].old + abd[41].old;
      abd[69].new = abd[70].old;
      abd[70].new = abd[71].old;
      abd[71].new = abd[72].old;
      abd[72].new = abd[73].old + abd[2].old;
      abd[73].new = abd[74].old;
      abd[74].new = abd[75].old + abd[73].old;
      abd[75].new = abd[76].old;
      abd[76].new = abd[77].old;
      abd[77].new = abd[78].old;
      abd[78].new = abd[79].old;
      abd[79].new = abd[80].old;
      abd[80].new = abd[81].old;
      abd[81].new = abd[82].old;
      abd[82].new = abd[83].old;
      abd[83].new = abd[84].old;
      abd[84].new = abd[85].old;
      abd[85].new = abd[86].old;
      abd[86].new = abd[87].old;
      abd[87].new = abd[88].old;
      abd[88].new = abd[89].old;
      abd[89].new = abd[90].old + abd[31].old;
      abd[90].new = abd[91].old;
      abd[91].new = abd[92].old + abd[2].old + abd[21].old + abd[73].old;
      abd[92].new = abd[39].old;

      sum = 0.0; /* sum abundances for normalization to 1 */
      for (j=1; j<=92; j++)
                      sum += abd[j].new;
      
      if (((i+1)%10)==0) /* show every 10th growth factor */
      {
                      gf = abd[33].new / abd[33].old; /* growth factor */
                      fprintf(stderr,"%d gf = %.16lf\n", i+1, gf);
      }

      for (j=1; j<=92; j++)
                      abd[j].old = abd[j].new / sum; /* normalization to 1 */
}


Figure (7.)10: initial abundances approaching their limit values

next page   content page


© Copyright 1993, Mario Hilgemeier, email: contact
homepage fivefold-symmetrical stamp