acid-base_titrations_in_matlab.pdf

4
1 Date Submitted: October 12, 2012 Acid-Base Titrations in MATLAB ChE 26 Design Project Write-up Submitted by: Gines, Kimberly A. 2011-47993 Quintero, Ramon Paolo T. 2011-11368 Repoquit, Dominique Ann, N. 2011-02461 Submitted to: Mr. Bemboy Nino F. Subosa INTRODUCTION Titration, or titrimetry, is an important method used in quantitative chemical analysis that is used to determine the unknown concentration of an identified solution. In a titration, one of the solutions to be neutralized (called the analyte), say the acid, is placed in a flask together with a few drops of a pH indicator. The other solution of known concentration (called the titrant) is placed in a buret. Then the titrant is added to the analyte drop wise, until the equivalence point is reached, defined by the change in color of the pH indicator. In order to ensure the success of a titration procedure, the indicator to be used must change in color during the equivalence point; otherwise, the false results will be obtained. A plot of pH vs. titrant volume is called a titration curve, and is used to visually see the behaviour of the analyte. Our main objective was to create a program executable in MATLAB that will give a list of possible indicators that may be used in titration whose conditions are specified by the user, and will generate a titration curve for the said process. PROGRAM DESCRIPTION Upon opening the program in MATLAB, a menu like the one showed in Figure 1 will appear, which allows the user to choose the type of analyte he/she will use. Figure 1. Initial Menu

Upload: paolo-quintero

Post on 02-Jan-2016

62 views

Category:

Documents


1 download

DESCRIPTION

matlab

TRANSCRIPT

1

Date Submitted: October 12, 2012

Acid-Base Titrations in MATLAB ChE 26 Design Project Write-up Submitted by: Gines, Kimberly A. 2011-47993 Quintero, Ramon Paolo T. 2011-11368 Repoquit, Dominique Ann, N. 2011-02461 Submitted to: Mr. Bemboy Nino F. Subosa

INTRODUCTION

Titration, or titrimetry, is an important method used in quantitative chemical analysis that is used to determine the unknown concentration of an identified solution. In a titration, one of the solutions to be neutralized (called the analyte), say the acid, is placed in a flask together with a few drops of a pH indicator. The other solution of known concentration (called the titrant) is placed in a buret. Then the titrant is added to the analyte drop wise, until the equivalence point is reached, defined by the change in color of the pH indicator. In order to ensure the success of a titration procedure, the indicator to be used must change in color during the equivalence point; otherwise, the false results will be obtained. A plot of pH vs. titrant volume is called a titration curve, and is used to visually see the behaviour of the analyte.

Our main objective was to create a program executable in MATLAB that will give a list of possible indicators that may be used in titration whose conditions are specified by the user, and will generate a titration curve for the said process.

PROGRAM DESCRIPTION

Upon opening the program in MATLAB, a menu like the one showed in Figure 1 will appear, which allows the user to choose the type of analyte he/she will use.

Figure 1. Initial Menu

2

When the user selects the “Strong Monoprotic Acid” and “Strong Monoprotic Base” buttons, the program will prompt the user for the concentration of the analyte and the titrant, as well as the volume of the analyte. As soon as the user accomplishes all of these, the program will tell at which pH the equivalence point will occur, will give the list of appropriate pH indicators, and will give the titration curve for the process, as shown in Figure 2.

Figure 2. Sample Titration Curves for Strong Acid-Strong Base Titration

The process is the same for Weak Acid/Weak Base titrations, the only difference is that a new parameter is introduced, the dissociation constant (K). When the user selects the “Weak Monoprotic Acid” or “Weak Monoprotic Base” buttons, a new menu appears, where one can either select a default analyte with given Ka/Kb, or a custom analyte, where he/she can specify the dissociation constant. As before, the program will display the list of possible indicators and display the titration curves.

The same rulings go for polyprotic acids. The only difference is that they have more than one Ka values corresponding to each of their acidic H atoms. The user can use an analyte with assigned Ka values or a custom analyte. The outputs will be the equivalence points, the corresponding lists of possible indicators and the titration curves, as shown in Figure 3.

Figure 3. Sample Titration Curves for Polyprotic Acid-Strong Base Titration

3

A sample output of the program is given below.

DESIGN METHODOLOGY

The program is designed such that all of the things we have learned in ChE 26 this semester would be applied. Many parts of the program were written using for and while loops. If-loops were used for each of the menus in the program and on the list of possible indicators. pH indicators work for a specific pH range, thus, the importance of using if-loops.

While-loops were used in the restriction of certain events, which include the termination of the program with the X icon on the upper right hand of the menus, and the input required when using the custom feature. The acid dissociation constant should be a nonnegative number less than 1. Because of that, the program will not accept any input that is less than 0 or greater than 1. Aside from restriction, it is also responsible for the continuity of the program, in such a way that, the initial menu (Figure 1) will show after the output, as the one given above, has been obtained. Hence, the only way to close the program is through the Exit button in the initial menu.

The equations used in obtaining the pH for every volume of the titrant are enumerated below:

�� � �������� (1)

��� ��������� � (2)

�� � ��� � �� (3)

�� � ��� � ���� ����������

����� (4)

�� � � !"#� !"$��%

(5)

�� �&'�()�

&(� (6)

4

Aside from using the equations above, the ICE (Initial, Change, Equilibrium) Table was used. By assigning a variable to the unknown acid concentration, a function with respect to the acid concentration was obtained, using Equation (6). The Modified Secant Method was used in obtaining the root of the said function, evaluating it using Equation (1). An initial value of 1 x 10-4 M, a tolerance of 1 x 10-10 and a perturbation factor of 1 x10-6 were used.

The pH values were computed by dividing the entire titrant volume into regions: the pre-equivalence region, the equivalence point, and the post-equivalence region. The pH values obtained for each region were vectorized, forming a single vector for pH. The equivalence points were computed using Equation (5).

The entire program is looped such that the user may still create titration curves after obtaining an output.

TROUBLESHOOTING and PROBLEMS ENCOUNTERED

Initially, the program will prompt the user for the dissociation constants. However, most especially for polyprotic acids, erroneous input of K values will result to a distorted titration curve. In order to solve this, default analytes were included in the program, which includes the most common acids/bases. The custom feature, was still not removed. Also, the titration curve plot remains even after a user starts to create a new one. In order to solve this, the Help function was used, and it was discovered that a close function can be used to close the figure before using the program again.

DIVISION OF TASKS

• Dominique Repoquit - Diprotic Acids - Debugging - Comments - Research

• Kimberly Gines - Strong Monoprotic Acids/Bases - Weak Monoprotic Acids/Bases - Debugging - Initial Interface

• Ramon Paolo Quintero - Triprotic Acids - Debugging - Compilation of the Program - Research - Project Write-Up