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

56. CHEMICAL EQUILIBRIUM     } cation[H].c[k]=sol_array[H][QH].ksp / anion[OH].c[k]; cation[H].moles[k]=cation[H].c[k]*litre[k]*$$\Delta X$$[k]; } while (( w.max >0.0001 $$\lor$$ anion [OH].c[k] <0.0) $$\land$$ iterations++ < 50); } /* extrapolate $$\phi'n$$ [FIRST_CELL] value */ $$\phi'^n$$[FIRST_CELL]=$$\phi'n$$[FIRST_CELL+1]-$$\Delta X$$[FIRST_CELL]*($$\phi'^n$$[FIRST_CELL+2]-($$\phi'^n$$[FIRST_CELL+1]); $$\phi'^n$$[FIRST_CELL]=MAX($$\phi'^n$$[FIRST_CELL],0.0);    /* extrapolate $$\phi'^n$$[NUM_CELL] value */   $$\phi'^n$$[NUM-CELLS]=2.0*$$\phi'^n$$[NUM_CELLS-1]-$$\phi'^n$$[NUM-CELLS-2];    /* extrapolate litre[FIRST_CELL] value */  litre [FIRST_CELL]=0.001 * Vsample * $$\phi'^n$$ FIRST_CELL]; }

59. Minimization.The routine mnbrak brackets a minimum.

⟨Function declarations 23⟩ \equiv=<\math> void mnbrak ( real *,real *,real *,real *,real *,real *, real(*/unc)(real, int, int, int), int, int, int);
 * 1) 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⟩+\equiv<\math> real brent (real, real, real, real(*/unc)(real, int, int, int), real, real *, int, int, int);
 * 1) include "brent. c"