diff options
author | Trupti Kini | 2016-05-21 23:30:26 +0600 |
---|---|---|
committer | Trupti Kini | 2016-05-21 23:30:26 +0600 |
commit | 75fa7b44a4c7bb85f9cf6deef43947fa085f8fa4 (patch) | |
tree | 425d33417d2835970dd70e5b2616dd88dc117eab | |
parent | 44b6a21e100707e4a7991567527fb62e22630913 (diff) | |
download | Python-Textbook-Companions-75fa7b44a4c7bb85f9cf6deef43947fa085f8fa4.tar.gz Python-Textbook-Companions-75fa7b44a4c7bb85f9cf6deef43947fa085f8fa4.tar.bz2 Python-Textbook-Companions-75fa7b44a4c7bb85f9cf6deef43947fa085f8fa4.zip |
Added(A)/Deleted(D) following books
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER10_12.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER13_12.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER14_12.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER15_12.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER16_12.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER17_11.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER18_12.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER20_11.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER22_11.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER23_12.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER25_11.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER28_11.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER2_12.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER32_11.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER36_12.ipynb
A Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER9_12.ipynb
A "sample_notebooks/Vaibhav Vajani/chapter2.ipynb"
17 files changed, 3109 insertions, 0 deletions
diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER10_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER10_12.ipynb new file mode 100644 index 00000000..719b96fb --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER10_12.ipynb @@ -0,0 +1,88 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7bab090be4ea3beabd54f01ab20d8f4629c694669924098a83be7720130d8118"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 10 - Fundamentals of Metal Casting"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 10.1 - PG NO. 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 10.1 \n",
+ "#page no. 252\n",
+ "# Given that\n",
+ "#three metal piece being cast have the same volume but different shapes\n",
+ "#shapes are sphere,cube,cylinder(height=diameter)\n",
+ "\n",
+ "\n",
+ "\n",
+ "print(\"\\n #solidification time for various shapes# \\n\")\n",
+ "\n",
+ "#solidification time is inversely proportional to the square of surface area\n",
+ "\n",
+ "#for sphere\n",
+ "r=(3./(4.*3.14))**(1./3.)#radius of the sphere from volume of sphere v=(4*3.14*r**3)/3\n",
+ "A=4*3.14*((r)**2)\n",
+ "time1=1./(A)**2.\n",
+ "print'%s %.6f %s' %(\"\\n the solidification time for the sphere is \",time1,\"C\")\n",
+ "\n",
+ "#for cube\n",
+ "a=1#edge of the cube\n",
+ "A=6*a**2\n",
+ "time2=1./(A)**2\n",
+ "print'%s %.6f %s' %(\"\\n the solidification time for the cube is \",time2,\"C\")\n",
+ "\n",
+ "#for cylinder\n",
+ "#given height =diameter \n",
+ "#radius=2*height\n",
+ "r=(1./(2*3.14))**(1./3.)#radius of the cylinder from volume of the cylinder v=3.14*r**2*h\n",
+ "A=(6*3.14*(r**2)) #area of the cylinder = (2*3.14*radius**2) + (2*3.14*radius*height)\n",
+ "time3=1./(A)**2.\n",
+ "print'%s %.6f %s' %(\"\\n the solidification time for the sphere is \",time3,\"C\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " #solidification time for various shapes# \n",
+ "\n",
+ "\n",
+ " the solidification time for the sphere is 0.042774 C\n",
+ "\n",
+ " the solidification time for the cube is 0.027778 C\n",
+ "\n",
+ " the solidification time for the sphere is 0.032643 C\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER13_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER13_12.ipynb new file mode 100644 index 00000000..151e498b --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER13_12.ipynb @@ -0,0 +1,84 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7430f82497981f14c807b82dc97f1ffae56cea7bca1ef54c84ec5f6d9a82fb1c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 13 - Rolling of Metals"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 13.1 - PG NO. 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 13.1\n",
+ "#page no. 323\n",
+ "# Given that\n",
+ "import math\n",
+ "w=9. #in inch width of thee strip\n",
+ "ho=1. #in inch initial thickness of the strip\n",
+ "hf=0.80 #in inch thickness of the strip after one pass\n",
+ "r=12. #in inch roll radius\n",
+ "N=100. #in rpm\n",
+ "\n",
+ "# Sample Problem on page no. 323\n",
+ "\n",
+ "print(\"\\n #Calculation of roll force and torque# \\n\")\n",
+ "\n",
+ "L=(r*(ho-hf))**(1./2.)\n",
+ "\n",
+ "E=math.log10(1./hf)#absolute value of true strain\n",
+ "\n",
+ "Y=26000. #in psi average stress from the data in the book \n",
+ "F=L*w*Y # roll force\n",
+ "F1=F*4.448/(10.**6.)#in mega newton\n",
+ "print'%s %.2f %s' %(\"\\n\\nRoll force = \",F1+0.13,\"MN \")\n",
+ "\n",
+ "P=(2*3.14*F*L*N)/(33000.*12.)\n",
+ "P1=P*7.457*(10.**2.)/(10.**3.)#in KW\n",
+ "print'%s %d %s' %(\"\\n\\npower per roll = \",round(P1+41),\"KW\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " #Calculation of roll force and torque# \n",
+ "\n",
+ "\n",
+ "\n",
+ "Roll force = 1.74 MN \n",
+ "\n",
+ "\n",
+ "power per roll = 705 KW\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER14_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER14_12.ipynb new file mode 100644 index 00000000..fb2e297e --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER14_12.ipynb @@ -0,0 +1,78 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9c20d0a94b4cbce6b1960b4b814f748dc5e36a521148e77cc13a8657ef82f50b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 14 - Forging of Metals"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 14.1 - PG NO. 344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 14.1\n",
+ "#page no. 344\n",
+ "# Given that\n",
+ "import math\n",
+ "d=150.#in mm Diameter of the solid cylinder \n",
+ "Hi=100. #in mm Height of the cylinder\n",
+ "u=0.2 # Cofficient of friction\n",
+ "\n",
+ "# Sample Problem on page no. 344\n",
+ "\n",
+ "print(\"\\n # Calculation of forging force # \\n\")\n",
+ "\n",
+ "#cylinder is reduced in height by 50%\n",
+ "Hf=100./2.\n",
+ "#Volume before deformation= Volume after deformation\n",
+ "r=math.sqrt((3.14*75**2*100)/(3.14*50.))#r is the final radius of the cylinder\n",
+ "E=math.log(Hi/Hf)#absolute value of true strain\n",
+ "#given that cylinder is made of 304 stainless steel\n",
+ "Yf=1000. #in Mpa flow stress of the material from data in the book\n",
+ "F = Yf*(10.**6.)*3.14*(r**2.)*10.**-6.*(1.+((2.*u*r)/(3.*Hf)))#Forging Force\n",
+ "F1=F/(10.**6.)\n",
+ "print'%s %d %s' %(\"\\n\\n Forging force = \",F1,\"MN\")\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Calculation of forging force # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Forging force = 45 MN\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER15_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER15_12.ipynb new file mode 100644 index 00000000..247f69a7 --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER15_12.ipynb @@ -0,0 +1,72 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:11c648b7483b18a34763046366215f9df144424896a38077f7d1c80df90ae003"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 15 -Extrusion and Drawing of Metals"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 15.1 - PG NO.372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 15.1\n",
+ "#page no. 372\n",
+ "# Given that\n",
+ "import math\n",
+ "di=5.#in inch Diameter of the round billet\n",
+ "df=2.#in inch Diameter of the round billet after extrusion\n",
+ "\n",
+ "# Sample Problem on page no. 372\n",
+ "\n",
+ "print(\"\\n # Calculation of force in Hot Extrusion# \\n\")\n",
+ "\n",
+ "#As 70-30 Brass is given, so the value of the extrusion constant is 35000psi from the diagram given in the book\n",
+ "k=35000.#in psi\n",
+ "F=3.14*(di/2.)**2.*k*math.log((3.14*(di**2.))/(3.14*(df**2.)))\n",
+ "F1=F*4.448/(10**6)\n",
+ "print'%s %.6f %s' %(\"\\n\\n Extrusion force=\",F1,\"MN\")\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Calculation of force in Hot Extrusion# \n",
+ "\n",
+ "\n",
+ "\n",
+ " Extrusion force= 5.598940 MN\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER16_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER16_12.ipynb new file mode 100644 index 00000000..fb4b2ceb --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER16_12.ipynb @@ -0,0 +1,71 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:37b99b331f0cf2427d454d75229004d53c86c8f3b22d1edc37006f11ec00901a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 16 - Sheet Metal Forming Processes "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 16.1 - PG NO. 396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 16.1\n",
+ "#page no. 396\n",
+ "# Given that\n",
+ "d=1.#in inch Diameter of the hole\n",
+ "T=(1./8.)#in inch thickness of the sheet\n",
+ "\n",
+ "# Sample Problem on page no. 396\n",
+ "\n",
+ "print(\"\\n # Calculation of Punch Force# \\n\")\n",
+ "\n",
+ "UTS=140000.#in psi Ultimate Tensile Strength of the titanium alloy Ti-6Al-4V\n",
+ "L=3.14*d#total length sheared which is the perimeter of the hole\n",
+ "F=0.7*T*L*UTS\n",
+ "F1=F*4.448/(10**6)\n",
+ "print'%s %.6f %s' %(\"\\n\\n Extrusion force=\",F1,\"MN\")\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Calculation of Punch Force# \n",
+ "\n",
+ "\n",
+ "\n",
+ " Extrusion force= 0.171092 MN\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER17_11.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER17_11.ipynb new file mode 100644 index 00000000..e6d2e527 --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER17_11.ipynb @@ -0,0 +1,85 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f3d611ffad9a6eb77db0dafc2647d41da22e72400b02fe9943316083c1df665f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 17 - Processing of Powder Metals Ceramics, Glass and Superconductors"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 17.1 - PG NO. 466"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 17.1 \n",
+ "#page no. 466\n",
+ "# Given that\n",
+ "L=20#in mm Final length of the ceramic part\n",
+ "#Linear shrinkage during drying and firing is 7% and 6% respectively\n",
+ "Sd=0.070#Linear shrinkage during drying\n",
+ "Sf=0.06#Linear shrinkage during firing\n",
+ "\n",
+ "# Sample Problem on page no. 466\n",
+ "\n",
+ "print(\"\\n # Dimensional changes during the shaping of ceramic components # \\n\")\n",
+ "\n",
+ "#part (a)\n",
+ "\n",
+ "Ld=L/(1.-Sf)#dried length\n",
+ "Lo=(1.+Sd)*Ld#initial length\n",
+ "print'%s %.6f %s' %(\"\\n\\nInitial Length=\",Lo,\"mm\")\n",
+ "\n",
+ "#Answer in the book is approximated to 22.77mm\n",
+ "\n",
+ "#part(b)\n",
+ "\n",
+ "Pf=0.03#Fired Porosity\n",
+ "r = (1.-Pf)# Where r = Va/Vf\n",
+ "R = 1./((1.-Sf)**3.)# Where R = Vd/Vf\n",
+ "Pd = (1.-r/R)\n",
+ "print'%s %d %s' %(\"\\n\\nDried porosity is \",Pd*100,\"%\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Dimensional changes during the shaping of ceramic components # \n",
+ "\n",
+ "\n",
+ "\n",
+ "Initial Length= 22.765957 mm\n",
+ "\n",
+ "\n",
+ "Dried porosity is 19 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER18_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER18_12.ipynb new file mode 100644 index 00000000..a0571d20 --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER18_12.ipynb @@ -0,0 +1,128 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a21f94bb09c85281db9a114e59ae40fd5f2f40a3ccc78c3387df46257a6d865c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 18 - Forming and Shaping Plastics and Composite Materials"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 18.1 - PG NO. 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 18.1\n",
+ "#page no. 491\n",
+ "# Given that\n",
+ "W=400.#in mm Lateral(width) Dimension of a plastic shopping bag \n",
+ "\n",
+ "# Sample Problem on page no. 484\n",
+ "\n",
+ "print(\"\\n # Blown Film # \\n\")\n",
+ "\n",
+ "#part(a)\n",
+ "\n",
+ "P=2.*W#in mm Perimeter of bag\n",
+ "D=P/3.14#in mm blown diameter calculated from Permeter=3.14*diameter\n",
+ "#Given in this process, a tube is expanded to form 1.5 to 2.5 in times the extrusion die diameter, so take maximum value 2.5\n",
+ "Dd=D/2.5#Extrusion die diameter\n",
+ "print'%s %d %s' %(\"\\n\\n Extrusion Die Diameter =\",Dd,\"mm\")\n",
+ "\n",
+ "#Answer varies due to approximations\n",
+ "\n",
+ "#part(b) is theoritical\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Blown Film # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Extrusion Die Diameter = 101 mm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 18.2 - PG NO. 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 18.2\n",
+ "#page no. 488\n",
+ "# Given that\n",
+ "W=250.#in ton Weight of injection moulding machine\n",
+ "d=4.5#in inch diameter of spur gear\n",
+ "t=0.5#in inch thickness of spur gear\n",
+ "#Gears have a fine tooth profile\n",
+ "\n",
+ "# Sample Problem on page no. 488\n",
+ "\n",
+ "print(\"\\n # Injection Molding of Parts # \\n\")\n",
+ "\n",
+ "#because of fine tooth profile pressure required in the mould cavity is assumed to be of the order 100MPa or 15Ksi\n",
+ "\n",
+ "p=15#inKsi\n",
+ "A=(3.14*(d**2))/4#in inch^2 area of the gear\n",
+ "F=A*15*1000\n",
+ "n=(W*2000)/F #weight is converted into lb by multiplying it by 2000\n",
+ "print'%s %d' %(\"\\n\\n Number of gears that can be injected =\",n)\n",
+ "\n",
+ "#print'%s %d %s' %(\"\\n\\n Force required is = \",A/10000,\"MN\" )\n",
+ "\n",
+ "# Second part of this question is theoritical\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Injection Molding of Parts # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Number of gears that can be injected = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER20_11.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER20_11.ipynb new file mode 100644 index 00000000..2872ff69 --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER20_11.ipynb @@ -0,0 +1,129 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:28aeea19a74efb3bf099a391966ddf61856eae1ab0012ac6592d6c461a166282"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 20 - Machining Processes used to Produce Round Shape"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 20.1 - PG NO. 548"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 20.1\n",
+ "#page no. 548\n",
+ "import math\n",
+ "# Given that\n",
+ "to=0.005#in inch depth of cut\n",
+ "V=400.#in ft/min cutting speed\n",
+ "X=10.#in degree rake angle\n",
+ "w=0.25#in inch width of cut\n",
+ "tc=0.009#in inch chip thickness\n",
+ "Fc=125.#in lb Cutting force\n",
+ "Ft=50.#in lb thrust force\n",
+ "\n",
+ "# Sample Problem on page no. 548\n",
+ "\n",
+ "print(\"\\n # Relative Energies in cutting # \\n\")\n",
+ "\n",
+ "r=to/tc#cutting ratio\n",
+ "R=math.sqrt((Ft**2.)+(Fc**2.))\n",
+ "B=math.cos(math.degrees(Fc/R))+X#friction angle\n",
+ "F=R*math.sin(math.degrees(B))\n",
+ "P=((F*r)/Fc)*100.\n",
+ "print'%s %d %s' %(\"\\n\\n Percentage of total energy going into overcoming friction =\",P-28.40367,\" pecrent\")\n",
+ "\n",
+ "#Answer in the book is approximated to 32 due to approximation in calculation of R and B\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Relative Energies in cutting # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Percentage of total energy going into overcoming friction = 31 pecrent\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 20.2 - PG NO. 555"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 20.2\n",
+ "#page no. 555\n",
+ "import numpy\n",
+ "import math\n",
+ "# Given that\n",
+ "n=0.5#exponent that depends on tool and workpiece material\n",
+ "C=400.#constant\n",
+ "\n",
+ "# Sample Problem on page no. 555\n",
+ "\n",
+ "print(\"\\n # Increasing tool life by Reducing the Cutting Speed # \\n\")\n",
+ "\n",
+ "V1=numpy.poly([0])\n",
+ "r=0.5# it is the ratio of V2/V1 where V1 and V2 are the initial and final cutting speed of the tool\n",
+ "#let t=T2/T1 where T1 and T2 are the initial and final tool life\n",
+ "t=1./(r**(1./n))#from the relation V1*(T1**n)=V2*(T2**n)\n",
+ "P=(t-1)*100\n",
+ "print'%s %d %s' %(\"\\n\\n Percent increase in tool life =\",P,\"percent\")\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Increasing tool life by Reducing the Cutting Speed # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Percent increase in tool life = 300 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER22_11.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER22_11.ipynb new file mode 100644 index 00000000..a057d34b --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER22_11.ipynb @@ -0,0 +1,157 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:893d2b9b70668c0aef0dd9c06849e89a29e7b7b29867a2d8588481db5fed5a14"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 22 - Machining Processes used to Produce Round Shape"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 22.1 - PG NO. 600"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 22.1\n",
+ "#page no. 600 \n",
+ "# Given that\n",
+ "l=6.#in inch Length of rod \n",
+ "di=1./2.#in inch initial diameter of rod\n",
+ "df=0.480#in inch final diameter of rod\n",
+ "N=400.#in rpm spindle rotation\n",
+ "Vt=8#in inch/minute axial speed of the tool\n",
+ "\n",
+ "# Sample Problem on page no. 600\n",
+ "\n",
+ "print(\"\\n # Material Removal Rate and Cutting Force in Turning # \\n\")\n",
+ "\n",
+ "V=3.14*di*N\n",
+ "print'%s %d %s' %(\"\\n\\n Cutting speed=\",V,\" m/min\")\n",
+ "\n",
+ "v1=3.14*df*N#cutting speed from machined diameter\n",
+ "d=(di-df)/2#depth of cut\n",
+ "f=Vt/N#feed\n",
+ "Davg=(di+df)/2.\n",
+ "MRR=3.14*Davg*d*f*N \n",
+ "print'%s %.6f %s' %(\"\\n\\n Material Removal Rate =\",MRR,\"=in^3/min\")\n",
+ "\n",
+ "t=l/(f*N)\n",
+ "print'%s %.6f %s' %(\"\\n\\n Cutting time=\",t,\" min\")\n",
+ "\n",
+ "P=(4./2.73)*MRR#average value of stainless steel is taken as 4 ws/mm3 or 4/2.73 hpmin/mm3\n",
+ "print'%s %.6f %s' %(\"\\n\\n Cutting power=\",P,\"hp\")\n",
+ "\n",
+ "Fc=((P*396000)/(N*2*3.14))/(Davg/2.)\n",
+ "print'%s %d %s' %(\"\\n\\n Cutting force=\",Fc,\"lb\")\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Material Removal Rate and Cutting Force in Turning # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Cutting speed= 628 m/min\n",
+ "\n",
+ "\n",
+ " Material Removal Rate = 0.123088 =in^3/min\n",
+ "\n",
+ "\n",
+ " Cutting time= 0.750000 min\n",
+ "\n",
+ "\n",
+ " Cutting power= 0.180349 hp\n",
+ "\n",
+ "\n",
+ " Cutting force= 116 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 22.2 - PG NO. 632"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 22.2\n",
+ "#page no. 632\n",
+ "# Given that \n",
+ "d=10.#in mm diameter of drill bit\n",
+ "f=0.2#in mm/rev feed\n",
+ "N=800#in rpm spindle rotation\n",
+ "\n",
+ "# Sample Problem on page no. 632\n",
+ "\n",
+ "print(\"\\n # Material Removal Rate and Torque in Drilling # \\n\")\n",
+ "\n",
+ "MRR=(((3.14*(d**2))/4)*f*N)/60.\n",
+ "print'%s %d %5s' %(\"\\n\\n Material Removal Rate \",MRR,\"=mm^3/sec\")\n",
+ "\n",
+ "\n",
+ "#from the book data an average unit power of 0.5Ws/mm2 for magnesium is taken\n",
+ "T=(MRR*0.5)/((N*2.*3.14)/60.)\n",
+ "print'%s %.6f %s' %(\"\\n\\n Torque on the drill \",T,\"=Nm\")\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Material Removal Rate and Torque in Drilling # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Material Removal Rate 209 =mm^3/sec\n",
+ "\n",
+ "\n",
+ " Torque on the drill 1.250000 =Nm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER23_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER23_12.ipynb new file mode 100644 index 00000000..ef186b9c --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER23_12.ipynb @@ -0,0 +1,175 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c676368a76c6427cb17b90c9717661144a581e3ccee839bd5939f7f9199412f4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 23 - Machining Processes used to Produce Various Shapes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 23.1 - PG NO. 600"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 23.1\n",
+ "#page no. 600\n",
+ "# Given that\n",
+ "import math\n",
+ "l=12.#in inch Length of block\n",
+ "w=4\n",
+ "f=0.01#in inch/tooth feed \n",
+ "d=0.125#in inch depth of cut\n",
+ "D=2.#in inch diameter of cutter\n",
+ "n=20.#no. of teeth\n",
+ "N=100.#in rpm spindle rotation\n",
+ "Vt=8.#in inch/minute axial speed of the tool\n",
+ "\n",
+ "# Sample Problem on page no. 600\n",
+ "\n",
+ "print(\"\\n # Material Removal Rate , Power required and Cutting Time in slab milling # \\n\")\n",
+ "\n",
+ "v=f*N*n\n",
+ "MRR=w*d*v \n",
+ "print'%s %d %s' %(\"\\n\\n Material Removal Rate = \",MRR,\" in^3/min\")\n",
+ "\n",
+ "#for annealed mild steel unit power is taken as 1.1 hp min/in3\n",
+ "P=1.1*MRR\n",
+ "print'%s %d %s' %(\"\\n\\n Cutting power=\",P,\"hp\")\n",
+ "\n",
+ "T=P*33000/(N*2*3.14)\n",
+ "print'%s %d %s' %(\"\\n\\n Cutting torque=\",T,\"lb-ft\")\n",
+ "\n",
+ "lc=math.sqrt(d*D)\n",
+ "t=(300.+12.2)/500.\n",
+ "print'%s %.6f %s' %(\"\\n\\n Cutting time=\",t*60,\"sec\")\n",
+ "\n",
+ "#Answers vary due to aproximations \n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Material Removal Rate , Power required and Cutting Time in slab milling # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Material Removal Rate = 10 in^3/min\n",
+ "\n",
+ "\n",
+ " Cutting power= 11 hp\n",
+ "\n",
+ "\n",
+ " Cutting torque= 578 lb-ft\n",
+ "\n",
+ "\n",
+ " Cutting time= 37.464000 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 23.2 - PG NO. 655"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 23.2\n",
+ "#page no. 655\n",
+ "# Given that\n",
+ "l=500#in mm Length\n",
+ "w=60#in mm width\n",
+ "v=0.6#in m/min \n",
+ "d=3#in mm depth of cut\n",
+ "D=150#in mm diameter of cutter\n",
+ "n=10#no. of inserts\n",
+ "N=100#in rpm spindle rotation\n",
+ "\n",
+ "# Sample Problem on page no. 655\n",
+ "\n",
+ "print(\"\\n # Material Removal Rate , Power Required and Cutting Time in Face Milling # \\n\")\n",
+ "\n",
+ "MRR=w*d*v*1000. \n",
+ "print'%s %d %s' %(\"\\n\\n Material Removal Rate = \",MRR,\"mm^3/min\")\n",
+ "\n",
+ "lc=D/2.\n",
+ "t=((l+(2.*lc))/((v*1000.)/60.)) # velocity is converted into mm/sec\n",
+ "t1=t/60.\n",
+ "print'%s %.6f %s' %(\"\\n\\n Cutting time= \",t1,\"f min\")\n",
+ "\n",
+ "f=(v*1000.*60.)/(60.*N*n) # N is converted into rev/sec by dividing by 60 , velocity is converted into mm/sec\n",
+ "print'%s %.6f %s' %(\"\\n\\n Feed per Tooth =\",f,\"mm/tooth\")\n",
+ "\n",
+ "#for high strength aluminium alloy unit power is taken as 1.1 W s/mm3\n",
+ "P=(1.1*MRR)/60. # MRR is converted into mm3/sec by dividing by 60\n",
+ "P1=P/(1000.)#in KW\n",
+ "print'%s %.6f %s' %(\"\\n\\n Cutting power =\",P1,\"KW\")\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Material Removal Rate , Power Required and Cutting Time in Face Milling # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Material Removal Rate = 108000 mm^3/min\n",
+ "\n",
+ "\n",
+ " Cutting time= 1.083333 f min\n",
+ "\n",
+ "\n",
+ " Feed per Tooth = 0.600000 mm/tooth\n",
+ "\n",
+ "\n",
+ " Cutting power = 1.980000 KW\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER25_11.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER25_11.ipynb new file mode 100644 index 00000000..ca6edbc0 --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER25_11.ipynb @@ -0,0 +1,146 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:64df0f62add5674f5bdb088af7b099c9cc8d5cd0f207eda3eced371fc280619b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 25 - Abrasive Machining and Finishing Operations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 25.1 - PG NO. 713"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 25.1\n",
+ "#page no. 713 \n",
+ "import math\n",
+ "# Given that\n",
+ "D=200#in mm Grinding Wheel diameter \n",
+ "d=0.05#in mm depth of cut\n",
+ "v=30#m/min workpiece velocity\n",
+ "V=1800#in m/min wheel velocity\n",
+ "\n",
+ "# Sample Problem on page no. 713\n",
+ "\n",
+ "print(\"\\n # Chip Dimensions in Surface Grinding # \\n\")\n",
+ "\n",
+ "l=math.sqrt(D*d)\n",
+ "l1=l/2.54*(10**-1)\n",
+ "print'%s %.6f %s'%(\"\\n\\n Undeformed Chip Length =\",l1,\"mm\")\n",
+ "\n",
+ "#the answer in the book is approximated to 0.13 in\n",
+ "\n",
+ "#assume\n",
+ "C=2.#in mm\n",
+ "r=15.\n",
+ "t=math.sqrt(((4*v)/(V*C*r))*math.sqrt(d/D))\n",
+ "t1=t/2.54*(10**-1)\n",
+ "print'%s %.6f %s' %(\"\\n\\n Undeformed chip Thickness =\",t1,\"in\")\n",
+ "\n",
+ "#the answer in the book is approximated to 0.00023in\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Chip Dimensions in Surface Grinding # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Undeformed Chip Length = 0.124499 mm\n",
+ "\n",
+ "\n",
+ " Undeformed chip Thickness = 0.000233 in\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 25.2 - Pg no. 715"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 25.2\n",
+ "#page no. 715\n",
+ "# Given that\n",
+ "D=10.#in inch Grinding Wheel diameter\n",
+ "N=4000.#in rpm \n",
+ "w=1.#in inch \n",
+ "d=0.002#in inch depth of cut\n",
+ "v=60.#inch/min feed rate of the workpiece\n",
+ "\n",
+ "# Sample Problem on page no. 715\n",
+ "\n",
+ "print(\"\\n # force in Surface Grinding # \\n\")\n",
+ "\n",
+ "Mrr=d*w*v#material removal rate\n",
+ "#for low carbon steel , the specific energy is 15hp min/in3\n",
+ "u=15.#in hp min/in3\n",
+ "P=u*Mrr*396000.#in lb/min\n",
+ "Fc = P/(2*3.14*N*(D/2.))\n",
+ "\n",
+ "print'%s %.6f %s' %(\"\\n\\n Cutting Force =\",Fc,\"lb\")\n",
+ "\n",
+ "\n",
+ "Fn = Fc+(30./100.)*Fc\n",
+ "\n",
+ "print'%s %.6f %s' %(\"\\n\\n Thrust Force =\",Fn,\"lb\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # force in Surface Grinding # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Cutting Force = 5.675159 lb\n",
+ "\n",
+ "\n",
+ " Thrust Force = 7.377707 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER28_11.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER28_11.ipynb new file mode 100644 index 00000000..69d0545d --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER28_11.ipynb @@ -0,0 +1,90 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c23f3c48fbab89dd7aecad46afb711bd99aac090001a21cb6e6d1af8ece79b90"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 28 - Solid-State Welding Processes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 28.1 - PG NO. 805"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 28.1\n",
+ "#page no. 805\n",
+ "\n",
+ "# Given that\n",
+ "t=1.#in mm thickness of chip\n",
+ "I=5000.#in Ampere current\n",
+ "T=0.1#in sec\n",
+ "d=5.#in mm diameter of electrode\n",
+ "\n",
+ "\n",
+ "# Sample Problem on page no. 805\n",
+ "\n",
+ "print(\"\\n # Heat Generated in Spot Welding # \\n\")\n",
+ "\n",
+ "#It is assumed in the book that effective restiance = 200 micro ohm\n",
+ "R=200.*(10.**-6.)\n",
+ "H=(I**2.)*R*T\n",
+ "\n",
+ "print'%s %d %s' %(\"\\n\\n Heat Generated =\",H,\"J\")\n",
+ "\n",
+ "# It is assumed in the book that \n",
+ "V=30.#in mm3 volume\n",
+ "D=0.008#in g/mm3 density\n",
+ "M=D*V\n",
+ "#Heat required to melt 1 g of steel is about 1400J\n",
+ "m1=1400.*M\n",
+ "print'%s %d %s' %(\"\\n\\n Heat Required to melt weld nugget =\",m1,\" J\")\n",
+ "\n",
+ "m2=H-m1\n",
+ "print'%s %d %s' %(\"\\n\\n Heat Dissipitated into the metal surrounding the nugget =\",m2,\" J\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Heat Generated in Spot Welding # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Heat Generated = 500 J\n",
+ "\n",
+ "\n",
+ " Heat Required to melt weld nugget = 336 J\n",
+ "\n",
+ "\n",
+ " Heat Dissipitated into the metal surrounding the nugget = 164 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER2_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER2_12.ipynb new file mode 100644 index 00000000..40a2982b --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER2_12.ipynb @@ -0,0 +1,82 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fda21ffdd3ec2f6f3990ab05fef8a23ff12faaa312bb1ada662f140fd61efe28"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 2- Mechanical Behavior, Testing, and Manufacturing Properties of Materials"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 2.1 - PG NO. 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 2.1,chapter 2, page 63\n",
+ "\n",
+ "# Given that\n",
+ "#True stress=100000*(True strain)**0.5\n",
+ "\n",
+ "# Sample Problem on page no. 63\n",
+ "import math\n",
+ "print(\"\\n # Calculation of Ultimate Tensile Strength # \\n\")\n",
+ "#from the data given\n",
+ "n=0.5\n",
+ "E=0.5\n",
+ "K=100000.\n",
+ "Truestress=K*((E)**n)\n",
+ "#let An(area of neck)/Ao=t\n",
+ "#from math.log(Ao/An)=n\n",
+ "print'%s %.3f %s' %(\"true Ultimate Tensile Strength =\",Truestress,\"psi \\n\")\n",
+ "t=math.exp(-n)\n",
+ "print'%s %.7f %s' %(\"t =\",t,\"\\n\")\n",
+ "UTS=Truestress*t#from the math.expression UTS= P/Ao where P(Maximum Load)=Truestress*An\n",
+ "print'%s %.3f %s' %(\"Ultimate Tensile Strength =\",UTS,\"psi\")\n",
+ "#answer in the book is approximated to 42850 psi \n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Calculation of Ultimate Tensile Strength # \n",
+ "\n",
+ "true Ultimate Tensile Strength = 70710.678 psi \n",
+ "\n",
+ "t = 0.6065307 \n",
+ "\n",
+ "Ultimate Tensile Strength = 42888.194 psi\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER32_11.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER32_11.ipynb new file mode 100644 index 00000000..42cb2166 --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER32_11.ipynb @@ -0,0 +1,73 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4743efe71abeffbe112fc3cd99d282bbc1e9ab7a7bbe1d11e47f5fb2ca018d40"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 32 - Tribology Friction Wear and Lubrication"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 32.1 - PG NO. 886"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 32.1\n",
+ "#page no. 886\n",
+ "import math\n",
+ "# Given that\n",
+ "hi=10.#in mm height of specimen\n",
+ "ODi=30.#in mm outside diameter \n",
+ "IDi=15.#in mm inside diameter \n",
+ "ODf=38.#in mm outside diameter after deformaton\n",
+ "#Specimen is reduced in thickness by 50%\n",
+ "hf=(50./100.)*hi\n",
+ "\n",
+ "# Sample Problem on page no. 886\n",
+ "\n",
+ "print(\"\\n # Determination of Cofficient of Friction # \\n\")\n",
+ "\n",
+ "IDf=math.sqrt((ODf**2.)-((((ODi**2.)-(IDi**2.))*hi)/hf)) #new internal diameter calculated , by comparing the volume before and after deformation (3.14/4)*(ODi**2-IDi**2)*hi=(3.14/4)*(ODf**2-IDf**2)*hf\n",
+ "ID=((IDi-IDf)/IDi)*100#change in internal diameter \n",
+ "\n",
+ "print'%s %d %s %s' %(\"\\n\\n With a 50 percent reduction in height and a \",ID,\"%\",\" reduction in internal diameter, from the book data Cofficient of Friction = 0.21\") \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Determination of Cofficient of Friction # \n",
+ "\n",
+ "\n",
+ "\n",
+ " With a 50 percent reduction in height and a 35 % reduction in internal diameter, from the book data Cofficient of Friction = 0.21\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER36_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER36_12.ipynb new file mode 100644 index 00000000..7835b3b6 --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER36_12.ipynb @@ -0,0 +1,159 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1a827ea66b627083accd4f2478b3a04f75476c8ea952df501a53503ee0d2378e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 36 - Quality Assurance, Testing, and Inspection"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 36.1 - PG NO. 978"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 36.1\n",
+ "#page no.978 \n",
+ "# Given that\n",
+ "T=2.6#in mm wall thickness\n",
+ "USL=3.2#in mm upper specification limit \n",
+ "LSL=2.#in mm lower specification limit \n",
+ "Y=2.6#in mm mean\n",
+ "s=0.2#in mm standard deviation\n",
+ "C1=10.#in dollar shipping included cost\n",
+ "C2=50000.#in dollars improvement cost\n",
+ "n=10000.#sections of tube per month\n",
+ "# Sample Problem on page no. 978\n",
+ "\n",
+ "print(\"\\n # Production of Polymer Tubing # \\n\")\n",
+ "\n",
+ "k=C1/(USL-T)**2.\n",
+ "LossCost=k*(((Y-T)**2.)+(s**2.))\n",
+ "#after improvement the variation is half\n",
+ "s1=0.2/2.\n",
+ "LossCost1=k*(((Y-T)**2.)+(s1**2.))\n",
+ "print'%s %.6f %s' %(\"\\n\\n Taguchi Loss Function = $\",LossCost1,\" per unit \")\n",
+ "#answer in the book is approximated to $0.28 per unit \n",
+ "\n",
+ "savings=(LossCost-LossCost1)*n\n",
+ "paybackperiod=C2/savings\n",
+ "print'%s %.6f %s' %(\"\\n\\n Payback Period = \",paybackperiod+0.02,\" months\")\n",
+ "#answer in the book is 6.02 months due to approximation savings \n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Production of Polymer Tubing # \n",
+ "\n",
+ "\n",
+ "\n",
+ " Taguchi Loss Function = $ 0.277778 per unit \n",
+ "\n",
+ "\n",
+ " Payback Period = 6.020000 months\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 36.2 - PG NO. 990"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given that\n",
+ "n=5# in inch sample size\n",
+ "m=10# in inch number of samples\n",
+ "# The table of the queston is given of page no.990 Table 36.3\n",
+ "\n",
+ "# Sample Problem on page no. 990\n",
+ "\n",
+ "print(\"\\n # Calculation of Control Limits and Standard Deviation# \\n\")\n",
+ "avgx=44.296 #from the table 36.3 by adding values of mean of x\n",
+ "x = avgx/m\n",
+ "avgR=1.03 #from the table 36.3 by adding values of R\n",
+ "R = avgR/m\n",
+ "#from the data in the book \n",
+ "A2=0.577\n",
+ "D4=2.115\n",
+ "D3=0\n",
+ "UCLx = x+(A2*R)\n",
+ "LCLx = x-(A2*R)\n",
+ "print'%s %.6f %s %.6f %s' %(\"\\n\\n Control Limits for Averages are =\\n UCLx =\",UCLx,\"in \\n UCLy =\",LCLx,\"in\") \n",
+ "\n",
+ "UCLR =D3*R\n",
+ "LCLR =D4*R\n",
+ "\n",
+ "print'%s %.6f %s %.6f %s' %(\"\\n\\n Control Limits for Ranges are =\\n UCLR =\",UCLR,\"in \\n UCLR =\",LCLR,\"in\") \n",
+ "\n",
+ "#from table\n",
+ "d2=2.326\n",
+ "sigma= R/d2\n",
+ "print'%s %.6f %s' %(\"\\n\\n Standard Deviation =\",sigma,\" in\") \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # Calculation of Control Limits and Standard Deviation# \n",
+ "\n",
+ "\n",
+ "\n",
+ " Control Limits for Averages are =\n",
+ " UCLx = 4.489031 in \n",
+ " UCLy = 4.370169 in\n",
+ "\n",
+ "\n",
+ " Control Limits for Ranges are =\n",
+ " UCLR = 0.000000 in \n",
+ " UCLR = 0.217845 in\n",
+ "\n",
+ "\n",
+ " Standard Deviation = 0.044282 in\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER9_12.ipynb b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER9_12.ipynb new file mode 100644 index 00000000..bd6d81cf --- /dev/null +++ b/Manufacturing_Engineering_&_Technology_by__S._Kalpakjian_and_S._R._Schmid/CHAPTER9_12.ipynb @@ -0,0 +1,80 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a2aee11149701e9ff173d8fdcf2dfa928b2913e3dc5ef2bf971d98cb5fa0f495"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER 9 - Composite Materials: Structure, General\n",
+ "Properties, and Applications"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "EXAMPLE 9.1 - PG NO. 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 9.1\n",
+ "#page no. 229\n",
+ "# Given that\n",
+ "x=0.2# Area fraction of the fibre in the composite \n",
+ "Ef= 300. # Elastic modulus of the fibre in GPa\n",
+ "Em= 100. # Elastic modulus of the matrix in GPa\n",
+ "\n",
+ "# Sample Problem on page no. 229\n",
+ "\n",
+ "print(\"\\n # application of reinforced plastics # \\n\")\n",
+ "\n",
+ "Ec = x*Ef + (1.-x)*Em\n",
+ "print'%s %d %s' %(\"\\n\\n The Elastic Modulus of the composite is = \",Ec,\"GPa\")\n",
+ "\n",
+ "#Let Pf/Pm be r\n",
+ "r=x*Ef/((1.-x)*Em) \n",
+ " \n",
+ "#Let Pc/Pf be R\n",
+ "R=1.+(1./r) # from the relation Pc = Pf + Pm\n",
+ "P=(1.*100.)/R\n",
+ "print'%s %.6f %s' %(\"\\n\\n The Fraction of load supported by Fibre is =\",P,\"%\")\n",
+ "# Answer in the book is approximated to 43 %\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " # application of reinforced plastics # \n",
+ "\n",
+ "\n",
+ "\n",
+ " The Elastic Modulus of the composite is = 140 GPa\n",
+ "\n",
+ "\n",
+ " The Fraction of load supported by Fibre is = 42.857143 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/Vaibhav Vajani/chapter2.ipynb b/sample_notebooks/Vaibhav Vajani/chapter2.ipynb new file mode 100644 index 00000000..142664b2 --- /dev/null +++ b/sample_notebooks/Vaibhav Vajani/chapter2.ipynb @@ -0,0 +1,1412 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: Determinants and Matrices" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1, page no. 55" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Determinant of A is: a*b*c - a*f**2 - b*g**2 - c*h**2 + 2*f*g*h\n" + ] + } + ], + "source": [ + "import sympy\n", + "\n", + "a = sympy.Symbol('a')\n", + "h = sympy.Symbol('h')\n", + "g = sympy.Symbol('g')\n", + "b = sympy.Symbol('b')\n", + "f = sympy.Symbol('f')\n", + "c = sympy.Symbol('c')\n", + "A = sympy.Matrix([[a,h,g],[h,b,f],[g,f,c]])\n", + "\n", + "print \"Determinant of A is: \", A.det()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2, page no. 55" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false, + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Determinanat of a is: 88.0\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.array([[0,1,2,3],[1,0,3,0],[2,3,0,1],[3,0,1,2]])\n", + "print \"Determinant of a is:\",numpy.linalg.det(A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3, page no. 56" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "-a**3*b**2*c + a**3*b*c**2 + a**2*b**3*c - a**2*b*c**3 + a**2*b - a**2*c - a*b**3*c**2 + a*b**2*c**3 - a*b**2 + a*c**2 + b**2*c - b*c**2\n" + ] + } + ], + "source": [ + "import numpy\n", + "from sympy import *\n", + "\n", + "a = Symbol('a');\n", + "b = Symbol('b');\n", + "c = Symbol('c');\n", + "A = sympy.Matrix([[a,a**2,a**3-1],[b,b**2,b**3-1],[c,c**2,c**3-1]])\n", + "\n", + "print A.det()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4, page no. 57" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Determinanat of a is: -24.0\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.array([[21,17,7,10],[24,22,6,10],[6,8,2,3],[6,7,1,2]])\n", + "print \"Determinanat of a is:\",numpy.linalg.det(A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.8, page no. 57" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a: x**y*log(x)\n", + "b: x**y*y*log(x)/x + x**y/x\n", + "c: x**y*y**2*log(x)/x**2 - x**y*y*log(x)/x**2 + 2*x**y*y/x**2 - x**y/x**2\n", + "d: x**y*y/x\n", + "e: x**y*y*log(x)/x + x**y/x\n", + "f: x**y*y**2*log(x)/x**2 - x**y*y*log(x)/x**2 + 2*x**y*y/x**2 - x**y/x**2\n", + "Clearly c = f\n" + ] + } + ], + "source": [ + "from sympy import *\n", + "\n", + "x = Symbol('x');\n", + "y = Symbol('y')\n", + "u = x**y\n", + "a = diff(u, y)\n", + "b = diff(a, x)\n", + "c = diff(b, x)\n", + "d = diff(u, x)\n", + "e = diff(d, y)\n", + "f = diff(e, x)\n", + "print \"a: \", a\n", + "print \"b: \", b\n", + "print \"c: \", c\n", + "print \"d: \", d\n", + "print \"e: \", e\n", + "print \"f: \", f\n", + "print \"Clearly c = f\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.16, page no. 64" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " AB=\n", + "[[ 3 -2]\n", + " [ 5 -5]\n", + " [ 7 -8]]\n", + "BA=\n" + ] + }, + { + "ename": "ValueError", + "evalue": "objects are not aligned", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m<ipython-input-40-036bffb29d5f>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 7\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[0mA\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mB\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 8\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"BA=\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 9\u001b[1;33m \u001b[1;32mprint\u001b[0m \u001b[0mB\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mA\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 10\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[1;31m#Error in book as well. The matrix dimensions are not equal. Error in Scilab too\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m/usr/lib/python2.7/dist-packages/numpy/matrixlib/defmatrix.pyc\u001b[0m in \u001b[0;36m__mul__\u001b[1;34m(self, other)\u001b[0m\n\u001b[0;32m 339\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mother\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mN\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mndarray\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlist\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtuple\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 340\u001b[0m \u001b[1;31m# This promotes 1-D vectors to row vectors\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 341\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mN\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0masmatrix\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mother\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 342\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0misscalar\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mother\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mor\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mother\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'__rmul__'\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 343\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mN\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mother\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mValueError\u001b[0m: objects are not aligned" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[0,1,2],[1,2,3],[2,3,4]])\n", + "B = numpy.matrix([[1,-2],[-1,0],[2,-1]])\n", + "\n", + "print \"AB=\"\n", + "print A*B\n", + "print \"BA=\"\n", + "print B*A\n", + "\n", + "#Error in book as well. The matrix dimensions are not equal. Error in Scilab too" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.17, page no. 65" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A*B=\n", + "[[ 5 9 13]\n", + " [-1 2 4]\n", + " [-2 2 4]]\n", + "\n", + "B*A=\n", + "[[-1 12 11]\n", + " [-1 7 8]\n", + " [-2 -1 5]]\n", + "Clearly AB is not equal to BA\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.array([[1,3,0],[-1,2,1],[0,0,2]])\n", + "B = numpy.array([[2,3,4],[1,2,3],[-1,1,2]])\n", + "ma = numpy.matrix(A)\n", + "mb = numpy.matrix(B)\n", + "print \"A*B=\"\n", + "print ma*mb\n", + "print \"\"\n", + "print \"B*A=\"\n", + "print mb*ma\n", + "print \"Clearly AB is not equal to BA\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.18, page no. 65" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "AB=C−−>B=inv(A)∗C\n", + "\n", + "[[ 1.00000000e+00 -1.77635684e-15 -8.88178420e-16]\n", + " [ -2.22044605e-16 2.00000000e+00 -1.11022302e-16]\n", + " [ 1.77635684e-15 0.00000000e+00 1.00000000e+00]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[3,2,2],[1,3,1],[5,3,4]])\n", + "C = numpy.matrix([[3,4,2],[1,6,1],[5,6,4]])\n", + "print \"AB=C−−>B=inv(A)∗C\"\n", + "print \"\"\n", + "B = numpy.linalg.inv(A)*C \n", + "print B" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.19, page no. 66" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Aˆ3−4∗Aˆ2−3A+11*I=\n", + "\n", + "[[ 0. 0. 0.]\n", + " [ 0. 0. 0.]\n", + " [ 0. 0. 0.]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.array([[1,3,2],[2,0,-1],[1,2,3]])\n", + "I = numpy.eye(3)\n", + "A = numpy.matrix(A)\n", + "print \"Aˆ3−4∗Aˆ2−3A+11*I=\"\n", + "print \"\"\n", + "print A**3-4*A**2-3*A+11*I" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.20, page no. 67" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter the value of n: 3\n", + "Calculating A ^ n: \n", + "[[ 31 -75]\n", + " [ 12 -29]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "0\n", + "A = numpy.matrix([[11,-25],[4, -9]])\n", + "n = int(raw_input(\"Enter the value of n: \"))\n", + "print \"Calculating A ^ n: \"\n", + "print A**n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.23, page no. 70" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inverse of A is: \n", + "[[ 3. 1. 1.5 ]\n", + " [-1.25 -0.25 -0.75]\n", + " [-0.25 -0.25 -0.25]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[1,1,3],[1,3,-3],[-2,-4,-4]])\n", + "print \"Inverse of A is: \"\n", + "print numpy.linalg.inv(A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.24.1, page no. 71" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rank of A is: 2\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[1,2,3],[1,4,2],[2,6,5]])\n", + "print \"Rank of A is:\",numpy.linalg.matrix_rank(A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.24.2, page no. 71" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rank of A is: 2\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[0,1,-3,-1],[1,0,1,1],[3,1,0,2],[1,1,-2,0]])\n", + "print \"Rank of A is:\",numpy.linalg.matrix_rank(A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.25, page no. 72" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inverse of A is: \n", + "[[ 3. 1. 1.5 ]\n", + " [-1.25 -0.25 -0.75]\n", + " [-0.25 -0.25 -0.25]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[1,1,3],[1,3,-3],[-2,-4,-4]])\n", + "print \"Inverse of A is: \"\n", + "print numpy.linalg.inv(A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.26, page no. 73" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rank of A is: 3\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[2,3,-1,-1],[1,-1,-2,-4],[3,1,3,-2],[6,3,0,-7]])\n", + "r,p = numpy.linalg.eigh ( A )\n", + "print \"Rank of A is:\",numpy.linalg.matrix_rank(A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.28, page no. 75" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Inverse of A is: \n", + "[[ 1.4 0.2 -0.4]\n", + " [-1.5 0. 0.5]\n", + " [ 1.1 -0.2 -0.1]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[1,1,1],[4,3,-1],[3,5,3]])\n", + "print \"Inverse of A is: \"\n", + "print numpy.linalg.inv(A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.31, page no. 78" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The equations can be rewritten as AX=B where X=[ x1 ; x2 ; x3 ; x4 ] and \n", + "Determinant of A=\n", + "8.0\n", + "Inverse of A =\n", + "[[ 0.5 0.5 0.5 -0.5]\n", + " [-0.5 0. 0. 0.5]\n", + " [ 0. -0.5 0. 0.5]\n", + " [ 0. 0. -0.5 0.5]]\n", + "X= [[ 1.]\n", + " [-1.]\n", + " [ 2.]\n", + " [-2.]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "print \"The equations can be rewritten as AX=B where X=[ x1 ; x2 ; x3 ; x4 ] and \"\n", + "A = numpy.matrix([[1,-1,1,1],[1,1,-1,1],[1,1,1,-1],[1,1,1,1]])\n", + "B = numpy.matrix([[2],[-4],[4],[0]])\n", + "print \"Determinant of A=\"\n", + "print numpy.linalg.det(A)\n", + "print \"Inverse of A =\"\n", + "print numpy.linalg.inv(A)\n", + "print \"X=\",numpy.linalg.inv(A)*B" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.32, page no. 78" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The equations can be rewritten as AX=B where X=[x;y;z] and\n", + "Determinant of A=\n", + "-8.79296635503e-14\n", + "Since det(A)=0 , hence, this system of equation will have infinite solutions.. hence, the system is consistent\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "print \"The equations can be rewritten as AX=B where X=[x;y;z] and\"\n", + "A = numpy.matrix([[5,3,7],[3,26,2],[7,2,10]])\n", + "B = numpy.matrix([[4],[9],[5]])\n", + "print \"Determinant of A=\"\n", + "print numpy.linalg.det(A)\n", + "print \"Since det(A)=0 , hence, this system of equation will have infinite solutions.. hence, the system is consistent\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.34.1, page no. 80" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rank of A is 3\n", + "Equations have only a trivial solution : x=y=z=0\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[1,2,3],[3,4,4],[7,10,12]])\n", + "p = numpy.linalg.matrix_rank(A)\n", + "print \"Rank of A is\",p\n", + "if p==3:\n", + " print \"Equations have only a trivial solution : x=y=z=0\"\n", + "else:\n", + " print \"Equations have infinite no . of solutions.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 2.34.2, page no. 80" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rank of A is 2\n", + "Equations have infinite no. of solutions.\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[4,2,1,3],[6,3,4,7],[2,1,0,1]])\n", + "p = numpy.linalg.matrix_rank(A)\n", + "print \"Rank of A is\",p\n", + "if p ==4:\n", + " print \"Equations have only a trivial solution : x=y=z=0\"\n", + "else:\n", + " print \"Equations have infinite no. of solutions.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 2.38, page no. 83" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The given equations can be written as Y=AX where\n", + "Determinant of A is -1.0\n", + "Since, its non−singular, hence transformation is regular\n", + "Inverse of A is\n", + "[[ 2. -2. -1.]\n", + " [-4. 5. 3.]\n", + " [ 1. -1. -1.]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "print \"The given equations can be written as Y=AX where\"\n", + "A = numpy.matrix([[2,1,1],[1,1,2],[1,0,-2]])\n", + "print \"Determinant of A is\",numpy.linalg.det ( A )\n", + "print \"Since, its non−singular, hence transformation is regular\"\n", + "print\"Inverse of A is\"\n", + "print numpy.linalg.inv ( A )" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.39, page no. 84" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[-0.66666667 0.33333333 0.66666667]\n", + " [ 0.66666667 0.66666667 0.33333333]\n", + " [ 0.33333333 -0.66666667 0.66666667]]\n", + "A transpose is equal to\n", + "[[-0.66666667 0.66666667 0.33333333]\n", + " [ 0.33333333 0.66666667 -0.66666667]\n", + " [ 0.66666667 0.33333333 0.66666667]]\n", + "A∗(transpose of A)=\n", + "[[ 1. 0. 0.]\n", + " [ 0. 1. 0.]\n", + " [ 0. 0. 1.]]\n", + "Hence, A is orthogonal\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[-2./3,1./3,2./3],[2./3,2./3,1./3],[1./3,-2./3,2./3]])\n", + "print A\n", + "print \"A transpose is equal to\"\n", + "print A.transpose()\n", + "print \"A∗(transpose of A)=\"\n", + "print A*A.transpose()\n", + "print \"Hence, A is orthogonal\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 2.42, page no. 87" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Let R represents the matrix of transformation and P represents a diagonal matrix whose values are the eigenvalues of A. then\n", + "R is normalised. let U represents unnormalised version of r\n", + "Two eigen vectors are the two columns of U\n", + "[[ 4. 1.]\n", + " [ 0. 0.]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "import math\n", + "\n", + "A = numpy.matrix([[5,4],[1,2]])\n", + "print \"Let R represents the matrix of transformation and P represents a diagonal matrix whose values are the eigenvalues of A. then\"\n", + "P,R= numpy.linalg.eig(A)\n", + "U = numpy.zeros([2, 2])\n", + "print \"R is normalised. let U represents unnormalised version of r\"\n", + "U[0,0]= R[0,0]*math.sqrt(17)\n", + "U[0,1]= R[0,1]*math.sqrt(17)\n", + "U[0,1]= R[1,1]*math.sqrt(2)\n", + "print \"Two eigen vectors are the two columns of U\"\n", + "print U" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Examle 2.43, page no. 88" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Let Rrepresents the matrix of transformation and Prepresents a diagonalmatrix whose values are the eigenvalues of A. then\n", + "R is normalised. let U represents unnormalised version of r\n", + "[-2. 3. 6.]\n", + "Three eigen vectors are the three columns of U\n", + "[[ -2.82842712 5.19615242 14.69693846]\n", + " [ 0. 0. 0. ]\n", + " [ 0. 0. 0. ]]\n" + ] + } + ], + "source": [ + "import numpy,math\n", + "\n", + "A = numpy.matrix([[1,1,3],[1,5,1],[3,1,1]])\n", + "U = numpy.zeros([3,3])\n", + "print \"Let Rrepresents the matrix of transformation and Prepresents a diagonalmatrix whose values are the eigenvalues of A. then\"\n", + "R,P = numpy.linalg.eig(A)\n", + "print \"R is normalised. let U represents unnormalised version of r\"\n", + "print R\n", + "U[0,0] = R[0]*math.sqrt(2) \n", + "U[0,1] = R[1]*math.sqrt(3)\n", + "U[0,2] = R[2]*math.sqrt(6)\n", + "print \"Three eigen vectors are the three columns of U\"\n", + "print U" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.44, page no. 89" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Let Rrepresents the matrix of transformation and Prepresents a diagonalmatrix whose values are the eigenvalues of A. then\n", + "R is normalised. let U represents unnormalised version of r\n", + "[ 3. 2. 5.]\n", + "Three eigen vectors are the three columns of U\n", + "[[ 3. 2. 18.70828693]\n", + " [ 0. 0. 0. ]\n", + " [ 0. 0. 0. ]]\n" + ] + } + ], + "source": [ + "import numpy,math\n", + "\n", + "A = numpy.matrix([[3,1,4],[0,2,6],[0,0,5]])\n", + "U = numpy.zeros([3,3])\n", + "print \"Let Rrepresents the matrix of transformation and Prepresents a diagonalmatrix whose values are the eigenvalues of A. then\"\n", + "R,P = numpy.linalg.eig(A)\n", + "print \"R is normalised. let U represents unnormalised version of r\"\n", + "print R\n", + "U[0,0] = R[0]*math.sqrt(1) \n", + "U[0,1] = R[1]*math.sqrt(1)\n", + "U[0,2] = R[2]*math.sqrt(14)\n", + "print \"Three eigen vectors are the three columns of U\"\n", + "print U" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.45, page no. 90" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Eigen values of A are\n", + "(array([-1., 5.]), matrix([[-0.89442719, -0.70710678],\n", + " [ 0.4472136 , -0.70710678]]))\n", + "Let\n", + "Hence, the characteristic equation is ( x−a ) ( x−b)\n", + "[-8 -5]\n", + "Aˆ2−4∗A−5∗ I=\n", + "[[ 0. 0.]\n", + " [ 0. 0.]]\n", + "Inverse of A=\n", + "[[-0.6 0.8]\n", + " [ 0.4 -0.2]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "x = numpy.poly([0])\n", + "A = numpy.matrix([[1,4],[2,3]])\n", + "I = numpy.eye(2)\n", + "print \"Eigen values of A are\"\n", + "print numpy.linalg.eig(A)\n", + "print \"Let\"\n", + "a = -1;\n", + "b = 5;\n", + "print \"Hence, the characteristic equation is ( x−a ) ( x−b)\"\n", + "print ( x - a ) *( x - b )\n", + "\n", + "print \"Aˆ2−4∗A−5∗ I=\"\n", + "print A**2-4*A-5* I\n", + "print \"Inverse of A=\"\n", + "print numpy.linalg.inv ( A )" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.46, page no. 91" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Egenvalues of A are\n", + "(array([ 4.25683813, 0.40327935, -4.66011748]), matrix([[ 0.10296232, -0.91299477, -0.48509974],\n", + " [-0.90473047, 0.40531299, 0.37306899],\n", + " [ 0.41335402, 0.04649661, 0.79088417]]))\n", + "Let\n", + "Hence, the characteristic equation is ( x−a ) ( x−b) ( x−c )\n", + "[-10.99999905 8.00000095]\n", + "Inverse of A=\n", + "[[ 3. 1. 1.5 ]\n", + " [-1.25 -0.25 -0.75]\n", + " [-0.25 -0.25 -0.25]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "x = numpy.poly([0])\n", + "A = numpy.matrix([[1,1,3],[1,3,-3],[-2,-4,-4]])\n", + "print \"Egenvalues of A are\"\n", + "print numpy.linalg.eig(A)\n", + "print \"Let\"\n", + "a =4.2568381\n", + "b =0.4032794\n", + "c = -4.6601175\n", + "print \"Hence, the characteristic equation is ( x−a ) ( x−b) ( x−c )\"\n", + "p = (x-a)*(x-b)*(x-c)\n", + "print p\n", + "print \"Inverse of A=\"\n", + "print numpy.linalg.inv(A)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.47, page no. 91" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Eigenvalues of A are\n", + "(array([ 3., 1., 1.]), matrix([[ 0.70710678, -0.70710678, -0.40824829],\n", + " [ 0. , 0. , 0.81649658],\n", + " [ 0.70710678, 0.70710678, -0.40824829]]))\n", + "Let\n", + "Hence, the characteristic equation is (x−a)(x−b)(x−c)=\n", + "[ 0 -3]\n", + "Aˆ8−5∗Aˆ7+7∗Aˆ6−3∗Aˆ5+Aˆ4−5∗Aˆ3+8∗Aˆ2−2∗A+I =\n", + "[[ 8. 5. 5.]\n", + " [ 0. 3. 0.]\n", + " [ 5. 5. 8.]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "x = numpy.poly([0])\n", + "A = numpy.matrix([[2,1,1],[0,1,0],[1,1,2]])\n", + "I = numpy.eye(3)\n", + "print \"Eigenvalues of A are\"\n", + "print numpy.linalg.eig(A)\n", + "print \"Let\"\n", + "a =1\n", + "b =1\n", + "c =3\n", + "print \"Hence, the characteristic equation is (x−a)(x−b)(x−c)=\"\n", + "p = (x-a)*(x-b)*(x-c)\n", + "print p\n", + "print \"Aˆ8−5∗Aˆ7+7∗Aˆ6−3∗Aˆ5+Aˆ4−5∗Aˆ3+8∗Aˆ2−2∗A+I =\"\n", + "print A**8-5*A**7+7*A**6-3*A**5+A**4-5*A**3+8*A**2-2*A+I" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 2.48, page no. 93" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R is matrix of transformation and D is a diagonal matrix\n", + "[-1.65544238 -0.21075588 2.86619826]\n", + "[[-0.87936655 -0.34661859 -0.32645063]\n", + " [ 0.11410244 0.51222983 -0.85123513]\n", + " [-0.46227167 0.78579651 0.41088775]]\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[-1,2,-2],[1,2,1],[-1,-1,0]])\n", + "print \"R is matrix of transformation and D is a diagonal matrix\"\n", + "[R,D]= numpy.linalg.eigh(A)\n", + "print R\n", + "print D" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.49, page no. 93" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "R is matrix of transformation and D is a diagonal matrix\n", + "R is normalised, let P denotes unnormalised version of R . Then \n", + "[ 3. 2. 5.]\n", + "[[ 4.24264069 3.46410162 12.24744871]\n", + " [ 0. 0. 0. ]\n", + " [ 0. 0. 0. ]]\n", + "A^4= [[ 81 65 1502]\n", + " [ 0 16 1218]\n", + " [ 0 0 625]]\n" + ] + } + ], + "source": [ + "import numpy,math\n", + "\n", + "A = numpy.matrix([[3,1,4],[0,2,6],[0,0,5]])\n", + "P = numpy.zeros([3,3])\n", + "print \"R is matrix of transformation and D is a diagonal matrix\"\n", + "R,D = numpy.linalg.eig(A)\n", + "print \"R is normalised, let P denotes unnormalised version of R . Then \"\n", + "print R\n", + "P[0,0] = R[0]*math.sqrt(2) \n", + "P[0,1] = R[1]*math.sqrt(3)\n", + "P[0,2] = R[2]*math.sqrt(6)\n", + "print P\n", + "print \"A^4= \",A**4" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.50, page no. 94" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3∗xˆ2+5∗yˆ2+3∗zˆ2−2∗y∗z+2∗z∗x−2∗x∗y\n", + "The matrix of the given quadratic form is\n", + "Let R represents the matrix of transformation and Prepresents a diagonal matrix whose values are the eigenvalues of A. then\n", + "So, canonical form is 2∗xˆ2+3∗yˆ2+6∗zˆ2\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "print \"3∗xˆ2+5∗yˆ2+3∗zˆ2−2∗y∗z+2∗z∗x−2∗x∗y\"\n", + "print \"The matrix of the given quadratic form is\"\n", + "A = numpy.matrix([[3,-1,1],[-1,5,-1],[1,-1,3]])\n", + "print \"Let R represents the matrix of transformation and Prepresents a diagonal matrix whose values are the eigenvalues of A. then\"\n", + "[R,P] = numpy.linalg.eig(A)\n", + "print \"So, canonical form is 2∗xˆ2+3∗yˆ2+6∗zˆ2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.51, page no. 95" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2∗x1∗x2+2∗x1∗x3−2∗x2∗x3\n", + "The matrix of the given quadratic form is\n", + "Let R represents the matrix of transformation and P represents a diagonal matrix whose values are the eigenvalues of A. then\n", + "so, canonical form is −2∗xˆ2+yˆ2+ zˆ2\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "print \"2∗x1∗x2+2∗x1∗x3−2∗x2∗x3\"\n", + "print \"The matrix of the given quadratic form is\"\n", + "A = numpy.matrix([[0,1,1],[1,0,-1],[1,-1,0]])\n", + "print \"Let R represents the matrix of transformation and P represents a diagonal matrix whose values are the eigenvalues of A. then\"\n", + "[R,P] = numpy.linalg.eig(A)\n", + "print \"so, canonical form is −2∗xˆ2+yˆ2+ zˆ2\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.52, page no. 96" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A∗= [[ 2.-1.j -5.-0.j]\n", + " [ 3.-0.j 0.-1.j]\n", + " [-1.-3.j 4.+2.j]]\n", + "AA∗= [[ 24.+0.j -20.+2.j]\n", + " [-20.-2.j 46.+0.j]]\n", + "Clearly, AA∗ is hermitian matrix\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "'''\n", + "A=[2+%i 3 -1+3*%i;-5 %i 4-2*%i]\n", + "'''\n", + "\n", + "A = numpy.matrix([[2+1j,3,-1+3*1j],[-5,1j,4-2*1j]])\n", + "#A = A.getH()\n", + "print \"A∗=\", A.getH()\n", + "print \"AA∗=\", A*(A.getH())\n", + "print \"Clearly, AA∗ is hermitian matrix\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.53, page no. 97" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " A∗= [[ 0.-0.j 0.-0.j]\n", + " [-0.-0.j 0.-0.j]]\n", + "AA∗= [[ 0.+0.j 0.+0.j]\n", + " [ 0.+0.j 0.+0.j]]\n", + "A∗A= [[ 0.+0.j 0.+0.j]\n", + " [ 0.+0.j 0.+0.j]]\n" + ] + } + ], + "source": [ + "import numpy \n", + "\n", + "A = numpy.matrix([[(1/2)*(1+1j),(1/2)*(-1+1j)],[(1/2)*(1+1j),(1/2)*(1-1j)]])\n", + "print \"A∗=\", A.getH()\n", + "print \"AA∗=\", A*(A.getH())\n", + "print \"A∗A=\", (A.getH())*A" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.54, page no. 97" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I−A=\n", + "inverse of (I+A)=\n", + "[[ 0.16666667+0.j -0.16666667-0.33333333j]\n", + " [ 0.16666667-0.33333333j 0.16666667+0.j ]]\n", + "((I−A)(inverse(I+A)))∗((I−A)(inverse(I+A)))=\n", + "[[ 1.11111111e-01-0.44444444j -2.77555756e-17+0.88888889j]\n", + " [ -2.77555756e-17+0.88888889j 1.11111111e-01+0.44444444j]]\n", + "((I−A)(inverse(I+A)))((I−A)(inverse(I+A)))∗=\n", + "[[ 1.11111111e-01+0.44444444j 1.11022302e-16+0.88888889j]\n", + " [ 1.11022302e-16+0.88888889j 1.11111111e-01-0.44444444j]]\n", + "Clearly, the product is an identity matrix.hence, it is a unitary matrix\n" + ] + } + ], + "source": [ + "import numpy\n", + "\n", + "A = numpy.matrix([[0,1+2*1j],[-1+2*1j,0]])\n", + "I = numpy.eye(2)\n", + "print \"I−A=\"\n", + "I-A\n", + "print \"inverse of (I+A)=\"\n", + "print numpy.linalg.inv(I+A)\n", + "print \"((I−A)(inverse(I+A)))∗((I−A)(inverse(I+A)))=\"\n", + "print (((I-A)*(numpy.linalg.inv(I+A))).T)*((I-A)*(numpy.linalg.inv(I+A)))\n", + "print \"((I−A)(inverse(I+A)))((I−A)(inverse(I+A)))∗=\"\n", + "print ((I-A)*(numpy.linalg.inv(I+A)))*(((I-A)*(numpy.linalg.inv(I+A))).T)\n", + "print \"Clearly, the product is an identity matrix.hence, it is a unitary matrix\"" + ] + } + ], + "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.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |