summaryrefslogtreecommitdiff
path: root/Fiber_Optics_and_Optoelectronics_by_R._P._Khare/Chapter10.ipynb
blob: 8dbddd08c7332cb702af19c10237cb60cb41beed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter10 - Optical Amplifiers"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 10.1 : Page 254"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "refrative index is : 3.75\n",
      "spectral bandwidth = 2.09 GHz\n"
     ]
    }
   ],
   "source": [
    "from math import pi, asin, sqrt\n",
    "from __future__ import division\n",
    "#refractive index and bandwidth\n",
    "#given data :\n",
    "lamda=1.55*10**-6## in m\n",
    "del_lamda=1*10**-9## in m\n",
    "L=320*10**-6## in m\n",
    "n=(lamda)**2/(2*del_lamda*L)#\n",
    "Gs=10**(5/10)## 5 dB is equivalent to 3.16\n",
    "R1=30/100#\n",
    "R2=R1#\n",
    "c=3*10**8## in m/s\n",
    "del_v=(c/(pi*n*L))*asin((1-(Gs*sqrt(R1*R2)))/(sqrt(4*Gs*sqrt(R1*R2))))#\n",
    "print \"refrative index is : %0.2f\"%n\n",
    "print \"spectral bandwidth = %0.2f GHz\"%(del_v*10**-9)\n",
    "#bandwidth is calculated wrong in the textbook"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 10.2 : Page 260"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "small signal gain of EDFA = 32.91 dB\n",
      "maximum possible achievable gain = 84.71 dB\n"
     ]
    }
   ],
   "source": [
    "from math import log10, exp\n",
    "#small-signal gain of EDFA and maximum pssible achievable gain\n",
    "ts=0.80##\n",
    "sa=4.6444*10**-25##in m**2\n",
    "n12=6*10**24##m**-3\n",
    "se=4.644*10**-25##m**2\n",
    "n21=0.70##\n",
    "l=7##in meter\n",
    "x=((sa*n12*l*(((se/sa)+1)*n21-1)))##\n",
    "G=ts*exp(x)##\n",
    "Gdb=10*log10(G)##\n",
    "Gmax=exp(se*n12*l)##\n",
    "Gmaxdb=10*log10(Gmax)##\n",
    "print \"small signal gain of EDFA = %0.2f dB\"%Gdb\n",
    "print \"maximum possible achievable gain = %0.2f dB\"%Gmaxdb"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 10.3 : Page 264"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "part (a)\n",
      "output signal power for forward pumping = 4.60 micro Watt\n",
      "part (b)\n",
      "overall gain = 6.63 dB\n"
     ]
    }
   ],
   "source": [
    "#output signal power and overall gain\n",
    "print \"part (a)\"\n",
    "psin=1*10**-6##in watts\n",
    "ppin=1##in watts\n",
    "gr=5*10**-14##mW**-1\n",
    "ap1=60*10**-12##m**2\n",
    "l=2000##meter\n",
    "asdb=0.15##dB/km\n",
    "As=3.39*10**-5##m**-1\n",
    "apdb=0.20##db/km\n",
    "ap=4.50*10**-5##m**-1\n",
    "z=(1-exp(-ap*l))/ap##\n",
    "y=(gr/ap1)##\n",
    "y1=z*y##\n",
    "y2=y1-(As*l)##\n",
    "psl=psin*exp(y2)##\n",
    "print \"output signal power for forward pumping = %0.2f micro Watt\"%(psl*10**6)\n",
    "print \"part (b)\"\n",
    "y1=z*y##\n",
    "y2=y1-(As*l)##\n",
    "psl=psin*exp(y2)##\n",
    "gfra=psl/(psin)##\n",
    "Gdb=10*log10(gfra)##\n",
    "print \"overall gain = %0.2f dB\"%Gdb"
   ]
  }
 ],
 "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}