summaryrefslogtreecommitdiff
path: root/Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb')
-rw-r--r--Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb125
1 files changed, 125 insertions, 0 deletions
diff --git a/Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb b/Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb
new file mode 100644
index 00000000..91a87652
--- /dev/null
+++ b/Introduction_to_flight_by_J_D_Anderson/Appendix_D.ipynb
@@ -0,0 +1,125 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Appendix D"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Change in gibbs free energy at 298K : 457.179 KJ\n",
+ "Change in gibbs free energy at 298K : 271.04 KJ\n"
+ ]
+ }
+ ],
+ "source": [
+ "# -*- coding: utf8 -*-\n",
+ "from __future__ import division\n",
+ "#Example: 16.2\n",
+ "'''Determine the value of \u0002G0 for the reaction 2H2O \u0003\u0004 2H2 + O2 at 25◦C and at 2000 K,\n",
+ "with the water in the gaseous phase.'''\n",
+ "\n",
+ "#Keys:\n",
+ "#1-H2\n",
+ "#2-O2\n",
+ "#3-H2O\n",
+ "\n",
+ "#Variable Declaration: \n",
+ "def dG(T1,Hf1,Hf2,Hf3,Sf1,Sf2,sf3):\n",
+ "\tdH = 2*Hf1+Hf2-2*Hf3\t#Change in enthalpy in kJ\n",
+ "\tdS = 2*Sf1+Sf2-2*sf3 \t#Change in entropy in J/K\n",
+ "\tdG = dH-T1*dS/1000\t#change n gibbs free energy in kJ\n",
+ "\treturn dG\n",
+ "\n",
+ "#Results:\n",
+ "print 'Change in gibbs free energy at 298K :',round(dG(298,0, 0, -241.826, 130.678,205.148,188.834),3),\"KJ\"\n",
+ "print 'Change in gibbs free energy at 298K :',round(dG(2000,52.942, 59.176, -241.826+72.788,188.419,268.748,264.769),3),\"KJ\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Equilibrium constant at 298K: -184.51\n",
+ "Equilibrium constant at 2000K: -16.299\n"
+ ]
+ }
+ ],
+ "source": [
+ "# -*- coding: utf8 -*-\n",
+ "from __future__ import division\n",
+ "#Example: 16.3\n",
+ "'''Determine the equilibrium constant K, expressed as ln K, for the reaction 2H2O <--->\n",
+ "2H2 + O2 at 25◦C and at 2000 K.'''\n",
+ "\n",
+ "#Variable Declaration: \n",
+ "dG1 = -457.166\t\t\t#change in gibbs free energy at temp 298 K from example2 in kJ\n",
+ "dG2 = -271.040\t\t\t#change in gibbs free energy at temp 2000 K from example2 n kJ\n",
+ "T1 = 298\t\t\t\t#K\n",
+ "T2 = 2000\t\t\t\t#K\n",
+ "R = 8.3145\t\t\t\t#gas constant\n",
+ "\n",
+ "#Calculations:\n",
+ "K1 = dG1*1000/(R*T1)\n",
+ "K2 = dG2*1000/(R*T2)\n",
+ "\n",
+ "#Results:\n",
+ "print 'Equilibrium constant at 298K: ',round(K1,2)\n",
+ "print 'Equilibrium constant at 2000K: ',round(K2,3)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}