summaryrefslogtreecommitdiff
path: root/2216
diff options
context:
space:
mode:
Diffstat (limited to '2216')
-rwxr-xr-x2216/CH10/EX10.1/ex_10_1.sce19
-rwxr-xr-x2216/CH10/EX10.2/ex_10_2.sce17
-rwxr-xr-x2216/CH10/EX10.3/ex_10_3.sce29
-rwxr-xr-x2216/CH11/EX11.1/ex_11_1.sce11
-rwxr-xr-x2216/CH11/EX11.2/ex_11_2.sce19
-rwxr-xr-x2216/CH11/EX11.4/ex_11_4.sce13
-rwxr-xr-x2216/CH12/EX12.1/ex_12_1.sce22
-rwxr-xr-x2216/CH12/EX12.2/ex_12_2.sce42
-rwxr-xr-x2216/CH12/EX12.3/ex_12_3.sce13
-rwxr-xr-x2216/CH12/EX12.4/ex_12_4.sce14
-rwxr-xr-x2216/CH12/EX12.5/ex_12_5.sce20
-rwxr-xr-x2216/CH13/EX13.1/ex_13_1.sce31
-rwxr-xr-x2216/CH13/EX13.2/ex_13_2.sce14
-rwxr-xr-x2216/CH13/EX13.3/ex_13_3.sce13
-rwxr-xr-x2216/CH14/EX14.1/ex_14_1.sce22
-rwxr-xr-x2216/CH14/EX14.3/ex_14_3.sce30
-rwxr-xr-x2216/CH14/EX14.4/ex_14_4.sce22
-rwxr-xr-x2216/CH14/EX14.5/ex_14_5.sce11
-rwxr-xr-x2216/CH2/EX2.1/ex_2_1.sce23
-rwxr-xr-x2216/CH2/EX2.2/ex_2_2.sce17
-rwxr-xr-x2216/CH2/EX2.3/ex_2_3.sce11
-rwxr-xr-x2216/CH2/EX2.4/ex_2_4.sce21
-rwxr-xr-x2216/CH2/EX2.5/ex_2_5.sce21
-rwxr-xr-x2216/CH3/EX3.1/ex_3_1.sce14
-rwxr-xr-x2216/CH3/EX3.2/ex_3_2.sce10
-rwxr-xr-x2216/CH3/EX3.3/ex_3_3.sce60
-rwxr-xr-x2216/CH3/EX3.4/ex_3_4.sce13
-rwxr-xr-x2216/CH4/EX4.1/ex_4_1.sce30
-rwxr-xr-x2216/CH4/EX4.2/ex_4_2.sce9
-rwxr-xr-x2216/CH4/EX4.3/ex_4_3.sce11
-rwxr-xr-x2216/CH4/EX4.4/ex_4_4.sce12
-rwxr-xr-x2216/CH4/EX4.5/ex_4_5.sce15
-rwxr-xr-x2216/CH5/EX5.1/ex_5_1.sce18
-rwxr-xr-x2216/CH5/EX5.2/ex_5_2.sce15
-rwxr-xr-x2216/CH5/EX5.3/ex_5_3.sce21
-rwxr-xr-x2216/CH5/EX5.4/ex_5_4.sce15
-rwxr-xr-x2216/CH5/EX5.5/ex_5_5.sce13
-rwxr-xr-x2216/CH6/EX6.1/ex_6_1.sce11
-rwxr-xr-x2216/CH6/EX6.2/ex_6_2.sce29
-rwxr-xr-x2216/CH6/EX6.3/ex_6_3.sce23
-rwxr-xr-x2216/CH6/EX6.4/ex_6_4.sce18
-rwxr-xr-x2216/CH6/EX6.5/ex_6_5.sce24
-rwxr-xr-x2216/CH7/EX7.1/ex_7_1.sce16
-rwxr-xr-x2216/CH7/EX7.2/ex_7_2.sce15
-rwxr-xr-x2216/CH7/EX7.3/ex_7_3.sce19
-rwxr-xr-x2216/CH7/EX7.4/ex_7_4.sce18
-rwxr-xr-x2216/CH7/EX7.5/ex_7_5.sce11
-rwxr-xr-x2216/CH7/EX7.6/ex_7_6.sce20
-rwxr-xr-x2216/CH7/EX7.7/ex_7_7.sce43
-rwxr-xr-x2216/CH8/EX8.1/ex_8_1.sce20
-rwxr-xr-x2216/CH8/EX8.2/ex_8_2.sce30
-rwxr-xr-x2216/CH8/EX8.3/ex_8_3.sce21
-rwxr-xr-x2216/CH8/EX8.4/ex_8_4.sce15
-rwxr-xr-x2216/CH8/EX8.5/ex_8_5.sce12
-rwxr-xr-x2216/CH8/EX8.6/ex_8_6.sce24
-rwxr-xr-x2216/CH8/EX8.7/ex_8_7.sce54
-rwxr-xr-x2216/CH9/EX9.1/ex_9_1.sce11
-rwxr-xr-x2216/CH9/EX9.2/ex_9_2.sce11
-rwxr-xr-x2216/CH9/EX9.3/ex_9_3.sce20
-rwxr-xr-x2216/CH9/EX9.4/ex_9_4.sce29
-rwxr-xr-x2216/CH9/EX9.5/ex_9_5.sce23
61 files changed, 1228 insertions, 0 deletions
diff --git a/2216/CH10/EX10.1/ex_10_1.sce b/2216/CH10/EX10.1/ex_10_1.sce
new file mode 100755
index 000000000..c93cfbcbb
--- /dev/null
+++ b/2216/CH10/EX10.1/ex_10_1.sce
@@ -0,0 +1,19 @@
+//Example 10.1;refractive index and bandwidth
+clc;
+clear;
+close;
+//given data :
+format('v',5)
+lamda=1.55*10^-6;// in m
+del_lamda=1*10^-9;// in m
+L=320*10^-6;// in m
+n=(lamda)^2/(2*del_lamda*L);
+Gs=10^(5/10);// 5 dB is equivalent to 3.16
+R1=30/100;
+R2=R1;
+c=3*10^8;// in m/s
+del_v=(c/(%pi*n*L))*asin((1-(Gs*sqrt(R1*R2)))/(sqrt(4*Gs*sqrt(R1*R2))));
+disp(n,"refrative index is")
+format('v',6)
+disp(del_v*10^-9,"spectral bandwidth in GHz is")
+//bandwidth is calculated wrong in the textbook
diff --git a/2216/CH10/EX10.2/ex_10_2.sce b/2216/CH10/EX10.2/ex_10_2.sce
new file mode 100755
index 000000000..8dc7c8ada
--- /dev/null
+++ b/2216/CH10/EX10.2/ex_10_2.sce
@@ -0,0 +1,17 @@
+//Example 10.2;small-signal gain of EDFA and maximum pssible achievable gain
+clc;
+clear;
+close;
+ts=0.80;//
+sa=4.6444*10^-25;//in m^2
+n12=6*10^24;//m^-3
+se=4.644*10^-25;//m^2
+n21=0.70;//
+l=7;//in meter
+x=((sa*n12*l*(((se/sa)+1)*n21-1)));//
+G=ts*exp(x);//
+Gdb=10*log10(G);//
+Gmax=exp(se*n12*l);//
+Gmaxdb=10*log10(Gmax);//
+disp(Gdb,"small signal gain of EDFA in dB is")
+disp(Gmaxdb,"maximum possible achievable gain in dB is")
diff --git a/2216/CH10/EX10.3/ex_10_3.sce b/2216/CH10/EX10.3/ex_10_3.sce
new file mode 100755
index 000000000..1a6b4f477
--- /dev/null
+++ b/2216/CH10/EX10.3/ex_10_3.sce
@@ -0,0 +1,29 @@
+//Example 10.3;output signal power and overall gain
+clc;
+clear;
+close;
+format('v',6)
+disp("part (a)")
+psin=1*10^-6;//in watts
+ppin=1;//in watts
+gr=5*10^-14;//mW^-1
+ap1=60*10^-12;//m^2
+l=2000;//meter
+asdb=0.15;//dB/km
+as=3.39*10^-5;//m^-1
+apdb=0.20;//db/km
+ap=4.50*10^-5;//m^-1
+z=(1-exp(-ap*l))/ap;//
+y=(gr/ap1);//
+y1=z*y;//
+y2=y1-(as*l);//
+psl=psin*exp(y2);//
+disp(psl*10^6,"output signal power for forward pumping in micro Watt is")
+format('v',5)
+disp("part (b)")
+y1=z*y;//
+y2=y1-(as*l);//
+psl=psin*exp(y2);//
+gfra=psl/(psin);//
+Gdb=10*log10(gfra);//
+disp(Gdb,"overall gain in dB is")
diff --git a/2216/CH11/EX11.1/ex_11_1.sce b/2216/CH11/EX11.1/ex_11_1.sce
new file mode 100755
index 000000000..ed1cc9666
--- /dev/null
+++ b/2216/CH11/EX11.1/ex_11_1.sce
@@ -0,0 +1,11 @@
+//Example 11.1:interaction length
+clc;
+clear;
+close;
+format('v',6)
+po=1;//assume
+p1=po/2;//
+p2=p1;//
+kl=asin(sqrt(p1));//in degree
+disp(kl,"interaction length is")
+//answer is in the form of pi in the textbook
diff --git a/2216/CH11/EX11.2/ex_11_2.sce b/2216/CH11/EX11.2/ex_11_2.sce
new file mode 100755
index 000000000..58dfbd95d
--- /dev/null
+++ b/2216/CH11/EX11.2/ex_11_2.sce
@@ -0,0 +1,19 @@
+//Example 11.2:position
+clc;
+clear;
+close;
+a=8.2;//in micro meter
+n1=1.45;//
+n2=1.446;//
+h1=1.31;//in micro meter
+h2=1.55;///in micro meter
+v1=((2*%pi*a*sqrt(n1^2-n2^2))/h1);//
+v2=((2*%pi*a*sqrt(n1^2-n2^2))/h2);//
+db=2.439;//
+del=5.5096*10^-3;//
+k1=1.0483;//mm^-1;//
+k2=1.2839///m^-1
+l1=((%pi)/(4*k1));//in mm
+l2=((%pi)/(4*k2));//in mm
+disp("output port positioned at "+string(l2)+" mm with respect to the input port will gather signals at h1=1310nm")
+disp("output port positioned at "+string(l1)+" mm with respect to the input port will gather signals at h1=1550nm")
diff --git a/2216/CH11/EX11.4/ex_11_4.sce b/2216/CH11/EX11.4/ex_11_4.sce
new file mode 100755
index 000000000..d411a07b4
--- /dev/null
+++ b/2216/CH11/EX11.4/ex_11_4.sce
@@ -0,0 +1,13 @@
+//Example 11.4: ARRAYED GUIDE
+clc;
+clear;
+close;
+//given data :
+c=3*10^8;
+lamda_c=1.55*10^-6;// in m
+vc=c/lamda_c;
+n=16;// number of channel
+f=100*10^9;// in Hz
+delV_FSR=n*f;
+m=round(vc/delV_FSR);
+disp(m,"required order of the arrayed waveguide, = ")
diff --git a/2216/CH12/EX12.1/ex_12_1.sce b/2216/CH12/EX12.1/ex_12_1.sce
new file mode 100755
index 000000000..d2088df56
--- /dev/null
+++ b/2216/CH12/EX12.1/ex_12_1.sce
@@ -0,0 +1,22 @@
+//Example 12.1: link length and reise time
+clc;
+clear;
+close;
+af=2.5;//dB/km
+ac=0.5;//dB/splice
+nc=1;//
+lc=1;//dB
+ncc=2;//
+plx=-10;//dBm
+prx=-42;//dBm
+Ms=6;//dB
+L=((plx-prx-Ms-(lc*ncc))/(af+ac));//
+TTX=12;//NS
+TRX=11;//NS
+NS1=3;//NS/KM
+NS2=1;//NS/KM
+tmat=(NS1*L);//ns
+tint=(NS2*L);//ns
+tsys=sqrt((TTX^2+tmat^2+tint^2+TRX^2));//ns
+disp(L,"maximum possible link length in km is")
+disp(round(tsys),"total rise time of the system in ns is")
diff --git a/2216/CH12/EX12.2/ex_12_2.sce b/2216/CH12/EX12.2/ex_12_2.sce
new file mode 100755
index 000000000..069a568f7
--- /dev/null
+++ b/2216/CH12/EX12.2/ex_12_2.sce
@@ -0,0 +1,42 @@
+//Example 12.2: link length and bandwidth
+clc;
+clear;
+close;
+format('v',4)
+disp("part (a)")
+af=3;//dB/km
+ac=0.5;//dB/splice
+nc=1;//
+lc=1;//dB
+ncc=1.5;//
+plx=0;//dBm
+prx=-25;//dBm
+Ms=7;//dB
+L=((plx-prx-Ms-(lc*ncc))/(af+ac));//
+TTX=12;//NS
+TRX=11;//NS
+NS1=3;//NS/KM
+NS2=1;//NS/KM
+tmat=(NS1*L);//ns
+tint=(NS2*L);//ns
+tsys=sqrt((TTX^2+tmat^2+tint^2+TRX^2));//ns
+disp(L,"maximum possible link length in km is")
+format('v',3)
+disp("part (b)")
+af=3;//dB/km
+ac=0.5;//dB/splice
+nc=1;//
+lc=1;//dB
+ncc=1.5;//
+plx=-0;//dBm
+prx=-25;//dBm
+Ms=7;//dB
+L=((plx-prx-Ms-(lc*ncc))/(af+ac));//
+TTX=1;//NS
+TRX=5;//NS
+NS1=9;//NS/KM
+NS2=2;//NS/KM
+tf=((NS1*L)^2+(NS2*L)^2);//
+tsys=sqrt((TTX^2+tf+TRX^2));//ns
+df=0.35/(tsys*10^-3);//
+disp(round(df),"system bandwidth in MHz iz")
diff --git a/2216/CH12/EX12.3/ex_12_3.sce b/2216/CH12/EX12.3/ex_12_3.sce
new file mode 100755
index 000000000..e3b539ebb
--- /dev/null
+++ b/2216/CH12/EX12.3/ex_12_3.sce
@@ -0,0 +1,13 @@
+//Example 12.3;no. of subscribers
+clc;
+clear;
+close;
+pt=1;//mW
+pn=-40;//dBm
+pn1=10^(pn/10);//
+c=0.05;//
+d=0.11;//
+x=((pn1)/(pt*c));//
+y=((log10(x))/(log10((1-d)*(1-c))));//
+n=y+1;//
+disp(round(n),"no. of subscribers are")
diff --git a/2216/CH12/EX12.4/ex_12_4.sce b/2216/CH12/EX12.4/ex_12_4.sce
new file mode 100755
index 000000000..7919bb433
--- /dev/null
+++ b/2216/CH12/EX12.4/ex_12_4.sce
@@ -0,0 +1,14 @@
+//Example 12.4: Total power
+clc;
+clear;
+close;
+//given data :
+L_eff=20;// in km
+del_lamdaC=125;// in nm
+gR=6*10^-14;// m/W
+A_eff=55*10^-12;// in m^2;
+del_lamdaS=0.8;// in nm
+N=32;// number of channels
+F=0.1;// constant
+P_tot=(4*F*del_lamdaC*A_eff)/(gR*del_lamdaS*L_eff*(N-1));
+disp(P_tot,"Total power,P_tot(mW) = ")
diff --git a/2216/CH12/EX12.5/ex_12_5.sce b/2216/CH12/EX12.5/ex_12_5.sce
new file mode 100755
index 000000000..d2514ea37
--- /dev/null
+++ b/2216/CH12/EX12.5/ex_12_5.sce
@@ -0,0 +1,20 @@
+//Example 12.5: SBS threshold power
+clc;
+clear;
+close;
+//given data :
+gb=4*10^-11;// in m/W
+A_eff=55*10^-12;// in m^2
+L_eff=20;// in km
+lamda_p=1.55;// micro-m
+n=1.46;// constant
+Va=5960;// for the silica fiber in m-s^-1
+Vb=(2*n*Va)/lamda_p;
+del_v=100*10^6;// in Hz
+del_Vb=20*10^6;// in Hz
+b1=1;
+b2=2;
+P_th=((21*b1*A_eff)/(gb*L_eff))*(1+(del_v/del_Vb))
+P_th1=((21*b2*A_eff)/(gb*L_eff))*(1+(del_v/del_Vb))
+disp(P_th,"SBS threshold power for the worst case in mW")
+disp(P_th1,"SBS threshold power for the best possible case in mW")
diff --git a/2216/CH13/EX13.1/ex_13_1.sce b/2216/CH13/EX13.1/ex_13_1.sce
new file mode 100755
index 000000000..2a1e9e3fd
--- /dev/null
+++ b/2216/CH13/EX13.1/ex_13_1.sce
@@ -0,0 +1,31 @@
+//Example 13.1: plot
+clc;
+clear;
+close;
+lod=[0;20;40;60;80;100;160];//in micro meter
+slong=[1.0;0.95;0.92;0.89;0.86;0.83;0.80];//
+lad=[0;10;20;30;40;50;60;70;80;90;100];//in micro meter
+slat=[0;0.1;0.2;0.3;0.4;0.5;0.6;0.7;0.8;0.9;1.0];//
+add=[0;1;2;3;4;5;6;7;8;9;10];//
+sang=[0;0.5;0.6;0.7;0.8;0.9;1.0;1.1;.12];//
+t=0:20:200;
+s1=1.0:-0.03:0.7;//
+subplot(131)
+plot(t,s1);//
+xtitle("Variation of Slong as a function of Δ x (with Δy=0 and Δθ=0) ")
+xlabel("Longitudinal displacement Δ x (micro meter)")
+ylabel("Slong (normalised)")
+t1=0:10:100;
+s2=1:-0.1:0;//
+subplot(132)
+plot(t1,s2);//
+xtitle("Variation of Slat as a function of Δ y (with Δx=0 and Δθ=0) ")
+xlabel("Lateral displacement Δ y (micro meter)")
+ylabel("Slat (normalised)")
+t2=0:1:10;
+s3=1.0:-0.03:0.7;//
+subplot(133)
+plot(t2,s3);//
+xtitle("Variation of Sang as a function of Δ θ (with Δx=0 and Δy=0) ")
+xlabel("Angular displacement Δ θ (deg)")
+ylabel("Sang (normalised)")
diff --git a/2216/CH13/EX13.2/ex_13_2.sce b/2216/CH13/EX13.2/ex_13_2.sce
new file mode 100755
index 000000000..d7aa4bde1
--- /dev/null
+++ b/2216/CH13/EX13.2/ex_13_2.sce
@@ -0,0 +1,14 @@
+//Example 13.2: phase change
+clc;
+clear;
+close;
+format('v',6)
+//given data :
+n=1.45;// index of core
+a=10^-5;// in C^-1
+b=5.1*10^-7;// in C^-1
+lamda=.633*10^-6;// in m
+// formula:- (1/L)*(del_fi/del_T)=((2*PI)/lamda)[(n/L)*(del_L/del_T)+(del_n/del_T)]
+//let we assume a=del_n/del_T, b=(1/L)*(del_L/del_T), c=(1/L)*(del_fi/del_T)
+c=((2*%pi)/lamda)*((n*b)+a);
+disp(c,"phase change,(rad/m°C) = ")
diff --git a/2216/CH13/EX13.3/ex_13_3.sce b/2216/CH13/EX13.3/ex_13_3.sce
new file mode 100755
index 000000000..9e83d80c6
--- /dev/null
+++ b/2216/CH13/EX13.3/ex_13_3.sce
@@ -0,0 +1,13 @@
+//Example 13.3: phase shift
+clc;
+clear;
+close;
+//given data :
+format('e',9)
+L=500;// in m
+D=0.1;//in m
+ohm=7.3*10^-5;// in rad s^-1
+lamda=0.85*10^-6;// in m
+c=3*10^8;// in m/s
+del_fi=(2*%pi*L*D*ohm)/(c*lamda);
+disp(del_fi,"phase shift,del_fi(rad) = ")
diff --git a/2216/CH14/EX14.1/ex_14_1.sce b/2216/CH14/EX14.1/ex_14_1.sce
new file mode 100755
index 000000000..9cc8f842e
--- /dev/null
+++ b/2216/CH14/EX14.1/ex_14_1.sce
@@ -0,0 +1,22 @@
+//Example 14.1: energy and threshold electrical energy
+clc;
+clear;
+close;
+format('v',4)
+disp("part (a)")
+no=1.9*10^19;//cm^-3;//
+hc=6.6*10^-34;//
+v=5.45*10^14;//Hz
+av=2;//
+nv=1;//
+n2=no/2;//
+eng=((n2*hc*v)/(av*nv));// J cm^-2
+disp(eng,"energy in J cm^-2 is")
+format('v',5)
+disp("part (b)")
+oe=0.50;//
+mr=0.15;//
+lr=0.20;//
+teng=eng/(oe*mr*lr);//
+disp(teng,"threshold energy in J cm^-2 is")
+//electrical energy is calculated wrong in the textbook
diff --git a/2216/CH14/EX14.3/ex_14_3.sce b/2216/CH14/EX14.3/ex_14_3.sce
new file mode 100755
index 000000000..383debcbb
--- /dev/null
+++ b/2216/CH14/EX14.3/ex_14_3.sce
@@ -0,0 +1,30 @@
+//Example 14.3: output power
+clc;
+clear;
+close;
+h=0.6943*10^-6;//
+lm=10;//in cm
+r1=1.0;//
+r2=0.8;//
+t1=0.98;//
+as=1;//cm^2;//
+Ls=2;//cm
+gth=((1/(2*lm))*log((1/(r1*r2*(t1)^8))))+(as*Ls)/lm;//
+sg=1.5*10^-20;//
+ndth=gth/sg;//cm^-3;//
+nth=ndth*as*lm;//atoms
+ni=5*nth;//atoms
+ng=1.78;//
+ns=2.7;//
+lair=2;//
+c=3*10^10;//
+trt=((2*ng*lm)/c)+((2*ns*Ls)/c)+((2*lair)/c);//seconds
+npmax=((ni-nth)/2)-(nth/2)*log(ni/nth);//photons
+L=14;//cm
+at=((as*Ls)/L)+((1/(2*L))*log(1/(r1*t1^8)));//
+aext=((1/(2*L))*log(1/r2));//
+tp=((trt)/(1-(r1*r2*t1^8*exp(-2*as*Ls))));//seconds
+hc=6.6*10^-34;//
+pmax=((aext/at)*hc*c*npmax)/(h*tp);//in watts
+disp(pmax*10^-6,"maximum power in MW is")
+//answer is wrong in the textbook
diff --git a/2216/CH14/EX14.4/ex_14_4.sce b/2216/CH14/EX14.4/ex_14_4.sce
new file mode 100755
index 000000000..059a6035a
--- /dev/null
+++ b/2216/CH14/EX14.4/ex_14_4.sce
@@ -0,0 +1,22 @@
+//Example 14.4: pulse width and spatial length
+clc;
+clear;
+close;
+format('v',5)
+disp("part (a)")
+//given data :
+del_v=1.5*10^9;// in Hz
+tau_p=1/del_v;
+C=3*10^8;// constant
+disp(tau_p*10^9,"pulse width,del_v(ns) = ")
+Lp=C*tau_p;
+disp(Lp*10^2,"spatial length,Lp(cm) = ")
+//spatial length is calculated wrong in the textbook
+format('v',5)
+disp("part (b)")
+del_v=6*10^10;// in Hz
+tau_p=1/del_v;
+C=3*10^8;// constant
+disp(tau_p*10^12,"pulse width,del_v(ps) = ")
+Lp=C*tau_p*10^3;
+disp(Lp,"spatial length,Lp(mm) = ")
diff --git a/2216/CH14/EX14.5/ex_14_5.sce b/2216/CH14/EX14.5/ex_14_5.sce
new file mode 100755
index 000000000..45efd6941
--- /dev/null
+++ b/2216/CH14/EX14.5/ex_14_5.sce
@@ -0,0 +1,11 @@
+//Example 14.5: time difference
+clc;
+clear;
+close;
+format('v',5)
+n=1.33;//
+x=2;//
+l=50;//m
+c=3*10^8;//m/s
+dt=((n*x*l)/c);//s
+disp(dt*10^6,"time difference is,(micro-seconds)=")
diff --git a/2216/CH2/EX2.1/ex_2_1.sce b/2216/CH2/EX2.1/ex_2_1.sce
new file mode 100755
index 000000000..cc514fbbe
--- /dev/null
+++ b/2216/CH2/EX2.1/ex_2_1.sce
@@ -0,0 +1,23 @@
+//Example 2.1 // NA ,angles and pulse broadning
+clc;
+clear;
+close;
+format('v',9 )
+disp("part (a)")
+n1=1.5;//core refrative index
+n2=1.48;//claddin refractive index
+a=100/2;//radius in micro meter
+na=1;//air refrative index
+NA=sqrt(n1^2-n2^2);//numerical aperture
+disp(NA,"numerical aperture is")
+disp("part (b)")
+am=(asind(NA));//
+tm=asind(NA/n1);//
+tc=asind(n2/n1);//
+disp(am,"angle in degree is (αm)")
+disp(tm,"angle in degree is (Om)")
+disp(tc,"angle in degree is(Φc)")
+disp("part (c)")
+c=3*10^8;//speed of light in m/s
+dtl=((n1/n2)*(n1-n2)/c);//pulse broadning per unit length
+disp(dtl,"pulse broadning per unit length in sm^-1")
diff --git a/2216/CH2/EX2.2/ex_2_2.sce b/2216/CH2/EX2.2/ex_2_2.sce
new file mode 100755
index 000000000..c92ca8229
--- /dev/null
+++ b/2216/CH2/EX2.2/ex_2_2.sce
@@ -0,0 +1,17 @@
+//Example 2.2 // minimum and maximum number of reflections
+clc;
+clear;
+close;
+format('v',5)
+n1=1.5;//core refrative index
+n2=1.48;//claddin refractive index
+a=100/2;//radius in micro meter
+na=1;//air refrative index
+NA=sqrt(n1^2-n2^2);//numerical aperture
+am=(asind(NA));//
+tm=asind(NA/n1);//
+tc=asind(n2/n1);//
+L=((a*10^-6)/(tand(tm)));//length in meter
+x=(1/(2*L));//maximum number of reflections per meter
+disp("all other rays will suffer reflections between these two extremes of "+string(0)+" and "+string(x)+" m^-1")
+//answer is wrong in the textbook
diff --git a/2216/CH2/EX2.3/ex_2_3.sce b/2216/CH2/EX2.3/ex_2_3.sce
new file mode 100755
index 000000000..f3344f789
--- /dev/null
+++ b/2216/CH2/EX2.3/ex_2_3.sce
@@ -0,0 +1,11 @@
+//Example 2.3 // pulse broadning
+clc;
+clear;
+close;
+format('v',6)
+h=0.85;//WAVELENGTH IN MICRO METER
+y=0.035;//spectral width
+c=0.021;//constant
+cl=3;//speed of light in m/s
+dtl=(y/cl)*c;//
+disp(dtl*10^4,"pulse broadning in ns km^-1")
diff --git a/2216/CH2/EX2.4/ex_2_4.sce b/2216/CH2/EX2.4/ex_2_4.sce
new file mode 100755
index 000000000..ed61bfa3d
--- /dev/null
+++ b/2216/CH2/EX2.4/ex_2_4.sce
@@ -0,0 +1,21 @@
+//Example 2.4 // pulse broadning
+clc;
+clear;
+close;
+format('v',6)
+disp("part (a)")
+h=850;//WAVELENGTH IN NANO METER
+l=80;//fiber length in Km
+dh=30;//in Nano Meter
+m1=105.5;//material dispersion for h=850nm in ps/nm-Km
+m2=2.8;//material dispersion for h=1300nm in ps/nm-Km
+t=m1*l*dh*10^-3;//material dispersion in ns when h=850nm
+disp(t,"material dispersion in ns when h=850nm")
+disp("part (b)")
+h=1300;//WAVELENGTH IN NANO METER
+l=80;//fiber length in Km
+dh=30;//in Nano Meter
+m1=105.5;//material dispersion for h=850nm in ps/nm-Km
+m2=2.8;//material dispersion for h=1300nm in ps/nm-Km
+t=m2*l*dh*10^-3;//material dispersion in ns when h=850nm
+disp(t,"material dispersion in ns when h=1300nm")
diff --git a/2216/CH2/EX2.5/ex_2_5.sce b/2216/CH2/EX2.5/ex_2_5.sce
new file mode 100755
index 000000000..ca8b4af2e
--- /dev/null
+++ b/2216/CH2/EX2.5/ex_2_5.sce
@@ -0,0 +1,21 @@
+//Example 2.5; pulse broadning
+clc;
+clear;
+close;
+format('v',6)
+disp("part (a)")
+h=850;//WAVELENGTH IN NANO METER
+l=80;//fiber length in Km
+dh=2;//in Nano Meter
+m1=105.5;//material dispersion for h=850nm in ps/nm-Km
+m2=2.8;//material dispersion for h=1300nm in ps/nm-Km
+t=m1*l*dh*10^-3;//material dispersion in ns when h=850nm
+disp(t,"material dispersion in ns when h=850nm")
+disp("part (b)")
+h=1300;//WAVELENGTH IN NANO METER
+l=80;//fiber length in Km
+dh=2;//in Nano Meter
+m1=105.5;//material dispersion for h=850nm in ps/nm-Km
+m2=2.8;//material dispersion for h=1300nm in ps/nm-Km
+t=m2*l*dh*10^-3;//material dispersion in ns when h=850nm
+disp(t,"material dispersion in ns when h=1300nm")
diff --git a/2216/CH3/EX3.1/ex_3_1.sce b/2216/CH3/EX3.1/ex_3_1.sce
new file mode 100755
index 000000000..8e0a21414
--- /dev/null
+++ b/2216/CH3/EX3.1/ex_3_1.sce
@@ -0,0 +1,14 @@
+//Example 3.1 // range of propagation constants and maximum no. of modes
+clc;
+clear;
+close;
+format('v',9)
+n1=1.5;//core refractive index
+n2=1.49;//cladding refrative index
+t=9.83;//thickness of guided layer in micro meter
+h=0.85;//wavelength in µm
+b1=((2*%pi*n1)/(h*10^-6));//phase propagation constant in m^-1
+b2=((2*%pi*n2)/(h*10^-6));//phase propagation constant in m^-1
+m=((4*t)/h)*(sqrt(n1^2-n2^2));//number of modes
+disp("range of propagation constant is "+string(b1)+" to "+string(b2)+" in m^-1")
+disp(round(m/2),"number of modes are")
diff --git a/2216/CH3/EX3.2/ex_3_2.sce b/2216/CH3/EX3.2/ex_3_2.sce
new file mode 100755
index 000000000..98e08717f
--- /dev/null
+++ b/2216/CH3/EX3.2/ex_3_2.sce
@@ -0,0 +1,10 @@
+//Example 3.2 // thickness
+clc;
+clear;
+close;
+format('v',6)
+n1=3.6;//core refractive index
+n2=3.56;//cladding refrative index
+h=0.85;//wavelength in µm
+a=((h/(2*sqrt(n1^2-n2^2))));//thickness in µm
+disp("thicknes of the slab should not be greater than "+string(a)+" µm")
diff --git a/2216/CH3/EX3.3/ex_3_3.sce b/2216/CH3/EX3.3/ex_3_3.sce
new file mode 100755
index 000000000..c19dc2231
--- /dev/null
+++ b/2216/CH3/EX3.3/ex_3_3.sce
@@ -0,0 +1,60 @@
+//Example 3.3 // no. of modes
+clc;
+clear;
+close;
+format('v',10)
+disp("part (a)")
+n1=1.5;//core refractive index
+n2=1.48;//cladding refrative index
+t=10.11;//thickness of guided layer in micro meter
+h=1.55;//wavelength in µm
+b1=((2*%pi*n1)/(h*10^-6));//phase propagation constant in m^-1
+b2=((2*%pi*n2)/(h*10^-6));//phase propagation constant in m^-1
+m=((2*%pi*t)/h)*(sqrt(n1^2-n2^2));//number of modes
+disp(round(m/2),"number of modes are")
+disp("part (b)")
+n1=1.5;//core refractive index
+n2=1.48;//cladding refrative index
+t1=10.11;//thickness of guided layer in micro meter
+t=t1/2;
+h=1.55;//wavelength in µm
+b1=((2*%pi*n1)/(h*10^-6));//phase propagation constant in m^-1
+b2=((2*%pi*n2)/(h*10^-6));//phase propagation constant in m^-1
+mo=(((2*%pi*t1)/h)*(sqrt(n1^2-n2^2)))/2;//number of modes
+uma0=1.30644;// for m=0 from the curve
+uma1=2.59574;// for m=1 from the curve
+uma2=3.83747;// for m=2 from the curve
+uma3=4.9063;// for m=3 from the curve
+wma0=4.8263;// for m=0 from the curve
+wma1=4.27342;// for m=1 from the curve
+wma2=3.20529;// for m=2 from the curve
+wma3=0.963466;// for m=3 from the curve
+um0=uma0/(t*10^-6);//in m^-1
+um1=uma1/(t*10^-6);//in m^-1
+um2=uma2/(t*10^-6);//in m^-1
+um3=uma3/(t*10^-6);//in m^-1
+wm0=wma0/(t*10^-6);//in m^-1
+wm1=wma1/(t*10^-6);//in m^-1
+wm2=wma2/(t*10^-6);//in m^-1
+wm3=wma3/(t*10^-6);//in m^-1
+bm0=((wm0*t*10^-6)/mo)^2;//for m=0
+bm1=((wm1*t*10^-6)/mo)^2;//for m=1
+bm2=((wm2*t*10^-6)/mo)^2;//for m=2
+bm3=((wm3*t*10^-6)/mo)^2;//for m=3
+m0=sqrt((bm0*(b1^2-b2^2))+b2^2);//for m=0 in m^-1
+m1=sqrt((bm1*(b1^2-b2^2))+b2^2);//for m=1 in m^-1
+m2=sqrt((bm2*(b1^2-b2^2))+b2^2);//for m=2 in m^-1
+m3=sqrt((bm3*(b1^2-b2^2))+b2^2);//for m=3 in m^-1
+params = [" " "m" "um[m^-1]" "wm[m^-1]" "bm" ];
+m = ["0" "1" "2" "3"]';
+um = ["um0" "um1" "um2" "um3"]';
+wm = string([22.41 11.77 33.41 4.24]');
+bm = string([26 19 22 17]');
+params = ["m" "um[m^-1]" "wm[m^-1]" "bm" "ßm[m^-1]" ];
+city=string([0 1 2 3]');
+towns = string([um0 um1 um2 um3]');
+country = string([wm0 wm1 wm2 wm3]');
+ pop = string([bm0 bm1 bm2 bm3]');
+ temp = string([m0 m1 m2 m3]');
+ table = [params; [ city towns country pop temp ]]
+ disp(table ,"constants are :")
diff --git a/2216/CH3/EX3.4/ex_3_4.sce b/2216/CH3/EX3.4/ex_3_4.sce
new file mode 100755
index 000000000..30d350158
--- /dev/null
+++ b/2216/CH3/EX3.4/ex_3_4.sce
@@ -0,0 +1,13 @@
+//Example 3.4 //G factor
+clc;
+clear;
+close;
+format('v',10)
+d=0.793;//in micro meter
+v=%pi/2;//point of intersection
+ua=0.934;//
+wa=1.262;//
+Y=(wa*(1+(sind(ua))*(cosd(ua))/ua));//
+G=(1+((cosd(ua))^2)/Y)^(-1);//
+disp(G,"G factor is")
+//answer is wrong in the textbook
diff --git a/2216/CH4/EX4.1/ex_4_1.sce b/2216/CH4/EX4.1/ex_4_1.sce
new file mode 100755
index 000000000..50c3c2ed2
--- /dev/null
+++ b/2216/CH4/EX4.1/ex_4_1.sce
@@ -0,0 +1,30 @@
+//Example 4.1;//normalised frequency,propagation constants and phase velocity
+clc;
+clear;
+close;
+format('v',5)
+disp("part (a)")
+n1=1.46;//core refrative index
+di=7.2;//core diameter
+n=1.46;//core refrative index
+d=1;//relative differnce
+h=1.55 ;// in micro meter
+v=((2*%pi*(di*10^-6)/2)*n*sqrt(2*(d/100)))/(h*10^-6);//normalised frequency parameter
+disp(v,"normalised frequency parameter is")
+disp("part (b)")
+format('e',11)
+b1=(2*%pi*n1)/(h*10^-6);// in m^-1
+n2=n1-(d/100);//cladding refrative index
+b2=(2*%pi*n2)/(h*10^-6);// in m^-1
+bo1=0.82;//
+b11=0.18;//
+B01=(b2^2+(bo1*(b1^2-b2^2)))^(1/2);//
+B11=(b2^2+(b11*(b1^2-b2^2)))^(1/2);//
+disp("propogation constants are Bo1 "+string(B01)+" and B11 "+string(B11)+" ")
+//propogation constants are calculated wrong in the text bOOK
+disp("part (c)")
+format('e',9)
+c=3*10^8;// in ms^-1
+vp1=(2*%pi*c)/(h*10^-6*B01);//IN MS^-1
+vp2=(2*%pi*c)/(h*10^-6*B11);//IN MS^-1
+disp("phase velocity are (Vp)01 "+string(vp1)+" ms^-1 and (Vp)11 "+string(vp2)+" ms^-1 ")
diff --git a/2216/CH4/EX4.2/ex_4_2.sce b/2216/CH4/EX4.2/ex_4_2.sce
new file mode 100755
index 000000000..8bc34fc20
--- /dev/null
+++ b/2216/CH4/EX4.2/ex_4_2.sce
@@ -0,0 +1,9 @@
+//Example 4.2;//frational power
+clc;
+clear;
+close;
+format('v',4)
+p01=0.11;//from the graph
+p11=0.347;//from the graph
+disp(p01*100,"power for LP01 mode is (%) ")
+disp(p11*100,"power for LP11 mode is (%)" )
diff --git a/2216/CH4/EX4.3/ex_4_3.sce b/2216/CH4/EX4.3/ex_4_3.sce
new file mode 100755
index 000000000..817557070
--- /dev/null
+++ b/2216/CH4/EX4.3/ex_4_3.sce
@@ -0,0 +1,11 @@
+// Example 4.3:Number of the modes
+clc;
+clear;
+close;
+format('v',6)
+h= 0.85;// Wavelenght in micrometers
+a= 50;// Core radius in micrometers
+NA=0.17;//
+v1=(2*%pi*a*NA)/h;
+m2= round((v1^2)/2);
+disp(m2,"Number of modes")
diff --git a/2216/CH4/EX4.4/ex_4_4.sce b/2216/CH4/EX4.4/ex_4_4.sce
new file mode 100755
index 000000000..5d3d4104c
--- /dev/null
+++ b/2216/CH4/EX4.4/ex_4_4.sce
@@ -0,0 +1,12 @@
+// Example 4.4:core diameter
+clc;
+clear;
+close;
+format('v',4)
+d=0.02;//difference
+n1=1.5;//core refrative index
+m=1000;// number of modes
+h= 1.3;// Wavelenght in micrometers
+a=((h/(%pi*n1))*(m/d)^(1/2));//core diamter in micro meter
+disp(a,"core diameter in micro meter")
+
diff --git a/2216/CH4/EX4.5/ex_4_5.sce b/2216/CH4/EX4.5/ex_4_5.sce
new file mode 100755
index 000000000..c719fe748
--- /dev/null
+++ b/2216/CH4/EX4.5/ex_4_5.sce
@@ -0,0 +1,15 @@
+// Example 4.5:core diameter
+clc;
+clear;
+close;
+format('v',5)
+d=0.02;//difference
+a1=75;//in micro meter
+n1=1.45;//core refrative index
+m=700;// number of modes
+v=sqrt(4*m);//
+h=((2*%pi*(a1/2)*n1*sqrt(2*(d/100)))/v);//in micro meter
+vc=2.405*sqrt(2);//for single mode fiber
+a=((vc*h)/(%pi*n1*sqrt(2*(d/100))));//core diamter in micro meter
+disp(a,"maximum core diameter in micro meter")
+
diff --git a/2216/CH5/EX5.1/ex_5_1.sce b/2216/CH5/EX5.1/ex_5_1.sce
new file mode 100755
index 000000000..ebe5de136
--- /dev/null
+++ b/2216/CH5/EX5.1/ex_5_1.sce
@@ -0,0 +1,18 @@
+// Example 5.1:w and wp
+clc;
+clear;
+close;
+format('v',7)
+n=1.46;//core refractive index
+d=0.003;//differnce in core-cladding refrative index
+a=4;//core radius in micro meter
+h1=1.30;// inmicro meter
+h2=1.55;//in micro meter
+v1=((2*%pi*(a*10^-6))*n*sqrt(2*(d)))/(h1*10^-6);//normalised frequency parameter
+v2=((2*%pi*(a*10^-6))*n*sqrt(2*(d)))/(h2*10^-6);//normalised frequency parameter
+w1=(a*10^-6)*(0.65+((1.619)/(v1)^(3/2))+(2.879/(v1)^6));//in meter
+wp1=w1-(a*10^-6)*(0.016+((1.567)/(v1)^7));//in micro meter
+w2=(a*10^-6)*(0.65+((1.619)/(v2)^(3/2))+(2.879/(v2)^6));//in meter
+wp2=w2-(a*10^-6)*(0.016+((1.567)/(v2)^7));//in micro meter
+disp(" w is "+string(w1*10^6)+" and wp is "+string(wp1*10^6)+" in micro meter when wavelength is 1.30 micro meter")
+disp(" w is "+string(w2*10^6)+" and wp is "+string(wp2*10^6)+" in micro meter when wavelength is 1.55 micro meter")
diff --git a/2216/CH5/EX5.2/ex_5_2.sce b/2216/CH5/EX5.2/ex_5_2.sce
new file mode 100755
index 000000000..9ef0d025b
--- /dev/null
+++ b/2216/CH5/EX5.2/ex_5_2.sce
@@ -0,0 +1,15 @@
+// Example 5.2;//difference between propogation constant and modal birefringence
+clc;
+clear;
+close;
+format('v',6)
+disp("part (a)")
+bl=10;//beat length in cm
+h=1;//in micro meter
+db=((2*%pi)/(bl*10^-2));//in m^-1
+disp(db,"difference between propogation constant in m^-1")
+disp("part (b)")
+format('v',8)
+mb=db*((h*10^-6)/(2*%pi));//modal birefringence
+disp(mb,"modal birefringence is")
+//answer is approximately equal to the answer in the book
diff --git a/2216/CH5/EX5.3/ex_5_3.sce b/2216/CH5/EX5.3/ex_5_3.sce
new file mode 100755
index 000000000..f9543cb8e
--- /dev/null
+++ b/2216/CH5/EX5.3/ex_5_3.sce
@@ -0,0 +1,21 @@
+// Example 5.3:waveguide dispersion factor
+clc;
+clear;
+close;
+format('v',6)
+n=1.45;//core refractive index
+d=0.003;//differnce in core-cladding refrative index
+n2=1.45*(1-d);//cladding refractive index
+d1=8.2;//core diameter in micro meter
+a=d1/2;//core radius in micro meter
+h1=1.30;// inmicro meter
+h2=1.55;//in micro meter
+v1=(2*%pi*a*n*sqrt(2*d))/h1;//normalised frequency parameter
+v2=((2*%pi*(a))*n*sqrt(2*(d)))/(h2);//normalised frequency parameter
+v1dv=0.080+0.549*(2.834-v1)^2;//
+v2dv=0.080+0.549*(2.834-v2)^2;//
+c=3*10^8;// in m/s
+dw1=-((n2*d*v1dv)/(c*h1))*10^12;//waveguide dispersion factor in ps nm^-1 km^-1
+dw2=-((n2*d*v2dv)/(c*h2))*10^12;//waveguide dispersion factor in ps nm^-1 km^-1
+disp(" waveguide dispersion factor is "+string(dw1)+" in ps nm^-1 km^-1 at wavelength 1.3 micro meter")
+disp(" waveguide dispersion factor is "+string(dw2)+" in ps nm^-1 km^-1 at wavelength 1.55 micro meter")
diff --git a/2216/CH5/EX5.4/ex_5_4.sce b/2216/CH5/EX5.4/ex_5_4.sce
new file mode 100755
index 000000000..72ad573d6
--- /dev/null
+++ b/2216/CH5/EX5.4/ex_5_4.sce
@@ -0,0 +1,15 @@
+// Example 5.4:diameter of the core
+clc;
+clear;
+close;
+format('v',4)
+c=3*10^8;//in m/s
+dm=6;//material dispersion in ps nm^-1 km^-1
+h=1.55;//in micro meter
+n1=1.45;//core refrative index
+d=0.005;//differnce
+n2=n1*(1-d);//cladding refrative index
+x=((-dm/(((-n2*d)/(c*h))*10^12))-0.080)/0.549;//
+v=-(sqrt(x)-2.834);//
+d=((v*h)/(%pi*n1*sqrt(2*d)));//diameter in micro meter
+disp(d,"diameter of the core in micro meter")
diff --git a/2216/CH5/EX5.5/ex_5_5.sce b/2216/CH5/EX5.5/ex_5_5.sce
new file mode 100755
index 000000000..16501e917
--- /dev/null
+++ b/2216/CH5/EX5.5/ex_5_5.sce
@@ -0,0 +1,13 @@
+// Example 5.5:splice loss
+clc;
+clear;
+close;
+format('v',5)
+h1=1.30;//in micro meter
+wp1=4.6155;//in micro meter
+h2=1.55;//in micro meter
+wp2=5.355;//in micro meter
+sl1=4.34*(1/wp1)^2;//splice loss in dB
+sl2=4.34*(1/wp2)^2;//splice loss in dB
+disp(sl1,"splice loss in dB when wavelength is 1.30 micro meter")
+disp(sl2,"splice loss in dB when wavelength is 1.55 micro meter")
diff --git a/2216/CH6/EX6.1/ex_6_1.sce b/2216/CH6/EX6.1/ex_6_1.sce
new file mode 100755
index 000000000..aab9f619b
--- /dev/null
+++ b/2216/CH6/EX6.1/ex_6_1.sce
@@ -0,0 +1,11 @@
+// Example 6.1:refractive index
+clc;
+clear;
+close;
+format('v',5)
+l=0.47;//in db
+nf=10^((l/-10));//
+x=poly(0,"x");
+p=1+-2.22*x+x^2;//
+y=roots(p);//
+disp(y(1,1),"refractive index is")
diff --git a/2216/CH6/EX6.2/ex_6_2.sce b/2216/CH6/EX6.2/ex_6_2.sce
new file mode 100755
index 000000000..5bde9cc0c
--- /dev/null
+++ b/2216/CH6/EX6.2/ex_6_2.sce
@@ -0,0 +1,29 @@
+// Example 6.2:loss
+clc;
+clear;
+close;
+disp("part (a)")
+format('v',5)
+dya=0.1;//
+n1=1.50;//refrative index
+na=1;//
+k1=n1/n1;//
+k2=1;//
+nf=((16*(n1)^2)/((n1+1)^4));//
+nlat=(2/(3.14))*(acos(dya/2)-(dya/2)*(1-(dya/2)^2)^(1/2));//
+nt=nf*nlat;//
+lt=(-10*log10(nt));//in dB
+disp(lt,"insertion loss at the joint in dB is")
+disp("part (b)")
+format('v',6)
+dya=0.1;//
+n1=1.50;//refrative index
+na=1;//
+k1=n1/n1;//
+k2=1;//
+nf=((16*(n1)^2)/((n1+1)^4));//
+nlat=(2/(%pi))*(acos(dya/2)-(dya/2)*(1-(dya/2)^2)^(1/2));//
+nt=k2*nlat;//
+lt=(-10*log10(nt));//in dB
+disp(lt,"insertion loss at the joint in dB is")
+
diff --git a/2216/CH6/EX6.3/ex_6_3.sce b/2216/CH6/EX6.3/ex_6_3.sce
new file mode 100755
index 000000000..85aa9ebe3
--- /dev/null
+++ b/2216/CH6/EX6.3/ex_6_3.sce
@@ -0,0 +1,23 @@
+// Example 6.3:loss
+clc;
+clear;
+close;
+format('v',5)
+d=100;//micro meter
+dx=0;//
+dy=3;//in micro mete
+dth=3;//in degree
+dthr=dth*(%pi/180);//
+dya=0.02;//
+n1=1.48;//refrative index
+na=1;//
+k1=n1/n1;//
+k2=1;//
+nf=((16*(n1)^2)/((n1+1)^4));//
+nlat=(2/(%pi))*(acos(dy/100)-(dy/100)*(1-(dy/100)^2)^(1/2));//
+NA=n1*(sqrt(2*dya));//
+nang=((1-(na*dthr)/(%pi*NA)));//
+nt=nf*nlat*nang;//
+lt=(-10*log10(nt));//in dB
+disp(lt,"total loss in dB is")
+
diff --git a/2216/CH6/EX6.4/ex_6_4.sce b/2216/CH6/EX6.4/ex_6_4.sce
new file mode 100755
index 000000000..bb894d831
--- /dev/null
+++ b/2216/CH6/EX6.4/ex_6_4.sce
@@ -0,0 +1,18 @@
+// Example 6.4:loss
+clc;
+clear;
+close;
+format('v',8)
+d1=80;//micro meter
+na1=0.25;//
+alpha1=2;//
+d2=60;//in micro meter
+na2=0.21;//
+alpha2=1.9;//
+ncd=(d2/d1)^2;//
+nna=(na2/na1)^2;//
+nalpha=((1+(2/alpha1))/(1+((2/alpha2))));//
+nt=ncd*nna*nalpha;//
+lt=(-10*log10(nt));//in dB
+disp(lt,"total loss in dB is")
+
diff --git a/2216/CH6/EX6.5/ex_6_5.sce b/2216/CH6/EX6.5/ex_6_5.sce
new file mode 100755
index 000000000..a688f1cc0
--- /dev/null
+++ b/2216/CH6/EX6.5/ex_6_5.sce
@@ -0,0 +1,24 @@
+// Example 6.5:loss
+clc;
+clear;
+close;
+format('v',5)
+d1=60;//micro meter
+na1=0.25;//
+alpha1=2.1;//
+d2=50;//in micro meter
+na2=0.20;//
+alpha2=1.9;//
+ncd=(d2/d1)^2;//
+nna=(na2/na1)^2;//
+nalpha1=1;//
+nalpha=((1+(2/alpha1))/(1+((2/alpha2))));//
+ncd1=1;//
+nna1=1;//
+nt=ncd*nna*nalpha1;//
+ltf=(-10*log10(nt));//in dB
+nt1=ncd1*nna1*nalpha;//
+ltb=(-10*log10(nt1));//in dB
+disp(ltf,"total loss forward direction in dB is")
+format('v',6)
+disp(ltb,"total loss backward direction in dB is")
diff --git a/2216/CH7/EX7.1/ex_7_1.sce b/2216/CH7/EX7.1/ex_7_1.sce
new file mode 100755
index 000000000..6764caec5
--- /dev/null
+++ b/2216/CH7/EX7.1/ex_7_1.sce
@@ -0,0 +1,16 @@
+//Example 7.1: Intrinsic carrier
+clc;
+clear;
+close;
+//given data :
+format('v',9)
+m=9.11*10^-31;// in kg
+k=1.38*10^-23;// in JK^-1
+h=6.626*10^-34;// in Js
+ev=1.6*10^-19;// in J
+T=300;// in K
+me=0.07*m;// in kg
+mh=0.56*m;// in kg
+Eg=1.43*ev;// in J
+ni=2*((2*%pi*k*T)/h^2)^(3/2)*(me*mh)^(3/4)*exp(-Eg/(2*k*T));
+disp(ni,"Intrinsic carrier concentration ,ni(m^-3) = ")
diff --git a/2216/CH7/EX7.2/ex_7_2.sce b/2216/CH7/EX7.2/ex_7_2.sce
new file mode 100755
index 000000000..fc90686d9
--- /dev/null
+++ b/2216/CH7/EX7.2/ex_7_2.sce
@@ -0,0 +1,15 @@
+//Example 7.2: Diffusion potential
+clc;
+clear;
+close;
+format('v',6)
+//given data :
+Na=5*10^23;// in m^-3
+Nd=5*10^21;// in m^-3
+T=300;// in K
+e=1.6*10^-19;// in J
+k=1.38*10^-23;// in JK^-1
+V=(k*T)/e;
+ni=2.2*10^12;// in m^-3
+Vd=V*log((Na*Nd)/ni^2);
+disp(Vd,"Diffusion potential,Vd(V) = ")
diff --git a/2216/CH7/EX7.3/ex_7_3.sce b/2216/CH7/EX7.3/ex_7_3.sce
new file mode 100755
index 000000000..636b26f0f
--- /dev/null
+++ b/2216/CH7/EX7.3/ex_7_3.sce
@@ -0,0 +1,19 @@
+//Example 7.3: Injection efficiency
+clc;
+clear;
+close;
+format('v',7)
+//given data :
+Na=10^23;// in m^-3
+Nd=10^21;// in m^-3
+T=300;// in K
+e=1.6*10^-19;// in J
+k=1.38*10^-23;// in JK^-1
+mue=0.85;// in m^2V^-1s^-1
+muh=0.04;// in m^2V^-1s^-1
+De=(mue*k*T)/e;// in m^2s^-1
+Dh=(muh*k*T)/e;// in m^2s^-1
+Le=1;
+Lh=Le;
+eta_inj=1/(1+((De/Dh)*(Lh/Le)*(Nd/Na)));
+disp(eta_inj,"Injection efficiency,eta_inj = ")
diff --git a/2216/CH7/EX7.4/ex_7_4.sce b/2216/CH7/EX7.4/ex_7_4.sce
new file mode 100755
index 000000000..8a938b161
--- /dev/null
+++ b/2216/CH7/EX7.4/ex_7_4.sce
@@ -0,0 +1,18 @@
+//Example 7.4: Internal and quantum efficiency
+clc;
+clear;
+close;
+//given data :
+format('v',4)
+disp("part (a)")
+tau_rr=1;
+tau_nr=tau_rr;
+eta_int=1/(1+(tau_rr/tau_nr));
+disp(eta_int,"Internal quantum efficiency = ")
+disp("part (b)")
+format('v',7)
+ns=3.7;
+na=1.5;
+as=0;
+eta_ext=eta_int*(1-as)*((2*na^3)/(ns*(ns+na)^2));
+disp(eta_ext,"External quantum efficiency = ")
diff --git a/2216/CH7/EX7.5/ex_7_5.sce b/2216/CH7/EX7.5/ex_7_5.sce
new file mode 100755
index 000000000..87e8bfa3d
--- /dev/null
+++ b/2216/CH7/EX7.5/ex_7_5.sce
@@ -0,0 +1,11 @@
+//Example 7.5: The number of longitudinal modes excited
+clc;
+clear;
+close;
+format('e',10)
+//given data :
+lamda=632.8*10^-9;// in m
+n=1;
+L=20*10^-2;// in m
+del_lamda=((lamda)^2/(2*n*L))*10^9;
+disp(del_lamda,"The number of longitudinal modes excited,(nm) = ")
diff --git a/2216/CH7/EX7.6/ex_7_6.sce b/2216/CH7/EX7.6/ex_7_6.sce
new file mode 100755
index 000000000..86cc902cd
--- /dev/null
+++ b/2216/CH7/EX7.6/ex_7_6.sce
@@ -0,0 +1,20 @@
+//Example 7.6: The reduction and Differential quantum efficiency
+clc;
+clear;
+close;
+//given data :
+format('v',5)
+disp("part (a)")
+alfa_eff=1.5;// in mm^-1
+gama=0.8;
+L=0.5;// in mm
+R1=0.35;
+R2=R1;
+R2a=1.0;
+g_th1=(1/gama)*(alfa_eff+(1/(2*L))*log(1/(R1*R2)));
+g_th2=(1/gama)*(alfa_eff+(1/(2*L))*log(1/(R1*R2a)));
+del_gth=g_th1-g_th2;
+disp(del_gth,"The reduction in threshold gain ,(mm^-1) = ")
+disp("part (b)")
+eta_D=(gama*(g_th2-alfa_eff))/(g_th2);
+disp(eta_D,"Differential quantum efficiency = ")
diff --git a/2216/CH7/EX7.7/ex_7_7.sce b/2216/CH7/EX7.7/ex_7_7.sce
new file mode 100755
index 000000000..6204ac140
--- /dev/null
+++ b/2216/CH7/EX7.7/ex_7_7.sce
@@ -0,0 +1,43 @@
+//Example 7.7: Internal and external power efficiency
+clc;
+clear;
+close;
+//given data :
+disp("part (a)")
+as=0;//
+ns=3.7;// assuming that the example 7.4
+eta_int=0.50;// internal efficiency
+V=1.5;// in V
+I=120*10^-3;// in A
+IBYe=120*10^-3;//
+Eph=1.43;// in eV
+eta_int=0.50;// internal efficiency
+fi_int=eta_int*IBYe*Eph;
+t_power=I*V;
+P_int=fi_int/t_power;
+disp(P_int,"The internal power efficiency = ")
+disp("part (b)")
+format('v',6)
+eta_ext=eta_int*(1-as)*2/(ns*(ns+1)^2);
+fi_ext=eta_ext*IBYe*Eph;
+t_power=I*V;
+P_ext=fi_ext/t_power;
+disp(P_ext,"The external power efficiency = ")
+disp("part (c)")
+format('e',9)
+V=1.5;// in V
+I=120*10^-3;// in A
+IBYe=120*10^-3;//
+Eph=1.43;// in eV
+n1=1.5;
+n2=1.48;
+na=n1;
+eta_ext=0.0337;
+eta_T=eta_ext*((n1^2-n2^2)/na^2);
+fi_T=eta_T*IBYe*Eph;
+t_power=I*V;
+sfpc=fi_T/t_power;
+O_loss=-10*log10(sfpc);
+disp(sfpc,"The overall source fiber power coupling efficiency = ")
+format('v',5)
+disp(O_loss,"The optical loss,(dB) = ")
diff --git a/2216/CH8/EX8.1/ex_8_1.sce b/2216/CH8/EX8.1/ex_8_1.sce
new file mode 100755
index 000000000..493a78c02
--- /dev/null
+++ b/2216/CH8/EX8.1/ex_8_1.sce
@@ -0,0 +1,20 @@
+//Example 8.1: The photon energy and optical power
+clc;
+clear;
+close;
+//given data :
+format('v',5)
+disp("part (a)")
+h=6.626*10^-34;// in Js
+c=3*10^8;// in ms^-1
+E=1.52*10^-19;// in J
+lamda=((h*c)/E)*10^6;
+disp(lamda,"The photon energy,(micro-m) = ")
+disp("part (b)")
+e=1.6*10^-19;// in J
+Ip=3*10^6;// in A
+E=1.52*10^-19;// in J
+eta=70/100;
+R=(eta*e)/E;
+P_in=(Ip/R)*10^-6;
+disp(P_in,"The optical power,(micro W)")
diff --git a/2216/CH8/EX8.2/ex_8_2.sce b/2216/CH8/EX8.2/ex_8_2.sce
new file mode 100755
index 000000000..b8251bf8a
--- /dev/null
+++ b/2216/CH8/EX8.2/ex_8_2.sce
@@ -0,0 +1,30 @@
+//Example 8.2: The quantum efficiency,Maximum possible band gap energy and mean output
+clc;
+clear;
+close;
+//given data :
+disp("part (a)")
+format('v',5)
+e=1;// electron
+p=2;// photon
+eta=(e/p)*100;
+disp(eta,"The quantum efficiency,eta(%) = ")
+disp("part (b)")
+h=6.626*10^-34;//in Js
+c=3*10^8;// in m s^-1
+lamda_c=0.85*10^-6;// in m
+Eg=((h*c)/lamda_c)/1.6*10^19;
+disp(Eg,"Maximum possible band gap energy,Eg(eV) = ")
+disp("part (c)")
+e=1;// electron
+p=2;// photon
+eta=(e/p);
+e=1.6*10^-19;// in J
+h=6.626*10^-34;//in Js
+c=3*10^8;// in m s^-1
+lamda_c=0.85*10^-6;// in m
+Eg=((h*c)/lamda_c);
+P_in=10*10^-6;// in W
+Ip=((eta*e*P_in)/Eg)*10^6;
+disp(Ip,"The mean output,Ip(micro A) = ")
+
diff --git a/2216/CH8/EX8.3/ex_8_3.sce b/2216/CH8/EX8.3/ex_8_3.sce
new file mode 100755
index 000000000..630c1ae35
--- /dev/null
+++ b/2216/CH8/EX8.3/ex_8_3.sce
@@ -0,0 +1,21 @@
+//Example 8.3: The quantum efficiency and The responsivity of the diode
+clc;
+clear;
+close;
+//given data :
+format('v',5)
+disp("part (a)")
+e=2*10^10;// in s^-1
+p=5*10^10;// in s^-1
+eta=e/p;
+disp(eta,"The quantum efficiency = ")
+disp("part (b)")
+e=2*10^10;// in s^-1
+p=5*10^10;// in s^-1
+eta=e/p;
+e=1.6*10^-19;// in J
+h=6.626*10^-34;//in Js
+c=3*10^8;// in m s^-1
+lamda=0.90*10^-6;// in m
+R=(eta*e*lamda)/(h*c);
+disp(R,"The responsivity of the diode,R(AW^-1) = ")
diff --git a/2216/CH8/EX8.4/ex_8_4.sce b/2216/CH8/EX8.4/ex_8_4.sce
new file mode 100755
index 000000000..648d9dc6f
--- /dev/null
+++ b/2216/CH8/EX8.4/ex_8_4.sce
@@ -0,0 +1,15 @@
+//Example 8.4: The multiplication
+clc;
+clear;
+close;
+format('v',5)
+//given data :
+eta=40/100;//
+e=1.6*10^-19;// in J
+h=6.626*10^-34;//in Js
+c=3*10^8;// in m s^-1
+lamda=1.3*10^-6;// in m
+P_in=0.3*10^-6;// in W
+I=6*10^-6;// in A
+M=(I*h*c)/(P_in*eta*e*lamda);
+disp(M,"The multiplication factor,M = ")
diff --git a/2216/CH8/EX8.5/ex_8_5.sce b/2216/CH8/EX8.5/ex_8_5.sce
new file mode 100755
index 000000000..ab38fbadb
--- /dev/null
+++ b/2216/CH8/EX8.5/ex_8_5.sce
@@ -0,0 +1,12 @@
+//Example 8.5: Photon rate
+clc;
+clear;
+close;
+//given data :
+format('v',9)
+e=1.6*10^-19;// in J
+M=800;
+eta=90/100;// quantum efficiency
+I=2*10^-9;// in A
+P_rate=I/(e*eta*M);
+disp(P_rate,"Photon incident rate(s^-1) = ")
diff --git a/2216/CH8/EX8.6/ex_8_6.sce b/2216/CH8/EX8.6/ex_8_6.sce
new file mode 100755
index 000000000..b0de7db9d
--- /dev/null
+++ b/2216/CH8/EX8.6/ex_8_6.sce
@@ -0,0 +1,24 @@
+//Example 8.6: Gain and The output photocurrent
+clc;
+clear;
+close;
+//given data :
+format('v',6)
+disp("part (a)")
+tf=6*10^-12;// in s
+del_f=450*10^6;// in Hz
+G=1/(2*%pi*tf*del_f);
+disp(G,"the gain = ")
+disp("part (b)")
+format('e',10)
+tf=6*10^-12;// in s
+del_f=450*10^6;// in Hz
+G=1/(2*%pi*tf*del_f);
+eta=75/100;
+P_in=5*10^-6;// in W
+e=1.6*10^-19;// in J
+lamda=1.3*10^-6;
+h=6.626*10^-34;//in Js
+c=3*10^8;// in m s^-1
+I=(G*eta*P_in*e*lamda)/(h*c);
+disp(I,"The output photo-current,I(A)")
diff --git a/2216/CH8/EX8.7/ex_8_7.sce b/2216/CH8/EX8.7/ex_8_7.sce
new file mode 100755
index 000000000..b61b11889
--- /dev/null
+++ b/2216/CH8/EX8.7/ex_8_7.sce
@@ -0,0 +1,54 @@
+//Example 8.7: rms value of shot noise ,dark noise and thermal noise current and S/N ratio
+clc;
+clear;
+close;
+format('v',6)
+disp("part (a)")
+n=0.7;//efficiency
+e=1.6*10^-19;//charge
+h=1.3;//in micro meter
+hc=6.626*10^-34;//plack constant
+c=3*10^8;//m/s
+pin=500;//nW
+Ip=((n*e*h*10^-6*pin*10^-9)/(hc*c));//in amperes
+df=25;//Mhz
+f1=1;//
+is2=(2*e*Ip*df*10^6*f1);//
+is=sqrt(is2);//in amperes
+Id=5*10^-9;//amperes
+id2=(2*e*Id*df*10^6);//
+id=sqrt(id2);//in amperes
+k=1.38*10^-23;//
+t=300;//in kelvin
+rl=1000;//ohms
+it2=((4*k*t*df*10^6)/rl);//
+it=sqrt(it2);//in amperes
+disp(is*10^9,"rms value of shot noise current is,(nA)=")
+disp(id*10^9,"rms value of dark current is,(nA)=")
+disp(it*10^9,"rms value of thermal noise current is,(nA)=")
+format('v',4)
+disp("part (b)")
+n=0.7;//efficiency
+e=1.6*10^-19;//charge
+h=1.3;//in micro meter
+hc=6.626*10^-34;//plack constant
+c=3*10^8;//m/s
+pin=500;//nW
+Ip=((n*e*h*10^-6*pin*10^-9)/(hc*c));//in amperes
+df=25;//Mhz
+f1=1;//
+is2=(2*e*Ip*df*10^6*f1);//
+is=sqrt(is2);//in amperes
+Id=5*10^-9;//amperes
+id2=(2*e*Id*df*10^6);//
+id=sqrt(id2);//in amperes
+k=1.38*10^-23;//
+t=300;//in kelvin
+rl=1000;//ohms
+it2=((4*k*t*df*10^6)/rl);//
+it=sqrt(it2);//in amperes
+itt2=is2+id2+it2;//in A^2
+ip2=Ip^2;//
+sn=ip2/itt2;//
+disp(sn,"S/N ratio is")
+//S/N ratio is calculated wrong in the textbook
diff --git a/2216/CH9/EX9.1/ex_9_1.sce b/2216/CH9/EX9.1/ex_9_1.sce
new file mode 100755
index 000000000..ce70445c4
--- /dev/null
+++ b/2216/CH9/EX9.1/ex_9_1.sce
@@ -0,0 +1,11 @@
+//Example 9.1: The thickness
+clc;
+clear;
+close;
+format('v',7)
+//given data :
+lamda=589.3*10^-9;// in m
+ne=1.553;
+no=1.544;
+x=(lamda/(4*(ne-no)))*10^3;
+disp(x,"The thickness of the a quarter wave plate,x(mm) = ")
diff --git a/2216/CH9/EX9.2/ex_9_2.sce b/2216/CH9/EX9.2/ex_9_2.sce
new file mode 100755
index 000000000..542cc876a
--- /dev/null
+++ b/2216/CH9/EX9.2/ex_9_2.sce
@@ -0,0 +1,11 @@
+//Example 9.2: The thickness
+clc;
+clear;
+close;
+//given data :
+format('v',7)
+lamda=589.3*10^-9;// in m
+ne=1.486;
+no=1.658;
+x=(lamda/(2*(no-ne)))*10^3;
+disp(x,"The thickness of the a quarter wave plate,x(mm) = ")
diff --git a/2216/CH9/EX9.3/ex_9_3.sce b/2216/CH9/EX9.3/ex_9_3.sce
new file mode 100755
index 000000000..6ff3343f7
--- /dev/null
+++ b/2216/CH9/EX9.3/ex_9_3.sce
@@ -0,0 +1,20 @@
+//Example 9.3:change in refractive index ,net phase shiftand Vpi
+clc;
+clear;
+close;
+format('v',6)
+v=5;//kV
+l=1;//cm
+ez=(v*10^3)/(l*10^-2);//in V/m
+no=1.51;//
+r63=10.5*10^-12;//m/V
+dn=((1/2)*no^3*r63*ez);//
+h=550;//nm
+dfi=((2*%pi*dn*l*10^-2)/(h*10^-9));//
+fi=2*dfi;//
+vpi=((h*10^-9)/(2*no^3*r63))*10^-3;//kV
+disp(dfi,"change in refrative index is")
+disp(fi,"net phase shift is")
+format('v',4)
+disp(vpi,"Vpi in kV is")
+//refractive index and phase shift is in the form of pi in the textbook
diff --git a/2216/CH9/EX9.4/ex_9_4.sce b/2216/CH9/EX9.4/ex_9_4.sce
new file mode 100755
index 000000000..5b4f232e8
--- /dev/null
+++ b/2216/CH9/EX9.4/ex_9_4.sce
@@ -0,0 +1,29 @@
+//Example 9.4:phase difference,additional phase difference and Vpi
+clc;
+clear;
+close;
+format('v',7)
+disp("part (a)")
+h=550;//nm
+l=3;//cm
+no=1.51;//
+ne=1.47;//
+dfi=((2*%pi*l*10^-2*(no-ne))/(h*10^-9));//
+disp(dfi,"phase differnce is")
+//phase difference is in the form of pi in the textbook
+disp("part (b)")
+no=1.51;//
+r63=26.4*10^-12;//m/V
+V=200;//
+d=0.25;//cm
+dfi=((%pi*r63*no^3*(V)*(l*10^-2))/(h*10^-9*d*10^-2));//
+disp(dfi,"additional phase differnce is")
+//additional phase difference is in the form of pi in the textbook
+disp("part (c)")
+r63=26.4*10^-12;//m/V
+format('v',5)
+V=200;//
+d=0.25;//cm
+dfi=((%pi*r63*no^3*(V)*(l*10^-2))/(h*10^-9*d*10^-2));//
+vpi=((h*10^-9)/(no^3*r63))*(d/l);//V
+disp(vpi,"Vpi in V is")
diff --git a/2216/CH9/EX9.5/ex_9_5.sce b/2216/CH9/EX9.5/ex_9_5.sce
new file mode 100755
index 000000000..0100d36e1
--- /dev/null
+++ b/2216/CH9/EX9.5/ex_9_5.sce
@@ -0,0 +1,23 @@
+//Example 9.5: angle and relative intensity
+clc;
+clear;
+close;
+//given data :
+disp("part (a)")
+format('v',5)
+m=1;
+l=633*10^-9;// in m
+f=5*10^6;// in Hz
+v=1500;//in m/s
+n=1.33;// for water
+A=v/f;
+theta=asind((l/(n*A)));
+disp(theta,"angle (degree) = ")
+disp("part (b)")
+format('v',6)
+del_n=10^-5;
+L=1*10^-2;// in m
+lamda=633*10^-9;// in m
+eta=(%pi^2*del_n^2*L^2)/lamda^2;
+disp(eta,"The relative intensity = ")
+