Titration of acid with a strong base

Titration of acid with a strong base preview image

1 collaborator

Screen_shot_2018-02-02_at_12.53.50_pm lin xiang (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.2.2 • Viewed 64 times • Downloaded 7 times • Run 0 times
Download the 'Titration of acid with a strong base' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This model presents the differences in titrating a strong acid (HCl) and a weak acid (Acetic acid). Students are able to observe the changes in pH when titrating a strong/weak acid with NaOH solution. Students may also change the concentrations of acids and the titrant and observe the corresponding results.

HOW IT WORKS

The pH of the solution is calculated based on the equation: C1V1=C2V2.

This model can be used to address a range of misconceptions about pH, titration, and dissociation.

Both the molarities of the conjugate base and titrant are used to calculate pH at the beginning of the titration (titration volume < approx 10 ml). Then, only the titrant's molarity is used to calculate pH.

HOW TO USE IT

  1. Choose an acid
  2. Set the acid concentration
  3. Set NaOH concentration
  4. Set dose of NaOH added per tick
  5. Set the total amount of NaOH added
  6. Click "Set up"
  7. Click "Titration"
  8. Observe outputs in the monitors and plots.

Note: -Don't change NaOH's concentration and dose during titration. -Use switches to hide some molecules or ions to help observations.

THINGS TO NOTICE

  • Dissociation of the strong acid and weak acid.
  • The pH changes in the Titration processes of the strong acid and weak acid.
  • The equivalent points of the titration of the strong acid and weak acid.

THINGS TO TRY

  • Choose different acid
  • Adjust acid and/or titrant concentration
  • Adjust the titration does
  • Hide some ions to help observations

RELATED MODELS

See more chemistry models at https://sites.google.com/view/3d-science-abm/physics-chemistry

CREDITS AND REFERENCES

Dr. Lin Xiang created this module at the University of Kentucky in 2022. If you mention this model in a publication, we ask that you include the citations below.

Xiang, L. (2022). Titration of acid with a strong base. Department of STEM Education, University of Kentucky, Lexington, KY.

CC BY-NC-SA 4.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

;Dr. Lin Xiang created this module at the University of Kentucky in 2022. If you mention this model in a publication, we ask that you include the citations below.
;
;Xiang, L. (2022). Titration of acid with a strong base. Department of STEM Education, University of Kentucky, Lexington, KY.
;
;![CC BY-NC-SA 4.0](http://ccl.northwestern.edu/images/creativecommons/byncsa.png)
;
;This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/.
;;;;;;;;;;;;;;;;;;;;;;


breed [HAs HA]
breed [A-s A-]
breed [OHs OH]
breed [H3OS H30]
breed [legends legend]

turtles-own[ ]
globals [
  mode
  ka
  Num-H Num-OH num-HA num-A
  vol-1 vol-titrant
  current-conc-H
  current-conc-OH
  current-conc-A
  current-conc-HA
  current-ph
  current-pOH
  b1
  c1
  change-a
  M-H
  M-T
  M-OH
  M-HA
  M-HA-1
  M-A
  unit-num-ha
  mark
   ]

to setup
  ca

  set-bk
  set-legends
  (ifelse
    choose-an-acid = "Hydrochloric acid" [set mode 1 set-HCl]
    choose-an-acid = "Acetic acid" [set mode 2 set-acetic-acid])


  plot-ion-concentrations-log
  reset-ticks
end 

to set-bk
  ask patches [set pcolor 91.5 + random-float 0.5]
  ask patches with [ pycor = max-pycor or pycor < 4] [set pcolor 101]
  ask patches with [ pxcor = min-pxcor or pxcor = max-pxcor] [set pcolor 101]
end 

to set-HCl
  set-default-shape ohs "ab-oh-1"
  set-default-shape h3os "ab-h3o-1"
  set-default-shape has "ab-ha-1"
  set-default-shape a-s "ab-ha-2"

  set vol-1 Acid-volume
  set vol-titrant 0
  set current-conc-H Acid-concentration
  set current-ph -1 * (log current-conc-H 10)
  set M-H Acid-concentration * vol-1 * 0.001   ;determine the mole of HA
  set M-A M-H
  set M-HA M-H
  set current-conc-A (M-A / (vol-1 * 0.001))  ;determine initial A- concentration
  set current-conc-HA 0                       ;there is no HA
  set current-Conc-OH 10 ^ (-14) / current-conc-H          ;calculate the concentration of OH-
  set M-OH current-Conc-OH * vol-1 * 0.001                 ;calculate exisitng mole of OH-



  set num-H round (1000 * (1.3895 ^ (-1 * current-ph)))     ;find the amount of visual H+
  set num-OH round (1000 * (1.3895 ^ (-1 * (14 - current-ph))))           ;find the amount of visual OH-

  if Hide-acid-molecule-and-conjugate-base? = false
   [create-a-s num-H [set-tt-properties set size 1.25 set color 113.5]]

  if Hide-hydronium-and-hydroxide? = false
  [set num-H round (1000 * (1.3895 ^ (-1 * current-ph)))     ;find the amount of visual H+
   set num-OH round (10000 / (num-H))                        ;find the amount of visual OH-
   create-h3os num-H [set-tt-properties set size 1.25 ]
   create-ohs num-OH [set-tt-properties set size 1.25 set color 85]]
end 

to set-acetic-acid
  set-default-shape ohs "ab-oh-1"
  set-default-shape h3os "ab-h3o-1"
  set-default-shape has "ab-ha-1"
  set-default-shape a-s "ab-ha-2"


  set ka 1.8 * (10 ^ -5)
  set vol-1 Acid-volume
  set vol-titrant 0
  ;set current-conc-H (-0.5 * (ka - sqrt (ka * ka + 4 * ka * Acid-concentration)))
  set current-conc-H ((-1 * ka + sqrt (ka * ka + 4 * ka * Acid-concentration)) / 2)
  set current-ph -1 * (log current-conc-H 10)
  set M-HA Acid-concentration * vol-1 * 0.001   ;determine the mole of HA
  set M-H current-conc-H * vol-1 * 0.001   ;determine the mole of H+
  set M-A M-H
  set current-conc-HA ((M-HA - M-H) / (vol-1 * 0.001))  ;determine initial HA concentration
  set current-conc-A (M-A / (vol-1 * 0.001))  ;determine initial HA concentration


  if Hide-acid-molecule-and-conjugate-base? = false
  [ set num-HA round (2500 * sqrt (sqrt (M-HA)))
    set num-A round (100 * sqrt (sqrt (M-A)))
    create-has num-HA [set-tt-properties set size 1.25 set color 116.5]
    create-a-s num-A [set-tt-properties set size 1.25 set color 113.5]
    set unit-num-ha (M-HA / num-ha) ]

  if Hide-hydronium-and-hydroxide? = false
  [set num-H round (1000 * (1.3895 ^ (-1 * current-ph)))     ;find the amount of visual H+
   set num-OH round (10000 / (num-H))                        ;find the amount of visual OH-
   create-h3os num-H [set-tt-properties set size 1.25 ]
   create-ohs num-OH [set-tt-properties set size 1.25 set color 85]]
end 

to set-tt-properties
   setxy 1 + random-float (max-pxcor - 2) 4 + random-float (max-pycor - 5)
end 

to set-legends
 create-legends 8

 ask legend 0
  [set shape "ab-h3o-1"
    set size 1.75
    set color 82.5
    setxy 1.5 2]

  ask legend 1
  [set shape "blank"
    set color 136
    set size 1.5
    set label "Hydronium (H3O+)"
    set label-color white
    set heading 75
    setxy 8.5 1.2]

  ask legend 2
   [set shape "ab-OH-1"
    set size 1.75
    set color 85
    setxy 12 2]

  ask legend 3
  [set shape "blank"
    set color 136
    set size 1.5
    set label "Hydroxide (OH-)"
    set label-color white
    set heading 75
    setxy 18 1.2]

  ask legend 4
   [set shape "ab-ha-1"
    set size 1.75
    set color 116.5
    setxy 22.5 2]

  ask legend 5
  [set shape "blank"
    set color 136
    set size 1.5
    set label "Acid molecule"
    set label-color white
    set heading 75
    setxy 27 1.2]

  ask legend 6
   [set shape "ab-ha-2"
    set size 1.75
    set color 113.5
    setxy 32 2]

  ask legend 7
  [set shape "blank"
    set color 136
    set size 1.5
    set label "Conjugate base"
    set label-color white
    set heading 75
    setxy 37.5 1.2]
end 

to go
  if vol-titrant >= (Total-mL-of-NaOH-added - 0.05) [user-message "Have added the specified amount of titrant." stop]
  move

  (ifelse
    choose-an-acid = "Hydrochloric acid" [if mode = 2 [setup] titration-HCl]
    choose-an-acid = "Acetic acid" [if mode = 1 [setup] titration-acetic-acid])


  (ifelse
    Hide-acid-molecule-and-conjugate-base? = true and count a-s > 0
      [if any? a-s [ask a-s [die]] if any? has [ask has [die]]]
    Hide-acid-molecule-and-conjugate-base? = false and count a-s > 0
    [if choose-an-acid = "Acetic acid" [dissociation]]
    Hide-acid-molecule-and-conjugate-base? = false and count a-s <= 0
    [ifelse choose-an-acid = "Acetic acid"
      [ set M-HA-1 (current-conc-HA * vol-1 * 0.001)
        let num-HA-to-be round (M-HA-1 / unit-num-ha)
        create-has num-HA-to-be [set-tt-properties set size 1.25 set color 116.5]
        create-a-s (num-HA - num-HA-to-be + num-A)[set-tt-properties set size 1.25 set color 113.5]]
      [create-a-s round (1000 * (1.3895 ^ (-1 * Acid-concentration))) [set-tt-properties set size 1.25 set color 113.5]]])

   (ifelse
    Hide-hydronium-and-hydroxide? = true and count OHs > 0
    [ask h3os [die] ask ohs [die]]
    Hide-hydronium-and-hydroxide? = false and count ohs > 0
    [acid-base-equilibrium]
    Hide-hydronium-and-hydroxide? = false and count ohs <= 0
    [set num-H round (1000 * (1.3895 ^ (-1 * current-pH)))
     set num-OH round (1000 * (1.3895 ^ (-1 * (14 - current-ph))))
     create-h3os num-H [set-tt-properties set size 1.25 ]
      create-ohs num-OH [set-tt-properties set size 1.25 set color 85]])


  plot-ion-concentrations-log



  tick
end 

to move
  ask turtles with [breed != legends]    ;ask non-legend turtles
  [rt random 360                            ;rotate
    if [pcolor] of patch-at dx dy <= 92 and [pcolor] of patch-at dx dy >= 91.5    ;if the patch-ahead has the proper color
      [fd 0.5                                                                      ;move forward
       if ycor < 4 [set ycor 4]                                                   ;if ycor is low, put ycor higher
  ]]
end 

to acid-base-equilibrium

  set num-H round (1000 * (1.3895 ^ (-1 * current-pH)))
  set num-OH round (1000 * (1.3895 ^ (-1 * (14 - current-ph))))

  let current-H count H3Os
  let current-OH count OHs

  (ifelse
    (num-H) > current-H
     [create-h3os abs ((num-H) - current-H) [set-tt-properties set size 1.25]]
    (num-H) < current-H
    [ask n-of abs ((num-H) - current-H) h3os [die]])

   (ifelse
    (num-OH) > current-OH
    [create-ohs abs ((num-OH) - current-OH) [set-tt-properties set size 1.25 set color 85]]
    (num-OH) < current-OH
    [ask n-of abs ((num-OH) - current-OH) OHs [die]])
end 

to dissociation

  set M-HA-1 (current-conc-HA * vol-1 * 0.001)
  let num-HA-to-be round (M-HA-1 / unit-num-ha)
  let current-num-ha count has

  if current-num-ha > num-HA-to-be
   [if any? Has
      [ask up-to-n-of (current-num-ha - num-HA-to-be) has [set breed a-s set color 113]]]

  let T-of-tick NaOH-concentration * 0.001 * NaOH-dose   ;calculate the added mole of OH- in this tick
  if M-HA - M-T <= -0.5 * t-of-tick
    [if any? Has [ask has [set breed a-s set color 113]]]
end 

to titration-HCl
     set current-Conc-OH 10 ^ (-14) / current-conc-H          ;calculate the concentration of OH-
     set M-OH current-Conc-OH * (vol-1) * 0.001   ;calculate exisitng mole of OH-
     set vol-titrant vol-titrant + NaOH-dose               ;increase Titrant volume
     set vol-1 vol-1 + NaOH-dose                           ;increase total volume
     let T-of-tick NaOH-concentration * 0.001 * NaOH-dose   ;calculate the added mole of OH- in this tick
     set M-T (M-T + t-of-tick)                                ;update total mole of titant

    (ifelse
       current-conc-H >= 10 ^ (-7)                         ;if acid + base
        [(ifelse
          M-HA > M-T                                          ;if more H+ than OH-
          [set current-conc-H (M-HA - M-T) / (vol-1 * 0.001)              ;calculate the concentration of H+
           set current-conc-A (M-HA / (vol-1 * 0.001))                 ;update A- concentration
           ifelse current-conc-H > 10 ^ (-6)
            [set current-ph (- log current-conc-H 10)]                   ;calculate the ph
            [set current-conc-H (10 ^ (-7) + current-conc-H);consider water self-ionizaiton
             set current-ph (- log current-conc-H 10)]]                 ; find current pH

          M-HA < M-T
          [set M-OH (M-T - M-HA)                              ;if more OH- than H+,calculate left mole of OH-
           set current-conc-OH M-OH / (vol-1 * 0.001)             ;calculate the concentration of OH-
           set current-conc-A (M-HA / (vol-1 * 0.001))             ;update A- concentration
           ifelse current-conc-OH > 10 ^ (-6)
            [set current-conc-H 10 ^ (-14) / current-conc-OH set current-ph (- log current-conc-H 10)]       ;calculate the concentration of H+
            [set current-conc-OH (10 ^ (-7) + current-conc-OH)           ;consider water self-ionizaiton
             set current-conc-H 10 ^ (-14) / current-conc-OH set current-ph (- log current-conc-H 10)]]         ;calculate the concentration of H+

          M-HA = M-T
          [set current-conc-A (M-HA / (vol-1 * 0.001))             ;update A- concentration
           set current-conc-H 10 ^ (-7) set current-ph (- log current-conc-H 10)])
        ]

       current-conc-H < 10 ^ (-7)                                 ;if base + base
        [set current-conc-A (M-HA / (vol-1 * 0.001))             ;update A- concentration
         let total-OH (M-OH + T-of-tick)                                ;calculate the total mole of OH-
         set current-conc-OH total-OH / (vol-1 * 0.001)           ;calculate the concentration of OH-
        set current-conc-H 10 ^ (-14) / current-conc-OH           ;calculate the concentration of H+
        set current-ph (- log current-conc-H 10)])               ;Find ph
end 

to titration-acetic-acid
     set vol-titrant vol-titrant + NaOH-dose               ;increase Titrant volume
     set vol-1 vol-1 + NaOH-dose                           ;increase total volume
     let T-of-tick NaOH-concentration * 0.001 * NaOH-dose   ;calculate the added mole of OH- in this tick
     set M-T (M-T + t-of-tick)                                ;update total mole of titant


 (ifelse
      M-HA - M-T > 0.5 * t-of-tick                                             ;if more HA than OH-, i.e., before the equivalent point
      [set current-conc-HA (M-HA - M-t) / (vol-1 * 0.001)                      ;update HA concentration

      ifelse  ((M-A + M-T) / (vol-1 * 0.001)) -  (M-T / (vol-1 * 0.001)) > 0.001     ;update A- concentration. consider the initial A concentration
      [set current-conc-A ((M-A + M-T) / (vol-1 * 0.001))]
      [set current-conc-A (M-T / (vol-1 * 0.001))]

      set current-conc-H (ka * current-conc-HA / current-conc-A)  ;find current H+ concentration
       set current-ph (- log current-conc-H 10)]                 ; find current pH

      M-HA - M-T <= 0.5 * t-of-tick and M-HA - M-T > -0.5 * t-of-tick                  ;if at the equivalent point
      [set current-conc-A ((Acid-concentration * Acid-volume * 0.001) / (vol-1 * 0.001))  ;update A- concentration
       let kb (10 ^ (-14) / ka)
       set current-conc-OH (-0.5 * (kb - sqrt (kb * kb + 4 * kb * current-conc-A))) ;find OH- concentration using Kb
       set current-pOH (- log current-conc-OH 10)            ;find current ph using pOH
       set current-ph (14 - current-pOH)            ;find current ph using pOH
       set current-conc-HA current-conc-OH]         ;update HA concentration


     M-HA - M-T <= -0.5 * t-of-tick                                   ; if after the equivalent point
      [set current-conc-HA 0                                          ;update HA concentration
       set current-conc-A (M-HA / (vol-1 * 0.001))                    ;update A- concentration
       set current-conc-OH ((M-T - M-HA) / (vol-1 * 0.001))           ; find OH- concentration
       set current-ph (14 - (- log current-conc-OH 10))])             ;find current ph using pOH
end 

to plot-ion-concentrations-log ;; this creates the bar graph

    set-current-plot "Acid/Conjugate base Concentrations"
    clear-plot
    set-plot-x-range 0 1
    set-plot-y-range 0 0.1
    plot-pen-down
    set-current-plot-pen "Acid"
    plotxy 0 current-conc-HA
    set-current-plot-pen "Conjugate base"
    plotxy 1 current-conc-A
end 

There are 3 versions of this model.

Uploaded by When Description Download
lin xiang over 1 year ago Fix plotting bug Download this version
lin xiang over 1 year ago update pH calculation Download this version
lin xiang over 1 year ago Initial upload Download this version

Attached files

File Type Description Last updated
Titration of acid with a strong base.png preview Preview for 'Titration of acid with a strong base' over 1 year ago, by lin xiang Download

This model does not have any ancestors.

This model does not have any descendants.