using System; using L=Science.Physics.GeneralPhysics; namespace Serway.Chapter20 { /// /// Example06: An Isothermal Expansion /// A 1.0 mol sample of an ideal gas is kept at 0.0 C during /// an expansion from 3.0 L to 10.0 L. /// (A) How much work is done on the gas during the expansion? /// W = -2.7 \times 10^3 J /// (B) How much energy transfer by heat occurs with the /// surroundings in this process? /// Q = -W = 2.7 \times 10^3 J /// (C) If the gas is returned to the orginal volume by means /// of an isobaric process, how much work is done on the gas? /// W = 1.6 \times 10^3 J /// public class Example06 { public Example06() { } private string result; public string Result { get{return result;} } public void Compute() { L.IdealGas gas = new L.IdealGas(); gas.Mole = 1.0; L.Temperature t = new L.Temperature(); t.C = 0.0; t.FindAbsoluteFromCelsius(); gas.Temperature = t.K; //(A) L.Work W = new L.Work(); W.J = - gas.Mole*L.Constant.UniversalGasConstant *gas.Temperature*Math.Log(10.0/3.0); result+=W.ToString()+"\r\n"; //(B) L.Energy U = new L.Energy(); U.J = 0.0; L.Heat Q = new L.Heat(); Q.VariableQ = true; L.FundamentalLaw.ThermodynamicsFirstLaw(Q,W,U); result+=Q.ToString()+"\r\n"; //(C) gas.Volume = 10.0E-3; gas.FindPressure(); W.J = -gas.Pressure*(3.0E-3 - 10.0E-3); result+=W.ToString()+"\r\n"; } } } /* -2734.18503586455 +/- 0 (J) 2734.18503586455 +/- 0 (J) 1589.67837 +/- 0 (J) */