summaryrefslogtreecommitdiff
path: root/Engineering_Physics_Marikani/Chapter_3.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Engineering_Physics_Marikani/Chapter_3.ipynb')
-rw-r--r--Engineering_Physics_Marikani/Chapter_3.ipynb219
1 files changed, 198 insertions, 21 deletions
diff --git a/Engineering_Physics_Marikani/Chapter_3.ipynb b/Engineering_Physics_Marikani/Chapter_3.ipynb
index 59daaddd..7496a57a 100644
--- a/Engineering_Physics_Marikani/Chapter_3.ipynb
+++ b/Engineering_Physics_Marikani/Chapter_3.ipynb
@@ -1,6 +1,7 @@
{
"metadata": {
- "name": "Chapter 3"
+ "name": "",
+ "signature": "sha256:3f2462cfb429298e26fc6bf563d665947cd211731889b95d7dd1a2db3452c286"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -11,25 +12,47 @@
"cell_type": "heading",
"level": 1,
"metadata": {},
- "source": "Fibre Optics"
+ "source": [
+ "Fibre Optics"
+ ]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 3.1, Page number 98 "
+ "source": [
+ "Example number 3.1, Page number 98 "
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the numerical aperture of an optical fibre\n\n#importing modules\nimport math\n\n#Variable declaration\nn1=1.6; #refractive index of core\nn2=1.5; #refractive index of cladding\n\n#Calculation\nNA=math.sqrt((n1**2)-(n2**2));\nNA=math.ceil(NA*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"the numerical aperture of the fibre is\",NA);\n",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n1=1.6; #refractive index of core\n",
+ "n2=1.5; #refractive index of cladding\n",
+ "\n",
+ "#Calculation\n",
+ "NA=math.sqrt((n1**2)-(n2**2));\n",
+ "NA=math.ceil(NA*10**4)/10**4; #rounding off to 4 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"the numerical aperture of the fibre is\",NA);\n"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('the numerical aperture of the fibre is', 0.5568)\n"
+ "text": [
+ "('the numerical aperture of the fibre is', 0.5568)\n"
+ ]
}
],
"prompt_number": 4
@@ -38,19 +61,54 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 3.2, Page number 98 "
+ "source": [
+ "Example number 3.2, Page number 98 "
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the numerical aperture and acceptance angle of a fibre\n\n#importing modules\nimport math\n\n#Variable declaration\nn1=1.54; #refractive index of core\nn2=1.5; #refractive index of cladding\nn0=1;\n\n#Calculation\nNA=math.sqrt((n1**2)-(n2**2)); #numerical aperture of fibre\nNA=math.ceil(NA*10**5)/10**5; #rounding off to 5 decimals\nalpha=math.asin(NA/n0); #acceptance angle in radians\nalpha=alpha*57.2957795; #converting radians to degrees\nalpha=math.ceil(alpha*10**5)/10**5; #rounding off to 5 decimals\ndeg=int(alpha); #converting to degrees\nt=60*(alpha-deg); \nmi=int(t); #converting to minutes\nsec=60*(t-mi); #converting to seconds\nsec=math.ceil(sec*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"the numerical aperture of the fibre is\",NA);\nprint(\"the acceptance angle of the fibre in degrees is\",alpha);\nprint(\"acceptance angle of the fibre is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");\n\n#answer for the angle given in the book is wrong",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n1=1.54; #refractive index of core\n",
+ "n2=1.5; #refractive index of cladding\n",
+ "n0=1;\n",
+ "\n",
+ "#Calculation\n",
+ "NA=math.sqrt((n1**2)-(n2**2)); #numerical aperture of fibre\n",
+ "NA=math.ceil(NA*10**5)/10**5; #rounding off to 5 decimals\n",
+ "alpha=math.asin(NA/n0); #acceptance angle in radians\n",
+ "alpha=alpha*57.2957795; #converting radians to degrees\n",
+ "alpha=math.ceil(alpha*10**5)/10**5; #rounding off to 5 decimals\n",
+ "deg=int(alpha); #converting to degrees\n",
+ "t=60*(alpha-deg); \n",
+ "mi=int(t); #converting to minutes\n",
+ "sec=60*(t-mi); #converting to seconds\n",
+ "sec=math.ceil(sec*10**3)/10**3; #rounding off to 3 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"the numerical aperture of the fibre is\",NA);\n",
+ "print(\"the acceptance angle of the fibre in degrees is\",alpha);\n",
+ "print(\"acceptance angle of the fibre is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");\n",
+ "\n",
+ "#answer for the angle given in the book is wrong"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('the numerical aperture of the fibre is', 0.34872)\n('the acceptance angle of the fibre in degrees is', 20.40905)\n('acceptance angle of the fibre is', 20, 'degrees', 24, 'minutes', 32.581, 'seconds')\n"
+ "text": [
+ "('the numerical aperture of the fibre is', 0.34872)\n",
+ "('the acceptance angle of the fibre in degrees is', 20.40905)\n",
+ "('acceptance angle of the fibre is', 20, 'degrees', 24, 'minutes', 32.581, 'seconds')\n"
+ ]
}
],
"prompt_number": 7
@@ -59,19 +117,47 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 3.3, Page number 99"
+ "source": [
+ "Example number 3.3, Page number 99"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the critical angle\n\n#importing modules\nimport math\n\n#Variable declaration\nn1=1.6; #refractive index of core\nn2=1.49; #refractive index of cladding\n\n#Calculation\nthetac=math.asin(n2/n1); #critical angle in radians\nthetac=thetac*57.2957795; #converting radians to degrees\ntheta_c=math.ceil(thetac*10**3)/10**3; #rounding off to 3 decimals\ndeg=int(thetac); #converting to degrees\nt=60*(thetac-deg); \nmi=int(t); #converting to minutes\nsec=60*(t-mi); #converting to seconds\nsec=math.ceil(sec*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"the critical angle of the fibre in degrees is\",theta_c);\nprint(\"critical angle of the fibre is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n1=1.6; #refractive index of core\n",
+ "n2=1.49; #refractive index of cladding\n",
+ "\n",
+ "#Calculation\n",
+ "thetac=math.asin(n2/n1); #critical angle in radians\n",
+ "thetac=thetac*57.2957795; #converting radians to degrees\n",
+ "theta_c=math.ceil(thetac*10**3)/10**3; #rounding off to 3 decimals\n",
+ "deg=int(thetac); #converting to degrees\n",
+ "t=60*(thetac-deg); \n",
+ "mi=int(t); #converting to minutes\n",
+ "sec=60*(t-mi); #converting to seconds\n",
+ "sec=math.ceil(sec*10**2)/10**2; #rounding off to 2 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"the critical angle of the fibre in degrees is\",theta_c);\n",
+ "print(\"critical angle of the fibre is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('the critical angle of the fibre in degrees is', 68.631)\n('critical angle of the fibre is', 68, 'degrees', 37, 'minutes', 49.85, 'seconds')\n"
+ "text": [
+ "('the critical angle of the fibre in degrees is', 68.631)\n",
+ "('critical angle of the fibre is', 68, 'degrees', 37, 'minutes', 49.85, 'seconds')\n"
+ ]
}
],
"prompt_number": 10
@@ -80,19 +166,54 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 3.4, Page number 99"
+ "source": [
+ "Example number 3.4, Page number 99"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the acceptance angle of a fibre\n\n#importing modules\nimport math\n\n#Variable declaration\nNA=0.15; #numerical aperture\nn2=1.55; #refractive index of cladding\nn0=1.33; #refractive index of water\n\n#Calculation\nn1=math.sqrt((NA**2)+(n2**2)); #refractive index\nn_1=math.ceil(n1*10**5)/10**5; #rounding off to 5 decimals\nalpha=math.asin(math.sqrt(n1**2-n2**2)/n0); #acceptance angle in radians\nalpha=alpha*57.2957795; #converting radians to degrees\nalphaa=math.ceil(alpha*10**3)/10**3; #rounding off to 3 decimals\ndeg=int(alpha); #converting to degrees\nt=60*(alpha-deg); \nmi=int(t); #converting to minutes\nsec=60*(t-mi); #converting to seconds\nsec=math.ceil(sec*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint(\"refractive index of the core is\",n_1);\nprint(\"the acceptance angle of the fibre in degrees is\",alphaa);\nprint(\"acceptance angle of the fibre is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");\n\n#answer for acceptance angle given in the book is wrong",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "NA=0.15; #numerical aperture\n",
+ "n2=1.55; #refractive index of cladding\n",
+ "n0=1.33; #refractive index of water\n",
+ "\n",
+ "#Calculation\n",
+ "n1=math.sqrt((NA**2)+(n2**2)); #refractive index\n",
+ "n_1=math.ceil(n1*10**5)/10**5; #rounding off to 5 decimals\n",
+ "alpha=math.asin(math.sqrt(n1**2-n2**2)/n0); #acceptance angle in radians\n",
+ "alpha=alpha*57.2957795; #converting radians to degrees\n",
+ "alphaa=math.ceil(alpha*10**3)/10**3; #rounding off to 3 decimals\n",
+ "deg=int(alpha); #converting to degrees\n",
+ "t=60*(alpha-deg); \n",
+ "mi=int(t); #converting to minutes\n",
+ "sec=60*(t-mi); #converting to seconds\n",
+ "sec=math.ceil(sec*10**2)/10**2; #rounding off to 2 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"refractive index of the core is\",n_1);\n",
+ "print(\"the acceptance angle of the fibre in degrees is\",alphaa);\n",
+ "print(\"acceptance angle of the fibre is\",deg,\"degrees\",mi,\"minutes\",sec,\"seconds\");\n",
+ "\n",
+ "#answer for acceptance angle given in the book is wrong"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('refractive index of the core is', 1.55725)\n('the acceptance angle of the fibre in degrees is', 6.476)\n('acceptance angle of the fibre is', 6, 'degrees', 28, 'minutes', 32.55, 'seconds')\n"
+ "text": [
+ "('refractive index of the core is', 1.55725)\n",
+ "('the acceptance angle of the fibre in degrees is', 6.476)\n",
+ "('acceptance angle of the fibre is', 6, 'degrees', 28, 'minutes', 32.55, 'seconds')\n"
+ ]
}
],
"prompt_number": 13
@@ -101,19 +222,41 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 3.5, Page number 100"
+ "source": [
+ "Example number 3.5, Page number 100"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the refractive index of cladding\n\n#importing modules\nimport math\n\n#Variable declaration\nNA=0.26; #numerical aperture\nn1=1.5; #refractive index of core\nd=100; #core diameter in micro meter\n\n#Calculation\nd=100*(10**-6); #core diameter in metre\nn2=math.sqrt((n1**2)-(NA**2));\nn2=math.ceil(n2*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"refractive index of the cladding is\",n2);",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "NA=0.26; #numerical aperture\n",
+ "n1=1.5; #refractive index of core\n",
+ "d=100; #core diameter in micro meter\n",
+ "\n",
+ "#Calculation\n",
+ "d=100*(10**-6); #core diameter in metre\n",
+ "n2=math.sqrt((n1**2)-(NA**2));\n",
+ "n2=math.ceil(n2*10**5)/10**5; #rounding off to 5 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"refractive index of the cladding is\",n2);"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('refractive index of the cladding is', 1.4773)\n"
+ "text": [
+ "('refractive index of the cladding is', 1.4773)\n"
+ ]
}
],
"prompt_number": 16
@@ -122,19 +265,53 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 3.6, Page number 100"
+ "source": [
+ "Example number 3.6, Page number 100"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the refractive indices of core and cladding\n\n#importing modules\nimport math\n\n#Variable declaration\nNA=0.26; #numerical aperture\ndelta=0.015; #refractive index difference\n\n#Calculation\n#NA=math.sqrt(n1**2-n2**2)\n#let A=n1**2-n2**2\n#therefore A=NA**2\nA=NA**2;\n#delta=(n1**2-n2**2)/2*(n1**2)\n#let 2*(n1**2) be B\n#therefore B=A/delta\nB=A/delta;\nn1=math.sqrt(B/2);\nn1=math.ceil(n1*100)/100; #rounding off to 2 decimals\nn2=math.sqrt(n1**2-NA**2);\nn2=math.ceil(n2*10**3)/10**3; #rounding off to 4 decimals\n\n#Result\nprint(\"refractive index of the core is\",n1);\nprint(\"refractive index of the cladding is\",n2);\n\n#answer for refractive index of cladding given in the book is wrong",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "NA=0.26; #numerical aperture\n",
+ "delta=0.015; #refractive index difference\n",
+ "\n",
+ "#Calculation\n",
+ "#NA=math.sqrt(n1**2-n2**2)\n",
+ "#let A=n1**2-n2**2\n",
+ "#therefore A=NA**2\n",
+ "A=NA**2;\n",
+ "#delta=(n1**2-n2**2)/2*(n1**2)\n",
+ "#let 2*(n1**2) be B\n",
+ "#therefore B=A/delta\n",
+ "B=A/delta;\n",
+ "n1=math.sqrt(B/2);\n",
+ "n1=math.ceil(n1*100)/100; #rounding off to 2 decimals\n",
+ "n2=math.sqrt(n1**2-NA**2);\n",
+ "n2=math.ceil(n2*10**3)/10**3; #rounding off to 4 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"refractive index of the core is\",n1);\n",
+ "print(\"refractive index of the cladding is\",n2);\n",
+ "\n",
+ "#answer for refractive index of cladding given in the book is wrong"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('refractive index of the core is', 1.51)\n('refractive index of the cladding is', 1.488)\n"
+ "text": [
+ "('refractive index of the core is', 1.51)\n",
+ "('refractive index of the cladding is', 1.488)\n"
+ ]
}
],
"prompt_number": 19
@@ -142,7 +319,7 @@
{
"cell_type": "code",
"collapsed": false,
- "input": "",
+ "input": [],
"language": "python",
"metadata": {},
"outputs": []