summaryrefslogtreecommitdiff
path: root/Material_Science_In_Engineering/ch4.ipynb
diff options
context:
space:
mode:
authorhardythe12014-07-28 14:01:58 +0530
committerhardythe12014-07-28 14:01:58 +0530
commit7876eeaf85f7c020ec1f3530963928cd2bc26a66 (patch)
tree67f4da564402aeb9869eaaf6f1e83ec7f1f75aa9 /Material_Science_In_Engineering/ch4.ipynb
parent1c1ea29e3e213559fef5f928df109b7d17c21f24 (diff)
downloadPython-Textbook-Companions-7876eeaf85f7c020ec1f3530963928cd2bc26a66.tar.gz
Python-Textbook-Companions-7876eeaf85f7c020ec1f3530963928cd2bc26a66.tar.bz2
Python-Textbook-Companions-7876eeaf85f7c020ec1f3530963928cd2bc26a66.zip
adding book
Diffstat (limited to 'Material_Science_In_Engineering/ch4.ipynb')
-rwxr-xr-xMaterial_Science_In_Engineering/ch4.ipynb195
1 files changed, 195 insertions, 0 deletions
diff --git a/Material_Science_In_Engineering/ch4.ipynb b/Material_Science_In_Engineering/ch4.ipynb
new file mode 100755
index 00000000..ebcb7af1
--- /dev/null
+++ b/Material_Science_In_Engineering/ch4.ipynb
@@ -0,0 +1,195 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 : Crystallography"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.3 page no : 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "r_na = 0.98;\t\t\t#ionic radius of sodium in angstorm\n",
+ "r_cl = 1.81;\t\t\t#ionic radius of chlorine in angstorm\n",
+ "n = 4.; \t\t\t#in fcc there are 4 Na and 4 Cl ions\n",
+ "\n",
+ "# Calculations\n",
+ "a = ((2*r_na)+(2*r_cl));\t\t\t#latice constant\n",
+ "apf = ((n*(4./3)*3.14*r_na**3)+(n*(4./3)*3.14*r_cl**3))/a**3;\n",
+ "\n",
+ "# Results\n",
+ "print \"Lattice consmath.tant = \",a\n",
+ "print \"atomic packing fraction of NaCl having FCC structure = %.2f\"%apf\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Lattice consmath.tant = 5.58\n",
+ "atomic packing fraction of NaCl having FCC structure = 0.66\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.4 pageno : 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math \n",
+ "\n",
+ "# Variables\n",
+ "r = 1.278;\t\t\t#radius of copper in angstorm\n",
+ "\n",
+ "#copper has FCC structure\n",
+ "a = round(4*r/math.sqrt(2),2);\t\t\t#in angstorm\n",
+ "a1 = a*10**-8;\t\t\t #in cm\n",
+ "aw = 63.54; \t\t\t#atomic weight of copper\n",
+ "ne = 4.;\t\t\t #fcc\n",
+ "na = 6.023*10**23;\t\t\t #Avagadro's no.\n",
+ "p = aw*ne/(na*a1**3);\t\t\t#in g/cm**3\n",
+ "\n",
+ "# Results\n",
+ "print \"a (in Angstorm) = %.2f A\"%a\n",
+ "print \"Density of Copper (in gm/cm**3) : %.2f\"%p\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a (in Angstorm) = 3.61 A\n",
+ "Density of Copper (in gm/cm**3) : 8.97\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.5 pageno : 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "w_na = 23.; \t\t\t#atomic weight of Na\n",
+ "w_cl = 35.5;\t\t\t#atomic weight of Cl\n",
+ "w = w_na+w_cl;\t\t\t#effective no.of atoms in FCC structure\n",
+ "n = 4.; \t\t\t#FCC\n",
+ "\n",
+ "# Calculations\n",
+ "na = 6.023*10**23;\t\t\t#Avagadrro's no.\n",
+ "w_4 = w*n/na;\t\t\t#weight of 4 molecules in gm\n",
+ "p = 2.18;\t\t\t#density in gm/cm**3\n",
+ "a3 = (w*n)/(na*p)\n",
+ "a = a3**(1./3)\n",
+ "#a = (w_4/p)**(1/3);\t\t\t#in cm\n",
+ "a1 = a*10**8;\t\t\t#in angstorm\n",
+ "d = a1/2;\n",
+ "\n",
+ "# Results\n",
+ "print \"unit cell dimension (in angstorm) = %.2f A\"%a1\n",
+ "print \"Distance between two adjacent atoms (in Angstorm) = %.2f A\"%d\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "unit cell dimension (in angstorm) = 5.63 A\n",
+ "Distance between two adjacent atoms (in Angstorm) = 2.81 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 4.6 pageno : 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Variables\n",
+ "n = 2.; \t\t\t#BCC \n",
+ "p = 7.86;\t \t\t #density in gm/cm**3\n",
+ "aw = 55.85;\t\t \t#atomic weight of iron\n",
+ "\n",
+ "# Calculations\n",
+ "na = 6.023*10**23;\t\t \t#Avagadrro's no.\n",
+ "a = ((aw*n)/(na*p))**(1./3);\t\t\t#in cm\n",
+ "a1 = a*10**8;\t \t\t#in angstorm\n",
+ "r = math.sqrt(3)*a1/4;\n",
+ "\n",
+ "# Results\n",
+ "print \"unit cell dimension of iron (in angstorm) = %.2f A\"%a1\n",
+ "print \"atomic radius = %.3f A\"%r\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "unit cell dimension of iron (in angstorm) = 2.87 A\n",
+ "atomic radius = 1.242 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file