diff options
author | hardythe1 | 2015-05-05 14:21:39 +0530 |
---|---|---|
committer | hardythe1 | 2015-05-05 14:21:39 +0530 |
commit | 435840cef00c596d9e608f9eb2d96f522ea8505a (patch) | |
tree | 4c783890c984c67022977ca98432e5e4bab30678 /Physical_Chemistry/Chapter1.ipynb | |
parent | aa1863f344766ca7f7c20a395e58d0fb23c52130 (diff) | |
download | Python-Textbook-Companions-435840cef00c596d9e608f9eb2d96f522ea8505a.tar.gz Python-Textbook-Companions-435840cef00c596d9e608f9eb2d96f522ea8505a.tar.bz2 Python-Textbook-Companions-435840cef00c596d9e608f9eb2d96f522ea8505a.zip |
add books
Diffstat (limited to 'Physical_Chemistry/Chapter1.ipynb')
-rwxr-xr-x | Physical_Chemistry/Chapter1.ipynb | 208 |
1 files changed, 208 insertions, 0 deletions
diff --git a/Physical_Chemistry/Chapter1.ipynb b/Physical_Chemistry/Chapter1.ipynb new file mode 100755 index 00000000..f8eddd0e --- /dev/null +++ b/Physical_Chemistry/Chapter1.ipynb @@ -0,0 +1,208 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2d2c58ce752ea004ea6f79edf5332f8f357b96a3e81270455c238eb5e0794fa8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 - matter and its atomic nature"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1 - pg 3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the Angle required\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "l=0.71 *10**-8 #cm\n",
+ "n=200. #lines/cm\n",
+ "v=0.00145 #radian\n",
+ "#calculations\n",
+ "d=1/n\n",
+ "phi2=2*l/d +v**2\n",
+ "phi=math.sqrt(phi2)\n",
+ "#results\n",
+ "print '%s %.2e %s' %('Angle required =',phi,'radian')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle required = 2.22e-03 radian\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2 - pg 6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the Interplanar distance\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "angle=37.25 #degrees\n",
+ "l=1.539 #A\n",
+ "n=1. #order\n",
+ "#calculations\n",
+ "d=n*l/(2*math.sin(angle/180.*math.pi))\n",
+ "#results\n",
+ "print '%s %.3f %s' %(\"Interplanar distance =\",d,\"A\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Interplanar distance = 1.271 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5 - pg 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the ratio of radii\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "r1=math.sqrt(3.)\n",
+ "r2=1\n",
+ "#calculations\n",
+ "ratio=r1-r2\n",
+ "#results\n",
+ "print '%s %.3f' %('Ratio of radii =',ratio)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of radii = 0.732\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6 - pg 21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the Avagadro number\n",
+ "#Initialization of variables\n",
+ "d=2.64 #g/cc\n",
+ "l=4.016*10**-8 #cm\n",
+ "n=4\n",
+ "M=25.94 #g/mol\n",
+ "#calculations\n",
+ "m=d*l**3 /n\n",
+ "N0=M/m\n",
+ "#results\n",
+ "print '%s %.3e %s' %(\"Avagadro number =\",N0,\" molecule/mol\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Avagadro number = 6.068e+23 molecule/mol\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 10 - pg 28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate the angle required\n",
+ "#Initialization of variables\n",
+ "import math\n",
+ "import numpy\n",
+ "A=numpy.array([-1, -1, -1 ])\n",
+ "B=numpy.array([1, 1, -1])\n",
+ "#calculations\n",
+ "Ad=math.sqrt(1+1+1)\n",
+ "Bd=math.sqrt(1+1+1)\n",
+ "dot=numpy.dot(A,B) /(Ad*Bd) \n",
+ "theta=math.acos(dot) *180./math.pi\n",
+ "#results\n",
+ "print '%s %.2f %s' %(\"Angle =\",theta,\" degrees\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Angle = 109.47 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |