Page:4SIGHT manual- a computer program for modelling degradation of underground low level waste concrete vaults (IA 4sightmanualcomp5612snyd).pdf/135

From Wikisource
Jump to navigation Jump to search
This page needs to be proofread.
56. CHEMICAL EQUILIBRIUM
B.27
     }
     cation[H].c[k]=sol_array[H][QH].ksp / anion[OH].c[k];
     cation[H].moles[k]=cation[H].c[k]*litre[k]*[k];
   } while (( w.max >0.0001  anion [OH].c[k] <0.0)  iterations++ < 50);
 }  /* extrapolate  [FIRST_CELL] value */
 [FIRST_CELL]=[FIRST_CELL+1]-[FIRST_CELL]*([FIRST_CELL+2]-([FIRST_CELL+1]);
 [FIRST_CELL]=MAX([FIRST_CELL],0.0);    /* extrapolate [NUM_CELL] value */ 
 [NUM-CELLS]=2.0*[NUM_CELLS-1]-[NUM-CELLS-2];
   /* extrapolate litre[FIRST_CELL] value */
 litre [FIRST_CELL]=0.001 * Vsample *  FIRST_CELL];
}

59. Minimization.The routine mnbrak brackets a minimum.

⟨Function declarations 23⟩ <math>\equiv=<\math>
 void mnbrak ( real *,real *,real *,real *,real *,real *, real(*/unc)(real, int, int, int), int, int, int);
#include "mnbrak.c"

60. Parabolic approximation. The routine brent uses parabolic approximation to determine the minimum given three points bracketing the minimum.

⟨Function declarations 23⟩<math>+\equiv<\math>
 real brent (real, real, real, real(*/unc)(real, int, int, int), real, real *, int, int, int);
#include "brent. c"