Acid-Base Zwitterion (Amino Acid)

Computer Methods in Chemical Engineering


Problem Statement: A chemical species A becomes a positively charged cation (A+, the protonated form of A) in an acid solution; it becomes a negatively charged anion (A-, the deprotonated form of A) in an alkaline solution. The dissociation constants for these steps are K1 and K2, which are defined as:

   A+ --> A + H+      K1=10-pK1=[A]*[H+]/[A+]     (1)
   A  --> A- + H+     K2=10-pK2=[A-]*[H+]/[A]     (2)
In addition, conservation of mass means that all three possible fractions must add up to unity:
   [A+]+[A]+[A-]=1            (3)
Write equations (1)-(3) in the standard "Ax=b" format. (Do not reduce the number of simultaneous equations, as we are practicing handling multiple algebraic equations, not our skill at manually reducing the number of equations.) Identify the matrix "A" and the vector "b" in the standard notation. Write a MATLAB function aminofr1(pH,pK1,pK2) that returns a vector of 3 fractions. In addition, provide a main M-script file that calls aminofr1(pH,pK1,pK2) to generate a table of three fractions from pH=0 to pH=12 in 1 pH increments (see below) for glutamic acid which has the following dissociation constants: pK1=2.10 and pK2=9.47.
        --------Fractions--------
    pH   Acation     A     Aanion
    -----------------------------
     0   0.9921   0.0079   0.0000
     1   0.9264   0.0736   0.0000
     :      :        :        :
    12   0.0000   0.0029   0.9971

Solution:

The three equations are rearranged as:
    K1*Acation - H*A            = 0    (1)
                K2*A - H*Aanion = 0    (2)
       Acation   + A   + Aanion = 1    (3)

In the standard Ax=b format, the matrix A is:
          Acation  A   Aanion    ... three fractions
       |  K1      -H      0   |  ... (1)
   A = |   0      K2     -H   |  ... (2)
       |   1       1      1   |  ... (3)

In the standard Ax=b format, the column vector b is:
       | 0 |
   b = | 0 |
       | 1 |

MATLAB codes for AMINOFR1.M
      function fraction=aminofr1(pH,pK1,pK2)
%-----------------------------------------------------------------------
% Programming Note:
%   Solve a set of linear algebraic equations of the form A*x=b
%-----------------------------------------------------------------------
% Instructor: Nam Sun Wang
%-----------------------------------------------------------------------

% Definition of pH & pK
      H  = 10^(-pH);
      K1 = 10^(-pK1);
      K2 = 10^(-pK2);

% Equations:
%     K1*Acation - H*A            = 0  % Definition for K1
%                 K2*A - H*Aanion = 0  % Definition for K2
%        Acation   + A   + Aanion = 1  % Conservation of mass
      A = [ K1 -H  0; 0 K2 -H; 1 1 1];
      b = [ 0; 0; 1];
      fraction = A\b;

MATLAB codes for the Main M-Script File
% Dissociation constants for glutamic acid -----------------------------
      pK1 = 2.10;
      pK2 = 9.47;

% Range pH and find the fractions of the three different forms ---------
      pH = [0. :       12.];
      fraction = zeros(3,size(pH,2));
      for i=1:size(pH,2)
        fraction(:,i) = aminofr1(pH(i), pK1, pK2);
      end

% Print a table --------------------------------------------------------
      disp(' ')
      disp('      --------Fractions--------')
      disp('  pH   Acation     A     Aanion')
      disp('  -----------------------------')
      for i=1:size(pH,2)
        fprintf('  %2i %8.4f %8.4f %8.4f\n', pH(i), fraction(:,i)' )
      end

Solution:


Re-work the problem with the nonlinear algebraic equation (f(x)=0) approach.

In numerical calculations, it is generally undesirable to divide by very small numbers; thus, you may want to use the following forms instead.

   K1*[A+]=[A]*[H+]     (1)
   K2/[H+]=[A-]/[A]     (2)
In addition, conservation of mass means that all three possible fractions must add up to unity:
   [A+]+[A]+[A-]=1            (3)
Note that we like to work with the "p" notation (e.g., pK, pH) where pH=-log([H+]) and pK=-log(K). With MATLAB, find the fractions A+, A, and A- as a function of pH by numerically solving equations (1)-(3) simultaneously. In other words, you are asked to write a function aminofr(pH,pK1,pK2) that returns a vector of 3 fractions. In addition, provide a main M-script file that calls aminofr(pH,pK1,pK2) to plot all three fractions on the same plot from pH=0.1 to pH=12 in 0.1 increments for glutamic acid, which has the following dissociation constants: pK1=2.10 and pK2=9.47.

Solution:


Return to Prof. Nam Sun Wang's Home Page
Return to Computer Methods in Chemical Engineering (ENCH250)

Computer Methods in Chemical Engineering -- Acid-Base Zwitterion (Amino Acid)
Forward comments to:
Nam Sun Wang
Department of Chemical & Biomolecular Engineering
University of Maryland
College Park, MD 20742-2111
301-405-1910 (voice)
301-314-9126 (FAX)
e-mail: nsw@umd.edu ©1996-2006 by Nam Sun Wang
UMCP logo