SOLUTION 1 temp 25 pH 9.1 units mol/kgw density 1 K 0.1 charge N(5) 0.1 -water 0.015 # kgREACTIONKOH 0.11.067e-4 # initial NaOH added to raise the pH to 12 before acid titrationEND
# Example of fitting speciation reactions SPECIATION jobtitle "Fitting Carbonate equilibrium using alkalinity titration" calculationType fit calculationMethod 1 database "Wateq4f.DAT" #debug 1 FIT fitMethod nlls dataFile "titrations.dat" # file containing observations and independent variables onepass true mainLoop 1 # main (iterating) loop starts at first simulation (relative to start of block) dependentVariableColumnObs pH # column in onepoint.dat dependentVariableColumnCalc calc_pH # column in selected output fitMaxStepSize .1 fitFiniteDiffStepSize 1.0E-03 # initial step size for parameter adjustment numberOfFitParameters 2 fitParameterNames "k1fit" "k2fit" fitLogParameters 0 0 fitAdjustableParameters 1 1 # 1 .= adjustable, 0 = fixed fitParameterValues 10.0 11.0 # initial values fitConvergenceCriterion 1e-7 PLOT plotfactor 1 # 0 turns off Plotting plotTitle "Alkalinity titration fit <br> log K values 10.329 16.681 <br> fitted values <k1fit> <k2fit>" xtitle step ytitle "pH" lines calculated # the 'calculated' column in the 'out' file is plotted as a line points observed # the 'observed' column in the 'out' file is plotted as points convertLabels F # prevents the labels being interpreted as species changeColor T # give subsets a sequence of difft colours lineColor "blue" useLineColorDictionary 0 # 0 = do NOT use the line colour dictionary for colours pointSize 1.5 # 3.0 # symbols will be 1.5 3 mm (nominal) plotFactor 1.0 # can use this to scale whole plot png t pdf t trackSymbolColor blackpointsSamecolor true gridLines trueCHEMISTRYPRINT -reset tSOLUTION_SPECIES#CO2 could be used instead of H2CO3 CO3-2 + 2 H+ = CO2 + H2O log_k <k2fit> #HCO3- 27 H+ + CO3-2 = HCO3- log_k <k1fit> SELECTED_OUTPUT 1 -file titrations.dat -high_precision true -reset false USER_PUNCH -headings calc_pH -start 10 PUNCH -LA("H+") -end SOLUTION units mg/L Alkalinity 200 Ca 80 pH 11.3 REACTION H2SO4.005 moles in 50 stepsEND
USER_PUNCH 1-heading Vol-start10 PUNCH SOLN_VOL-end