diff options
author | Trupti Kini | 2016-03-20 23:30:12 +0600 |
---|---|---|
committer | Trupti Kini | 2016-03-20 23:30:12 +0600 |
commit | 03dcbf0b11d1414a91d838aded9e61a307a74b0b (patch) | |
tree | 445e5ee8a5202c58271064b7af892fb129cea16c /sample_notebooks | |
parent | fbf7bfe3ae79ca0913b5ed72666546284798450b (diff) | |
download | Python-Textbook-Companions-03dcbf0b11d1414a91d838aded9e61a307a74b0b.tar.gz Python-Textbook-Companions-03dcbf0b11d1414a91d838aded9e61a307a74b0b.tar.bz2 Python-Textbook-Companions-03dcbf0b11d1414a91d838aded9e61a307a74b0b.zip |
Added(A)/Deleted(D) following books
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/Chapter1__1.ipynb
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/Chapter2_2.ipynb
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/Chapter3_2.ipynb
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/Chapter4&5_2.ipynb
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/Chapter6_2.ipynb
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/Chapter7_2.ipynb
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/Chapter8_2.ipynb
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/Chapter9_2.ipynb
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/screenshots/Screenshot_(1)_2.png
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/screenshots/Screenshot_(2)_2.png
A Engineering_Physics_by_Prabir_K_Basu_&_Hrishikesh_Dhasmana/screenshots/Screenshot_(3)_2.png
A sample_notebooks/Hrituraj/Ch-6.ipynb
A "sample_notebooks/Nitin Kumar/Chap3.ipynb"
A sample_notebooks/SaleemAhmed/Chapter10.ipynb
A sample_notebooks/VineshSaini/Ch1.ipynb
Diffstat (limited to 'sample_notebooks')
-rw-r--r-- | sample_notebooks/Hrituraj/Ch-6.ipynb | 540 | ||||
-rw-r--r-- | sample_notebooks/Nitin Kumar/Chap3.ipynb | 390 | ||||
-rw-r--r-- | sample_notebooks/SaleemAhmed/Chapter10.ipynb | 439 | ||||
-rw-r--r-- | sample_notebooks/VineshSaini/Ch1.ipynb | 516 |
4 files changed, 1885 insertions, 0 deletions
diff --git a/sample_notebooks/Hrituraj/Ch-6.ipynb b/sample_notebooks/Hrituraj/Ch-6.ipynb new file mode 100644 index 00000000..63e7e1c5 --- /dev/null +++ b/sample_notebooks/Hrituraj/Ch-6.ipynb @@ -0,0 +1,540 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Ch-6 : Frequency response, bode plots and resonance" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example: 6.1 Page No: 476" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "peak value of Vout = 6.00 volts\n", + "phase angle of Vout = 70.00 degrees\n", + "with frequency equal to = 1000.00\n" + ] + } + ], + "source": [ + "from math import pi, cos, sin, atan, sqrt\n", + "# given V_in(t)=2*cos(2000*pi*t+A), A=40*pi/180\n", + "w=2000*pi# #omega\n", + "f=w/(2*pi)# #frequency\n", + "A=40*pi/180# #40 degrees = %0.2f radians\n", + "#equation of straight line of H_magnitude vs f is x+1000*y-4000=0\n", + "H_max=(4000-f)/1000# #magnitude of H(traansfer function)\n", + "#equation of straight line of H_phase angle vs f is 6000*y=pi*x (phase angle = %0.2f radians)\n", + "H_phi=pi*f/6000# #phase angle of H\n", + "H=H_max*complex(cos(H_phi),sin(H_phi))\n", + "V_in=2*complex(cos(A),sin(A))# #input voltage phasor\n", + "V_out=H*V_in# #output voltage phasor\n", + "V_out_R=(V_out.real)# #real part\n", + "V_out_I=(V_out.imag)# #imaginary part\n", + "V_out_max=sqrt((V_out_R**2)+(V_out_I**2))# #peak value\n", + "V_out_phi=atan(V_out_I/V_out_R)\n", + "print 'peak value of Vout = %0.2f volts'%V_out_max\n", + "print 'phase angle of Vout = %0.2f degrees'%(V_out_phi*180/pi)\n", + "print 'with frequency equal to = %0.2f'%f" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example: 6.2 Page No: 477" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Output voltage is Vout1+Vout2+Vout3 where\n", + "\n", + "FOR Vout1:\n", + "peak value = 12.00 volts\n", + "phase angle = 0.00 degrees\n", + "with frequency = 0.00 hertz\n", + "\n", + "FOR Vout2:\n", + "peak value = 6.00 volts\n", + "phase angle = 30.00 degrees\n", + "with frequency = 1000.00 hertz\n", + "\n", + "FOR Vout3:\n", + "peak value = 2.00 volts\n", + "phase angle = -10.00 degrees\n", + "with frequency = 2000.00 hertz\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "#given V_in(t)=3+2*cos(2000*pi*t)+cos(4000*pi*t-A), A=70*pi/180\n", + "#the three parts of V_in(t) are V_in_1=3, V_in_2=2*cos(2000*pi*t),V_in_3=cos(4000*pi*t-A)\n", + "\n", + "#first component V_1\n", + "V_in_1=3\n", + "f_1=0# #as omega is zero\n", + "#equation of straight line of H_magnitude vs f is x+1000*y-4000=0\n", + "H_1_max=(4000-f_1)/1000# #magnitude of H(traansfer function)\n", + "#equation of straight line of H_phase angle vs f is 6000*y=pi*x (phase angle = %0.2f radians)\n", + "H_1_phi=pi*f_1/6000# #phase angle of H\n", + "H_1=H_1_max*complex(cos(H_1_phi),sin(H_1_phi))\n", + "V_out_1=H_1*V_in_1\n", + "V_out_1_R=(V_out_1).real# #real part\n", + "V_out_1_I=(V_out_1).imag# #imaginary part\n", + "V_out_1_max=sqrt((V_out_1_R**2)+(V_out_1_I**2))# #peak value\n", + "V_out_1_phi=atan(V_out_1_I/V_out_1_R)# #phase angle\n", + "\n", + "#second component V_in_2\n", + "V_in_2=2*complex(cos(0),sin(0))# #V_in_2 phasor\n", + "w=2000*pi# #omega\n", + "f_2=w/(2*pi)# #frequency\n", + "#equation of straight line of H_magnitude vs f is x+1000*y-4000=0\n", + "H_2_max=(4000-f_2)/1000# #magnitude of H(traansfer function)\n", + "#equation of straight line of H_phase angle vs f is 6000*y=pi*x (phase angle = %0.2f radians)\n", + "H_2_phi=pi*f_2/6000# #phase angle of H\n", + "H_2=H_2_max*complex(cos(H_2_phi),sin(H_2_phi))\n", + "V_out_2=H_2*V_in_2\n", + "V_out_2_R=(V_out_2).real# #real part\n", + "V_out_2_I=(V_out_2).imag# #imaginary part\n", + "V_out_2_max=sqrt((V_out_2_R**2)+(V_out_2_I**2))# #peak value\n", + "V_out_2_phi=atan(V_out_2_I/V_out_2_R)# #phase angle\n", + "\n", + "#third component\n", + "A=-70*pi/180# #-70 degrees = %0.2f radians\n", + "V_in_3=complex(cos(A),sin(A))# #V_in_3 phasor\n", + "w=4000*pi# #omega\n", + "f_3=w/(2*pi)# #frequency\n", + "#equation of straight line of H_magnitude vs f is x+1000*y-4000=0\n", + "H_3_max=(4000-f_3)/1000# #magnitude of H(traansfer function)\n", + "#equation of straight line of H_phase angle vs f is 6000*y=pi*x (phase angle = %0.2f radians)\n", + "H_3_phi=pi*f_3/6000# #phase angle of H\n", + "H_3=H_3_max*complex(cos(H_3_phi),sin(H_3_phi))\n", + "V_out_3=H_3*V_in_3\n", + "V_out_3_R=(V_out_3).real# #real part\n", + "V_out_3_I=(V_out_3).imag# #imaginary part\n", + "V_out_3_max=sqrt((V_out_3_R**2)+(V_out_3_I**2))# #peak value\n", + "V_out_3_phi=atan(V_out_3_I/V_out_3_R)# #phase angle\n", + "\n", + "print 'Output voltage is Vout1+Vout2+Vout3 where'\n", + "print ''\n", + "print 'FOR Vout1:'\n", + "print 'peak value = %0.2f volts'%V_out_1_max\n", + "print 'phase angle = %0.2f degrees'%(V_out_1_phi*180/pi)\n", + "print 'with frequency = %0.2f hertz'%f_1\n", + "print ''\n", + "print 'FOR Vout2:'\n", + "print 'peak value = %0.2f volts'%V_out_2_max\n", + "print 'phase angle = %0.2f degrees'%(V_out_2_phi*180/pi)\n", + "print 'with frequency = %0.2f hertz'%f_2\n", + "print ''\n", + "print 'FOR Vout3:'\n", + "print 'peak value = %0.2f volts'%V_out_3_max\n", + "print 'phase angle = %0.2f degrees'%(V_out_3_phi*180/pi)\n", + "print 'with frequency = %0.2f hertz'%f_3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example: 6.3 Page No: 477" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " All the values in the textbook are approximated, hence the values in this code differ from those of Textbook\n", + "Output voltage is Vout1+Vout2+Vout3 where\n", + "\n", + "FOR Vout1:\n", + "peak value = 4.98 volts\n", + "phase angle = -5.71 degrees\n", + "with frequency = 10.00 hertz\n", + "\n", + "FOR Vout2:\n", + "peak value = 3.54 volts\n", + "phase angle = -45.00 degrees\n", + "with frequency = 100.00 hertz\n", + "\n", + "FOR Vout3:\n", + "peak value = 0.50 volts\n", + "phase angle = -84.29 degrees\n", + "with frequency = 1000.00 hertz\n" + ] + } + ], + "source": [ + "R=1000/(2*pi)# #resistance\n", + "C=10*10**-6# #capacitance\n", + "f_B=1/(2*pi*R*C)# #half-power frequency\n", + "#the three parts of V_in are V_1=5*cos(20*pi*t)+5*cos(200*pi*t)+5*cos(2000*pi*t)\n", + "\n", + "#first component V_in_1\n", + "V_in_1=5*complex(cos(0),sin(0))# #V_in_1 phasor\n", + "w_1=20*pi# #omega\n", + "f_1=w_1/(2*pi)# #frequency\n", + "H_1=1/(1+1J*(f_1/f_B))# #transfer function\n", + "V_out_1=H_1*V_in_1\n", + "V_out_1_R=(V_out_1).real# #real part\n", + "V_out_1_I=(V_out_1).imag# #imaginary part\n", + "V_out_1_max=sqrt((V_out_1_R**2)+(V_out_1_I**2))# #peak value\n", + "V_out_1_phi=atan(V_out_1_I/V_out_1_R)# #phase angle\n", + "\n", + "#second component V_in_2\n", + "V_in_2=5*complex(cos(0),sin(0))# #V_in_2 phasor\n", + "w_2=200*pi# #omega\n", + "f_2=w_2/(2*pi)# #frequency\n", + "H_2=1/(1+1J*(f_2/f_B))# #transfer function\n", + "V_out_2=H_2*V_in_2\n", + "V_out_2_R=(V_out_2).real #real part\n", + "V_out_2_I=(V_out_2).imag #imaginary part\n", + "V_out_2_max=sqrt((V_out_2_R**2)+(V_out_2_I**2))# #peak value\n", + "V_out_2_phi=atan(V_out_2_I/V_out_2_R)# #phase angle\n", + "\n", + "#third component V_in_3\n", + "V_in_3=5*complex(cos(0),sin(0))# #V_in_3 phasor\n", + "w_3=2000*pi# #omega\n", + "f_3=w_3/(2*pi)# #frequency\n", + "H_3=1/(1+1J*(f_3/f_B))# #transfer function\n", + "V_out_3=H_3*V_in_3\n", + "V_out_3_R=(V_out_3).real #real part\n", + "V_out_3_I=(V_out_3).imag #imaginary part\n", + "V_out_3_max=sqrt((V_out_3_R**2)+(V_out_3_I**2))# #peak value\n", + "V_out_3_phi=atan(V_out_3_I/V_out_3_R)# #phase angle\n", + "\n", + "print \" All the values in the textbook are approximated, hence the values in this code differ from those of Textbook\"\n", + "print 'Output voltage is Vout1+Vout2+Vout3 where'\n", + "print ''\n", + "print 'FOR Vout1:'\n", + "print 'peak value = %0.2f volts'%V_out_1_max\n", + "print 'phase angle = %0.2f degrees'%(V_out_1_phi*180/pi)\n", + "print 'with frequency = %0.2f hertz'%f_1\n", + "print ''\n", + "print 'FOR Vout2:'\n", + "print 'peak value = %0.2f volts'%V_out_2_max\n", + "print 'phase angle = %0.2f degrees'%(V_out_2_phi*180/pi)\n", + "print 'with frequency = %0.2f hertz'%f_2\n", + "print ''\n", + "print 'FOR Vout3:'\n", + "print 'peak value = %0.2f volts'%V_out_3_max\n", + "print 'phase angle = %0.2f degrees'%(V_out_3_phi*180/pi)\n", + "print 'with frequency = %0.2f hertz'%f_3\n", + "#we can observe that there is a clear discrimination = %0.2f output signals based on frequencies i.e, lesser the frequency lesser the effect." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example: 6.4 Page No: 478" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " All the values in the textbook are approximated, hence the values in this code differ from those of Textbook\n", + "Break frequency = 1897.37 Hz\n" + ] + } + ], + "source": [ + "H_max=-30# #transfer function magnitude\n", + "f=60\n", + "m=20# #low-frequency asymptote slope rate = %0.2f db/decade\n", + "#f_B must be K higher than f where K is\n", + "K=abs(H_max)/m\n", + "#(base 10)log(f_B/60)=1.5 ==>\n", + "f_B=60*10**1.5\n", + "print \" All the values in the textbook are approximated, hence the values in this code differ from those of Textbook\"\n", + "print 'Break frequency = %0.2f Hz'%f_B" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example: 6.5 Page No: 479" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Phasor voltage across Resistance\n", + "peak value = 1.00 volts\n", + "phase angle = 0.00 degrees\n", + "\n", + "Phasor voltage across Inductance\n", + "peak value = 10.00 volts\n", + "phase angle = 90.00 degrees\n", + "\n", + "Phasor voltage across Capacitance\n", + "peak value = 10.00 volts\n", + "phase angle = -90.00 degrees\n" + ] + } + ], + "source": [ + "V_s=1*complex(cos(0),sin(0))\n", + "L=159.2*10**-3\n", + "R=100\n", + "C=0.1592*10**-6\n", + "f_o=1/(2*pi*sqrt(L*C))# #resonant frequency\n", + "Q_s=2*pi*f_o*L/R# #quality factor\n", + "B=f_o/Q_s# #Bandwidth\n", + "#Approximate half-power frequencies are\n", + "f_H=f_o+(B/2)\n", + "f_L=f_o-(B/2)\n", + "#At resonance\n", + "Z_L=1J*2*pi*f_o*L# #impedance of inductance\n", + "Z_C=-1J/(2*pi*f_o*C)# #impedance of capacitance\n", + "Z_s=R+Z_L+Z_C\n", + "I=V_s/Z_s# #phasor current\n", + "#voltages across diffrent elements are\n", + "#for resistance\n", + "V_R=R*I\n", + "V_R_R=(V_R).real #real part\n", + "V_R_I=(V_R).imag #imaginary part\n", + "V_R_max=sqrt((V_R_R**2)+(V_R_I**2))# #peak value\n", + "V_R_phi=atan(V_R_I/V_R_R)# #phase angle\n", + "#for inductance\n", + "V_L=Z_L*I\n", + "V_L_R=(V_L).real #real part\n", + "V_L_I=(V_L).imag #imaginary part\n", + "V_L_max=sqrt((V_L_R**2)+(V_L_I**2))# #peak value\n", + "#Z_L is pure imaginary ==> V_L is pure imaginary which means V_L_phi can be +or- pi/2\n", + "if ((V_L/1J)==abs(V_L)):\n", + " V_L_phi=pi/2\n", + "elif ((V_L/1J)==-abs(V_L)):\n", + " V_L_phi=-pi/2\n", + "\n", + "\n", + "#for capacitance\n", + "V_C=Z_C*I\n", + "V_C_R=(V_C).real #real part\n", + "V_C_I=(V_C).imag #imaginary part\n", + "V_C_max=sqrt((V_C_R**2)+(V_C_I**2))# #peak value\n", + "#Z_C is pure imaginary ==> V_C is pure imaginary which means V_C_phi can be +or- pi/2\n", + "if ((V_C/1J)==abs(V_C)) :\n", + " V_C_phi=pi/2\n", + "elif ((V_C/1J)==-abs(V_C)) :\n", + " V_C_phi=-pi/2\n", + "\n", + " \n", + "print 'Phasor voltage across Resistance'\n", + "print 'peak value = %0.2f volts'%V_R_max\n", + "print 'phase angle = %0.2f degrees'%(V_R_phi*180/pi)\n", + "print ''\n", + "print 'Phasor voltage across Inductance'\n", + "print 'peak value = %0.2f volts'%V_L_max\n", + "print 'phase angle = %0.2f degrees'%(V_L_phi*180/pi)\n", + "print ''\n", + "print 'Phasor voltage across Capacitance'\n", + "print 'peak value = %0.2f volts'%V_C_max\n", + "print 'phase angle = %0.2f degrees'%(V_C_phi*180/pi)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example: 6.6 Page No: 480" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current phasor across Resistance\n", + "peak value = 0.001 amperes\n", + "phase angle = 0 degrees\n", + "\n", + "Current phasor across Inductance\n", + "peak value = 0.010 amperes\n", + "phase angle = -90.00 degrees\n", + "\n", + "current phasor across capacitance\n", + "peak value = 0.010 amperes\n", + "phase angle = 90.00 degrees\n" + ] + } + ], + "source": [ + "R=10*10**3\n", + "f_o=1*10**6\n", + "B=100*10**3\n", + "I=10**-3*complex(cos(0),sin(0))\n", + "Q_p=f_o/B# #quality factor\n", + "L=R/(2*pi*f_o*Q_p)\n", + "C=Q_p/(2*pi*f_o*R)\n", + "#At resonance\n", + "V_out=I*R\n", + "Z_L=1J*2*pi*f_o*L\n", + "Z_C=-1J/(2*pi*f_o*C)\n", + "\n", + "#across resistance\n", + "I_R=V_out/R\n", + "I_R_R=(I_R).real# #real part\n", + "I_R_I=(I_R).imag# #imaginary part\n", + "I_R_max=sqrt((I_R_R**2)+(I_R_I**2))# #peak value\n", + "I_R_phi=atan(I_R_I/I_R_R)# #phase angle\n", + "\n", + "#across inductance\n", + "I_L=V_out/Z_L\n", + "I_L_R=(I_L).real #real part\n", + "I_L_I=(I_L).imag# #imaginary part\n", + "I_L_max=sqrt((I_L_R**2)+(I_L_I**2))# #peak value\n", + "#Z_L is pure imaginary ==> V_L is pure imaginary which means V_L_phi can be +or- pi/2\n", + "if ((I_L/1J)==abs(I_L)):\n", + " I_L_phi=pi/2\n", + "elif ((I_L/1J)==-abs(I_L)) :\n", + " I_L_phi=-pi/2\n", + "\n", + "\n", + "#across capacitor\n", + "I_C=V_out/Z_C\n", + "I_C_R=(I_C).real# #real part\n", + "I_C_I=(I_C).imag# #imaginary part\n", + "I_C_max=sqrt((I_C_R**2)+(I_C_I**2))# #peak value\n", + "#Z_C is pure imaginary ==> V_C is pure imaginary which means V_C_phi can be +or- pi/2\n", + "if ((I_C/1J)==abs(I_C)):\n", + " I_C_phi=pi/2\n", + "elif ((I_C/1J)==-abs(I_C)) :\n", + " I_C_phi=-pi/2\n", + "\n", + "\n", + "print 'Current phasor across Resistance'\n", + "print 'peak value = %0.3f amperes'%I_R_max\n", + "print 'phase angle = %0.f degrees'%(I_R_phi*180/pi)\n", + "print ''\n", + "print 'Current phasor across Inductance'\n", + "print 'peak value = %0.3f amperes'%I_L_max\n", + "print 'phase angle = %0.2f degrees'%(I_L_phi*180/pi)\n", + "print ''\n", + "print 'current phasor across capacitance'\n", + "print 'peak value = %0.3f amperes'%I_C_max\n", + "print 'phase angle = %0.2f degrees'%(I_C_phi*180/pi)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example: 6.7 Page No: 481" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " All the values in the textbook are approximated, hence the values in this code differ from those of Textbook\n", + "\n", + "The required second order circuit configuration is\n", + "Inductance = 50.00 KH\n", + "Capacitance = 0.51 mF(micro Farads)\n", + "Resistance = 314.16 ohms\n" + ] + } + ], + "source": [ + "#We need a high-pass filter\n", + "L=50*10**-3\n", + "#for the transfer function to be approximately constant = %0.2f passband area(from graph given = %0.2f the text), we choose\n", + "Q_s=1\n", + "f_o=1*10**3\n", + "C=1/(((2*pi)**2)*f_o**2*L)\n", + "R=2*pi*f_o*L/Q_s\n", + "print \" All the values in the textbook are approximated, hence the values in this code differ from those of Textbook\"\n", + "print ''\n", + "print 'The required second order circuit configuration is'\n", + "print 'Inductance = %0.2f KH'%(L*10**3)\n", + "print 'Capacitance = %0.2f mF(micro Farads)'%(C*10**6)\n", + "print 'Resistance = %0.2f ohms'%R\n", + "\n" + ] + } + ], + "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 +} diff --git a/sample_notebooks/Nitin Kumar/Chap3.ipynb b/sample_notebooks/Nitin Kumar/Chap3.ipynb new file mode 100644 index 00000000..c7cdde82 --- /dev/null +++ b/sample_notebooks/Nitin Kumar/Chap3.ipynb @@ -0,0 +1,390 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter - 3 : Tuned Amplifier" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exa 3.1 : page 97" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Close loop voltage gain AF = 11.00 \n", + "Value of RiF = 1.82e+10 ohm\n", + "Value of RoF = 4.12e-03 ohm\n", + "Value of fF = 91 kHz\n" + ] + } + ], + "source": [ + "# given data\n", + "R1=1.5 #in kohm\n", + "RF=15 #in kohm\n", + "A=2*10**5 #unitless\n", + "Ri=1 #in Mohm\n", + "Ro=75 #in ohm\n", + "fo=5 #in Hz\n", + "AF=1+RF/R1 #unitless\n", + "B=1/AF #unitless\n", + "RiF=(1+A*B)*Ri*10**6 #in ohm\n", + "RoF=Ro/(1+A*B) #in ohm\n", + "fF=fo*(1+A*B) #in ohm\n", + "print \"Close loop voltage gain AF = %0.2f \" %AF\n", + "print \"Value of RiF = %0.2e ohm\"%RiF\n", + "print \"Value of RoF = %0.2e ohm\"%RoF\n", + "print \"Value of fF = %0.f kHz\"%(fF/1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exa 3.2 : page 98" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value of RiF = 99.00 kohm\n", + "Value of RiF = 2.00e+09 ohm\n", + "Value of RoF = 3.75e-02 ohm\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# given data\n", + "AF=100 #unitless\n", + "A=2*10**5 #unitless\n", + "Ri=1 #in Mohm\n", + "Ro=75 #in ohm\n", + "#let R1 =1 ohm\n", + "R1=1 #in ohm\n", + "#formula : AF=1+RF/R1\n", + "RF=(AF-1)*R1 #in kohm\n", + "B=1/AF #unitless\n", + "RiF=(1+A*B)*Ri*10**6 #in ohm\n", + "RoF=Ro/(1+A*B) #in ohm\n", + "print \"Value of RF = %0.2f kohm\"%RF\n", + "print \"Value of RiF = %0.2e ohm\"%RiF\n", + "print \"Value of RoF = %0.2e ohm\"%RoF" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exa 3.3 : page 99" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value of RiF = 2.00e+11 ohm\n", + "Value of RoF = 3.75e-04 ohm\n", + "Value of fF = 1.00 MHz\n" + ] + } + ], + "source": [ + "# given data\n", + "AF=1 #unitless\n", + "B=1 #unitless\n", + "A=2*10**5 #unitless\n", + "fo=5 #in Hz\n", + "Ri=1 #in Mohm\n", + "Ro=75 #in ohm\n", + "#let 1+AB=A as A>>>1\n", + "RiF=A*Ri*10**6 #in ohm\n", + "RoF=Ro/A #in ohm\n", + "fF=fo*A #in ohm\n", + "print \"Value of RiF = %0.2e ohm\"%RiF\n", + "print \"Value of RoF = %0.2e ohm\"%RoF\n", + "print \"Value of fF = %0.2f MHz\"%(fF/10**6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exa 3.4 : page 103" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value of RF = 300 kohm\n" + ] + } + ], + "source": [ + " # given data\n", + "R1=50 #in Kohm\n", + "AF=-6 #unitless\n", + "# here AF=-RF/R1\n", + "RF=-AF*R1 #in kohm\n", + "print \"Value of RF = %0.f kohm\" %RF" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exa 3.5 : page 104" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Close loop voltage gain AF = -6.00\n", + "Value of RiF = 50.00 kohm\n", + "Value of RoF = 2.62e-03 ohm\n", + "Value of fF = 143 kHz\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# given data\n", + "A=2*10**5 #unitless\n", + "Ri=1 #in Mohm\n", + "Ro=75 #in ohm\n", + "fo=5 #in Hz\n", + "R1=50 #in kohm\n", + "RF=300 #in kohm\n", + "K=RF/(R1+RF) #unitless\n", + "B=R1/(R1+RF) #unitless\n", + "AF=-(A*K/(1+A*B)) #unitless\n", + "RiF=R1 #in kohm ideal\n", + "RoF=Ro/(1+A*B) #in ohm\n", + "fF=-(A*K*fo/AF) #in Hz\n", + "print \"Close loop voltage gain AF = %0.2f\"%AF\n", + "print \"Value of RiF = %0.2f kohm\"%RiF\n", + "print \"Value of RoF = %0.2e ohm\"%RoF\n", + "print \"Value of fF = %0.f kHz\"%(fF/1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exa 3.6 : page 107" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value of RF = 30 kohm\n" + ] + } + ], + "source": [ + "# given data\n", + "# let R1=R2=R3=R=10kohm\n", + "R=10 #in kohm\n", + "R1=R #in kohm\n", + "R2=R #in kohm\n", + "R3=R #in kohm\n", + "RF=3*R #in Kohm\n", + "print \"Value of RF = %0.0f kohm\"%RF" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exa 3.7 : page 108" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value of R1 = 33.33 kohm\n", + "Value of RiF = 33.33 kohm\n" + ] + } + ], + "source": [ + " # given data\n", + "RF=1 #in Mohm\n", + "AV=-30 #unitless\n", + "#AV=-RF/R1=Vo/V1\n", + "R1=-RF*10**6/AV #in ohm\n", + "#for an inverting amplifier RiF=R1\n", + "RiF=R1 #in ohm\n", + "print \"Value of R1 = %0.2f kohm\"%(R1/1000)\n", + "print \"Value of RiF = %0.2f kohm\"%(RiF/1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exa 3.8 : page 108" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Required value of R2 = 533.33 kohm\n", + "Required value of R1 = 66.67 kohm\n" + ] + } + ], + "source": [ + " # given data\n", + "AV=-8 #unitless\n", + "Vin=-1 #in Volts\n", + "Imax=15 #in uA\n", + "Vo=AV*Vin #in Volts\n", + "#Formula : Vo=Imax*R2min\n", + "R2min=Vo/(Imax*10**-6) #in kohm\n", + "R1min=-Vin/(Imax*10**-6) #in kohm\n", + "print \"Required value of R2 = %0.2f kohm\"%(R2min/1000)\n", + "print \"Required value of R1 = %0.2f kohm\"%(R1min/1000)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exa 3.9 : page 110" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of RF = 75.00 Mohm\n", + "Value of R1 = 98.80 kohm\n", + "Value of R2 = 494.00 kohm\n", + "Value of R3 = 494.00 kohm\n", + "Value of R4 = 17.64 kohm\n" + ] + } + ], + "source": [ + " # given data\n", + "Vo=1.5 #in Volts\n", + "Vin=10 #in mVolts\n", + "RiF=500 #in kohm\n", + "R1=500 #in kohm\n", + "AF=Vo/(Vin*10**-3) #unitless\n", + "RF=AF*R1 #in Kohm\n", + "print \"The value of RF = %0.2f Mohm\"%(RF/1000)\n", + "#AF=-R2/R1*(1+R3/R2+R3/R4)\n", + "#Microphone resistance is Rm=1.2 Kohm\n", + "R1eff=100 #in Kohm\n", + "Rm=1.2 #in Kohm\n", + "R1=R1eff-Rm\n", + "R3=5*R1 \n", + "R2=R3 #in Kohm\n", + "R4=R3/28 #in Kohm\n", + "print \"Value of R1 = %0.2f kohm\" %R1\n", + "print \"Value of R2 = %0.2f kohm\" %R2\n", + "print \"Value of R3 = %0.2f kohm\" %R3\n", + "print \"Value of R4 = %0.2f kohm\" %R4" + ] + } + ], + "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 +} diff --git a/sample_notebooks/SaleemAhmed/Chapter10.ipynb b/sample_notebooks/SaleemAhmed/Chapter10.ipynb new file mode 100644 index 00000000..fbb36289 --- /dev/null +++ b/sample_notebooks/SaleemAhmed/Chapter10.ipynb @@ -0,0 +1,439 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter10 - Optical Fiber Systems" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.1 Page No: 349" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The voltage required to have a pi radian phase change = 4.56 volt\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "r=30.8*10**-12## electro optice coefficient in m/V\n", + "L=3*10**-2## length in m\n", + "y=1.3*10**-6## wavelength in m\n", + "n=2.1#\n", + "d=30*10**-6## distance between the electrodes in m\n", + "V=(y*d)/((n)**3*r*L)## voltage required to have a pi radian phase change in volt\n", + "print \"The voltage required to have a pi radian phase change = %0.2f volt\"%( V)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.2 Page No: 350" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The total channel loss =31 dB\n" + ] + } + ], + "source": [ + "a_fc=4## fider cable loss in dB/km\n", + "aj=0.7## splice loss in db/km\n", + "L=5## length in km\n", + "a_cr1=4## connector losses\n", + "a_cr2=3.5## connector losses\n", + "CL=(a_fc+aj)*L+(a_cr1+a_cr2)## total channel loss in dB\n", + "print \"The total channel loss =%d dB\"%( CL)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.3 Page No: 350" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "with mode coupling, the total rms broadening = 1.73 ns\n", + "\n", + " The dispersion equalization penalty = 1.84 dB\n", + "\n", + " without mode coupling, the total rms broadening = 6.00 dB\n", + "\n", + " without mode coupling, equalization penalty = 0.03 dB\n", + "\n", + " without mode coupling,dispersion equalization penalty with 125 Mb/s = 83.98 dB\n", + "\n", + " with mode coupling,dispersion equalization penalty with 125 Mb/s = 0.28 dB\n", + "\n", + " The answer is wrong in the textbook\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "p=0.5*10**-9## pulse broadening in s/km\n", + "L=12## length in km\n", + "Pt=p*sqrt(L)## with mode coupling, the total rms broadening in s\n", + "BT=20*10**6##\n", + "DL=2*(2*Pt*BT*sqrt(2))**4## dispersion equalization penalty in dB\n", + "Pt1=p*L## without mode coupling, the total rms broadening in s\n", + "DL1=2*(2*Pt1*BT*sqrt(2))**4## without mode coupling, equalization penalty in dB\n", + "DL2=2*(2*Pt1*150*10**6*sqrt(2))**4## without mode coupling,dispersion equalization penalty with 125 Mb/s\n", + "DL3=2*(2*Pt*125*10**6*sqrt(2))**4## with mode coupling,dispersion equalization penalty with 125 Mb/s\n", + "print \"with mode coupling, the total rms broadening = %0.2f ns\"%( Pt*10**9)#\n", + "print \"\\n The dispersion equalization penalty = %0.2f dB\"%( DL*10**4)#\n", + "print \"\\n without mode coupling, the total rms broadening = %0.2f dB\"%( Pt1*10**9)#\n", + "print \"\\n without mode coupling, equalization penalty = %0.2f dB\"%( DL1)#\n", + "print \"\\n without mode coupling,dispersion equalization penalty with 125 Mb/s = %0.2f dB\"%( DL2)#\n", + "print \"\\n with mode coupling,dispersion equalization penalty with 125 Mb/s = %0.2f dB\"%( DL3)#\n", + "print \"\\n The answer is wrong in the textbook\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.4 Page No: 351" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The length when system operating at 25 Mbps = 78.89 km\n", + "\n", + " The length when system operating at 350 Mbps = 56.67 km\n" + ] + } + ], + "source": [ + "Pi=-2.5## mean optical power launched into the fiber in dBm\n", + "Po=-45## mean output optical power available at the receiver in dBm\n", + "a_fc=0.35## fider cable loss in dB/km\n", + "aj=0.1## splice loss in db/km\n", + "a_cr=1## connector losses\n", + "Ma=6## safety margin in dB\n", + "L=(Pi-Po-a_cr-Ma)/(a_fc+aj)## length in km when system operating at 25 Mbps\n", + "Po1=-35## mean output optical power available at the receiver in dBm\n", + "L1=(Pi-Po1-a_cr-Ma)/(a_fc+aj)## length in km when system operating at 350 Mbps\n", + "print \"The length when system operating at 25 Mbps = %0.2f km\"%( L)#\n", + "print \"\\n The length when system operating at 350 Mbps = %0.2f km\"%( L1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.5 Page No: 351" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The fider loss = 20.00 dB\n", + "\n", + " The total splicing loss = 3.20 dB\n", + "\n", + " The fangle effects & future splice = 5.00 dB\n", + "\n", + " The total attenuation = 29.20 dB\n", + "\n", + " The excess power margin = 2.80 dB\n", + "\n", + " hence the system can operate with small excess power margin\n" + ] + } + ], + "source": [ + "Tx=-80## transmitter output in dBm\n", + "Rx=-40## receiver sensitivity in dBm\n", + "sm=32## system margin in dB\n", + "L=10## in km\n", + "fl=2*L## fider loss in dB\n", + "cl=1## detector coupling loss in dB\n", + "tl=0.4*8## total splicing loss in dB\n", + "ae=5## angle effects & future splice in dB\n", + "ta=29.2## total attenuation in dB\n", + "Ep=2.8## excess power margin in dB\n", + "print \"The fider loss = %0.2f dB\"%( fl)#\n", + "print \"\\n The total splicing loss = %0.2f dB\"%( tl)#\n", + "print \"\\n The fangle effects & future splice = %0.2f dB\"%( ae)#\n", + "print \"\\n The total attenuation = %0.2f dB\"%( ta)#\n", + "print \"\\n The excess power margin = %0.2f dB\"%( Ep)#\n", + "print \"\\n hence the system can operate with small excess power margin\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.6 Page No: 352" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The max transmission length when transmission star coupler is used = 1.99 km\n", + "\n", + " The max transmission length when reflection star coupler is used = 1.24 km\n" + ] + } + ], + "source": [ + "from math import log\n", + "Lc=1## connector loss in db\n", + "Ls=5## star coupler insertion loss in dB\n", + "af=2## fider loss in dB\n", + "Ps=-14## transmitted power in dBm\n", + "Pr=-49## receiver sensitivity in dBm\n", + "sm=6## system margin in dB\n", + "N=16#\n", + "L=(Ps-Pr-Ls-4*Lc-(10*log(N))/log(10)-sm)/(2*af)## max transmission length in km when transmission star coupler is used\n", + "N1=32#\n", + "L1=(Ps-Pr-Ls-4*Lc-(10*log(N1))/log(10)-sm)/(2*af)## max transmission length in km when reflection star coupler is used\n", + "print \"The max transmission length when transmission star coupler is used = %0.2f km\"%( L)#\n", + "print \"\\n The max transmission length when reflection star coupler is used = %0.2f km\"%( L1)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.7 Page No: 353" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The system rise time = 18.51 ns\n", + "\n", + " The max bit rate for NRZ coding = 37.81 Mbit/s\n", + "\n", + " The max bit rate for RZ coding = 18.90 Mbit/s\n" + ] + } + ], + "source": [ + "y=860*10**-9## wavelength in m\n", + "L=5000## length in m\n", + "X=0.024#\n", + "dy=20*10**-9## spectral width in m\n", + "dts=6*10**-9## silica optical link rise time in s\n", + "dtr=8*10**-9## detector rise in s\n", + "c=3*10**8## speed of light in m/s\n", + "dtm=-(L*dy*X)/(c*y)## material dispersion delay time in s\n", + "id=2.5*10**-12## intermodel dispersion in s/m\n", + "dti=id*L## intermodel dispersion delay time\n", + "dtsy=sqrt((dts**2)+(dtr**2)+(dtm**2)+(dti**2))## system rise time in s\n", + "Br_max=0.7/dtsy## max bit rate for NRZ coding in bit/s\n", + "Br_max1=0.35/dtsy## max bit rate for RZ coding in bit/s\n", + "print \"The system rise time = %0.2f ns\"%( dtsy*10**9)#\n", + "print \"\\n The max bit rate for NRZ coding = %0.2f Mbit/s\"%( Br_max/10**6)#\n", + "print \"\\n The max bit rate for RZ coding = %0.2f Mbit/s\"%( Br_max1/10**6)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.8 Page No: 353" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The transmission distance for Si fiber = 71.43 m\n", + "\n", + " The transmission distance for GRIN fiber = 420.00 m\n" + ] + } + ], + "source": [ + "Br=50*10**6## data rate in b/s\n", + "c=3*10**8## speed of light in m/s\n", + "n1=1.47## \n", + "dl=0.02## \n", + "n12=n1*dl## the difference b/w n1 and n2\n", + "L_si=(0.35*c)/(n12*Br)## transmission distance for Si fiber\n", + "L_GI=(2.8*c*n1**2)/(2*n1*n12*Br)## transmission distance for GRIN fiber\n", + "print \"The transmission distance for Si fiber = %0.2f m\"%( L_si)#\n", + "print \"\\n The transmission distance for GRIN fiber = %0.2f m\"%( L_GI)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.9 Page No: 353" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The material dispersion limited transmission distance =627 m\n" + ] + } + ], + "source": [ + "Br=20.0*10**6## data rate in b/s\n", + "c=3*10**8## speed of light in m/s\n", + "y=86*10**-9## wavelength in m\n", + "dy=30*10**-9## spectral width in m\n", + "X=0.024#\n", + "Tb=1/Br#\n", + "Lmax=(0.35*Tb*c*y)/(dy*X)## material dispersion limited transmission distance for RZ coding in m\n", + "print \"The material dispersion limited transmission distance =%d m\"%( Lmax)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex:10.10 Page No: 354" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "ename": "ZeroDivisionError", + "evalue": "integer division or modulo by zero", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m<ipython-input-15-50e925000b80>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 11\u001b[0m \u001b[0mLmax\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m0.35\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mc\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0my\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdy\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mX\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;31m## material dispersion limited distance for RZ coding in m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 12\u001b[0m \u001b[0mL_GI\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m1.4\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mc\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0mn1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mn12\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;31m## model dispersion limited distance for RZ coding in m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 13\u001b[1;33m \u001b[0mL_At\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mPt\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mPr\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mLa\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;31m## attenuation limited distance for RZ coding in m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 14\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"The material dispersion limited distance = %0.2f*10**10*1/Br m\"\u001b[0m\u001b[1;33m%\u001b[0m\u001b[1;33m(\u001b[0m \u001b[0mLmax\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m**\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;31m#\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 15\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[1;34m\"\\n The model dispersion limited distance = %0.2f*10**10*1/Br m\"\u001b[0m\u001b[1;33m%\u001b[0m\u001b[1;33m(\u001b[0m \u001b[0mL_GI\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m**\u001b[0m\u001b[1;36m10\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;31m#\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero" + ] + } + ], + "source": [ + "y=860*10**-9## wavelength in m\n", + "c=3*10**8## speed of light in m/s\n", + "n1=1.47## \n", + "dl=0.02## \n", + "n12=n1*dl## the difference b/w n1 and n2\n", + "La=1/1000## loss a in dB/m\n", + "Pr=-65## receiver power in dB\n", + "Pt=-5## transmitted power in dB\n", + "dy=30*10**-9## line width in m\n", + "X=0.024#\n", + "Lmax=(0.35*c*y)/(dy*X)## material dispersion limited distance for RZ coding in m\n", + "L_GI=(1.4*c*n1)/(n12)## model dispersion limited distance for RZ coding in m\n", + "L_At=(Pt-Pr)/(La)## attenuation limited distance for RZ coding in m \n", + "print \"The material dispersion limited distance = %0.2f*10**10*1/Br m\"%( Lmax/10**10)#\n", + "print \"\\n The model dispersion limited distance = %0.2f*10**10*1/Br m\"%( L_GI/10**10)#\n", + "print \"\\n The attenuation limited distance =%d-20log(Br) km\"%( L_At/10**3)" + ] + } + ], + "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 +} diff --git a/sample_notebooks/VineshSaini/Ch1.ipynb b/sample_notebooks/VineshSaini/Ch1.ipynb new file mode 100644 index 00000000..f27cc088 --- /dev/null +++ b/sample_notebooks/VineshSaini/Ch1.ipynb @@ -0,0 +1,516 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter1 - Vaccum Tubes and Semiconductors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 1.1 page : 41" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "VAK2 = 300.00 volts\n", + "VAK1 = 170.00 volts\n", + "IA2 = 0.0020 ampere\n", + "IA1 = 0.0000 ampere\n", + "resistance,rP =(VAK2-VAK1)/(IA2-IA1)=65000.00 ohm\n", + "VGK2 = -2.50 volts\n", + "VGK1 = -1.50 volts\n", + "VAK3 = 200.00 volts\n", + "amplification factor,u =(VAK2-VAK1)/(VGK2-VGK1)=-100.00 unitless \n", + "IA4 = 0.0022 ampere\n", + "IA1 = 0.0005 ampere\n", + "transconductance,gm =(IAK4-IAK3)/(VGK2-VGK3)=-0.00 ampere/volt \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "#refer to fig 1.2(c) and given d.c operating points VGKQ=-2 V,VAKQ=250 V,IAQ=-1.2 mA\n", + "VAK2=300\n", + "print \"VAK2 = %0.2f\"%(VAK2),\" volts\" # value of anode voltage2 \n", + "VAK1=170\n", + "print \"VAK1 = %0.2f\"%(VAK1),\" volts\" # value of anode voltage1 \n", + "IA2=2*10**(-3)\n", + "print \"IA2 = %0.4f\"%(IA2),\" ampere\" # value of anode current2\n", + "IA1=0*10**(-3)\n", + "print \"IA1 = %0.4f\"%(IA1),\" ampere\" # value of anode current1\n", + "rP=(VAK2-VAK1)/(IA2-IA1)#anode resistance at VGK=VGKQ\n", + "print \"resistance,rP =(VAK2-VAK1)/(IA2-IA1)=%0.2f\"%(rP),\" ohm\" #calculation\n", + "VGK2=-2.5\n", + "print \"VGK2 = %0.2f\"%(VGK2),\" volts\" # value of grid voltage2 \n", + "VGK3=-1.5\n", + "print \"VGK1 = %0.2f\"%(VGK3),\" volts\" # value of grid voltage1\n", + "VAK3=200\n", + "print \"VAK3 = %0.2f\"%(VAK3),\" volts\" # value of anode voltage1 \n", + "u=(VAK2-VAK3)/(VGK2-VGK3)#amplification factor at IA=IAQ\n", + "print \"amplification factor,u =(VAK2-VAK1)/(VGK2-VGK1)=%0.2f\"%(u),\" unitless \" #calculation\n", + "IA4=2.2*10**(-3)\n", + "print \"IA4 = %0.4f\"%(IA4),\" ampere\" # value of anode current4\n", + "IA3=0.5*10**(-3)\n", + "print \"IA1 = %0.4f\"%(IA3),\" ampere\" # value of anode current1\n", + "gm=(IA4-IA3)/(VGK2-VGK3)# transconductance at VAK=VAKQ\n", + "print \"transconductance,gm =(IAK4-IAK3)/(VGK2-VGK3)=%0.2f\"%(gm),\" ampere/volt \" #calculation\n", + "#mistake of negative sign for answers for u(amplification factor) and gm(transconductance)in book" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 1_2 page : 41" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "d = 0.01 metre\n", + "l = 0.02 metre\n", + "L = 0.20 metre\n", + "Va = 2000.00 volts\n", + "Vd = 100.00 volts\n", + "m = 9.11e-31 Kg\n", + "q = 1.60e-19 coulomb\n", + "horizontal beam velocity,Vx =(2*Va*q/m)**(0.5) metre/second\n", + "horizontal beam velocity,Vx =(2*Va*q/m)**(0.5)= 2.65e+07 metre/second\n", + "transit time,t1 =(l/Vx) second\n", + "transit time,t1 =(l/Vx)= 7.55e-10 second\n", + "vertical beam velocity,Vy =(q*Vd*l/d*m*Vx) metre/second\n", + "vertical beam velocity,Vy =(q*Vd*l/d*m*Vx)= 2.65e+06 metre/second\n", + "vertical displacement,D =((l*L*Vd)/(2*d*Va) metre\n", + "vertical displacement,D =((l*L*Vd)/(2*d*Va)=0.02 metre\n", + "sensitivity of CRT,S =(0.5*l*L)/(d*Va) metre/volt\n", + "sensitivity of CRT,S =(0.5*l*L)/(d*Va)=2.0e-04 metre/volt\n" + ] + } + ], + "source": [ + "d=0.5*10**(-2)\n", + "print \"d = %0.2f\"%(d),\"metre\" #initializing value of distance b/w plates\n", + "l=2*10**(-2)\n", + "print \"l = %0.2f\"%(l),\"metre\" #initializing value of length of plates\n", + "L=20*10**(-2)\n", + "print \"L = %0.2f\"%(L),\"metre\" #initializing value of distance b/w centre of plates and screen\n", + "Va=2000\n", + "print \"Va = %0.2f\"%(Va),\"volts\" ##initializing value ofanode voltage\n", + "Vd=100\n", + "print \"Vd = %0.2f\"%(Vd),\"volts\" #initializing value of deflecting voltage\n", + "m=9.11*10**(-31)\n", + "print \"m = %0.2e\"%(m),\"Kg\" #mass of electron\n", + "q=1.6*10**(-19)\n", + "print \"q = %0.2e\"%(q),\"coulomb\" #charge on an electron\n", + "print \"horizontal beam velocity,Vx =(2*Va*q/m)**(0.5) metre/second\" #formula\n", + "Vx =(2*Va*q/m)**(0.5)\n", + "print \"horizontal beam velocity,Vx =(2*Va*q/m)**(0.5)= %0.2e\"%(Vx),\" metre/second\" #calculation\n", + "print \"transit time,t1 =(l/Vx) second\" #formula\n", + "t1=(l/Vx)\n", + "print \"transit time,t1 =(l/Vx)= %0.2e\"%(t1),\" second\" #calculation\n", + "print \"vertical beam velocity,Vy =(q*Vd*l/d*m*Vx) metre/second\" #formula\n", + "Vy=((q*Vd*l)/(d*m*Vx))\n", + "print \"vertical beam velocity,Vy =(q*Vd*l/d*m*Vx)= %0.2e\"%(Vy),\" metre/second\" #calculation\n", + "print \"vertical displacement,D =((l*L*Vd)/(2*d*Va) metre\" #formula\n", + "D =(l*L*Vd)/(2*d*Va)\n", + "print \"vertical displacement,D =((l*L*Vd)/(2*d*Va)=%0.2f\"%(D),\" metre\" #calculation\n", + "print \"sensitivity of CRT,S =(0.5*l*L)/(d*Va) metre/volt\" #formula\n", + "S =(0.5*l*L)/(d*Va)\n", + "print \"sensitivity of CRT,S =(0.5*l*L)/(d*Va)=%0.1e\"%(S),\" metre/volt\" #calculation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 1-3 page : 42" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "m = 9.11e-31 Kg\n", + "q = 1.60e-19 coulomb\n", + "B = 1.50e-03 wb/m**2\n", + "l = 0.05 metre\n", + "L = 0.30 metre\n", + "Va = 10000.00 volts\n", + "horizontal beam velocity,Vx =(2*Va*q/m)**(0.5) metre/second\n", + "horizontal beam velocity,Vx =(2*Va*q/m)**(0.5)= 5.93e+07 metre/second\n", + "radius,r =(m*Vx)/(B*q) metre\n", + "radius,r =(m*Vx)/(B*q)= 0.22 metre\n", + "deflection,D =(L*l)/r) metre\n", + "deflection,D =(L*l)/r)=0.07 metre\n" + ] + } + ], + "source": [ + "m=9.11*10**(-31)\n", + "print \"m = %0.2e\"%(m),\" Kg\" #mass of electron\n", + "q=1.6*10**(-19)\n", + "print \"q = %0.2e\"%(q),\" coulomb\" #charge on an electron\n", + "B=1.5*10**(-3)\n", + "print \"B = %0.2e\"%(B)+ \" wb/m**2\" #initializing value of magnetic field\n", + "l=5*10**(-2)\n", + "print \"l = %0.2f\"%(l),\" metre\" #initializing axial length of magnetic field\n", + "L=30*10**(-2)\n", + "print \"L = %0.2f\"%(L),\" metre\" #initializing value of distance of screen from centre of magnetic field\n", + "Va=10000\n", + "print \"Va = %0.2f\"%(Va),\" volts\" ##initializing value of anode voltage\n", + "print \"horizontal beam velocity,Vx =(2*Va*q/m)**(0.5) metre/second\" #formula\n", + "Vx =(2*Va*q/m)**(0.5)\n", + "print \"horizontal beam velocity,Vx =(2*Va*q/m)**(0.5)= %0.2e\"%(Vx),\" metre/second\" #calculation\n", + "print \"radius,r =(m*Vx)/(B*q) metre\" #formula\n", + "r =(m*Vx)/(B*q)\n", + "print \"radius,r =(m*Vx)/(B*q)= %0.2f\"%(r),\" metre\" #calculation\n", + "print \"deflection,D =(L*l)/r) metre\" #formula\n", + "D =(L*l)/r\n", + "print \"deflection,D =(L*l)/r)=%0.2f\"%(D),\" metre\" #calculation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex -1.4 page : 43" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "q = 1.60e-19 coulomb\n", + "I = 10.00 Ampere\n", + "radius,r = 64.25 mils\n", + "r1 = 0.00 metre\n", + "n = 5.00e+28 electrons/m**3\n", + "cross sectional area,A =(pi*r1**2)= 8.37e-06 square metre\n", + "drift velocity,v=(I)/(A*q*n)=1.49e-04 metre/second\n" + ] + } + ], + "source": [ + "from math import pi\n", + "q=1.6*10**(-19)\n", + "print \"q = %0.2e\"%(q),\"coulomb\" #charge on an electron\n", + "I=10\n", + "print \"I = %0.2f\"%(I),\"Ampere\" #initializing value of current\n", + "r=64.25\n", + "print \"radius,r = %0.2f\"%(r),\" mils\" #initializing value of radius of wire\n", + "def mils2metres(mils):\n", + " metres=(mils*2.54)/(1000*100)\n", + " return metres\n", + "r1=mils2metres(r) \n", + "print \"r1 = %0.2f\"%(r1),\" metre\"\n", + "n=5*10**(28)\n", + "print \"n = %0.2e\"%(n),\" electrons/m**3\" # electrons concentration in copper\n", + "A=(pi*r1**2) #formulae \n", + "print \"cross sectional area,A =(pi*r1**2)= %0.2e\"%(A),\" square metre\" #calculation\n", + "v=(I)/(A*q*n)#formulae(I=A*q*n*v)\n", + "print \"drift velocity,v=(I)/(A*q*n)=%0.2e\"%(v),\" metre/second\" #calculation\n", + "\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 1_5 page : 44" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "cross sectional area,A =1.00e-05 merer square\n", + "resitivity(rho),p1 =1.00e-04 ohm-m\n", + "resitivity(rho),p2 =1000.00 ohm-m\n", + "resitivity(rho),p3 =1.00e+10 ohm-m\n", + "conductor length,l =0.01 metre\n", + " resistance for copper,R = p1*l/A = 0.10 ohm\n", + " resistance for silicon,R = p2*l/A = 1.00e+06 ohm\n", + " resistance for glass,R = p3*l/A = 1.00e+13 ohm\n" + ] + } + ], + "source": [ + "A=10*10**(-6)\n", + "p1=10**(-4)\n", + "p2=10**(3)\n", + "p3=10**(10)\n", + "l=1*10**(-2)# #initializations\n", + "print \"cross sectional area,A =%0.2e\"%(A),\"merer square\" \n", + "print \"resitivity(rho),p1 =%0.2e\"%(p1),\" ohm-m\"\n", + "print \"resitivity(rho),p2 =%0.2f\"%(p2),\" ohm-m\"\n", + "print \"resitivity(rho),p3 =%0.2e\"%(p3),\" ohm-m\"\n", + "print \"conductor length,l =%0.2f\"%(l),\" metre\"\n", + "print \" resistance for copper,R = p1*l/A = %0.2f\"%(p1*l/A),\"ohm\" #calculations for copper\n", + "print \" resistance for silicon,R = p2*l/A = %0.2e\"%(p2*l/A),\"ohm\" #calculations for silicon\n", + "print \" resistance for glass,R = p3*l/A = %0.2e\"%(p3*l/A),\"ohm\" #calculations for glass" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 1_6 page : 45" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I = 1.00e-06 Ampere\n", + "intrinsic charge concentration,ni = 1.45e+10 /centimetre cube\n", + "silicon atoms concntration, nV = 5.00e+22 /centimetre cube \n", + "electron mobility,un = 1500.00 cm.sq/V-s\n", + "hole mobility,up = 475.00 cm.sq/V-s\n", + "temperature,T = 300.00 K\n", + "q = 1.59e-19 coulomb\n", + "cross sectional area,A =2.50e-05 cm square\n", + "conductor length,l =0.01 cm\n", + "relative concentration,N =nV/ni= 3.45e+12 silicon atoms per electron -hole pair\n", + "intrinsic conductivityi,sigma =(1.59*10**(-19)*(1.45*10**10)*(1500+0475))= 0.00 (ohm-cm)**-1\n", + "resitivity(rho),pi =(1/sigma)=2.20e+05 ohm-cm\n", + " resistance for silicon,R =((2.22*10**5*0.5)/0.000025) = 4.44e+09 ohm\n", + " voltage drop,V =I*R = 4440.00 V\n" + ] + } + ], + "source": [ + "ni = 1.45*10**10 #initializations\n", + "nV = 5*10**22 #initializations\n", + "un = 1500 #initializations\n", + "up = 475#initializations\n", + "T = 300 #initializations\n", + "I=10**(-6)\n", + "print \"I = %0.2e\"%(I),\"Ampere\" #initializing value of current\n", + "A=(50*10**(-4))**2# l=0.5 #initializations\n", + "q=1.59*10**(-19) #charge on an electron\n", + "print \"intrinsic charge concentration,ni = %0.2e\"%(ni),\" /centimetre cube\"\n", + "print \"silicon atoms concntration, nV = %0.2e\"%(nV),\" /centimetre cube \"\n", + "\n", + "print \"electron mobility,un = %0.2f\"%(un),\" cm.sq/V-s\"\n", + "print \"hole mobility,up = %0.2f\"%(up),\"cm.sq/V-s\"\n", + "print \"temperature,T = %0.2f\"%(T),\"K\"\n", + "print \"q = %0.2e\"%(q),\"coulomb\" #charge on an electron\n", + "print \"cross sectional area,A =%0.2e\"%(A),\"cm square\" \n", + "print \"conductor length,l =%0.2f\"%(l),\"cm\"\n", + "N=nV/ni\n", + "print \"relative concentration,N =nV/ni= %0.2e\"%(N),\" silicon atoms per electron -hole pair\" #calculation\n", + "sigma=(1.59*10**(-19)*(1.45*10**10)*(1500+475))\n", + "print \"intrinsic conductivityi,sigma =(1.59*10**(-19)*(1.45*10**10)*(1500+0475))= %0.2f\"%(sigma),\" (ohm-cm)**-1\" #calculation\n", + "pi =(1/sigma)#formulae\n", + "print \"resitivity(rho),pi =(1/sigma)=%0.2e\"%(pi),\" ohm-cm\" #calculation\n", + "R=(2.22*10**5*0.5)/0.000025\n", + "print \" resistance for silicon,R =((2.22*10**5*0.5)/0.000025) = %0.2e\"%(R),\" ohm\" #calculations for silicon\n", + "V=I*R\n", + "print \" voltage drop,V =I*R = %0.2f\"%(V),\" V\" #calculations " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 1_7 page : 45" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "I = 1.00e-06 Ampere\n", + "intrinsic charge concentration,ni = 1.45e+10 /centimetre cube\n", + "silicon atoms concntration, nV = 5.00e+22 /centimetre cube \n", + "electron mobility,un = 1500.00 cm.sq/V-s\n", + "hole mobility,up = 317.00 cm.sq/V-s\n", + "temperature,T = 300.00 K\n", + "q = 0.00 coulomb\n", + "cross sectional area,A =0.00 cm square\n", + "conductor length,l =0.01 cm\n", + "donor concentration,nD= nV/10**6=50000000000000000.00 /cm.cube\n", + "resulting mobile electron concentration,nn= nD=5.00e+16 /cm.cube\n", + "resulting hole concentration,pn= ni**2/nD=4.20e+03 /cm.cube\n", + "n-type semiconductor conductivity,sigma=q*nD*un= 11.93 (ohm-cm)**-1\n", + "doped silicon resitivity(rho),pn =(1/sigma)=0.08 ohm-cm\n", + " resistance for silicon,R =((0.084*0.5)/A) = 1680.00 ohm\n", + " voltage drop,V =I*R = 1.68e-03 V\n" + ] + } + ], + "source": [ + "ni = 1.45*10**10 #initializations\n", + "nV = 5*10**22 #initializations\n", + "un = 1500 #initializations\n", + "up = 0475#initializations\n", + "T = 300 #initializations\n", + "I=10**(-6)\n", + "print \"I = %0.2e\"%(I),\"Ampere\" #initializing value of current\n", + "A=(50*10**(-4))**2# l=0.5 #initializations\n", + "q=1.59*10**(-19) #charge on an electron\n", + "print \"intrinsic charge concentration,ni = %0.2e\"%(ni),\" /centimetre cube\"\n", + "print \"silicon atoms concntration, nV = %0.2e\"%(nV),\" /centimetre cube \"\n", + "\n", + "print \"electron mobility,un = %0.2f\"%(un),\" cm.sq/V-s\"\n", + "print \"hole mobility,up = %0.2f\"%(up),\" cm.sq/V-s\"\n", + "print \"temperature,T = %0.2f\"%(T),\" K\"\n", + "print \"q = %0.2f\"%(q),\"coulomb\" #charge on an electron\n", + "print \"cross sectional area,A =%0.2f\"%(A),\" cm square\" \n", + "print \"conductor length,l =%0.2f\"%(l),\" cm\"\n", + "nD=nV/10**6#formulae\n", + "print \"donor concentration,nD= nV/10**6=%0.2f\"%(nD),\" /cm.cube\" #calculation\n", + "nn=nD#formulae\n", + "print \"resulting mobile electron concentration,nn= nD=%0.2e\"%(nn),\" /cm.cube\" #calculation\n", + "pn= ni**2/nD#formulae\n", + "print \"resulting hole concentration,pn= ni**2/nD=%0.2e\"%(pn),\" /cm.cube\" #calculation\n", + "sigma=q*nD*un#formulae\n", + "print \"n-type semiconductor conductivity,sigma=q*nD*un= %0.2f\"%(sigma),\" (ohm-cm)**-1\" #calculation\n", + "pn =(1/sigma)\n", + "print \"doped silicon resitivity(rho),pn =(1/sigma)=%0.2f\"%(pn),\" ohm-cm\" #calculation\n", + "R=(0.084*0.5)/A\n", + "print \" resistance for silicon,R =((0.084*0.5)/A) = %0.2f\"%(R),\" ohm\" #calculations for silicon\n", + "V=I*R\n", + "print \" voltage drop,V =I*R = %0.2e\"%(V),\" V\" #calculations " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex 1_8 page : 46" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "q = 1.59e-19 coulomb\n", + "dimension of semiconductor,d=0.04 cm\n", + "cross sectional area,A =d**2=1.37e-03 cm square\n", + "thickness,x =1.00e-04 cm\n", + "thickness,x0 =0 cm\n", + "hole concentration at x,p= 9.22e+15 /cm-cube\n", + "hole concentration at x0,p0= 0 /cm-cube\n", + " change in concentration at ,dp= 9.22e+15 /cm-cube\n", + "change in thickness,dx= 1.00e-04 cm\n", + " slope,(dp/dx) =(p-p0)/(x-x0)=9.22e+19 holes/cm-cube\n", + "hole diffusion constant,Dp= 12.00 cm-sq/s\n", + " hole diffusion current,Ip =A*q*Dp*(dp/dx)=0.24 ampere\n" + ] + } + ], + "source": [ + "q=1.59*10**(-19) #charge on an electron\n", + "print \"q = %0.2e\"%(q),\"coulomb\" #charge on an electron\n", + "d=0.037\n", + "print \"dimension of semiconductor,d=%0.2f\"%(d),\" cm\"\n", + "A=(d**2) #area formulae for square shaped semiconductor\n", + "print \"cross sectional area,A =d**2=%0.2e\"%(A),\" cm square\" \n", + "x=10**(-4)\n", + "print \"thickness,x =%0.2e\"%(x),\" cm\"\n", + "x0=0\n", + "print \"thickness,x0 =%0.f\"%(x0),\" cm\"\n", + "p=9.22*10**(15)#\n", + "print \"hole concentration at x,p= %0.2e\"%(p),\" /cm-cube\" #calculation\n", + "p0=0#\n", + "print \"hole concentration at x0,p0= %0.f\"%(p0),\" /cm-cube\" #calculation\n", + "dp=(p-p0)#formulae\n", + "dx=(x-x0)#formulae\n", + "print \" change in concentration at ,dp= %0.2e\"%(dp),\" /cm-cube\" #calculation\n", + "print \"change in thickness,dx= %0.2e\"%(dx),\" cm\" #calculation\n", + "(dp/dx)==(p-p0)/(x-x0)#formulae\n", + "print \" slope,(dp/dx) =(p-p0)/(x-x0)=%0.2e\"%(dp/dx),\" holes/cm-cube\" #calculation\n", + "Dp=12\n", + "print \"hole diffusion constant,Dp= %0.2f\"%(Dp),\" cm-sq/s\" #calculation\n", + "Ip=A*q*Dp*(dp/dx)\n", + "print \" hole diffusion current,Ip =A*q*Dp*(dp/dx)=%0.2f\"%(Ip),\" ampere\" #calculation" + ] + } + ], + "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 +} |