SOLUTION 1 SEAWATER FROM NORDSTROM AND OTHERS (1979) units ppm pH 8.22 pe 8.451 density 1.023 temp 25.0 Ca 412.3 Mg 1291.8 Na 10768.0 K 399.1 Si 4.28 Cl 19353.0 Alkalinity 141.682 as HCO3 S(6) 2712.0USER_PRINT10 if (EXISTS(1) = 0) then PUT(TOT("Cl"), 1)ENDSOLUTION 2ENDUSE solution 2EQUILIBRIUM_PHASESCalciteCO2(g) -2.0 10SAVE solution 2USER_PRINT10 if (exists(2) = 0) then PUT(TOT("Cl"),2)ENDUSER_GRAPH 1 -axis_titles "Mixing fraction" "pH" "" -axis_scale x_axis 0 1 auto auto -initial_solutions false -connect_simulations true -plot_concentration_vs x -start10 graph_x (TOT("Cl") - GET(2))/(GET(1) - GET(2))20 graph_y -LA("H+") -end -active trueENDSOLUTION 3SELECTED_OUTPUT 3-file mixesUSER_PUNCH 35 n = 4110 for i = 1 to n20 f = (i - 1) / (n - 1)30 PUNCH "MIX 1", EOL$40 PUNCH "1 ", 1 - f, EOL$50 PUNCH "2 ", f, EOL$60 PUNCH "END", EOL$70 next iENDSELECTED_OUTPUT 3-active falseINCLUDE$ mixesEND
# Example of fitting root finding a mixture SPECIATION jobtitle "mixing proportions" calculationType fit calculationMethod 1 database "WATEQ4F.dat" debug 3 FITfitMethod bobyqa dataFile "fixpH.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_fit # column in onepoint.dat dependentVariableColumnCalc pH # column in selected output fitMaxStepSize .2 fitFiniteDiffStepSize 1.0E-05 # initial step size for parameter adjustment numberOfFitParameters 1 fitParameterNames "FitMIX" fitLogParameters 0 fitAdjustableParameters 1 # 1 .= adjustable, 0 = fixed fitParameterValues .1 # initial values fitConvergenceCriterion 1e-7 numericTag <FIT_diff> = "1-<FitMIX>" fitUpperParameterValues 1. # initial values fitLowerParametervalues 0.0 PLOT plotfactor 0 # turns off Plotting CHEMISTRYPRINT -reset tSOLUTION 1 CaCO3 Solution units mg/LCa 20 Alkalinity 100pH 8.3 ENDSOLUTION 2units mg/LpH 7REACTIONH2SO40.0001 molesSAVE SOLUTION 2ENDSELECTED_OUTPUT-file sel.xls-reset falseUSER_PUNCH-headings pH-start10 PUNCH -LA("H+")-end MIX1 <FitMIX>2 <FIT_diff>END