## Notebook 2.1: Work in Reversible Isothermal Expansions

January 16, 2010This short exercise gives students more practice using Maxima’s integration and comma operators.

- Download and install the Euler Math Toolbox.
- Cut and paste the code below into a plain text file.
- Save the file with an .en file extension.
- Double-click the file. It should open up in the Toolbox.

All of the notebooks in this series are specifically keyed to Atkins’ Physical Chemistry, 8th edition. Italics mark the items students had to fill in themselves.

--------------------------------------------------------snip here---------------------------------------------------- Notebook 2.1: Work in Reversible Isothermal Expansions % % In reversible expansions or compressions, the external pressure constantly changes so that % it remains exactly equal to the pressure of the gas. In this special case, we can substitute % the pressure calculated from the gas's equation of state for the external pressure when calculating work. % For example, the work done to compress n moles of an ideal gas from V1 to V2 under reversible % conditions at temperature T is % >: assume(V1>0, V2>0, V1>V2, V>0) [V1 > 0, V2 > 0, V1 > V2, V > 0] >: work_ideal: -integrate(n*R*T/V,V,V1,V2) n R T (log(V1) - log(V2)) % If the "assume" had been omitted, Maxima would have asked a series of questions about % the signs of the volumes during the integration. % % If we want to calculate the work for specific temperatures and volumes, we can use Maxima's % comma operator. For example, >: work_ideal, n=1, R=8.314, T=298, V1=1, V2=0.5, numer 1717.322046434265 % % Integrating -n*R*T/V with respect to V from V1 to V2 at constant T gives -n*R*T*ln(V2/V1), so we could % also have calculated the work as -n*R*T*log(V2/V1). % --> Notice that the Maxima function for natural logarithms is log(), NOT ln()!) % --> The final ",numer" tells Maxima that we want a number as an answer. Maxima will sometimes % just display logs of whole numbers without calculating them in a final result if we don't include this. % --------------------------------------------------------------------------------------------------------- % In the space below, create an expression called work_vdw that calculates the work for a reversible isothermal % expansion of a van der Waals gas as it expands from volume V1 to volume V2 at temperature T. %>: assume(V>b, V1>b, V2>b) [V > b, V1 > b, V2 > b] >: work_vdw: -integrate(n*R*T/(V-b)-n^2*a/V^2,V,V1,V2) 2 2 a n a n - n R T log(V2 - b) - ---- + n R T log(V1 - b) + ---- V2 V1% --------------------------------------------------------------------------------------------------------- % In the space below, use the comma operator to calculate the work for one mole of xenon expanding from 1 m^3 % to a volume of 10 m^3 at a temperature of 298 K. %>: work_vdw, a=5.125, b=1.06e-2, T=298, n=1, V1=1, V2=10, R=8.314,numer - 5723.982679505956% --------------------------------------------------------------------------------------------------------- % In the space below, use the comma operator to calculate the work for one mole of xenon expanding from 1 m^3 % to a volume of 10 m^3 at a temperature of 298 K IGNORING INTERMOLECULAR ATTRACTIONS. %>: work_vdw, a=0, b=1.06e-2, T=298, n=1, V1=1, V2=10, R=8.314, numer - 5728.595179505956% --------------------------------------------------------------------------------------------------------- % In the space below, use the comma operator to calculate the work for one mole of xenon expanding from 1 m^3 % to a volume of 10 m^3 at a temperature of 298 K IGNORING INTERMOLECULAR REPULSIONS. %>: work_vdw, a=5.125, b=0, T=298, n=1, V1=1, V2=10, R=8.314, numer - 5700.207854019444% --------------------------------------------------------------------------------------------------------- % In the space below, use the comma operator to calculate the work for one mole of xenon expanding from 1 m^3 % to a volume of 10 m^3 at a temperature of 298 K IGNORING ALL INTERMOLECULAR FORCES. %>: work_vdw, a=0, b=0, T=298, n=1, V1=1, V2=10, R=8.314, numer - 5704.820354019445

Advertisements

very usefull tool, thanks

by molecular sieve February 18, 2011 at 3:31 am