titration2.ppi

SPECIATION
  calculationType                      custom
  calculationMethod                    1
  xmin                                 0.0
  xmax                                 3.0E-03
  resolution                           50
  numericTags                          <titre> = "<x_axis>"

PLOT
  plotTitle                            "Acid titration of 50 mL of groundwater<br>(using MIX keyword)"
  xtitle                               "ml 0.16M HCl"
  ytitle                               pH
  lineColor                            blue
  customXcolumn                        ml
  lines                                pH Gran
  points                               Gran
  pointColor                           green
  labelSize                            0
  extraText                            "extratexttitration.dat"

CHEMISTRY

SELECTED_OUTPUT
  -reset false

TITLE Acid titration of groundwater (assumes no CO2 loss)

SOLUTION 1 # Groundwater
  pH    7.05
  units mg/L
  temp  10.5
  water 0.050 kg
  Na    6
  K     0.6
  Ca    124
  Mg    1.6
  Cl    11
  Alkalinity 348 as HCO3
  S(6)  3 as SO4
  Si    5.8

SOLUTION 2
  units mol/kgw
  pH    1 charge                                 # 0.16 mol/kgw HCl
  Cl    0.16
END


MIX 1 Add 0.1M HCl to the soln                   # mix two solutions, the sample and the acid
  1     1
  2    <titre>                                   # driven by x loop parameters, see above

USER_PUNCH
  -headings ml pH VT Gran
  1 pH = -la("H+")
  10 V = <titre>*1000
  11 VT = (0.05 + <titre>)*1000
  20 Gran = VT*(10^-pH)*30
  30 punch V, pH, VT, Gran

GAS_PHASE
  -fixed_volume
  -volume      0.01                              # 10 mL gas + 50 mL solution
  -equilibrate 1                                 # equilibrate with solution 1 to begin with - this leads to some initial degassing
   CO2(g)

END