Chemical equilibrium and spreadsheets - Journal of Chemical

Using a Spreadsheet Scroll Bar to Solve Equilibrium Concentrations. Andrés Raviolo. Journal of Chemical Education 2012 89 (11), 1411-1415. Abstract |...
0 downloads 0 Views 5MB Size
edited by RUSSELLH. BAT

the compurtctr Chemical Equillbrlum and Spreadsheets Carl W. David Universily of Connecticut Storrs, CT 06268

(1) given the equilihrium constant, to understand how concentrations andlor partial pressures adjust as a system approaches equilihrium and (2) given the free energy of formation of the suhstances involved in the chemical equilihrium, to understand how the equilihrium constant is obtained. There is a third piece in the puzzle of understanding that warrants attention and can become a useful numerical "exoeriment". This involves eom~utine the free en"~ ergy changearsoriated with a reaction as the "extent of reaction" isallowed tovary. Sinre the attainment of equilihrium is associated with a zero value for AG and a minimum value for G itself (at fixed T and p), following how this hannens is a worthwhile undertaking. Such ac&nputation, although simple in principle, is unpleasant in detail, give n t h e large n u m h e r of t r u l y trivial computations required to ohtain the desired insight. Enter the spreadsheet. ~

~

~

~~~~

need to consider gases at pressures other than 1atm.

The Spreadsheet The numerical "exoeriment" orooosed here is to pick a starting number of moles of the three rubstancer and a fixed total pressure; compute the partial pressures of the constituents as a function of an "extent of reaction (f)", and then compute AG for the reaction as a function of that same "extent of reaction". The computed value of AG will go to zero and G itself will go though a minimum as f is varied, provided the sign of (was properly chosen and the numher of steps in the spreadsheet is large enough. Our example consists of the choice of one mole of ammonia and one mole each of nitrogen and hydrogen, mixed a t 298 K. The numher of moles of ammonia, when f is not equal to zero is

. .

There are two componentsto understanding chemical equilibrium:

~

Kenyon College

Gambier. OH 43022

.~~~

~

~~~

~NH= ,

nKH, - zf

while the number of moles of nitrogen is nN, = nN,

+f

and the numher of moles of hydrogen is

nq = n&

+ 3f

which allows us, in spreadsheet form, to compute the mole fraction of all three gases. From the mole fractions, assuming a constant total pressure (in our case, 0.1 atm), we compute the partial pressures of the three gases. For each of these gases, Gi=G,+RTln-

Pi l(atm)

consonant with the constant total pressure (the volume is changing), and we compute AG for the reaction. The results of these computations, as f varies, allows us to see, immediately, whether {should be chosen to he positive or negative, corresponding to answering the question of whether the ammonia is going to convert into more nitroeen and hvdroeen .. or the nitrogenand hydrogen are going tocorn. bine to form moreammonia. In spreadsheet terms,the first column is the extent of resction, t, which will start at zero. Thus in an appropriate starting row, say 4, we enter a zero. (The top three rows we use for labels and headings.) The second (B), third (C), and fourth (Dl (Continued on page ,4238)

.

The Problem We consider the same chemical equilibrium discussed earlier'

a t 298 K, AGO of formation for ammonia is about -16.64 kJImol, while those of both hydrogen and nitrogen are zero. AGO for the reaction as written is just AGO for formation of ammonia, provided all the gases are held a t one atmosphere and the temperature is held constant at 298 K. Since the derivation of the formula

and the statement that AG is zero and G is a minimum at equilihrium are obtained a t constant total pressure, we need to phrase the problem of computing the changes to the Gihbs's free energy of the constituent gases in terms of the starting conditions and the constant total pressure. We do this by first specifying the startingnumher of moles of all substances and the total pressure (implying the starting volume of the mixture). Then, in order to hold the total pressure constant during the computation, we reohrase the camnutation in terms of mole fractions and Dalton's law. Our interest is in the pressweof the three gases as equilibrium is established s w i n g from an arbitrary set of initial pressures. Thus, we are not interested in treating gases at the standard pressure, 1atm. Instead, we

Volume 66

Number 10

October 1989

A237

columns will hold the instantaneous number of moles of ammonia, nitrogen and hy. drogen, respectively. while the fifth column (El will hold the sum of thew, ie.. the total number of moles a t the instant (denoted as " N in the soreadsheet). The oartial oressuresare computed in columns F,C,and H, in terms of the mule frartions and the tnfRl pressure, which is arbitrarily set at some value ( P = contents of cell $C$1).Columns I,

J, and K are resewed for the Gihhs's free energy of the three components of the system, as evaluated at the fixed temperature (which can be changed for a different exoeriment orovided AGO is recornouted at thenew temp~raturelTheentryfor column I.. which is the Gthhs's free energy of prudu d s minus that of reactants is

.

When row four has been constructed, we need only propagate the spreadsheet with increasing (or decreasing) values of in order to obtain the resultant values of AG. We do this in our examole with an increment. l "ine"),which contained in cell $ ~ $(named allows us to define the entry cell A5 as =A4 - inc

Lastly, we have the total Gihbs free ener. gy in column M, i.e.,

We force cell B5 to have the value B4 - 2: A5, cell C5 has the value C4 A5, and cell D5 has the value D4 3*A5. Copying cells E4 thru M4 to E5 thru M5 results in all the formulas being upgraded to reflect the new value oft.

r

+

+

Row 5 has now been set up in terms of variables, so that copying row 5 to row 6 will result in incrementing the reaction (by the value of inc) forward (or backward, depending an the sign of in+ The resulting (Excel) spreadsheet, for typical data, is shown in the table. DI~cusslon I t will he seen immediately that AG changes sign between = -0.28 and -0.3. This corresponds to having converted sufficient hydrogen and nitrogen into ammonia to bring their partial pressures into the correct range to satisfy the equilibrium cons t a n t Notice that a t this same "place", G itself is going through a minimum of about -44.9 kdlmol. Using different starting conditions (numbers of moles, ete.) one can explore the approach to equilibrium easily and speedily, all the while gaining insight into the peculiarity of the governing equation. For students whose calculus skills are modest, this numerical technique offers a valuable adjunct to understanding how thermodynamics governs the approach to equilibrium. The fact that the Gihbs free energy of thesystem approaches a minimum value a t constant pressure and that the equation AG=AG0+RTlnQ generates a zero value for AG, which simultaneously creates an equation forKp, should cement the understanding.of how equilibrium is achieved.

r

'David. C. W. J. Chem Edue. 1988, 65. 407409.

Modellingand Analyzing

log concentration .

~preadsheei:Acid-Base Systems Stephen Leharne S c h l of Biol~gicalSciences and Environmental Health Thames Polyiechnlc Wellington Steet LondonSE186PF United Kingdom

In a previous issue of this Jourml Atkinson et al.1 outlined a numher of uses far plots of pH vs. log concentration for species in acid-base equilibria. These included the ability to display trends as a function of pH and the solving of problems typically encountered in undergraduate chemistry courses. A numher of useful texts have been written on the subject of such graphical displays.2J In practice the object of such graphs is to show how the concentration of an aqueous chemical species varies with some master variable such as pH or ligand concentration. Once the relationship hetween concentration and the selected master variable is formulated. one can then use aspreadsheet tocomputesp~riesronc~ntmtion as a function of this master variahle and show the variation paphirally. Acid-Base Equilibria The species distribution of any acid H,A can he formulated as a function of pH by considering equilibrium descriptions of the system in terms of proton addition to the anion A"-. (Charges have been omitted for clarity.)

K,=l/Kal*

...Ka.

[HA1

=-

[A1 [HI"

The fraction of unassociated anion (FrA) is given by [A1

[A]

+ [HA] + [HA] t ...[H,A]

Dividing top and bottom by [A] and suhstituting for the resultant fractions yields FrA =

1 1 Z,K,[H]'

+

where K, is the protonation constant for specieat. [Alisgiven I,y FrA' Cacid (theacid concentration). The fraction of species i, where i is the number of associated protons, is given by Ki* [HIi* FrA. The soreadsheet mav he set UD to oerform these c&nutations &d the r&l& sneciesdistridution plottedasa function of i l l . Figure 1 shows a plot of log (speciesroneentmtion) vs. pH for a 0.05M solutim of ethanoic acid. The graph may he used to determine the pH of the solution. To do this we formulate &I electroneutrality expression. Such an expression equates the molar concentrations

..

.

..

..

.

.. . .

..

.

.

.

.

.

.

.

.

.

.

I

I

I

.

..

0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 pH

-

Flaure 1. Loa isoecies concentation)vs. DHfor a 0.05 M solution of elhanoic acid. of positive and negative charges. For 0.05 M ethanoic acid the equation is [H'] = [A-]

+ [OH-]

If we consider Figure 1, it is apparent that this electroneutrality condition is approximated to hy the intersection of the H+ and A- lines since at this point the coneentration of OH- is very low. The pH of this intersection is 3. We may alsonseFigure 1todetermine the endpoint pH in the neutralization of 0.05 M solution of ethanoic acid by a strong base like NaOH. At the endpoint the solution is essentially 0.05 M sodium ethanoate. The charge halance for this solution is

[Nat]

+ [H']

= [A-]

+ [OH-]

(1)

Given that some ethanoate ions will hydrolyze to form ethanoic acid we may write the following mass balance: [Nat] = [A-]

+ [HA]

and thus eq 1may he rewritten as [HA] + [HC]= [OH-]

(2)

On the graph this is approximated to by the intersection of the HA and OH-, lines. The endpoint pH is thus about 8.1. Equation 2 is a statement of the proton (Continued on page A2401

log concentrotion

the computer bulletin b o d condition for the solution. In formal terms the proton condition3 is a statement concerning the balance of proton excess and defieiencyin a system, based uponsome initial reference condition. In the above case the initial reference condition is the addition of sodium ethanoate to water. A fraction of ethanoate ions will comhine with protons to form ethanoic acid. Every mole of ethanoic acid so formed represents a mole of proton excess. The self-ionization of water yielding protons and hydroxide ions gives rise to proton excess and deficiency too. Proton balances are useful for the analysis of polybasic acids. Figure 2 shows species distribution as a function of pH for a 0.05 M solution of phosphoric acid. We may determine the nH of a 0.05 M solution of Na-HPO, b v writing thcappropriate pnrton condition lor the solution: [Ht]

0

1

2

3

4

5

6

7

8

9

1

0

1

1

1

2

1

3

1

4

pH

Figure 2. Log(speciesarncemration)vs. pH f a a 0.05 M solution of phosphnic acid. 109 concentration 0 . .

.

.

.

.

.

.

.

.

.

:

\

.

+ [H,PO,-] + 2[HSP0,] Proton excess

+

= [OH-] [PO:-] Proton deficiency

The coefficient of 2 in front of the H3P01 concentration indicates that the H3P04 molecule contains two rotons in excess of the reference ion, HPo!-. The intersection of the H2P04- lines and the PO:- roughly approximates to the above proton condition. The approximation is not entirely satisfactory since the OH- concentration is

: 0

1

2

3

4

5

6

8

7

9

10

..

I

I

11

12

.. I

1311

pH

Fiwe 3. Log (species concsnbation)vs. pH for 0.05 M solutions of ethanoic acM and ammonium ions. only slightly lower than the concentration of PO!-. This problem is overcome on the b y computing the composite &adsheet line of lug ([OH-] [PO:-]!.The pH at the intersection of this eumoosrte line with the H z P O l line is identified as the pH of the solution. More than one acid may be shown on the equilibrium graph. In Figure 3 acidbase equilibria for 0.05 M solutions of ethanolie acid and the ammonium ion are shown. The pH of a 0.05 M solution of ammonium ethanoste may be determined by identifying the appropriate proton condition:

+

The intersection of the ethanoic acid and ammonia Lines at a pH of 6.9 approximates to this condition.

The Theoretlcal Course ol a TltratlOn Any stage in the addition of a base like NaOH to an acid (HA), is characterized by an electroneutrality ~ondition.~," [~a']

+ [H']

= [A-]

+ [OH]

(3)

The concentrations of [Na+] and [A-1 are given by the expressions: [Nat] = Chase * Vbase Vacid Vbase

+

[A-] = Cacid * Vacid * FrA Vacid Vbase

+

where Cacid and Chase are the molar concentrations of acid and base. Vacid and Vbaae are the volumes of add-

ed acid and baseandFrAis the fraction of A. By substitution in and rearrangement of eq. 3 it can be shown that Vbase = Vaeid * Cacid*FrA

Cbase

+ [OH] - [HI

+ [HI - [OH]

(4) Willis'argues tbat Vbase may be considered the dependent variable, and thus various values for the proton concentration are used to compute the hydroxide ion and conjugate base concentrations. These are then substituted into eq 4 to compute the volume of base that would need to he added to give that proton concentration. It should he noted that same proton concentrations will give negative values for base volume added. These values may, however, he erased from the spreadsheet allowing only positive values to be plotted.

Summary The shove procedures have been used in undergraduate classes to good effect. The diagrams have proved useful in enabling students to "visualize" acid-base systems and the changes in such systems during titrations. While the production of the diagrams and development of charge, proton, and mass balances has necessitated the development of a real working grasp of the chemistry of the systems.

'

Atklnson. G. F.; Doadt, E. G.: Rell. C. J. Ghem. Educ. 41986,63.841. Slumrn. W.; Morgan. J. J. Aquatic Chemisby: An Intmduction EmphsIzIngChemicalEquiiibrIaIn Mtumi Waters. 2nd ed.; Wlley: New Yo*. 1981. Sillen. L. G. Qaphirnl Presentation of Equiiib ria Data. In Treatise on Analytical Chemisby; KolW off. I. M.; Elvlng. P. J.: Eds.: Interscience: New Ywk. 1959; Part 1. Vol. 2. 'Wllls, C. J. J. Chem. Educ 11B8l. 58.859.

Spreadsheets

-

Clyde Metz and Henry Donato, Jr. The College of Charleston Charleston. SC 29424 The concepts of chemical equilibrium, the equilibrium constant, and the equilihrium constant expression are presented in virtuall" all introduetorv calleee ehemistrv coursesfor both majorsand nonmajoru. Stu. denta are usually asked tosolveequilibrium problems both to test their understanding of the underlying chemical principles and to illustrate the utility of these principles. We have observed tbat the solution to these prohlems can he divided into two steps: 1. Students must describe a chemical situation with an algebraic equation. 2. The algebraic equation must be solved to find a phyairally meaningful root.

The first step requires some understanding of chemical principles to identify the chemical reaction involved and initial conditions for the chemical reaction, describe the net changes tbat must take place to reach equilibrium, and write down the equilihrium constaht expression in terms of a single unknown quantity. The second step involves finding the unknown quantity. In general,

this may require solving a quadratic, cubic, or higher order polynomial equation. The mathematical complexities of finding roots order oolvnomisl eouaof cubic or hieher " tlons has led to the situation in whrcb only problrms lradmg to quadratic equation8 are considered in many introductory chemistry courses. Breneman (5) has addressed this Lack of completeness by investigating the use of spreadsheets for finding r w t s of palynomial equations arising from equilibrium problems. He has shown that a spreadsheet can easily be constructed to find the root of a fourth-degree polynomial using an iterative procedure, the NewtowRaphson method. Joshi (6) has described a spreadsheet template which can be used to find the roots of any polynomial of order three, againusing the Newton-Raphson formula. While quick and convenient, these methods require from the student the abilitv to olace the eauation in polynomial form,a knowledge ofdifferrntial calculus, and anuugh chemiral intuition to start the iterative procedure reasonably close to the physically meaningful root. In this paper, we describe a general numerical method for obtaining a chemically relevant root to polynomial expressions generated from a consideration of chemical equilibrium. This method is based on a trial and error procedure tor findmg the physl~ally relevant rout and is conveniently executed on a personal computer runnmg a sprcadsheet program.

. .

volved in solving the equilihrium constant expression. Suppose that a t a temperature C a mixture of 3 parts Hz(g) and 1 of 400 ' oart NAe) is nlaced in a container with a iota1 pressure of 10 bar and the partial prrssuresuf Hz, N?, and NHxat equilibrium are desired. The reaction involved is

.

The initial partial pressures of Nz and Hz can be extracted from information given in the nrohlem. If onelets x be the nartial oressure of the nitrogen gar that reaccs in order tt, reach equilihrium, then the equrlibrium partial pressures of the gases are oven below:

. .

Descrlptlon and Appllcation of the Method Consider a reaction that is usually not discussed in introductory chemistry courses because of the mathematical difficulties in-

The equilibrium constant expression then becomes

Rewmed at me 10th Bfennlal Conference on Chemical Eduwtlon, Purdue University. August 1988.

(Continued on page A242)

An analytical solution to this quartic equation is beyond most beginning chemistry students. However, one may find a solution quickly by trial and error. Note that the difference between the left- and right-hand sides of eq 1 is zero when I is a root. I t is also clear that I must he between 0 and 2.5 bar in order to be physically meaningful. Anexnm. plc ofa spreadsheet which findsa physically meanindul mot for ea 1 is described beluw. The v&es of K , and the initial pressure are in cells A2 and A4, respectively. Trial values of x starting a t 0.0 har, increasing in increments of 0.1 bar and ending a t 2.5 bar, are placed in the cell range A6 to A30. The difference between the left- and right-hand sides of eq 1 is calculated by the spreadsheet for each trial value of x and entered in the cell range B6 to B30. The difference calculated in column B changes sign between the x values 0.1 and 0.2 bar, hence a root of eq 1 must lie in that interval. In column C, trial values of x starting with 0.1 bar and increasingin increments of 0.01 harunti10.2 bar are entered. The difference is calculated for the x values in column C and entered into column D. Inspection of column D reveals that a root must he between 0.17 bar and 0.18 bar. Proceeding in this fashion in columns E and F one can further narrow the interval in which the physically meaningful root lies. One would proceed until a value of x is found by trial and e m r whose difference from the physically meaningful root is insignificant, given the precisian of the experimental data in the problem. I t should he noted that this trial and error method is suitable for finding roots of any nonlinear algebraic equation in one unknown. The chief advantages of this praeedure are that it is conceptually simple, requires no calculus, and could be executed by any beginning chemistry student. The major disadvantage is that some problems require considerable spreadsheet manipulation and may take as long as 15 min. We have compared the performance of our method to that of commercial equation solvers like Eureka far a variety of equilihrium prohlems. When the algebraic expression derived from the consideration of the chemical equilibrium is transformed to a polynomial form, which may involve considerable algebraic manipulation, and the polynomial is scaled properly, i.e., the order of magnitude difference between the quantities in the problem is not too large, then Eureka finds the roots of the equation in a few seconds. Even if equation solvers like Eureka could be applied in a straightforward manner to every equilihrium prohlem, we would still argue that the trial and error method makes better pedagogical sense. Students nroerams like Eureka as tend to aooroach .. . . hlark hoaes. Active pnrrrcrpationon thc pan ofthestudent is rrqumd to use the trial and error method. Caution should be used when applying the trial and error method to some equilihrium prohlems. Difficulties may arise if the equilihrium constant is too large or too small. First, consider the chemical reaction:

A242

Journal of Chemical Education

with the initial concentration of C at 0.20 M and K = 6.00 X 10 -*.The above represents an unlikely ~ituation,hut a beginningchemistry student could easily calculate the equilibrium concentration of A and B.

[A] = [B] = [(6.00 X 10-99)(0.20)]05 = 3.5 X lo-" M

The trial and error method can only locate the solution between 3.1 X lo-" and 3.8 X lo-". Closer approach to the solution yields a difference hetween K and the equilibrium constant expression of less than 1 X 10-99, which is an undefined number for the spreadsheet. Second, consider the reaction, first pointed out to us by the editor, whose equilihrium constant is very large.

If the initial concentration of H202is 0.01 M, then one might proceed to calculate the equilihrium concentrations of all reacting species by letting r he the concentration of Hz02 that reacts to reach equilibrium. Defined in this way, x is very close to 0.01 M because K is so large. Therefore r must he calculated with very high precision ( x = 0.00999999988 M) in order to fmd the desired quantity, i.e., the equilihrium concentration of HzOz which is 1.2 X 10-'O M. This example pushed our spreadsheet torts limit of prcclswn. To avoid rhrs dfficulty, one could assume that all the H,O, isconvened into products and let the equfiihrium state he approached from the other direction. If this assumption is made, the initial conditions become

Now 1: is the concentration of Hz02 formed to reach equilihrium. One may now calcul a t e r by the straightforward application of the trial and error procedure.