summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_J._P._Holman/ch5.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Thermodynamics_by_J._P._Holman/ch5.ipynb')
-rwxr-xr-xThermodynamics_by_J._P._Holman/ch5.ipynb207
1 files changed, 207 insertions, 0 deletions
diff --git a/Thermodynamics_by_J._P._Holman/ch5.ipynb b/Thermodynamics_by_J._P._Holman/ch5.ipynb
new file mode 100755
index 00000000..8df6c255
--- /dev/null
+++ b/Thermodynamics_by_J._P._Holman/ch5.ipynb
@@ -0,0 +1,207 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:427d2fadecfbb47aca45827faabee15c72f488581939d9b848cacc0b97c7f502"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : principles of statistical\n",
+ "thermodynamics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.1 pg : 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import factorial\n",
+ "\t\t\t\n",
+ "# Variables\n",
+ "N1 = 1.\n",
+ "N2 = 1.\n",
+ "N3 = 3.\n",
+ "N4 = 1.\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "N = N1+N2+N3+N4\n",
+ "sig = factorial(N) /(factorial(N1) *factorial(N2)*factorial(N3)*factorial(N4))\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"No. of ways of arranging = %d \"%(sig)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. of ways of arranging = 120 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.2 pg : 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\t\t\t\n",
+ "# Variables\n",
+ "N = 6.\n",
+ "g = 4.\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "sig = factorial(g+N-1) /(factorial(g-1) *factorial(N))\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"No. of ways of arranging = %d \"%(sig)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. of ways of arranging = 84 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.3 pg : 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import factorial\t\t\t\n",
+ "# Variables\n",
+ "N = 6.\n",
+ "g = 8.\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "sig = factorial(g) /(factorial(N) *factorial(g-N))\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"No. of ways = %d \"%(sig)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "No. of ways = 28 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5.4 pg : 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%matplotlib inline\n",
+ "import math \n",
+ "from matplotlib.pyplot import bar\n",
+ "\n",
+ "# Variables\n",
+ "N0 = 1.\n",
+ "\t\t\t\n",
+ "# Calculations\n",
+ "N1 = 3/math.e\n",
+ "N2 = 6/math.e**2\n",
+ "N3 = 10/math.e**3\n",
+ "N = N0+N1+N2+N3\n",
+ "ei = [0, 1, 2, 3]\n",
+ "\n",
+ "f0 = N0/N\n",
+ "f1 = N1/N\n",
+ "f2 = N2/N\n",
+ "f3 = N3/N\n",
+ "fi = [f0, f1, f2, f3]\n",
+ "\t\t\t\n",
+ "# Results\n",
+ "print \"fractional population of level 0 = %.3f\"%(f0)\n",
+ "print \" fractional population of level 1 = %.3f\"%(f1)\n",
+ "print \" fractional population of level 2 = %.3f\"%(f2)\n",
+ "print \" fractional population of level 3 = %.3f\"%(f3)\n",
+ "bar(ei,fi,0.1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fractional population of level 0 = 0.293\n",
+ " fractional population of level 1 = 0.323\n",
+ " fractional population of level 2 = 0.238\n",
+ " fractional population of level 3 = 0.146\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 2,
+ "text": [
+ "<Container object of 4 artists>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEACAYAAABfxaZOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAD7dJREFUeJzt3V+IHed5x/HvidailaxtrFa1qKx0QVbrGGwSU5RtZbcn\nqTCbXESGXMgmwVAHVxdV7YtQhKBE66uigikEgaOCCmlqqotWMYLKlW3oUJG6sjbVv9Zao1UqkBTX\nOLbrWA6hK3R68c5Gk6NdvTPn75x9vx846My875x9eLz+ndl35uyCJEmSJEmSJEmSJEmSJEmSamAK\nmAUuALsXGd8OnAFOAT8AvlAYuwSczcfe6GuVkqSurQDmgAngDuA08Om2OasLzx/I5y/4b2BtH+uT\nJFXwicj4FkKIXwLmgUOEM/uijwvP7wR+3Dbe6KI+SVIPxUJ/A3C5sH0l39fuMeA88DLwTGF/C3gN\nmAGe7rxMSVIvjEXGWyVf56X88QjwXeC38/1bgbeBdcCrhGsDx6uXKUnqhVjoXwU2FrY3Es72l3I8\nf81fBd4jBD7Au8D3CM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