summaryrefslogtreecommitdiff
path: root/Optical_Fiber_Communication_by_A_Kalavar/2-Optical_Fibers.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Optical_Fiber_Communication_by_A_Kalavar/2-Optical_Fibers.ipynb')
-rw-r--r--Optical_Fiber_Communication_by_A_Kalavar/2-Optical_Fibers.ipynb1277
1 files changed, 1277 insertions, 0 deletions
diff --git a/Optical_Fiber_Communication_by_A_Kalavar/2-Optical_Fibers.ipynb b/Optical_Fiber_Communication_by_A_Kalavar/2-Optical_Fibers.ipynb
new file mode 100644
index 0000000..179c9c5
--- /dev/null
+++ b/Optical_Fiber_Communication_by_A_Kalavar/2-Optical_Fibers.ipynb
@@ -0,0 +1,1277 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2: Optical Fibers"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.10_1: Determine_cutoff_wavelength.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.10.1 page 2.39\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"a=4.5d-6; //core diameter\n",
+"delta=0.25/100; //relative index difference\n",
+"lamda=0.85d-6; //operating wavelength\n",
+"n1=1.46; //core refractive index\n",
+"\n",
+"v= 2*%pi*a*n1*sqrt(2*delta)/lamda; //computing normalized frequency\n",
+"lamda_cut_off=v*lamda/2.405; //computing cut off wavelength\n",
+"lamda_cut_off=lamda_cut_off*10^9;\n",
+"printf('\nCut off wavelength is %.d nanometer.',lamda_cut_off);\n",
+"\n",
+"printf('\n\nWhen delta is 1.25 percent-');\n",
+"delta=1.25/100;\n",
+"v= 2*%pi*a*n1*sqrt(2*delta)/lamda; //computing normalized frequency\n",
+"lamda_cut_off=v*lamda/2.405; //computing cut off wavelength\n",
+"lamda_cut_off=lamda_cut_off*10^7;\n",
+"lamda_cut_off=round(lamda_cut_off);\n",
+"lamda_cut_off=lamda_cut_off*100;\n",
+"printf('\nCut off wavelength is %.d nanometer.',lamda_cut_off);\n",
+"\n",
+"//answer in the book for cut off wavelength in the book is given as 1214nm, deviation of 1nm."
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.10_2: Calculate_cutoff_number_and_number_of_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.10.2 page 2.40\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"a=50d-6; //core radius\n",
+"lamda=1500d-9; //operating wavelength\n",
+"n1=2.53; //core refractive index\n",
+"n2=1.5; //cladding refractive index\n",
+"\n",
+"delta=(n1-n2)/n1; //computing delta\n",
+"v= 2*3.14*a*n1*sqrt(2*delta)/lamda; //computing normalized frequency\n",
+"M=(v)^2/2; //computing guided modes\n",
+"printf('\nNormalized Frequency is %.1f\nTotal number of guided modes are %.d',v,M);\n",
+"printf('\nNOTE - Calculation error in book. \n Normalized frequency is 477, it is calculated as 47.66');\n",
+"\n",
+"//Calculation error in book. Normalized frequency is 477, it is calculated as 47.66, hence answers after that are erroneous.\n",
+"//answers in the book\n",
+"//normalized frequency = 48.(incorrect)\n",
+"//guided modes = 1152.(incorrect)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.10_3: Compute_number_of_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.10.3 page 2.41\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"core_diameter=8d-6; //core diameter\n",
+"delta=0.92/100; //relative index difference\n",
+"lamda=1550d-9; //operating wavelength\n",
+"n1=1.45; //core refractive index\n",
+"\n",
+"a=core_diameter/2; //computing core radius\n",
+"v= 2*%pi*a*n1*sqrt(2*delta)/lamda; //computing normalized frequency\n",
+"M=(v)^2/2; //computing guided modes\n",
+"printf('\nNormalized Frequency is %.1f.\nTotal number of guided modes are %.d.',v,M);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.10_4: Calculate_delay_difference.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.10.4 page 2.41\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"delta=1/100; //relative index difference\n",
+"n1=1.5; //core refractive index\n",
+"c=3d8;\n",
+"L=6;\n",
+"\n",
+"n2=sqrt(n1^2-2*delta*n1^2); //computing refractive index of cladding\n",
+"delta_T=L*n1^2*delta/(c*n2); //computing pulse broadning\n",
+"delta_T=delta_T*10^11;\n",
+"delta_T=round(delta_T);\n",
+"printf('\nDelay difference between slowest and fastest mode is %d ns/km.',delta_T);\n",
+"printf('\nThis means that a pulse broadnes by %d ns after travel time a distance of %d km.',delta_T,L);\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.13_1: Find_modal_briefringence.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.13.1 page 2.54\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"L_BL=8d-2; //beat length\n",
+"\n",
+"Br=2*3.14/L_BL; //computing modal briefringence\n",
+"printf('\nModal briefringence is %.1f per meter.',Br);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.13_2: Find_output_power.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.13.2 page 2.57\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"Pin=500d-6; //input power\n",
+"L=200; //length of fiber\n",
+"loss=2; //loss associated with fiber\n",
+"\n",
+"Pin_dbm=10 * log10 (Pin/(10^-3)); //computing input power in dBm\n",
+"Pin_dbm=round(Pin_dbm);\n",
+"Pout_dbm=Pin_dbm-L*loss; //computing output power level\n",
+"Pout= 10^(Pout_dbm/10);\n",
+"printf('Output power is %.2e mW.',Pout);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.16_1: Calculate_NA_and_maximum_acceptance_angle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.16.1 page 2.67\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.48; //core refractive index\n",
+"n2=1.46; //cladding refractive index\n",
+"\n",
+"phi = asind(n2/n1); //computing critical angle\n",
+"NA = sqrt(n1^2 - n2^2); //computing numericla aperture\n",
+"theta= asind(NA); //computing acceptance angle\n",
+"printf('\nCritical angle is %.2f degrees.\nNumerical aperture is %.3f.\nAcceptance angle is %.2f degree.',phi,NA,theta);\n",
+"\n",
+"//answers in the book\n",
+"//Critical angle is 80.56 degrees, deviation of 0.01.\n",
+"//Numerical aperture is 0.244, deviation of 0.002.\n",
+"//Acceptance angle is 14.17 degree, deviation of 0.14."
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.3_1: Estimate_numerical_aperture_and_critical_angle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.3.1 page 2.10\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"delta = 1/100; // Relative refractive difference index\n",
+"n1=1.46; // Core refractive index (assumption)\n",
+"\n",
+"NA= n1*sqrt(2*delta); //computing numerical aperture\n",
+"theta = 1 - delta;\n",
+"Critical_angle = asind(theta); //computing critical angle\n",
+"\n",
+"printf('\nNumerical aperture is %.2f.\nCritical angle is %.1f degree.',NA,Critical_angle);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.3_2: Estimate_numerical_aperture.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.3.2 page 2.10\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"delta = 1/100; // Relative refractive difference index\n",
+"n1=1.47; // Core refractive index \n",
+"\n",
+"NA= n1*sqrt(2*delta); //computing numerical aperture\n",
+"\n",
+"printf('\nNumerical aperture is %.1f.',NA)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4_1: Determine_critical_angle_numerical_aperture_and_acceptance_angle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.4.1 page 2.11\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.49; //core refractive index\n",
+"n2=1.45; //cladding refractive index\n",
+"\n",
+"phi = asind(n2/n1); //computing critical angle\n",
+"NA = sqrt(n1^2 - n2^2); //computing numericla aperture\n",
+"theta= asind(NA); //computing acceptance angle\n",
+"\n",
+"printf('\nCritical angle is %.2f degrees.\nNumerical aperture is %.3f.\nAcceptance angle is %.2f degree.',phi,NA,theta);\n",
+"\n",
+"//answer in the book for Numerical aperture is 0.343, deviation of 0.003\n",
+"//answer in the book for Acceptance angle is 20.24, deviation of 0.18"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4_2: Determine_numerical_aperture.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.4.2 page 2.12\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"delta = 1/100; // Relative refractive difference index\n",
+"n1=1.47; // Core refractive index \n",
+"\n",
+"NA= n1*sqrt(2*delta); //computing numerical aperture\n",
+"printf('\nNumerical aperture is %.1f.',NA)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4_3: Find_numerical_aperture_and_acceptance_angle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.4.3 page 2.12\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"delta = 1.2/100; // Relative refractive difference index\n",
+"n1=1.45; // Core refractive index \n",
+"\n",
+"NA= n1*sqrt(2*delta); //computing numerical aperture\n",
+"Acceptance_angle = asind(NA); //computing acceptance angle\n",
+"si = %pi * NA^2; //computing solid acceptance angle\n",
+"\n",
+"printf('\nNumerical aperture is %.3f.\nAcceptance angle is %.2f degree.\nSolid acceptance angle is %.3f radians.',NA,Acceptance_angle,si);\n",
+"\n",
+"//answer in the book for Numerical aperture is 0.224, deviation of 0.001\n",
+"//answer in the book for solid acceptance angle is 0.157, deviation of 0.002"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4_4: Find_acceptance_angle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.4.4 page 2.13\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"NA = 0.45; // Numerical Aperture\n",
+"\n",
+"Acceptance_angle = asind(NA); //computing acceptance angle.\n",
+"printf('\nAcceptance angle is %.1f degree.',Acceptance_angle);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4_5: Compute_numerical_aperture_and_full_cone_angle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.4.5 page 2.13\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"diameter = 1; //Diameter in centimeter\n",
+"Focal_length = 10; //Focal length in centimeter\n",
+"\n",
+"radius=diameter/2; //computing radius\n",
+"Acceptance_angle = atand(radius/Focal_length); //computing acceptance angle\n",
+"Conical_full_angle = 2*Acceptance_angle; //computing conical angle\n",
+"Solid_acceptance_angle = %pi*Acceptance_angle^2; //computing solid acceptance angle\n",
+"NA = sqrt(Solid_acceptance_angle/%pi); //computing Numerical aperture\n",
+"\n",
+"printf('\nNumerical aperture is %.2f.\nConical full angle is %.2f degree.',NA,Conical_full_angle);\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.5_1: Find_acceptance_angle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.5.1 page 2.17\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"NA = 0.45 //Numerical aperture\n",
+"betaB = 45 // Skew ray change direction by 90 degree at each reflection\n",
+"\n",
+"Meridional_theta = asind(NA); //computing acceptacne angle for meridoinal ray\n",
+"Skew_theta = asind(NA/cosd(betaB)); //computing acceptacne angle for skew ray\n",
+"\n",
+"printf('\nAcceptacne angle for Meridoinal ray is %.2f degree.\nAcceptance angle for Skew ray %.1f degree.',Meridional_theta,Skew_theta);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_10: Determine_normalized_frequency_and_number_of_guided_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.10 page 2.29\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.48; //refractive index of core\n",
+"n2=1.46; //refractive index of cladding\n",
+"lamda1=1320d-9; //Wavelength\n",
+"lamda2=1550d-9; //Wavelength\n",
+"a=25d-6; //radius of core\n",
+"\n",
+"NA=sqrt(n1^2 - n2^2); //computing Numerical aperture\n",
+"v1=2*%pi*a*NA/lamda1; //computing normalized frequency\n",
+"v1=round(v1);\n",
+"M1=v1^2/2; //computing number of guided modes\n",
+"M1=round(M1);\n",
+"v2=2*%pi*a*NA/lamda2;\n",
+"M2=v2^2/2;\n",
+"M2=round(M2);\n",
+"lamda1=lamda1*10^9;\n",
+"lamda2=lamda2*10^9;\n",
+"\n",
+"printf('\nfor %d nm, normalized frequency = %d, Guided modes = %d.',lamda1,v1,M1);\n",
+"printf('\nfor %d nm, normalized frequency = %.2f, Guided modes = %d.',lamda2,v2,M2);\n",
+"\n",
+"//answer in the book,\n",
+"//for 1550 nm, normalized frequency = 24.69(deviation of 0.08), Guided modes = 305(deviation of 3)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_11: Compute_NA_and_number_of_guided_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.11 page 2.29\n",
+"\n",
+"clc;\n",
+"clear all;\n",
+"\n",
+"n1=1.5; //refractive index of core\n",
+"n2=1.38; //refractive index of cladding\n",
+"lamda=1300d-9; //Wavelength\n",
+"a=25d-6; //core radius\n",
+"\n",
+"NA=sqrt(n1^2 - n2^2); //computing Numerical aperture\n",
+"theta= asind(NA); //computing acceptance angle\n",
+"solid_angle=%pi*(NA)^2; //computing solid angle\n",
+"v= 2*%pi*a*NA/lamda; //computing normalized frequency\n",
+"M=(v)^2/2; //computing guided modes\n",
+"M=round(M);\n",
+"printf('\nNumerical aperture is %.2f.\nNormalized frequency is %.2f.\nAcceptance angle is %.2f degrees.\nSolid angle is %.3f radians.\nTotal number of modes are %d.',NA,v,theta,solid_angle,M);\n",
+"printf('\n\n NOTE - Calculation error in the book.\n(2.25-1.9)^0.5=0.59; they have taken 0.35');\n",
+"\n",
+"\n",
+"//Calculation error in the book.(2.25-1.9)^0.5=0.59; they have taken 0.35\n",
+"//answers in the book,\n",
+"//Numerical aperture is 0.35.(incorrect)\n",
+"//Normalized frequency is 42.26.(incorrect)\n",
+"//Acceptance angle is 20.48 degrees.(incorrect)\n",
+"//Solid angle is 0.384 radians.(incorrect)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_12: Compute_core_radius_and_acceptance_angle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.12 page 2.30\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.48; //refractive index of core\n",
+"n2=1.478; //refractive index of cladding\n",
+"lamda=820d-9; //Wavelength\n",
+"\n",
+"NA=sqrt(n1^2 - n2^2); //computing Numerical aperture\n",
+"theta= asind(NA); //computing acceptance angle\n",
+"solid_angle=%pi*(NA)^2; //computing solid angle\n",
+"\n",
+"printf('\nNumerical aperture is %.3f.\nAcceptance angle is %.2f degrees.\nSolid angle is %.4f radians.',NA,theta,solid_angle);\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_13: Estimate_range_of_wavelength_for_single_mode_transmission.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"\n",
+"// Example 2.7.13 page 2.31\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.447; //refractive index of core\n",
+"n2=1.442; //refractive index of cladding\n",
+"lamda=1.3d-6; //Wavelength\n",
+"a=3.6d-6; //core radius\n",
+"\n",
+"NA=sqrt(n1^2 - n2^2); //computing Numerical aperture\n",
+"v= 2*%pi*a*NA/lamda; //computing normalized frequency\n",
+"\n",
+"printf('As normalized frequency is %.2f which is less than 2.405, this fiber will permit single mode transmission',v);\n",
+"\n",
+"lamda_cut_off=v*lamda/2.405\n",
+"lamda_cut_off=lamda_cut_off*10^9\n",
+"printf('\n\nSingle mode operation will occur above this cut off wavelength of %.2f nm',lamda_cut_off);\n",
+"printf('\n\n NOTE - Calculation error in the book.\n(1.447^2 - 1.442^2)^0.5=0.121; they have taken 0.141\nHence calculations after that are incorrect in the book');\n",
+"\n",
+"//Calculation error in the book.(1.447^2 - 1.442^2)^0.5=0.121; they have taken 0.141.Hence calculations after that are incorrect in the book.\n",
+"//They have taken radius as 2.6d-6, whereas in question it is given 3.6d-6.\n",
+"//answers in the book\n",
+"//Normalized frequency is 1.77.(incorrect)\n",
+"//cut off wavelength 956nm.(incorrect)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_14: Estimate_number_of_guided_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.14 page 2.34\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"NA=0.2; //Numericla aperture\n",
+"d=50d-6; //Diameter of core\n",
+"lamda=1d-6; //Wavelength\n",
+"\n",
+"a=d/2; //computing radius\n",
+"v=2*3.14*a*NA/lamda; //computing normalized frequency\n",
+"Mg=v^2/4; //computing mode volume for parabollic profile\n",
+"Mg=round(Mg);\n",
+"printf('\nNormalized Frequency is %.1f.\nTotal number of guided modes are %.d.',v,Mg);\n",
+"\n",
+"//answer in the book for guided modes is 247, deviation of 1."
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_15: Determine_core_diameter.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.15 page 2.34\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"delta=0.015; //relative refractive index\n",
+"n1=1.48; //core refractive index\n",
+"lamda=0.85d-6; //wavelength\n",
+"\n",
+"a=(2.4*lamda)/(2*3.14*n1*sqrt(2*delta)); //computing radius of core\n",
+"d=2*a; //computing diameter of core\n",
+"a=a*10^7;\n",
+"a=round(a);\n",
+"a=a/10\n",
+"d=d*10^6;\n",
+"printf('\nCore radius is %.1f micrometer.\nCore diameter is %.1f micrometer.',a,2*a);\n",
+"\n",
+"printf('\n\nWhen delta is reduced by 10 percent-');\n",
+"delta=0.0015;\n",
+"a=(2.4*lamda)/(2*3.14*n1*sqrt(2*delta)); //computing radius of core\n",
+"d=2*a; //computing diameter of core\n",
+"a=a*10^7;\n",
+"a=round(a);\n",
+"a=a/10\n",
+"d=d*10^6;\n",
+"printf('\nCore radius is %.1f micrometer.\nCore diameter is %.1f micrometer.',a,2*a);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_16: Find_number_of_guided_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.16 page 2.35\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"NA=0.25; //Numericla aperture\n",
+"d=45d-6; //Diameter of core\n",
+"lamda=1.5d-6; //Wavelength\n",
+"\n",
+"a=d/2; //computing radius\n",
+"v=2*3.14*a*NA/lamda; //computing normalized frequency\n",
+"Mg=v^2/4; //computing mode volume for parabollic profile\n",
+"Mg=round(Mg);\n",
+"printf('\nNormalized Frequency is %.1f.\nTotal number of guided modes are %.d.',v,Mg);\n",
+"\n",
+"//answer in the book for normalized frequency is 23.55, deviation 0.05"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_17: Estimate_number_of_guided_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.17 page 2.35\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"NA=0.25; //Numericla aperture\n",
+"d=45d-6; //Diameter of core\n",
+"lamda=1.2d-6; //Wavelength\n",
+"\n",
+"a=d/2; //computing radius\n",
+"v=2*3.14*a*NA/lamda; //computing normalized frequency\n",
+"Mg=v^2/4; //computing mode volume for parabollic profile\n",
+"Mg=round(Mg);\n",
+"printf('\nNormalized Frequency is %.1f.\nTotal number of guided modes are %.d.',v,Mg);\n",
+"printf('\n\nNOTE - In the question NA is given 0.22. However while solving it is taken as 0.25');\n",
+"\n",
+"// answer in the book for number of guided modes is given as 216, deviation of 1.\n",
+"\n",
+"printf('\nHence solving for NA = 0.22 also,');\n",
+"printf('\n\nWhen NA=0.22');\n",
+"\n",
+"NA=0.22; //Numericla aperture\n",
+"d=45d-6; //Diameter of core\n",
+"lamda=1.2d-6; //Wavelength\n",
+"\n",
+"a=d/2; //computing radius\n",
+"v=2*3.14*a*NA/lamda; //computing normalized frequency\n",
+"Mg=v^2/4; //computing mode volume for parabollic profile\n",
+"Mg=round(Mg);\n",
+"printf('\nNormalized Frequency is %.1f.\nTotal number of guided modes are %.d.',v,Mg);\n",
+"\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_18: Compute_cutoff_parameter_and_number_of_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.18 page 2.36\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.54; //refractive index of core\n",
+"n2=1.5; //refractive index of cladding\n",
+"a=25d-6; //Radius of core\n",
+"lamda=1.3d-6; //Wavelength\n",
+"\n",
+"NA=sqrt(n1^2-n2^2);\n",
+"v=2*3.14*a*NA/lamda; //computing normalized frequency\n",
+"v=round(v);\n",
+"Mg=v^2/4; //computing mode volume for parabollic profile\n",
+"Mg=round(Mg);\n",
+"lamda_cut_off=v*lamda/2.405; //computing cut off wavelength\n",
+"lamda_cut_off=lamda_cut_off*10^6;\n",
+"printf('\nNormalized Frequency is %.d.\nTotal number of guided modes are %.d.\nCut off wavelength is %.1f micrometer.',v,Mg,lamda_cut_off);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_1: Find_normalized_frequency_and_number_of_guided_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.1 page 2.23\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"core_diameter=78d-6; //core diameter\n",
+"delta=1.4/100; //relative index difference\n",
+"lamda=0.8d-6; //operating wavelength\n",
+"n1=1.47; //core refractive index\n",
+"\n",
+"a=core_diameter/2; //computing core radius\n",
+"v= 2*3.14*a*n1*sqrt(2*delta)/lamda; //computing normalized frequency\n",
+"M=(v)^2/2; //computing guided modes\n",
+"\n",
+"printf('\nNormalized Frequency is %.3f.\nTotal number of guided modes are %.1f',v,M);\n",
+"printf('\nNOTE - Calculation error, answer in the book for normalized frequency is given as 75.156 which should be 75.306.');\n",
+"\n",
+"//answer in the book for normalized frequency is given as 75.156(incorrect) and for Guided modes is 5648.5(incorrect)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_2: Find_wavelength.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.2 page 2.24\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.47 //refractive index of core\n",
+"a=4.3d-6; //radius of core\n",
+"delta=0.2/100 //relative index difference\n",
+"\n",
+"lamda= 2*3.14*a*n1*sqrt(2*delta)/2.405; //computing wavelength\n",
+"lamda=lamda*10^9;\n",
+"printf('Wavelength of fiber is %d nm.',lamda);\n",
+"printf('\n\nNote:Calculation error, answer given in the book (1230nm) is incorrect.');\n",
+"\n",
+"//answer in the book is given as 1230nm which is incorrect."
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_3: Find_core_radius_NA_and_acceptance_angle.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.3 page 2.24\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.482; //refractive index of core\n",
+"n2=1.474; //refractive index of cladding\n",
+"lamda=820d-9; //Wavelength\n",
+"\n",
+"NA=sqrt(n1^2 - n2^2); //computing Numerical aperture\n",
+"theta= asind(NA); //computing acceptance angle\n",
+"solid_angle=%pi*(NA)^2; //computing solid angle\n",
+"a=2.405*lamda/(2*3.14*NA); //computing core radius\n",
+"a=a*10^6;\n",
+"\n",
+"printf('\nNumerical aperture is %.3f.\nAcceptance angle is %.1f degrees.\nSolid angle is %.3f radians.\nCore radius is %.2f micrometer.',NA,theta,solid_angle,a);\n",
+"\n",
+"//answer in the book for Numerical aperture is 0.155, deviation of 0.001.\n",
+"//answer in the book for acceptance angle is 8.9, deviation of 0.1.\n",
+"//answer in the book for solid acceptance angle is 0.075, deviation of 0.001.\n",
+"//answer in the book for core radius is 2.02 micrometer, deviation of 0.02 micrometer."
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_4: Estimate_number_of_guided_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.4 page 2.25\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"NA=0.16 //Numerical aperture\n",
+"n1=1.45 //core refractive index\n",
+"d=60d-6 //core diameter\n",
+"lamda=0.82d-6 //wavelength\n",
+"\n",
+"a=d/2; //core radius\n",
+"v=2*3.14*a*NA/lamda; //computing normalized frequency\n",
+"v=round(v);\n",
+"M=v^2/2; //computing guided modes\n",
+"M=floor(M);\n",
+"\n",
+"printf('if normalized frequency is taken as %d, then %d guided modes.',v,M);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_5: Determine_normalized_frequency_and_number_of_guided_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.5 page 2.26\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.48; //core refractive index\n",
+"n2=1.46; //cladding refractive index\n",
+"a=25d-6; //core radius\n",
+"lamda0=850d-9;\n",
+"lamda1=1320d-9;\n",
+"lamda2=1550d-9;\n",
+"\n",
+"NA=sqrt(n1^2-n2^2); //computing numerical aperture\n",
+"v0=2*%pi*a*NA/lamda0; //computing normalized frequency\n",
+"M0=v0^2/2; //computing guided modes\n",
+"M0=floor(M0);\n",
+"v1=2*%pi*a*NA/lamda1;\n",
+"M1=v1^2/2;\n",
+"M1=floor(M1);\n",
+"v2=2*%pi*a*NA/lamda2;\n",
+"M2=v2^2/2;\n",
+"M2=floor(M2);\n",
+"lamda0=lamda0*10^9;\n",
+"lamda1=lamda1*10^9;\n",
+"lamda2=lamda2*10^9;\n",
+"printf('\nfor %d nm, normalized frequency = %.2f, Guided modes = %d.',lamda0,v0,M0);\n",
+"printf('\nfor %d nm, normalized frequency = %.2f, Guided modes = %d.',lamda1,v1,M1);\n",
+"printf('\nfor %d nm, normalized frequency = %.2f, Guided modes = %d.',lamda2,v2,M2);\n",
+"\n",
+"//answers in the book (sligt deviations in each)\n",
+"//for 850 nm, normalized frequency = 45, Guided modes = 1012\n",
+"//for 1320 nm, normalized frequency = 28.91, Guided modes = 419\n",
+"//for 1550 nm, normalized frequency = 24.67, Guided modes = 304 "
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_6: Estimate_diameter_of_core.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.6 page 2.27\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"delta=1/100; //relative refractive index\n",
+"n1=1.3; //core refractive index\n",
+"lamda=1100d-9; //wavelength\n",
+"\n",
+"a=(2.4*lamda)/(2*3.14*n1*sqrt(2*delta)); //computing radius of core\n",
+"d=2*a; //computing diameter of core\n",
+"a=a*10^6;\n",
+"d=d*10^6;\n",
+"printf('\nCore radius is %.1f micrometer\nCore diameter is %.1f micrometer',a,d);\n",
+"printf('\nNOTE - In the book they have asked diameter of core. However, they have calculated only radius.');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_7: Calculate_NA_and_maximum_angle_of_entrance.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.7 page 2.27\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"n1=1.48; //refractive index of core\n",
+"n2=1.46; //refractive index of cladding\n",
+"\n",
+"NA=sqrt(n1^2-n2^2); //computing Numerical aperture\n",
+"theta=asind(NA); //computing acceptance angle\n",
+"\n",
+"printf('\nNumerical aperture is %.3f.\nAcceptance angle is %.2f degrees.',NA,theta);\n",
+"\n",
+"//answer in the book for Numerical aperture is 0.244, deviation of 0.002.\n",
+"//answer in the book for Acceptance angle is 14.12, deviation of 0.09."
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_8: Calculate_normalized_frequency_and_number_of_guided_modes.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.8 page 2.28\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"core_diameter=80d-6; //core diameter\n",
+"delta=1.5/100; //relative index difference\n",
+"lamda=0.85d-6; //operating wavelength\n",
+"n1=1.48; //core refractive index\n",
+"\n",
+"a=core_diameter/2; //computing core radius\n",
+"v= 2*%pi*a*n1*sqrt(2*delta)/lamda; //computing normalized frequency\n",
+"M=(v)^2/2; //computing guided modes\n",
+"printf('\nNormalized Frequency is %.1f.\nTotal number of guided modes are %.d.',v,M);\n",
+"\n",
+"//answer in the book for Guided modes is 2873, deviation of 1."
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7_9: Estimate_diameter_of_the_core.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Example 2.7.9 page 2.28\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"delta=1/100; //relative refractive index\n",
+"n1=1.5; //refractive index of core\n",
+"M=1100; //Guided modes\n",
+"lamda=1.3d-6; //wavelength\n",
+"\n",
+"v=sqrt(2*M); //computing normalized frequecy\n",
+"a=(v*lamda)/(2*3.14*n1*sqrt(2*delta)); //computing radius of core\n",
+"d=a*2;\n",
+"a=a*10^6;\n",
+"d=d*10^6;\n",
+"\n",
+"printf('\nNormalize frequency is %.1f.\nCore radius is %.2f micrometer.\nCore diameter is %.1f micrometer.',v,a,d);\n",
+"printf('\nCalculation error in the book while calculating radius and diameter.');\n",
+"\n",
+"//calculation error in the book.\n",
+"//answers in the book - \n",
+"//Core radius is 46.18 micrometer.(incorrect)\n",
+"//Core diameter is 92.3 micrometer.(incorrect)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.q: Find_briefrengence.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Question 4 page 2.75\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"L_BL=8d-2; //beat length\n",
+"\n",
+"Br=2*3.14/L_BL; //computing modal briefringence\n",
+"printf('\nModal briefringence is %.1f per meter.',Br);"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.q: Determine_modal_briefringence.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Question 5 page 2.76\n",
+"\n",
+"clc;\n",
+"clear;\n",
+"\n",
+"L_BL=0.6d-3; //beat length\n",
+"lamda=1.4d-6; //wavelength\n",
+"L_BL1=70;\n",
+"Bh=lamda/L_BL; //computing high briefringence\n",
+"Bl=lamda/L_BL1; //computing low briefringence\n",
+"\n",
+"printf('\nHigh briefringence is %.2e.\nLow briefringence is %.1e.',Bh,Bl);"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}