diff options
author | hardythe1 | 2015-06-11 17:31:11 +0530 |
---|---|---|
committer | hardythe1 | 2015-06-11 17:31:11 +0530 |
commit | 251a07c4cbed1a5a960f5ed416ce6ac13c8152b7 (patch) | |
tree | cb7f084fad6d7ee6ae89e586fad0e909b5408319 /Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha | |
parent | 47d7279a724246ef7aa0f5359cf417992ed04449 (diff) | |
download | Python-Textbook-Companions-251a07c4cbed1a5a960f5ed416ce6ac13c8152b7.tar.gz Python-Textbook-Companions-251a07c4cbed1a5a960f5ed416ce6ac13c8152b7.tar.bz2 Python-Textbook-Companions-251a07c4cbed1a5a960f5ed416ce6ac13c8152b7.zip |
add books
Diffstat (limited to 'Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha')
56 files changed, 20149 insertions, 0 deletions
diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter01.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter01.ipynb new file mode 100755 index 00000000..76fb6b09 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter01.ipynb @@ -0,0 +1,241 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b7a82ebd5adf08f1d2cb1363a68626f83f8a9fdc0fb722a735bf408f1a7aed03"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter01:Introduction to Electronics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the range of tolerance\n",
+ "#soltion\n",
+ "#given\n",
+ "#color coding\n",
+ "orange=3.#\n",
+ "gold=5.#\n",
+ "yellow=4.#\n",
+ "violet=7.#\n",
+ "#band pattern\n",
+ "band1=yellow#\n",
+ "band2=violet#\n",
+ "band3=orange#\n",
+ "band4=gold#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The range of resistance =',llr/1000. ,'kOhm','to',ulr/1000,'kOhm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The range of resistance = 44.65 kOhm to 49.35 kOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the range of tolerance\n",
+ "#color coding\n",
+ "blue=6.#\n",
+ "gold=-1.#\n",
+ "gray=8.#\n",
+ "silver=10.#\n",
+ "#band pattern\n",
+ "band1=gray#\n",
+ "band2=blue#\n",
+ "band3=gold#\n",
+ "band4=silver#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The Range of resistance is',llr,'ohm','to',ulr,'ohm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Range of resistance is 7.74 ohm to 9.46 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the equivalent current source\n",
+ "#given\n",
+ "Vs=2.;#Volts #dc voltage source\n",
+ "Rs=1.;#ohm #internal resistance\n",
+ "Rl=1.;#ohm #load resistance\n",
+ "Ise=Vs/Rs;#ampere #equivalent current source\n",
+ "\n",
+ "# In accordance to figure 1.23a\n",
+ "Il1=Ise*(Rs/(Rs+Rl));#using current divider concept\n",
+ "Vl1=Il1*Rl;\n",
+ "print \"In accordance to figure 1.23a\\n\"\n",
+ "print \"The Load current (current source Il=\",Il1,'A'\n",
+ "print \"The Load voltage (current source Vl=\",Vl1,'V','\\n'\n",
+ "\n",
+ "# In accordance to figure 1.23b\n",
+ "Vl2=Vs*(Rs/(Rs+Rl));#using voltage divider concept\n",
+ "Il2=Vl2/Rl;\n",
+ "print \"\\nIn accordance to figure 1.23b\"\n",
+ "print \"\\nThe Load voltage (voltage source) Vl=\",Vl2,'V'\n",
+ "print \"The Load current (voltage source) Il=\",Il2,'A'\n",
+ "print \"\\nTherefore they both provide same voltage and current to load\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.23a\n",
+ "\n",
+ "The Load current (current source Il= 1.0 A\n",
+ "The Load voltage (current source Vl= 1.0 V \n",
+ "\n",
+ "\n",
+ "In accordance to figure 1.23b\n",
+ "\n",
+ "The Load voltage (voltage source) Vl= 1.0 V\n",
+ "The Load current (voltage source) Il= 1.0 A\n",
+ "\n",
+ "Therefore they both provide same voltage and current to load\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find percentage variation in load current and load voltage\n",
+ "#given\n",
+ "Vs=10.;#volt#Supply voltage\n",
+ "Rs=100.;#ohm#internal resistance\n",
+ "\n",
+ "# In accordance to figure 1.24a\n",
+ "#For 1ohm - 10 ohm\n",
+ "Rl11=1.;#ohm#min extreme value of Rl\n",
+ "Rl12=10.;#ohm#max extreme value of Rl\n",
+ "Il11=Vs/(Rs+Rl11);\n",
+ "Il12=Vs/(Rs+Rl12);\n",
+ "Pi1=(Il11-Il12)*100./Il11;#Percentage variation in current\n",
+ "Vl11=Il11*Rl11;\n",
+ "Vl12=Il12*Rl12;\n",
+ "Pv1=(Vl12-Vl11)*100./Vl12;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24a \\n\");\n",
+ "print '%s %.2f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi1,'percent');\n",
+ "print '%s %.1f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv1,'percent\\n\\n');\n",
+ "\n",
+ "# In accordance to figure 1.24b\n",
+ "#For 1kohm - 10kohm\n",
+ "Rl21=1000.;#ohm#min extreme value of Rl\n",
+ "Rl22=10000.;#ohm#max extreme value of Rl\n",
+ "Il21=Vs/(Rs+Rl21);\n",
+ "Il22=Vs/(Rs+Rl22);\n",
+ "Pi2=(Il21-Il22)*100./Il21;#Percentage variation in current\n",
+ "Vl21=Il21*Rl21;\n",
+ "Vl22=Il22*Rl22;\n",
+ "Pv2=(Vl22-Vl21)*100./Vl22;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24b \\n\");\n",
+ "print '%s %.f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi2,'percent');\n",
+ "print '%s %.f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv2,'percent \\n');\n",
+ "print 'In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to' \n",
+ "print 'the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.24a \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 8.18 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 89.1 percent\n",
+ "\n",
+ " \n",
+ "In accordance to figure 1.24b \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 89 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 8 percent \n",
+ " \n",
+ "In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to\n",
+ "the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter02.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter02.ipynb new file mode 100755 index 00000000..6a53266d --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter02.ipynb @@ -0,0 +1,100 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b73ef6216a642d72e71cacf5b5b61b6bfffda60f0becbd024d7e5a916e6cf6d4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter02:Semiconductor Physics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the conductivity and resistivity of germanium\n",
+ "#!/usr/bin/env/ python\n",
+ "#-*- coding: utf-8 -*-\n",
+ "q=1.6*10.**-19.#Coulomb #charge of an electron\n",
+ "ni=2.5*10.**19.#per m**3 #concentration\n",
+ "un=0.36#m**2/Vs #mobility of electron\n",
+ "up=0.17#m**2/Vs #mobility of holes\n",
+ "con=q*ni*(un+up); #conductivity\n",
+ "res=(1./con); #resistivity\n",
+ "print '%s %.2f %s' %(\"The conductivty is =\",con,'S/m');\n",
+ "print '%s %.2f %s' %(\"The resistivity is =\",res,'ohm m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is = 2.12 S/m\n",
+ "The resistivity is = 0.47 ohm m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ecample E2 - pg 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the conductivity of extrinsic semiconductor\n",
+ "#given\n",
+ "e=1.6*10.**-19.;#Coulomb #charge of an electron\n",
+ "ni=1.5*10.**16.;#per m**3 #concentration\n",
+ "un=0.13;#m**2/Vs #mobility of electron\n",
+ "up=0.05;#m**2/Vs #mobility of holes\n",
+ "Si=5.*10.**28.;#per m**3 #atomic density in silicon\n",
+ "dop=(1./(2.*10.**8.)); #concentration of an antimony per silicon atoms\n",
+ "Nd=dop*Si;#per m**3 #donor concentraion\n",
+ "n=Nd;#per m**3 #free electron concentration\n",
+ "p=(ni**2/Nd);#per m **3 # hole concentration\n",
+ "con=e*(n*un+p*up);\n",
+ "print '%s %.1f %s' %(\"The conductivty is=\",con, 'S/m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is= 5.2 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter03.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter03.ipynb new file mode 100755 index 00000000..1fd8d21b --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter03.ipynb @@ -0,0 +1,644 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7bf8d28c6c82b7e899c3ac6b15267e576e5304a1722b176d625beb68170b13b4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter03:Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Page 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the value of threshold voltage\n",
+ "#given\n",
+ "t1=25.;#degrees C#initial temperature\n",
+ "t2=100.;#degrees C#final temperature\n",
+ "V=2.*10.**-3.;#V per celsius degree#decrease in barrier potential per degree\n",
+ "V0=0.7#V#Potential at normal temperature\n",
+ "Vd=(t2-t1)*V;#decrease in barrier potential\n",
+ "Vt=V0-Vd;#threshold volatge at 100degree C\n",
+ "print '%s %.2f %s' %(\"Threshold volatge at 100 degrees C =\",Vt,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Threshold volatge at 100 degrees C = 0.55 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#detrenmine dc resistance of silicon diode\n",
+ "#given\n",
+ "#At Id = 2 mA\n",
+ "Id=2.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.5;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Id = 20 mA\n",
+ "Id=20.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.75;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.1f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Vd = - 10 V \n",
+ "Id=-2.*10.**-6.;#Ampere#diode current(from given curve)\n",
+ "Vd=-10.;#V#voltage\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf/10**6,\"M ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance is = 250 ohm\n",
+ "\n",
+ "The dc resistance is = 37.5 ohm\n",
+ "\n",
+ "The dc resistance is = 5 M ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc & ac resistance of silicon diode\n",
+ "#given\n",
+ "Id=20.*10.**-3.;#A#diode current\n",
+ "Vd=0.75;#V# as given in the V-I graph\n",
+ "Rf=Vd/Id;\n",
+ "print '%s %.1f %s' %(\"The dc resistance of diode is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#From Graph the values of dynamic voltage and current are\n",
+ "#which is equal to MN and NL repectively (in graph)\n",
+ "del_Vd=(0.8-0.68);#V\n",
+ "del_Id=(40-0)*10.**-3.;#A\n",
+ "rf=del_Vd/del_Id;\n",
+ "print '%s %.f %s' %(\"The ac resistance of the diode is =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance of diode is = 37.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is = 3 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine ac resistance of silicon diode\n",
+ "#given\n",
+ "#At Id =10mA\n",
+ "Id=10.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.1f %s' %(\"The ac resistance of the diode is(At Id= 10mA) =\",rf,\"ohm\\n\")\n",
+ "\n",
+ "#At Id =20mA\n",
+ "Id=20.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.2f %s' %(\"The ac resistance of the diode is(At Id= 20mA) =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac resistance of the diode is(At Id= 10mA) = 2.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is(At Id= 20mA) = 1.25 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through diode\n",
+ "#given\n",
+ "Vt=0.3;#V#Threshold voltage\n",
+ "rf=25.;#ohm# average resistance\n",
+ "\n",
+ "#assuming it to be ideal\n",
+ "#from fig 3.19\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=45.;#ohm\n",
+ "R2=5.;#ohm\n",
+ "Vab=Vaa*R2/(R1+R2);\n",
+ "#Vab>Vt therefore diode is forward bias and no current flow through R2\n",
+ "Idi=Vaa/R1; #for ideal\n",
+ "print '%s %.f %s' %(\"The diode current (for ideal) is =\",Idi*1000,\"mA\\n\");\n",
+ "\n",
+ "#assuming it to be real\n",
+ "#Thevenins equivalent circuit parameters of fig 3.19\n",
+ "Vth=Vaa*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "Idr=(Vth-Vt)/(Rth+rf); #for real\n",
+ "print '%s %.1f %s' %(\"The diode current (for real) is =\",Idr*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diode current (for ideal) is = 222 mA\n",
+ "\n",
+ "The diode current (for real) is = 23.7 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through resistance in given figure\n",
+ "#From fig\n",
+ "Vaa=20.;#V#supply\n",
+ "Vt=0.7;#V#threshold voltage of diode\n",
+ "rf=5.;#ohm #forward resistance\n",
+ "R=90.;#ohm#given resistor\n",
+ "\n",
+ "#Diode D1 and D4 are forward bias and D2 and D3 are reverse biased\n",
+ "\n",
+ "Vnet=Vaa-Vt-Vt;\n",
+ "Rt=R+rf+rf;\n",
+ "I=Vnet/Rt;\n",
+ "print '%s %.f %s' %(\"Current through 90 ohm resistor is =\",I*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 90 ohm resistor is = 186 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current drawn by the battery\n",
+ "#From fig\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=100.;#ohm\n",
+ "R2=100.;#ohm\n",
+ "\n",
+ "#Forward Bias\n",
+ "Id=Vaa/R1;\n",
+ "print '%s %.1f %s' %(\"Current drawn from battery (forward bias) =\",Id,\"A\\n\");\n",
+ "\n",
+ "#Reverse Bias\n",
+ "Rnet=R1+R2;\n",
+ "Id=Vaa/Rnet;\n",
+ "print '%s %.2f %s' %(\"Current drawn from battery (reverse bias) =\",Id,\"A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from battery (forward bias) = 0.1 A\n",
+ "\n",
+ "Current drawn from battery (reverse bias) = 0.05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc current through load and rectification efficiency and peak inverse voltage\n",
+ "#given\n",
+ "import math\n",
+ "TR=31./2.;#Turn ratio of the transformer\n",
+ "rf=20.;#ohm#Dynamic forward resistance\n",
+ "Rl=1000.;#ohm#Load resistance\n",
+ "Vt=0.66;#V#Threshold voltage of diode\n",
+ "V=220.;#V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp;\n",
+ "Im=(Vm-Vt)/(rf+Rl);\n",
+ "Idc=Im/math.pi;\n",
+ "n=40.6/(1.+rf/Rl);\n",
+ "print '%s %.f %s' %(\"The dc current through load is =\",Idc*1000,\"mA\\n\");\n",
+ "print '%s %.1f %s' %(\"The rectification efficiency is =\",n,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"Peak inverse voltage =Vm = \",Vm,\"V\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current through load is = 6 mA\n",
+ "\n",
+ "The rectification efficiency is = 39.8 percent\n",
+ "\n",
+ "Peak inverse voltage =Vm = 20.07 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc voltage across load and peak inverse voltage across each diode\n",
+ "#given\n",
+ "import math\n",
+ "TR=12./1.##Turn ratio of the transformer\n",
+ "V=220.##V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp#\n",
+ "Vdc=(2.*Vm)/math.pi#\n",
+ "print '%s %.1f %s' %(\"The dc voltage across load =\",Vdc,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for bridge rectifier) =\",Vm,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for centre tap rectifier) =\",2*Vm,\"V\\n\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc voltage across load = 16.5 V\n",
+ "\n",
+ "Peak inverse voltage (for bridge rectifier) = 25.9 V\n",
+ "\n",
+ "Peak inverse voltage (for centre tap rectifier) = 51.9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc power supplied to load and efficiency and PIV rating of the diode\n",
+ "#given\n",
+ "import math\n",
+ "rf=2.;#ohm#Dynamic forward resistance\n",
+ "Rs=5.;#ohm#resistaqnce of secondary\n",
+ "Rl=25.;#ohm#Load resistance\n",
+ "Idc=0.1;#A#dc current to a load\n",
+ "Pdc=Idc**2.*Rl; #dc power\n",
+ "n=(81.2*Rl)/(Rl+rf+Rs); #efficiency\n",
+ "Im=(math.pi*Idc)/2.; #peak value current\n",
+ "Vm=Im*(Rl+rf+Rs); #peak voltage\n",
+ "Vlm=Vm-Im*(rf+Rs); #peak voltage across load\n",
+ "PIV=Vm+Vlm;\n",
+ "print '%s %.2f %s' %(\"The dc power supplied to the load is =\",Pdc,'W\\n');\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,'percent\\n');\n",
+ "print '%s %.3f %s' %(\"The peak inverse voltage is =\",PIV,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc power supplied to the load is = 0.25 W\n",
+ "\n",
+ "Efficiency = 63.44 percent\n",
+ "\n",
+ "The peak inverse voltage is = 8.954 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate output voltage and current through load and voltage across series resistor and current and power dissipated in zener diode\n",
+ "#given\n",
+ "Vi=110.;#V #input voltage\n",
+ "Rl=6.*10.**3.;# ohm #load resistance\n",
+ "Rs=2.*10.**3.;#ohm #series resistance\n",
+ "Vz=60.;#V #Zener voltage\n",
+ "V=Vi*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Vs=Vi-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Iz=Is-Il #/By applying kirchhoffs law\n",
+ "Pz=Vz*Iz #Power dissipated accross zener diode\n",
+ "\n",
+ "print '%s %.f %s' %(\"The output voltage is =\",Vo,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The current through load resistance is =\",Il*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"Voltage across series resistor is =\",Vs,\"V\\n\")\n",
+ "print '%s %.f %s' %(\"Current in zener diode is =\",Iz*1000,\"mA\\n\")\n",
+ "print '%s %.f %s' %(\"Power dissipated by zener diode =\",Pz*1000,'mW');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 60 V\n",
+ "\n",
+ "The current through load resistance is = 10 mA\n",
+ "\n",
+ "Voltage across series resistor is = 50 V\n",
+ "\n",
+ "Current in zener diode is = 15 mA\n",
+ "\n",
+ "Power dissipated by zener diode = 900 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate max and min values of zener diode current\n",
+ "#given\n",
+ "Vimin=80.;#V #minimum input voltage\n",
+ "Vimax=120.;#V #maximum input voltage\n",
+ "Rl=10.*10.**3.;# ohm #load resistance\n",
+ "Rs=5.*10.**3.;#ohm #series resistance\n",
+ "Vz=50.;#V #Zener voltage\n",
+ "V=Vimin*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "#For minimum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimin-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmin=Is-Il;\n",
+ "print '%s %.f %s' %(\"Minimum values of zener diode current is =\",Izmin*1000,\"mA\\n\");\n",
+ "\n",
+ "#For maximum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimax-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmax=Is-Il;\n",
+ "print '%s %.f %s' %(\"Maximum values of zener diode current is =\",Izmax*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum values of zener diode current is = 1 mA\n",
+ "\n",
+ "Maximum values of zener diode current is = 9 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine value of the series resistor and wattage rating\n",
+ "#given\n",
+ "Vi=12.##V #input voltage\n",
+ "Vz=7.2##V #Zener voltage\n",
+ "Izmin=10.*10.**-3.##A #min current through zener diode\n",
+ "Ilmax=100*10.**-3.##A #max current through load\n",
+ "Ilmin=12.*10.**-3.##A #min current through load\n",
+ "Vs=Vi-Vz# #Voltage drop across the series resistor\n",
+ "Is=Izmin+Ilmax# #Current through the series resistor\n",
+ "Rs=Vs/Is#\n",
+ "print '%s %.1f %s' %(\"The series resistor so that 10mA current flow through zener diode is =\",Rs,\"ohm\\n\")#\n",
+ "Izmax=Is-Ilmin#max zener through zener diode\n",
+ "Pmax=Izmax*Vz#\n",
+ "print '%s %.1f %s' %(\"The maximum wattage rating is =\",Pmax*1000,\"mW\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resistor so that 10mA current flow through zener diode is = 43.6 ohm\n",
+ "\n",
+ "The maximum wattage rating is = 705.6 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the capacitance of a varactor diode\n",
+ "#given\n",
+ "import math\n",
+ "C=5.;#pf#capcitance of varactor diode at V=4V\n",
+ "V=4.;#V\n",
+ "K=C*math.sqrt(4.);\n",
+ "#When bias voltage is increased upto 6 V\n",
+ "Vn=6.;#V#new bias voltage\n",
+ "Cn=K/(math.sqrt(Vn));\n",
+ "print '%s %.3f %s' %(\"Capacitance (At 6 V ) =\",Cn,\"pf\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance (At 6 V ) = 4.082 pf\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter04.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter04.ipynb new file mode 100755 index 00000000..6c215ea6 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter04.ipynb @@ -0,0 +1,420 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:42445a9cad2a842fdbeaf4fef86ad51dfbe0d5e8d585b4595a7c5777bd6d8bc1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter04:Bipolar Junction Transistors (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the collector and base current\n",
+ "#given\n",
+ "a=0.98;#dc alpha\n",
+ "Ie=5.*10.**-3.;#A#emitter current\n",
+ "Ico=2.*10.**-6.;#A#collector reverse leakage current\n",
+ "Ic=a*Ie+Ico;\n",
+ "Ib=Ie-Ic;\n",
+ "print '%s %.3f %s' %(\"The collector current is =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current is = 4.902 mA\n",
+ "\n",
+ "The base current is = 98 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the base and collector current and exact and approax dc alpha \n",
+ "#given\n",
+ "Ie=8.4*10.**-3.#A#emitter current\n",
+ "Icbo=0.1*10.**-6.##A#reverse leakage current\n",
+ "Ib=0.008*Ie##A#base current\n",
+ "Ic=Ie-Ib#\n",
+ "Icinj=Ic-Icbo#\n",
+ "a0=Icinj/Ie#\n",
+ "a=Ic/Ie#\n",
+ "print '%s %.1f %s' %(\"Base current is =\",Ib*10**6,\"uA\\n\")#\n",
+ "print '%s %.4f %s' %(\"Collector current =\",Ic*1000,\"mA\\n\",)#\n",
+ "print '%s %.7f %s' %(\"Exact value of alphha =\",a0,\"\\n\")#\n",
+ "print '%s %.3f' %(\"Approax value of alpha =\",a)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current is = 67.2 uA\n",
+ "\n",
+ "Collector current = 8.3328 mA\n",
+ "\n",
+ "Exact value of alphha = 0.9919881 \n",
+ "\n",
+ "Approax value of alpha = 0.992\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the base current\n",
+ "#given\n",
+ "a=0.96; #dc alpha\n",
+ "Rc=2.*10.**3.;#ohm #resistor across collector\n",
+ "Vc=4.;#V #Voltage drop across the collector resistor\n",
+ "Ic=Vc/Rc; #Colletor current\n",
+ "Ie=Ic/a; #Emmiter current\n",
+ "Ib=Ie-Ic; #Base current\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\",)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current is = 83 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Ie=2.;#mA\n",
+ "Vcb=10.;#V\n",
+ "\n",
+ "#Taking points around Ie & Vcb from graph\n",
+ "del_Ie=(2.5-1.5)*10.**-3.;#A\n",
+ "\n",
+ "#corresponding change in Veb\n",
+ "del_Veb=(0.9-0.8);#V\n",
+ "rib=del_Veb/del_Ie;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rib,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 100 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc current gain in common emitter configuration\n",
+ "#given\n",
+ "a=0.98;#dc current gain in common base configuration\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The dc current gain in common emitter configuration is=\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current gain in common emitter configuration is= 49\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac alpha and beta\n",
+ "#given\n",
+ "ic=0.995#mA#Emitter current change\n",
+ "ie=1.#mA#collector current change\n",
+ "a=ic/ie;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.3f %s' %(\"The ac alpha is =\",a,\"\\n\")\n",
+ "print '%s %.f' %(\"The common emitter ac current gain is =\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac alpha is = 0.995 \n",
+ "\n",
+ "The common emitter ac current gain is = 199\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate beta and Iceo and exact and approax collector current\n",
+ "#given\n",
+ "a0=0.992;#dc current gain in common base configuration\n",
+ "Icbo=48.*10.**-9.;#A\n",
+ "Ib=30.*10.**-6.;#A#base current\n",
+ "B=a0/(1.-a0);\n",
+ "Iceo=Icbo/(1.-a0);\n",
+ "print '%s %.f %s' %(\"Beta=\",B,\"\\n\");\n",
+ "print '%s %.f %s' %(\"Iceo=\",Iceo*10**6,\"uA\\n\");\n",
+ "Ic=B*Ib+Iceo;\n",
+ "Ica=B*Ib;#approax\n",
+ "print '%s %.3f %s' %(\"Exact collector current =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"Approax collector current =\",Ica*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta= 124 \n",
+ "\n",
+ "Iceo= 6 uA\n",
+ "\n",
+ "Exact collector current = 3.726 mA\n",
+ "\n",
+ "Approax collector current = 3.72 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Vbe=0.75;#V\n",
+ "Vce=2.;#V\n",
+ "\n",
+ "#Taking points around Vbe=0.75V from graph\n",
+ "del_Vbe=(0.98-0.9);#V\n",
+ "\n",
+ "#corresponding change in ib\n",
+ "del_ib=(68.-48.)*10.**-6.;#A\n",
+ "\n",
+ "rie=del_Vbe/del_ib;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rie/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 4 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance and dc and ac current gain\n",
+ "#given\n",
+ "Ib=30.*10.**-6.;#A\n",
+ "Vce=10.;#V\n",
+ "Ic=3.6*10.**-3.;#A #from graph\n",
+ "\n",
+ "#Taking points around Vce = 10V from graph\n",
+ "del_Vce=(12.5-7.5);#V\n",
+ "\n",
+ "#corresponding change in ic\n",
+ "del_ic=(3.7-3.5)*10.**-3.;#A\n",
+ "\n",
+ "roe=del_Vce/del_ic;\n",
+ "print '%s %.f %s' %(\"The dynamic output resistance of transistor is =\",roe/1000,\"k ohm\\n\");\n",
+ "\n",
+ "#dc current gain\n",
+ "Bo=Ic/Ib;\n",
+ "print '%s %.f %s' %(\"The dc current gain is =\",Bo,\"\\n\");\n",
+ "\n",
+ "#ac current gain\n",
+ "\n",
+ "del_ic=(4.7-2.5)*10.**-3.; #the collector current change is from 3.5mA to 4.7mA as we can see from graph when we change ib from 40mA to 20mA\n",
+ "del_ib=(40.-20.)*10.**-6.;\n",
+ "B=del_ic/del_ib;\n",
+ "print '%s %.f %s' %(\"The ac current gain is =\",B,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic output resistance of transistor is = 25 k ohm\n",
+ "\n",
+ "The dc current gain is = 120 \n",
+ "\n",
+ "The ac current gain is = 110 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac current gain in CE and CC configuration\n",
+ "#given\n",
+ "a=0.99;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The ac current gain in CE configuration is =\",B);\n",
+ "y=1.+B;\n",
+ "print '%s %.f' %(\"\\nThe ac current gain in CC configuration is =\",y);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac current gain in CE configuration is = 99\n",
+ "\n",
+ "The ac current gain in CC configuration is = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter05.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter05.ipynb new file mode 100755 index 00000000..6fb4ca83 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter05.ipynb @@ -0,0 +1,348 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6ddc78aaecb14f72535c7221afdce9fdaaec875cc64d4211459abad2c8c70077"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter05:Field Effect Transistors (FETs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate saturation voltage and saturation current\n",
+ "#given\n",
+ "Vp=-4.#V #pinch off voltage\n",
+ "Idss=12.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Vgs=-2.;#V #gate to source voltage\n",
+ "Vds=Vgs-Vp;\n",
+ "Id=Idss*(Vds/Vp)**2.;\n",
+ "print '%s %.f %s' %(\"Saturation Voltage is =\",Vds,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Saturation current is =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Voltage is = 2 V\n",
+ "\n",
+ "Saturation current is = 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vgso=-5.;#V #gate to source cut off voltage\n",
+ "Idss=20.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#At vgs = -2 V\n",
+ "vgs=-2.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -2 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -4 V\n",
+ "vgs=-4.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -4 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -8 V\n",
+ "print '%s' %(\"Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current is (At vgs = -2 V) = 7.2 mA\n",
+ "\n",
+ "Drain current is (At vgs = -4 V) = 0.8 mA\n",
+ "\n",
+ "Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Vds saturation\n",
+ "#given\n",
+ "import math\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=-15.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Id=-3.*10.**-3.;#A #saturation current\n",
+ "Vgs=Vp*(1.-math.sqrt(Id/Idss));\n",
+ "Vds=Vgs-Vp;\n",
+ "print '%s %.3f %s' %(\"The gate to source voltage (Vgs) is =\",Vgs,\"V\\n\");\n",
+ "print '%s %.3f %s' %(\"The saturation voltage is Vds(sat) =\",Vds,\"V\");\n",
+ "\n",
+ "print '\\nThe value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gate to source voltage (Vgs) is = 2.764 V\n",
+ "\n",
+ "The saturation voltage is Vds(sat) = -2.236 V\n",
+ "\n",
+ "The value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for N channel\n",
+ "#given\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= - 3 V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id(For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5 V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id(For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id(For Vgs= -3V) = 2.88 mA\n",
+ "\n",
+ "The drain current Id(For Vgs= 2.5V) = 40.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for P channel\n",
+ "#given\n",
+ "Vp=-5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= -3V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id (For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id (For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id (For Vgs= -3V) = 46.08 mA\n",
+ "\n",
+ "The drain current Id (For Vgs= 2.5V) = 4.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vt=2.;#V #threshold voltage\n",
+ "K=0.25*10.**-3.;# A/V**2 #conductivity parameter\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=2.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "Id=K*(Vgs-Vt)**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 0.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of Id\n",
+ "#given\n",
+ "Vt=1.5;#V #threshold voltage\n",
+ "Id=2.*10.**-3.;#A\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=5.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "# Calculating K\n",
+ "K=Id/((Vgs-Vt)**2.); # A/V**2 #conductivity parameter\n",
+ "\n",
+ "#Calculating Id for Vgs= 5 V and Vds= 6 V\n",
+ "Vgs=5;#V #gate supply\n",
+ "Vds=6;#V #saturation voltage\n",
+ "Id=K*((Vgs-Vt)**2);\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 10.89 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the dynamic drain resistance\n",
+ "#given\n",
+ "gm=200.*10.**-6.;#S transconductance\n",
+ "u=80.;#amplification factor\n",
+ "rd=u/gm;\n",
+ "print '%s %.f %s' %(\"The dynamic drain resistance is =\",rd/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic drain resistance is = 400 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter06.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter06.ipynb new file mode 100755 index 00000000..41c7fb9c --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter06.ipynb @@ -0,0 +1,699 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cddd2c9e37ec7b804dfbcdffbef1b63f83f302e02514fa667b184fd9044289b8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter06:Transistor Biasing and Stabilization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.2*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=270.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,'V',Ic*1000,'mA');\n",
+ "\n",
+ "#Note--In book Vce = 5.7 V because of approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 5.6 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=150.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=100.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ics*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 0 V 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Rb and percentage change in collector current due to temperature rise\n",
+ "#given\n",
+ "\n",
+ "#Calculating the base resistance\n",
+ "B=20.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Ic=1.*10.**-3.;#A #collector current\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Icbo=2.*10.**-6.;#A #collector to base leakage current\n",
+ "\n",
+ "Ib=(Ic-(1.+B)*Icbo)/B;\n",
+ "Rb=(Vcc-Vbe)/Ib;\n",
+ "\n",
+ "print '%s %.f %s' %(\"The value of resistor Ib is =\",120,'kohm');\n",
+ "\n",
+ "Rb=120.*10.**3.;#ohm approax\n",
+ "\n",
+ "#Now when temperature rise\n",
+ "Icbo=10.*10.**-6.;#A #collector to base leakage current\n",
+ "B=25.;#dc beta\n",
+ "Ic1=B*Ib+(B+1)*Icbo;# #changed collector current\n",
+ "perc=(Ic1-Ic)*100./Ic;#percentage increase\n",
+ "print '%s %.f %s' %(\"The percentage change in collector current is =\",perc,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of resistor Ib is = 120 kohm\n",
+ "The percentage change in collector current is = 46 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.1f %s' %(\"The Q point (At B=50) =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.; #dc beta\n",
+ "Ic1=B*Ib; #Colletor current\n",
+ "Ics1=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.1f %s' %(\"\\nThe Q point (At B=150) is =\",Vce,\"V\",Ics*1000,\"mA\");\n",
+ "\n",
+ "print '%s %.f' %(\"\\nThe factor at which collector current increases =\",Ics1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point (At B=50) = 6.00 V 1.5 mA\n",
+ "\n",
+ "The Q point (At B=150) is = 0 V 4.5 mA\n",
+ "\n",
+ "The factor at which collector current increases = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Q point in collector to base bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=500.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-(Ic+Ib)*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 9.1 V 1.8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the collector current and change in it if B is changed by three times of previous B\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.3f %s' %(\"Collector current (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "#Now B=150\n",
+ "B=3.*B; #three times of previous B\n",
+ "Ib1=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic1=B*Ib1; #Colletor current\n",
+ "print '%s %.2f %s' %(\"Collector current (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.f' %(\"The factor at which collector current increases =\",Ic1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current (B=50)= 1.125 mA\n",
+ "\n",
+ "Collector current (B=150)= 2.25 mA\n",
+ "\n",
+ "The factor at which collector current increases = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of all three current Ie and Ic and Ib\n",
+ "#given\n",
+ "B=90.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ie=Ic+Ib; #Emitter current\n",
+ "print '%s %.1f %s %s %.3f %s %s %.3f %s' %(\"Base current =\",Ib*10**6,\"uA\\n\",\"\\nCollector current =\",Ic*10**3,\"mA\\n\",\"\\nEmitter current =\",Ie*10**3,\"mA\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 16.5 uA\n",
+ " \n",
+ "Collector current = 1.486 mA\n",
+ " \n",
+ "Emitter current = 1.503 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max and min value of emitter current\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=75.;#ohm #resistor connected to collector\n",
+ "Re=100.;#ohm #resistor connected to emitter\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Ib=(Vcc-Vbe)/(Rb+(1.+B)*Re); #Base current\n",
+ "Ie=(1.+B)*Ib;\n",
+ "Vce=Vcc-(Rc+Re)*Ie\n",
+ "print '%s %.2f %s' %(\"Minimum emitter current =\",Ie*10**3,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"The collector to emitter volatge =\",Vce,\"V\\n\");\n",
+ "\n",
+ "#At B=300 \n",
+ "\n",
+ "B1=300.; #dc beta\n",
+ "Ib1=(Vcc-Vbe)/(Rb+(1.+B1)*Re);#Base current\n",
+ "Ie1=(1.+B1)*Ib1;\n",
+ "Vce1=Vcc-(Rc+Re)*Ie1\n",
+ "#Here Vce1= -1.4874 V but can never have negative voltage because Ie1 is wrong as it cant be more than saturation value therefore\n",
+ "Ie1=Vcc/(Rc+Re);\n",
+ "\n",
+ "#And Vce=0 V\n",
+ "\n",
+ "Vce1=0;#V\n",
+ "print '%s %.2f %s' %(\"Maximum emitter current =\",Ie1*10**3,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The collector to emitter volatge(saturation) =\",Vce1,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum emitter current = 19.25 mA\n",
+ "\n",
+ "The collector to emitter volatge = 2.63 V\n",
+ "\n",
+ "Maximum emitter current = 34.29 mA\n",
+ "\n",
+ "The collector to emitter volatge(saturation) = 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of base resistance\n",
+ "#given\n",
+ "\n",
+ "B=100.; #dc beta\n",
+ "Rc=200.;#ohm #resistor connected to collector\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Vce=4.5;#V #Collector to emitter voltage\n",
+ "Ic=(Vcc-Vce)/(Rc+Re);\n",
+ "Ib=Ic/B;\n",
+ "Rb=(Vcc-B*Re*Ib)/Ib;\n",
+ "print '%s %.f %s' %(\"The value of base resistance is =\",Rb/1000,\"kohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base resistance is = 90 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the collector current at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.;#dc beta\n",
+ "Rc=2.;#ohm #resistor connected to collector\n",
+ "Re=1000.;#ohm #resistor connected to emitter\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.2f %s' %(\"The collector current at (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.;#dc beta\n",
+ "Ib1=Vcc/(Rb+B1*Re); #Base current\n",
+ "Ic1=B1*Ib1; #Colletor current\n",
+ "print '%s %.1f %s' %(\"The collector current at (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.1f' %(\"The factor at which collector current increases=\",Ic1/Ic);\n",
+ "\n",
+ "#IN BOOK Ic(AT B=50)= 1.25 mA and Ic1/Ic=2.4 DUE TO APPROAXIMATION\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current at (B=50)= 1.29 mA\n",
+ "\n",
+ "The collector current at (B=150)= 3.0 mA\n",
+ "\n",
+ "The factor at which collector current increases= 2.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Q point in voltage divider\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.*10.**3.;#ohm #voltage divider resistor 1\n",
+ "R2=1.*10.**3.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "I=Vcc/(R1+R2); #current through voltage divider\n",
+ "Vb=I*R2; #voltage at base\n",
+ "Ve=Vb-Vbe;\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie #approaximating Ib is nearly equal to 0\n",
+ "Vc=Vcc-Ic*Rc;\n",
+ "Vce=(Vc)-Ve; \n",
+ "print '%s %.1f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Ibc=I/20.; #critical value of base current\n",
+ "Ib=Ic/B; #actual base current\n",
+ "\n",
+ "#Since Ib < Ibc, hence assumption is alright\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 3.3 V 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Solve the voltage divider accurately by applying thevenin's theorem\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.;#ohm #voltage divider resistor 1\n",
+ "R2=1.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "\n",
+ "Vth=Vcc*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent voltage Vth =\",Vth,\"V\");\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent resistance Rth =\",Rth,\"kohm\");\n",
+ "\n",
+ "Ib=(Vth-Vbe)/(Rth+(1.+B)*Re);\n",
+ "Ic=B*Ib;\n",
+ "Ie=Ic+Ib;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re; \n",
+ "print '%s %.4f %s' %(\"\\nThe accurate value of Ic =\",Ic*10**3,\"mA\");\n",
+ "print '%s %.5f %s' %(\"\\nThe accurate value of Vce =\",Vce,\"V\");\n",
+ "Icp=3.*10.**-3.; # Current calculated by voltage divider in previous example\n",
+ "Vcep=3.4; # Voltage calculated by voltage divider in previous example\n",
+ "Err_Ic=(Ic-Icp)*100./Ic;\n",
+ "Err_Vce=(Vce-Vcep)*100./Vce;\n",
+ "print '%s %.1f %s' %(\"\\nError in Ic =\",Err_Ic,\"percent\\n\");\n",
+ "print '%s %.1f %s' %(\"\\nError in Vce =\",Err_Vce,\"percent\");\n",
+ "\n",
+ "# The errors and The accurate values are different \n",
+ "# because of the approaximation in Vth and Rth in book\n",
+ "\n",
+ "# In Book Ic = 2.8436 mA and Vce = 3.73839 V\n",
+ "# Error in Ic = -5.5% \n",
+ "# Error in Vce = +9% \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin equivalent voltage Vth = 0.9 V\n",
+ "\n",
+ "Thevenin equivalent resistance Rth = 0.9 kohm\n",
+ "\n",
+ "The accurate value of Ic = 3.0152 mA\n",
+ "\n",
+ "The accurate value of Vce = 3.36060 V\n",
+ "\n",
+ "Error in Ic = 0.5 percent\n",
+ "\n",
+ "\n",
+ "Error in Vce = -1.2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the Q point for the emitter bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=5.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=10.*10.**3.;#ohm #resistor connected to emitter \n",
+ "Vcc=12.;#V #Voltage supply across the collector resistor\n",
+ "Vee=15;#V #supply at emitter\n",
+ "Ie=Vee/Re;\n",
+ "Ic=Ie;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 4.5 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Rs\n",
+ "#given\n",
+ "import math\n",
+ "Vp=2.;#V\n",
+ "Idss=1.75*10.**-3.;#A #drain current at Vgs=0\n",
+ "Vdd=24.;#V #drain to supply source\n",
+ "Id=1.*10.**-3.;#A #drain current\n",
+ "Vgs=(-Vp)*(1-math.sqrt(Id/Idss));\n",
+ "Rs=abs(Vgs)/Id;\n",
+ "print '%s %.3f %s' %(\"Vgs =\",Vgs,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Rs =\",Rs,\"ohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vgs = -0.488 V\n",
+ "\n",
+ "Rs = 488 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter07.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter07.ipynb new file mode 100755 index 00000000..ef03f356 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter07.ipynb @@ -0,0 +1,591 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:df8de903c993d95a64f446dabb646c726ccbd74d5f5097708ab83278555b0cb9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter07:Small Signal SIngle-Stage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max current and check will the capacitor act as short for given frequency\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "Vs=1.;#V\n",
+ "Imax=Vs/(Rs+Rl);\n",
+ "fc=1./(2.*math.pi*(Rs+Rl)*C) #critical frequency\n",
+ "fh=10.*fc; #Border frequency\n",
+ "print '%s %.f %s' %(\"Maximum current is =\",Imax*10**6,\"uA\\n\");\n",
+ "print '%s %.2f %s' %(\"fh =\",fh,\"Hz\\n\");\n",
+ "print '%s %.2f %s %s' %(\"As long as source frequency is greater than\",fh,\"Hz\",\"the coupling capacitor acts like an ac short for 20Hz to 20kHz\")\n",
+ "\n",
+ "#In book Imax is 200mA but there is misprinting of 'm' in mA it should be uA\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum current is = 200 uA\n",
+ "\n",
+ "fh = 3.18 Hz\n",
+ "\n",
+ "As long as source frequency is greater than 3.18 Hz the coupling capacitor acts like an ac short for 20Hz to 20kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the capacitor is an effective bypass for the signal currents of lowest frequency 20 Hz\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "f=20.;#Hz #lowest frequency\n",
+ "Xc=1./(2.*math.pi*f*C) #reactance of capacitor at 20Hz\n",
+ "Rth=Rs*Rl/(Rs+Rl); #Thevenins equivalent resistance\n",
+ "print '%s %.1f %s %.f %s ' %(\"Xc < Rth/10 is satisfied\",Xc,\"ohm\",Rth/10,\"ohm\\n\");\n",
+ "print '%s' %(\"The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Xc < Rth/10 is satisfied 79.6 ohm 80 ohm\n",
+ " \n",
+ "The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of capacitor required\n",
+ "#given\n",
+ "import math\n",
+ "Rs1=20.*10.**3.;#ohm\n",
+ "Rs2=30.*10.**3.;#ohm\n",
+ "Rl1=40.*10.**3.;#ohm\n",
+ "Rl2=80.*10.**3.;#ohm\n",
+ "Rl3=80.*10.**3.;#ohm\n",
+ "Rth=Rs1*Rs2/(Rs1+Rs2); #Thevenins equivalent resistance\n",
+ "Rl_=Rl2*Rl3/(Rl2+Rl3);\n",
+ "Rl=Rl1*Rl_/(Rl1+Rl_); #Equivalent load\n",
+ "f=50.;#Hz #lowest frequency\n",
+ "R=Rth+Rl;\n",
+ "C=10./(2.*math.pi*f*R)\n",
+ "print '%s %.f %s' %(\"The required value of coupling capacitor is =\",C*10**6,\"uF\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of coupling capacitor is = 1 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage and current gain and input and output resistance\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "#given\n",
+ "\n",
+ "#DC analysis\n",
+ "Vcc=12.;#V\n",
+ "Rb=200.*10.**3.;#ohm\n",
+ "Rc=1.*10.**3.;#ohm\n",
+ "B=100.;# beta\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#AC analysis\n",
+ "Rl=1.*10.**3.;#ohm\n",
+ "hfe=B;\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "hoe_1=40.*10.**3.;#ohm # 1/hoe\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-hfe*Rac/hie;\n",
+ "print '%s %.2f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "\n",
+ "#Siince (1/hoe) > Rac therefore entire current will flows through Rac\n",
+ "Io=-100.*Ib;\n",
+ "Ac=Io/Ib;\n",
+ "print '%s %.2f %s' %(\"The current gain =\",Ac,\"\\n\");\n",
+ "\n",
+ "Ri=prll(Rb,hie);\n",
+ "Ro=prll(Rl,prll(Rc,hoe_1));\n",
+ "print '%s %.f %s' %(\"The input resistance =\",Ri/1000,\"kohm\\n\");\n",
+ "print '%s %.1f %s' %(\"The output resistance =\",Ro/1000,\"kohm\");\n",
+ "\n",
+ "#In book the voltage gain is 25 due to skipping of '-' in printing\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 6.00 V 6.00 mA\n",
+ "\n",
+ "The voltage gain = -25.00 \n",
+ "\n",
+ "The current gain = -100.00 \n",
+ "\n",
+ "The input resistance = 2 kohm\n",
+ "\n",
+ "The output resistance = 0.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Solve previous example using hybrid pie model\n",
+ "#soltion\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "Vcc=12.##V\n",
+ "Rb=200.*10.**3.##ohm\n",
+ "Rc=1.*10.**3.##ohm\n",
+ "Rl=1.*10.**3.##ohm\n",
+ "B=100.## beta\n",
+ "hie=2.*10.**3.##ohm\n",
+ "hoe_1=40.*10.**3.##ohm # 1/hoe\n",
+ "\n",
+ "Ib=Vcc/Rb#\n",
+ "Ic=B*Ib#\n",
+ "Rac=prll(Rc,Rl)#\n",
+ "gm=Ic/(25.*10.**-3.)#\n",
+ "rpi=B/gm#\n",
+ "ri=hie#\n",
+ "rb=ri-rpi#\n",
+ "ro=hoe_1#\n",
+ "Vpi=rpi/(rpi+rb)#\n",
+ "Vo=-gm*Vpi*Rac# #output voltage\n",
+ "Av=Vo#\n",
+ "print '%s %.2f' %(\"The voltage gain\",Av)#\n",
+ "#In book voltage gain is -24.96 due to appraoximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain -25.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of output voltage\n",
+ "#given\n",
+ "Vcc=12.;#V\n",
+ "Rb=150.*10.**3.;#ohm\n",
+ "Rc=5.*10.**3.;#ohm\n",
+ "B=200.;# beta\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "ro=60.*10.**3.;#ohm # 1/hoe\n",
+ "Vi=1.*10.**-3.;#V\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "# Icsat < Ic therefore transistor is in saturation mode and outpuut voltage wil be zero\n",
+ "Vo=0;\n",
+ "print '%s %.f %s' %(\"The output voltage=\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage= 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input resistance\n",
+ "# Function definition is here\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2);\n",
+ "\treturn z\n",
+ "\n",
+ "R1=75.*10.**3.;#ohm\n",
+ "R2=7.5*10.**3.;#ohm\n",
+ "Rc=4.7*10.**3.;#ohm\n",
+ "Re=1.2*10.**3.;#ohm\n",
+ "Rl=12.*10.**3.;#ohm\n",
+ "B=150.;\n",
+ "ri=2.*10.**3.;#ohm\n",
+ "Vcc=15.;#V\n",
+ "Vb=Vcc*R2/(R1+R2);\n",
+ "Ve=Vb; #since Vbe=0\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie;\n",
+ "Icsat=Vcc/(Rc+Re);\n",
+ "# Ic < Icsat therefore transistor is in active mode\n",
+ "Vce=Vcc-Ic*(Rc+Re);\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-B*Rac/ri;\n",
+ "print '%s %.1f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "Ri_=prll(ri,R2);\n",
+ "print '%s %.2f %s' %(\"The input resistance=\",Ri_/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 8.30 V 1.14 mA\n",
+ "\n",
+ "The voltage gain = -253.3 \n",
+ "\n",
+ "The input resistance= 1.58 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of gm at different values of Vgs\n",
+ "#given\n",
+ "\n",
+ "Idss=8.*10.**-3.;#A\n",
+ "Vp=4;#V\n",
+ "#At Vgs= -0.5 V\n",
+ "Vgs= -0.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.f %s' %(\"gmo =\",gmo*1000,\"mS\\n\");\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -0.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -1.5 V\n",
+ "Vgs= -1.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -1.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -2.5 V\n",
+ "Vgs= -2.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -2.5V) =\",gm*1000,\"mS\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gmo = 4 mS\n",
+ "\n",
+ "gm (At Vgs = -0.5V) = 3.5 mS\n",
+ "\n",
+ "gm (At Vgs = -1.5V) = 2.5 mS\n",
+ "\n",
+ "gm (At Vgs = -2.5V) = 1.5 mS\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output signal voltage of the amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Rd=12.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Cs=25.*10.**-6.;#F\n",
+ "u=80.; #amplification factor\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Vi=0.1;#V\n",
+ "f=1.*10.**3.;#Hz #input frequency\n",
+ "Xcs=1./(2.*math.pi*f*Cs);\n",
+ "#This is much smaller than Rs therefore it is bypassed\n",
+ "\n",
+ "gm=u/rd;\n",
+ "Av=gm*(rd*Rd/(rd+Rd));\n",
+ "Vo=Av*Vi;\n",
+ "print '%s %.3f %s' %(\"The output voltage is =\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 0.453 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "Rd=2.*10.**3.;#ohm\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Av=-gm*(rd*Rd/(rd+Rd));\n",
+ "Ri=Rg;\n",
+ "Ro=rd*Rd/(rd+Rd);\n",
+ "print '%s %.f %s %.f %s %s %.f %s' %(\"The small signal voltage gain =\",Av,\"\\ninput resistance=\",Ri/10**6,\"Mohm\",\"\\noutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -4 \n",
+ "input resistance= 1 Mohm \n",
+ "output resistance = 2 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=500.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Rd=5.*10.**3.;#ohm\n",
+ "Rs=100.;#ohm\n",
+ "Rl=5.*10.**3.;#ohm\n",
+ "gm=1.5*10.**-3.;#S\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Rg=R1*R2/(R1+R2);\n",
+ "Rac=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*Rac;\n",
+ "Ri=Rg;\n",
+ "Ro=(rd*Rac/(rd+Rac));\n",
+ "print '%s %.2f %s %.2f %s %s %.1f %s' %(\"The small signal voltage gain =\",Av,\"\\nInput resistance =\",Ri/1000,\"kohm\",\"\\nOutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -3.75 \n",
+ "Input resistance = 45.45 kohm \n",
+ "Output resistance = 2.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the voltage gain of the FET\n",
+ "#given\n",
+ "Idss=8.*10.**-3.##A\n",
+ "Vp=4.##V\n",
+ "rd=25.*10.**3.##ohm\n",
+ "Rd=2.2*10.**3.##ohm #by the help of figure\n",
+ "Vgs=-1.8##V\n",
+ "gmo=2.*Idss/(abs(Vp))#\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)))#\n",
+ "Av=-gm*(rd*Rd/(rd+Rd))#\n",
+ "print '%s %.2f' %(\"The voltage gain of the FET =\",Av)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain of the FET = -4.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter08.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter08.ipynb new file mode 100755 index 00000000..e4cb5ead --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter08.ipynb @@ -0,0 +1,393 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:47928243cc84327e58308ad01fcae0874127c6d6b4c52996e681382b0f99add6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter08:Multistage Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Express the gain in decibel\n",
+ "#given\n",
+ "#Powere gain of 1000\n",
+ "import math\n",
+ "Pg1=1000.;\n",
+ "Pgd1=10.*math.log10(Pg1);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd1,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1000\n",
+ "Vg1=1000.;\n",
+ "Vgd1=20.*math.log10(Vg1);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd1,\"dB\\n\");\n",
+ "\n",
+ "#Powere gain of 1/100\n",
+ "Pg2=1./100.;\n",
+ "Pgd2=10.*math.log10(Pg2);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd2,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1/100\n",
+ "Vg2=1./100.;\n",
+ "Vgd2=20.*math.log10(Vg2);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd2,\"dB\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain (in dB)= 30 dB\n",
+ "\n",
+ "Voltage gain (in dB)= 60 dB\n",
+ "\n",
+ "Power gain (in dB)= -20 dB\n",
+ "\n",
+ "Voltage gain (in dB)= -40 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine power and voltage gain\n",
+ "#given\n",
+ "#For Gain = 10 dB\n",
+ "G=10.;#dB\n",
+ "Pg1=10.**(G/10.); #taking antilog\n",
+ "Vg1=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.f %s' %(\"Power gain ratio =\",Pg1,\"\\n\");\n",
+ "print '%s %.2f %s' %(\"Voltage gain ratio =\",Vg1,\"\\n\");\n",
+ "\n",
+ "#For Gain 3 dB\n",
+ "G=3.;#dB\n",
+ "Pg2=10.**(G/10.); #taking antilog\n",
+ "Vg2=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.2f %s' %(\"Power gain ratio =\",Pg2,\"\\n\");\n",
+ "print '%s %.3f %s' %(\"Voltage gain ratio =\",Vg2,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Gain 10 dB\n",
+ "\n",
+ "Power gain ratio = 10 \n",
+ "\n",
+ "Voltage gain ratio = 3.16 \n",
+ "\n",
+ "For Gain 3 dB\n",
+ "\n",
+ "Power gain ratio = 2.00 \n",
+ "\n",
+ "Voltage gain ratio = 1.413 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the overall voltage gain\n",
+ "#given\n",
+ "import math\n",
+ "A1=80.\n",
+ "A2=50.\n",
+ "A3=30.\n",
+ "Ad=20.*math.log10(A1)+20.*math.log10(A2)+20.*math.log10(A3);\n",
+ "\n",
+ "#Alternatively\n",
+ "A=A1*A2*A3;\n",
+ "Ad=20.*math.log10(A);\n",
+ "print '%s %.2f %s' %(\"The Voltage gain is =\",Ad,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Voltage gain is = 101.58 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate quiescent output voltage and small signal voltage gain\n",
+ "#given\n",
+ "#At input Voltage =3V\n",
+ "Vi1=3.##V #input voltage\n",
+ "Vbe=0.7##V\n",
+ "B=250.#\n",
+ "Vcc=10.##V #Supply\n",
+ "Re1=1.*10.**3.##ohm\n",
+ "Rc1=3.*10.**3.##ohm\n",
+ "Re2=2.*10.**3.##ohm\n",
+ "Rc2=4.*10.**3.##ohm\n",
+ "Vb1=Vi1# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo1=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage(At input Voltage = 3V) is =\",Vo1,\"V\\n\")#\n",
+ "\n",
+ "#At input Voltage =3.2 V\n",
+ "Vi2=3.2##V #input voltage\n",
+ "Vb1=Vi2# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo2=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage (At input Voltage =3.2 V) is =\",Vo2,\"V\\n\")#\n",
+ "\n",
+ "#Small Signal input and output voltage\n",
+ "vi=Vi2-Vi1#\n",
+ "vo=Vo2-Vo1#\n",
+ "Av=vo/vi#\n",
+ "print '%s %.f' %(\"The small signal voltage gain is =\",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The quiescent output voltage(At input Voltage = 3V) is = 5.2 V\n",
+ "\n",
+ "The quiescent output voltage (At input Voltage =3.2 V) is = 6.4 V\n",
+ "\n",
+ "The small signal voltage gain is = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the maximum voltage gain and bandwidth of multistage amplifier\n",
+ "#FUNCTIONS\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "rin=10.*10.**6.;#ohm #input resistance of JFET\n",
+ "Rd=10.*10.**3.;#ohm\n",
+ "Rs=500.;#ohm\n",
+ "Rg=470.*10.**3.;#ohm\n",
+ "Rl=470.*10.**3.;#ohm\n",
+ "Cc=0.01*10.**-6.;#Farad\n",
+ "Csh=100.*10.**-12.;#Farad\n",
+ "Cs=50.*10.**-6.;#Farad\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Rac2=prll(Rd,Rl);\n",
+ "Rac1=prll(Rd,Rg);\n",
+ "Req=prll(rd,prll(Rd,Rl));\n",
+ "Am=math.ceil(gm*Req);\n",
+ "Am2=Am*Am; #Voltage gain of two stage amplifier\n",
+ "print '%s %.f %s' %(\"Voltage gain of two stage amplifier=\",Am2,\"\\n\");\n",
+ "R_=prll(rd,Rd)+prll(Rg,rin);\n",
+ "f1=1./(2.*math.pi*Cc*R_); #lower cutoff frequency\n",
+ "f1_=f1/(math.sqrt(math.sqrt(2.)-1.));\n",
+ "f2=1./(2.*math.pi*Csh*Req); #upper cutoff frequency\n",
+ "f2_=f2*(math.sqrt(math.sqrt(2.)-1.));\n",
+ "BW=f2_-f1_;\n",
+ "print '%s %.f %s' %(\"Bandwidth=\",BW/1000.,\"kHz\\n\");\n",
+ "#There is a slight error in f1 due to use of R'(here R_)=479 kohm and in f2 due to approaximation of Req there is a slight variation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain of two stage amplifier= 324 \n",
+ "\n",
+ "Bandwidth= 115 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the midband voltage gain and bandwidth of cascade amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Am=8.##midband voltage gain of individual MOSFET\n",
+ "BW=500.*10.**3.#Hz\n",
+ "f2=BW#\n",
+ "n=4.#\n",
+ "A2m=Am**n#\n",
+ "f2_=f2*(math.sqrt((2.**(1./n))-1.))#\n",
+ "print '%s %.f %s' %(\"Midband voltage gain =\",A2m,\"\\n\")#\n",
+ "print '%s %.1f %s' %(\"Overall Bandwidth =\",f2_/1000,\"kHz\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Midband voltage gain = 4096 \n",
+ "\n",
+ "Overall Bandwidth = 217.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the input and output impedance and voltage gain\n",
+ "#FUNCTIONS\n",
+ "\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "hie=1.1*10.**3.;#ohm=rin\n",
+ "hfe=120.;#=B\n",
+ "#the values of Rac2, Zi, Zo are as per diagram\n",
+ "Rac2=prll(3.3*10**3,2.2*10**3);\n",
+ "Rac1=prll(6.8*10**3,prll(56*10**3,prll(5.6*10**3,1.1*10**3)));\n",
+ "Zi=prll(5.6*10**3,prll(56*10**3,1.1*10**3));\n",
+ "Zo=prll(3.3*10**3,2.2*10**3);\n",
+ "print '%s %.3f %s %s %.2f %s' %(\"Input Resistance =\",Zi/1000,\"kohm\\n\",\"\\nOutput Resistance =\",Zo/1000,\"kohm\");\n",
+ "Am2=-hfe*Rac2/(hie);\n",
+ "Am1=-hfe*Rac1/(hie);\n",
+ "Am=Am1*Am2;\n",
+ "Am=20.*math.log10(Am);\n",
+ "print '%s %.2f %s' %(\"\\nThe Overall Voltage gain is\",Am,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input Resistance = 0.905 kohm\n",
+ " \n",
+ "Output Resistance = 1.32 kohm\n",
+ "\n",
+ "The Overall Voltage gain is 81.97 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter09.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter09.ipynb new file mode 100755 index 00000000..b31e5fc7 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter09.ipynb @@ -0,0 +1,277 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:58dac3f9469c1fa78c6aeab36d8b7e58e74064bbe6f173699cbfdd2fb606b914"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter09:Power Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the turns ratio of the transformer\n",
+ "#given\n",
+ "import math\n",
+ "Rl=8.;#ohm\n",
+ "Rl_=5.*10.**3.;#ohm\n",
+ "TR=math.sqrt(Rl_/Rl); #Turns ratio\n",
+ "print '%s %.f %s' %(\"Turns Ratio =\",TR,\": 1\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Turns Ratio = 25 : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the output impedance of the transistor\n",
+ "#given\n",
+ "TR=16./1.; #turn ratio\n",
+ "Rl=4.;#ohm #loudspeaker impedance\n",
+ "ro=(TR**2.)*Rl;\n",
+ "print '%s %.f %s' %(\"The output impedance of the transistor =\",ro,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output impedance of the transistor = 1024 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Determine the efficiency of a single ended transformer\n",
+ "#given\n",
+ "Vceq=10.;#V #supply voltage\n",
+ "\n",
+ "#At Vp=10V\n",
+ "Vp=10.;#V\n",
+ "Vce_max1=Vceq+Vp;\n",
+ "Vce_min1=Vceq-Vp;\n",
+ "n1=50.*((Vce_max1-Vce_min1)/(Vce_max1+Vce_min1))**2.;\n",
+ "print '%s %.f %s' %(\"Efficiency (At Vp = 10V)=\",n1,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=5V\n",
+ "Vp=5.;#V\n",
+ "Vce_max2=Vceq+Vp;\n",
+ "Vce_min2=Vceq-Vp;\n",
+ "n2=50.*((Vce_max2-Vce_min2)/(Vce_max2+Vce_min2))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 5V)=\",n2,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=1V\n",
+ "Vp=1.;#V\n",
+ "Vce_max3=Vceq+Vp;\n",
+ "Vce_min3=Vceq-Vp;\n",
+ "n3=50.*((Vce_max3-Vce_min3)/(Vce_max3+Vce_min3))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 1V)=\",n3,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency (At Vp = 10V)= 50 percent\n",
+ "\n",
+ "Efficiency (At Vp = 5V)= 12.5 percent\n",
+ "\n",
+ "Efficiency (At Vp = 1V)= 0.5 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine input and output power and efficiency\n",
+ "#given\n",
+ "import math\n",
+ "Vcc=20.;#V#supply voltage\n",
+ "Rl=4.;#ohm\n",
+ "Vp=15.;#V\n",
+ "Ip=Vp/Rl;\n",
+ "Idc=Ip/math.pi;\n",
+ "Pi=Vcc*Idc;\n",
+ "Po=((Vp/2.)**2.)/Rl;\n",
+ "n=100.*Po/Pi;\n",
+ "print '%s %.1f %s' %(\"Input power =\",Pi,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Output power =\",Po,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 23.9 W\n",
+ "\n",
+ "Output power = 14.06 W\n",
+ "\n",
+ "Efficiency = 58.90 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage increase in output power\n",
+ "#given\n",
+ "D=0.2;#harmonic distortion\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power=\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage increase in output power= 4 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n",
+ "\n",
+ "The percentage increase in output power = 1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter10.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter10.ipynb new file mode 100755 index 00000000..4e6b0eab --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter10.ipynb @@ -0,0 +1,379 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:efde35bc6b39332bcbdd0902e3c4730008212f1e0c635f78b359c0a32b2006c0"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10:Feedback in Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier\n",
+ "#given\n",
+ "A=100.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 9.09 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=60.;#dB #internal gain in dB\n",
+ "A=10.**(Ad/20.); #internal gain\n",
+ "B=1./20.;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "Afd=20.*math.log10(Af);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Afd,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 25.85 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of output fed back to input\n",
+ "#given\n",
+ "A=600.;#internal gain\n",
+ "Af=50.;#gain of feedback amplifier\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.3f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of output fed back to input = 1.833 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the internal gain and percentage of output fed back to input\n",
+ "#given\n",
+ "Af=80.;#gain of feedback amplifier\n",
+ "Vi=0.05;#V#input with feedback\n",
+ "Vi_=4.*10.**-3.;#V#input without feedback\n",
+ "Vo_=Af*Vi;\n",
+ "A=Vo_/Vi_;\n",
+ "print '%s %.f %s' %(\"The internal gain is =\",A,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.2f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal gain is = 1000 \n",
+ "\n",
+ "The percentage of output fed back to input = 1.15 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain with and without feedback and feedback factor\n",
+ "#given\n",
+ "Vo_=5.;#V #output voltage\n",
+ "Vi=0.2;#V #input with feedback\n",
+ "Vi_=0.05;#V #input without feedback\n",
+ "A=Vo_/Vi_;\n",
+ "Af=Vo_/Vi;\n",
+ "print '%s %.f %s' %(\"The gain without feedback is =\",A,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The gain with feedback is =\",Af,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain without feedback is = 100 \n",
+ "\n",
+ "The gain with feedback is = 25 \n",
+ "\n",
+ "The feedback factor = 3 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain of feedback amplifier and feedback factor\n",
+ "#given\n",
+ "A=100.; #internal gain\n",
+ "N=20.;#dB #negative feedback\n",
+ "B=(10.**(-N/(-20.))-1.)/A; #taking antilog\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n",
+ "print '%s %.f %s' %(\"The gain of the feedback amplifier is =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The feedback factor = 9 percent\n",
+ "\n",
+ "The gain of the feedback amplifier is = 10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "A=1000.;#internal gain\n",
+ "N=40.;#dB#negative feedback\n",
+ "D=10.**((-N)/-20.);#D=(1+AB)desensitivity\n",
+ "dA_A=10.;#percent#dA/A\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.1f %s' %(\"The percentage change in the overall gain =\",dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain = 0.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "Adb=60.;#dB#internal gain in dB\n",
+ "B=0.005;#feedback factor\n",
+ "A=10.**(Adb/(20.));#taking antilog\n",
+ "dA_A=-12.;#percent #dA/A\n",
+ "D=(1.+A*B);#D=(1+AB)desensitivity\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.f %s' %(\"The percentage change in the overall gain reduces by =\",-dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain reduces by = 2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the input resistance of feedback amplifier\n",
+ "#given\n",
+ "A=250.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Ri=1.1*10.**3.;#ohm #input resistance\n",
+ "Rif=Ri*(1.+A*B);\n",
+ "print '%s %.1f %s' %(\"The input resistance of feedback amplifier =\",Rif/1000,\"kohm\");\n",
+ "\n",
+ "#The ans in book is incorrect due to use of (2+A*B) instead of (1+A*B) the ans in book is 29.7 kohm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input resistance of feedback amplifier = 28.6 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of negative feedback to input\n",
+ "#given\n",
+ "Adb=60.;#dB #internal gain in dB\n",
+ "A=10.**(Adb/(20.)); #taking antilog\n",
+ "Ro=12.*10.**3.;#ohm #output resistance\n",
+ "Rof=600.;#ohm\n",
+ "B=(Ro/Rof-1.)/A;\n",
+ "print '%s %.1f %s' %(\"The percentage of negative feedback to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of negative feedback to input = 1.9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter11.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter11.ipynb new file mode 100755 index 00000000..776f0b1a --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter11.ipynb @@ -0,0 +1,186 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3303f44cdb2f2123a36f676f7675540bf34779306594f12942900e5506f78518"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11:Tuned Volatge AMplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current and voltage across each element at resonance\n",
+ "#given\n",
+ "import math\n",
+ "R=12.;#ohm\n",
+ "L=200.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "Vs=9.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Z=R;#impedance\n",
+ "print '%s %.1f %s' %(\"The Resonant frequency =\",fo/1000,\"kHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Z,\"ohm\\n\");\n",
+ "\n",
+ "Io=Vs/R;\n",
+ "print '%s %.2f %s' %(\"The Source current =\",Io,\"A\\n\");\n",
+ "\n",
+ "Vl=Io*(2.*math.pi*fo*L);\n",
+ "Vc=Io/(2.*math.pi*fo*C);\n",
+ "Vr=Io*R;\n",
+ "print '%s %.1f %s' %(\"The voltage across the inductor =\",Vl,\"V\\n\");\n",
+ "print '%s %.1f %s' %(\"The voltage across the capacitor =\",Vc,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The voltage across the resistor =\",Vr,\"V\\n\");\n",
+ "#There is a slight variation in voltage across capacitor due to the approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 649.7 kHz\n",
+ "\n",
+ "The impedance Z = 12 ohm\n",
+ "\n",
+ "The Source current = 0.75 A\n",
+ "\n",
+ "The voltage across the inductor = 612.4 V\n",
+ "\n",
+ "The voltage across the capacitor = 612.4 V\n",
+ "\n",
+ "The voltage across the resistor = 9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current at resonance and current in coil and capacitor\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=100.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "Vs=10.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.3f %s' %(\"The Resonant frequency =\",fo/10**6,\"MHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Io=Vs/Zp;\n",
+ "print '%s %.f %s' %(\"The Source current =\",Io*10**6,\"uA\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Xc=1./(2.*math.pi*fo*C);\n",
+ "Z1=math.sqrt(Xl**2.+R**2.);\n",
+ "Z2=Xc;\n",
+ "Ic=Vs/Z2;\n",
+ "Il=Ic;\n",
+ "print '%s %.f %s' %(\"The current in the coil =\",1000,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"The current in the capacitor =\",Ic*1000,\"mA\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 1.592 MHz\n",
+ "\n",
+ "The impedance Z = 100 kohm\n",
+ "\n",
+ "The Source current = 100 uA\n",
+ "\n",
+ "The current in the coil = 1000 ohm\n",
+ "\n",
+ "The current in the capacitor = 10 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate impedance and quality factor and bandwidth\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=150.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1/(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Q=Xl/R;\n",
+ "BW=fo/Q;\n",
+ "print '%s %.1f %s' %(\"The Quality factor of the circuit =\",Q,\"\\n\");\n",
+ "print '%s %.1f %s' %(\"The Band width of the circuit =\",BW/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impedance Z = 150 kohm\n",
+ "\n",
+ "The Quality factor of the circuit = 122.5 \n",
+ "\n",
+ "The Band width of the circuit = 10.6 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter12.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter12.ipynb new file mode 100755 index 00000000..842a7419 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter12.ipynb @@ -0,0 +1,214 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f3203bf7786c39de89c39055969e5210f4d6ecee2a5994233cbc07ff50437a9b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12:Sinusoidal Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "L=55.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.f %s' %(\"The frequency of oscillations =\",fo/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1239 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations and feedback factor and voltage gain\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "C1=0.001*10.**-6.;#F\n",
+ "C2=0.01*10.**-6.;#F\n",
+ "L=15.*10.**-6.;#H\n",
+ "C=prll(C1,C2);\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/10**6,\"MHz\\n\");\n",
+ "B=C1/C2;\n",
+ "Amin=1./B;\n",
+ "print '%s %.1f %s' %(\"The feedback factor of the circuit =\",B,\"\\n\");\n",
+ "print '%s %.f' %(\"The circuit needs a minimum voltage gain of\",Amin);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1.36 MHz\n",
+ "\n",
+ "The feedback factor of the circuit = 0.1 \n",
+ "\n",
+ "The circuit needs a minimum voltage gain of 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=10.*10.**3.;#ohm\n",
+ "C=0.01*10.**-6.;#F\n",
+ "fo=1./(2.*math.pi*R*C*math.sqrt(6.));\n",
+ "print '%s %.1f %s' %(\"The frequency of oscillations =\",fo,\"Hz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 649.7 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=22.*10.**3.;#ohm\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*R*C);\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/1000,\"KHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 72.34 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter14.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter14.ipynb new file mode 100755 index 00000000..31604c97 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter14.ipynb @@ -0,0 +1,211 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:22a4fbff9c8897e342a78bd9c8e48f9f093d2131b002f5667d92f4929ec8b5e4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter14:Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "Acl=-Rf/R1;\n",
+ "Ricl=R1;\n",
+ "Ro=0;\n",
+ "print '%s %.f %s' %(\"The voltage gain =\",Acl,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The input resistance =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"The output resistance =\",Ro,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -100 \n",
+ "\n",
+ "The input resistance = 20 kohm\n",
+ "\n",
+ "The output resistance = 0 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output voltage\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "v1=4.;#V\n",
+ "v2=3.8;#V\n",
+ "vo=v2*(1.+Rf/R1)-(Rf/R1)*v1;\n",
+ "print '%s %.1f %s' %(\"The output voltage =\",vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -16.2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design an adder circuit using an op amp\n",
+ "#given\n",
+ "#Vo=-(V1+10*V2+100*V3)\n",
+ "Rf=100.*10.**3.;#ohm\n",
+ "C1=1.;#coefficient of V1\n",
+ "C2=10.;#coefficient of V2\n",
+ "C3=100.;#coefficient of V3\n",
+ "R1=Rf/C1;\n",
+ "R2=Rf/C2;\n",
+ "R3=Rf/C3;\n",
+ "print '%s %.f %s' %(\"R1 =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R2 =\",R2/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R3 =\",R3/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 kohm\n",
+ "\n",
+ "R2 = 10 kohm\n",
+ "\n",
+ "R3 = 1 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate CMRR in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=100.;#differential mode gain\n",
+ "Ac=0.01;#common mode gain\n",
+ "CMRR=20.*math.log10(Ad/Ac);\n",
+ "print '%s %.f %s' %(\"The CMRR in dB =\",CMRR,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The CMRR in dB = 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the output voltage\n",
+ "#given\n",
+ "Ad=2000.;#differential mode gain\n",
+ "CMRR=10000.;\n",
+ "V1=10.**-3.;#V\n",
+ "V2=0.9*10.**-3.;#V\n",
+ "Vd=V1-V2;\n",
+ "Vc=(V1+V2)/2.;\n",
+ "Vo=Ad*Vd*(1.+Vc/(CMRR*Vd));\n",
+ "print '%s %.2f %s' %(\"The output voltage is =\",Vo*1000,\"mV\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 200.19 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter15.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter15.ipynb new file mode 100755 index 00000000..fd33b772 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter15.ipynb @@ -0,0 +1,321 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3272b71267bbacf52f9c327ed8b09b4bccad5d41aa103777487106ade1397663"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter15:Electronic Instruments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance and multiplying factor\n",
+ "#given\n",
+ "Im=5.*10.**-3.;#A\n",
+ "Rm=20.;#ohm\n",
+ "I=5.;#A\n",
+ "Rsh=Rm*Im/(I-Im);\n",
+ "n=I/Im;\n",
+ "print '%s %.5f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"Multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 0.02002 ohm\n",
+ "\n",
+ "Multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance\n",
+ "#given\n",
+ "#At I= 1 mA\n",
+ "I1=1.*10.**-3.;#A\n",
+ "Im=0.1*10.**-3.;#A\n",
+ "Rm=500.;#ohm\n",
+ "Rsh=Rm*Im/(I1-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I2=10.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I2-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I3=100.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I3-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 55.5556 ohm\n",
+ "\n",
+ "Shunt resistance = 5.0505 ohm\n",
+ "\n",
+ "Shunt resistance = 0.5005 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 514"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caluclate the series resistance to convert it into voltmeter\n",
+ "#given\n",
+ "Im=100.*10.**-6.;#A\n",
+ "Rm=100.;#ohm\n",
+ "V=100.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.1f %s' %(\"The value of series resistance is\",Rs/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of series resistance is 999.9 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate multiplier resistance and voltage multiplying factor\n",
+ "#given\n",
+ "Im=50.*10.**-6.;#A\n",
+ "Rm=1000.;#ohm\n",
+ "V=50.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.f %s' %(\"The value of multiplier resistance is\",Rs/1000,\"kohm\\n\");\n",
+ "Vm=Im*Rm;\n",
+ "n=V/Vm;\n",
+ "print '%s %.f %s' %(\"Voltage multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of multiplier resistance is 999 kohm\n",
+ "\n",
+ "Voltage multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate reading and error of each voltmeter\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "S_A=1000.;# ohm/V#sensitivity\n",
+ "S_B=20000.;# ohm/V#sensitivity\n",
+ "R=50.;#V#range of voltmeter\n",
+ "Vs=150.;#V#Supply\n",
+ "R1=100.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Vt=Vs*(R2/(R1+R2));\n",
+ "\n",
+ "#Voltmeter A\n",
+ "Ri1=S_A*R;\n",
+ "Rxy_A=prll(Ri1,R2); #total resistance at X and Y\n",
+ "V1=Vs*(Rxy_A/(Rxy_A+R1));\n",
+ "print '%s %.f %s' %(\"The voltmeter indicates\",V1,\"V\\n\");\n",
+ "\n",
+ "#Voltmeter B\n",
+ "Ri2=S_B*R;\n",
+ "Rxy_B=prll(Ri2,R2); #total resistance at X and Y\n",
+ "V2=Vs*(Rxy_B/(Rxy_B+R1));\n",
+ "print '%s %.2f %s' %(\"The voltmeter indicates\",V2,\"V\\n\");\n",
+ "\n",
+ "e1=(Vt-V1)*100./Vt;\n",
+ "e2=(Vt-V2)*100./Vt;\n",
+ "print '%s %.f %s' %(\"The error in the reading of voltmeter A =\",e1,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"The error in the reading of voltmeter A =\",e2,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltmeter indicates 30 V\n",
+ "\n",
+ "The voltmeter indicates 48.39 V\n",
+ "\n",
+ "The error in the reading of voltmeter A = 40 percent\n",
+ "\n",
+ "The error in the reading of voltmeter A = 3.23 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value of the ac voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=8.3;#cm#length of the trace\n",
+ "D=5.;# V/cm#deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/(2.*math.sqrt(2.));\n",
+ "print '%s %.1f %s' %(\"The rms value of the ac voltage\",Vrms,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the ac voltage 14.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value and frequency of the sine voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=3.5;#cm #length of the trace\n",
+ "D=2.;# V/cm #deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/math.sqrt(2.);\n",
+ "print '%s %.2f %s' %(\"The rms value of the sine voltage =\",Vrms,\"V\\n\");\n",
+ "x=4.;#cm #one cycle length on x axis\n",
+ "t=0.5*10.**-3.;# s/cm #timebase setting\n",
+ "T=x*t;\n",
+ "f=1./T;\n",
+ "print '%s %.1f %s' %(\"The frequency of the sine voltage =\",f/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the sine voltage = 4.95 V\n",
+ "\n",
+ "The frequency of the sine voltage = 0.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01.ipynb new file mode 100755 index 00000000..d9b8d232 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01.ipynb @@ -0,0 +1,241 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f29193149f0b645210af1f807e738f44273cdf4f3faf059dbea7ad23270af3f9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 01:Introduction to Electronics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the range of tolerance\n",
+ "#soltion\n",
+ "#given\n",
+ "#color coding\n",
+ "orange=3.#\n",
+ "gold=5.#\n",
+ "yellow=4.#\n",
+ "violet=7.#\n",
+ "#band pattern\n",
+ "band1=yellow#\n",
+ "band2=violet#\n",
+ "band3=orange#\n",
+ "band4=gold#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The range of resistance =',llr/1000. ,'kOhm','to',ulr/1000,'kOhm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The range of resistance = 44.65 kOhm to 49.35 kOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the range of tolerance\n",
+ "#color coding\n",
+ "blue=6.#\n",
+ "gold=-1.#\n",
+ "gray=8.#\n",
+ "silver=10.#\n",
+ "#band pattern\n",
+ "band1=gray#\n",
+ "band2=blue#\n",
+ "band3=gold#\n",
+ "band4=silver#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The Range of resistance is',llr,'ohm','to',ulr,'ohm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Range of resistance is 7.74 ohm to 9.46 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the equivalent current source\n",
+ "#given\n",
+ "Vs=2.;#Volts #dc voltage source\n",
+ "Rs=1.;#ohm #internal resistance\n",
+ "Rl=1.;#ohm #load resistance\n",
+ "Ise=Vs/Rs;#ampere #equivalent current source\n",
+ "\n",
+ "# In accordance to figure 1.23a\n",
+ "Il1=Ise*(Rs/(Rs+Rl));#using current divider concept\n",
+ "Vl1=Il1*Rl;\n",
+ "print \"In accordance to figure 1.23a\\n\"\n",
+ "print \"The Load current (current source Il=\",Il1,'A'\n",
+ "print \"The Load voltage (current source Vl=\",Vl1,'V','\\n'\n",
+ "\n",
+ "# In accordance to figure 1.23b\n",
+ "Vl2=Vs*(Rs/(Rs+Rl));#using voltage divider concept\n",
+ "Il2=Vl2/Rl;\n",
+ "print \"\\nIn accordance to figure 1.23b\"\n",
+ "print \"\\nThe Load voltage (voltage source) Vl=\",Vl2,'V'\n",
+ "print \"The Load current (voltage source) Il=\",Il2,'A'\n",
+ "print \"\\nTherefore they both provide same voltage and current to load\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.23a\n",
+ "\n",
+ "The Load current (current source Il= 1.0 A\n",
+ "The Load voltage (current source Vl= 1.0 V \n",
+ "\n",
+ "\n",
+ "In accordance to figure 1.23b\n",
+ "\n",
+ "The Load voltage (voltage source) Vl= 1.0 V\n",
+ "The Load current (voltage source) Il= 1.0 A\n",
+ "\n",
+ "Therefore they both provide same voltage and current to load\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find percentage variation in load current and load voltage\n",
+ "#given\n",
+ "Vs=10.;#volt#Supply voltage\n",
+ "Rs=100.;#ohm#internal resistance\n",
+ "\n",
+ "# In accordance to figure 1.24a\n",
+ "#For 1ohm - 10 ohm\n",
+ "Rl11=1.;#ohm#min extreme value of Rl\n",
+ "Rl12=10.;#ohm#max extreme value of Rl\n",
+ "Il11=Vs/(Rs+Rl11);\n",
+ "Il12=Vs/(Rs+Rl12);\n",
+ "Pi1=(Il11-Il12)*100./Il11;#Percentage variation in current\n",
+ "Vl11=Il11*Rl11;\n",
+ "Vl12=Il12*Rl12;\n",
+ "Pv1=(Vl12-Vl11)*100./Vl12;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24a \\n\");\n",
+ "print '%s %.2f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi1,'percent');\n",
+ "print '%s %.1f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv1,'percent\\n\\n');\n",
+ "\n",
+ "# In accordance to figure 1.24b\n",
+ "#For 1kohm - 10kohm\n",
+ "Rl21=1000.;#ohm#min extreme value of Rl\n",
+ "Rl22=10000.;#ohm#max extreme value of Rl\n",
+ "Il21=Vs/(Rs+Rl21);\n",
+ "Il22=Vs/(Rs+Rl22);\n",
+ "Pi2=(Il21-Il22)*100./Il21;#Percentage variation in current\n",
+ "Vl21=Il21*Rl21;\n",
+ "Vl22=Il22*Rl22;\n",
+ "Pv2=(Vl22-Vl21)*100./Vl22;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24b \\n\");\n",
+ "print '%s %.f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi2,'percent');\n",
+ "print '%s %.f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv2,'percent \\n');\n",
+ "print 'In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to' \n",
+ "print 'the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.24a \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 8.18 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 89.1 percent\n",
+ "\n",
+ " \n",
+ "In accordance to figure 1.24b \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 89 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 8 percent \n",
+ " \n",
+ "In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to\n",
+ "the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01_1.ipynb new file mode 100755 index 00000000..d9b8d232 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_01_1.ipynb @@ -0,0 +1,241 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f29193149f0b645210af1f807e738f44273cdf4f3faf059dbea7ad23270af3f9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 01:Introduction to Electronics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the range of tolerance\n",
+ "#soltion\n",
+ "#given\n",
+ "#color coding\n",
+ "orange=3.#\n",
+ "gold=5.#\n",
+ "yellow=4.#\n",
+ "violet=7.#\n",
+ "#band pattern\n",
+ "band1=yellow#\n",
+ "band2=violet#\n",
+ "band3=orange#\n",
+ "band4=gold#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The range of resistance =',llr/1000. ,'kOhm','to',ulr/1000,'kOhm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The range of resistance = 44.65 kOhm to 49.35 kOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the range of tolerance\n",
+ "#color coding\n",
+ "blue=6.#\n",
+ "gold=-1.#\n",
+ "gray=8.#\n",
+ "silver=10.#\n",
+ "#band pattern\n",
+ "band1=gray#\n",
+ "band2=blue#\n",
+ "band3=gold#\n",
+ "band4=silver#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The Range of resistance is',llr,'ohm','to',ulr,'ohm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Range of resistance is 7.74 ohm to 9.46 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the equivalent current source\n",
+ "#given\n",
+ "Vs=2.;#Volts #dc voltage source\n",
+ "Rs=1.;#ohm #internal resistance\n",
+ "Rl=1.;#ohm #load resistance\n",
+ "Ise=Vs/Rs;#ampere #equivalent current source\n",
+ "\n",
+ "# In accordance to figure 1.23a\n",
+ "Il1=Ise*(Rs/(Rs+Rl));#using current divider concept\n",
+ "Vl1=Il1*Rl;\n",
+ "print \"In accordance to figure 1.23a\\n\"\n",
+ "print \"The Load current (current source Il=\",Il1,'A'\n",
+ "print \"The Load voltage (current source Vl=\",Vl1,'V','\\n'\n",
+ "\n",
+ "# In accordance to figure 1.23b\n",
+ "Vl2=Vs*(Rs/(Rs+Rl));#using voltage divider concept\n",
+ "Il2=Vl2/Rl;\n",
+ "print \"\\nIn accordance to figure 1.23b\"\n",
+ "print \"\\nThe Load voltage (voltage source) Vl=\",Vl2,'V'\n",
+ "print \"The Load current (voltage source) Il=\",Il2,'A'\n",
+ "print \"\\nTherefore they both provide same voltage and current to load\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.23a\n",
+ "\n",
+ "The Load current (current source Il= 1.0 A\n",
+ "The Load voltage (current source Vl= 1.0 V \n",
+ "\n",
+ "\n",
+ "In accordance to figure 1.23b\n",
+ "\n",
+ "The Load voltage (voltage source) Vl= 1.0 V\n",
+ "The Load current (voltage source) Il= 1.0 A\n",
+ "\n",
+ "Therefore they both provide same voltage and current to load\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find percentage variation in load current and load voltage\n",
+ "#given\n",
+ "Vs=10.;#volt#Supply voltage\n",
+ "Rs=100.;#ohm#internal resistance\n",
+ "\n",
+ "# In accordance to figure 1.24a\n",
+ "#For 1ohm - 10 ohm\n",
+ "Rl11=1.;#ohm#min extreme value of Rl\n",
+ "Rl12=10.;#ohm#max extreme value of Rl\n",
+ "Il11=Vs/(Rs+Rl11);\n",
+ "Il12=Vs/(Rs+Rl12);\n",
+ "Pi1=(Il11-Il12)*100./Il11;#Percentage variation in current\n",
+ "Vl11=Il11*Rl11;\n",
+ "Vl12=Il12*Rl12;\n",
+ "Pv1=(Vl12-Vl11)*100./Vl12;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24a \\n\");\n",
+ "print '%s %.2f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi1,'percent');\n",
+ "print '%s %.1f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv1,'percent\\n\\n');\n",
+ "\n",
+ "# In accordance to figure 1.24b\n",
+ "#For 1kohm - 10kohm\n",
+ "Rl21=1000.;#ohm#min extreme value of Rl\n",
+ "Rl22=10000.;#ohm#max extreme value of Rl\n",
+ "Il21=Vs/(Rs+Rl21);\n",
+ "Il22=Vs/(Rs+Rl22);\n",
+ "Pi2=(Il21-Il22)*100./Il21;#Percentage variation in current\n",
+ "Vl21=Il21*Rl21;\n",
+ "Vl22=Il22*Rl22;\n",
+ "Pv2=(Vl22-Vl21)*100./Vl22;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24b \\n\");\n",
+ "print '%s %.f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi2,'percent');\n",
+ "print '%s %.f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv2,'percent \\n');\n",
+ "print 'In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to' \n",
+ "print 'the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.24a \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 8.18 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 89.1 percent\n",
+ "\n",
+ " \n",
+ "In accordance to figure 1.24b \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 89 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 8 percent \n",
+ " \n",
+ "In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to\n",
+ "the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02.ipynb new file mode 100755 index 00000000..3298c091 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02.ipynb @@ -0,0 +1,100 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4bfa36805a5140f0dc7023e6b533e12bf6cf488b53f4f9082629f42b62484f4a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 02:Semiconductor Physics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the conductivity and resistivity of germanium\n",
+ "#!/usr/bin/env/ python\n",
+ "#-*- coding: utf-8 -*-\n",
+ "q=1.6*10.**-19.#Coulomb #charge of an electron\n",
+ "ni=2.5*10.**19.#per m**3 #concentration\n",
+ "un=0.36#m**2/Vs #mobility of electron\n",
+ "up=0.17#m**2/Vs #mobility of holes\n",
+ "con=q*ni*(un+up); #conductivity\n",
+ "res=(1./con); #resistivity\n",
+ "print '%s %.2f %s' %(\"The conductivty is =\",con,'S/m');\n",
+ "print '%s %.2f %s' %(\"The resistivity is =\",res,'ohm m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is = 2.12 S/m\n",
+ "The resistivity is = 0.47 ohm m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ecample E2 - pg 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the conductivity of extrinsic semiconductor\n",
+ "#given\n",
+ "e=1.6*10.**-19.;#Coulomb #charge of an electron\n",
+ "ni=1.5*10.**16.;#per m**3 #concentration\n",
+ "un=0.13;#m**2/Vs #mobility of electron\n",
+ "up=0.05;#m**2/Vs #mobility of holes\n",
+ "Si=5.*10.**28.;#per m**3 #atomic density in silicon\n",
+ "dop=(1./(2.*10.**8.)); #concentration of an antimony per silicon atoms\n",
+ "Nd=dop*Si;#per m**3 #donor concentraion\n",
+ "n=Nd;#per m**3 #free electron concentration\n",
+ "p=(ni**2/Nd);#per m **3 # hole concentration\n",
+ "con=e*(n*un+p*up);\n",
+ "print '%s %.1f %s' %(\"The conductivty is=\",con, 'S/m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is= 5.2 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02_1.ipynb new file mode 100755 index 00000000..3298c091 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_02_1.ipynb @@ -0,0 +1,100 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4bfa36805a5140f0dc7023e6b533e12bf6cf488b53f4f9082629f42b62484f4a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 02:Semiconductor Physics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the conductivity and resistivity of germanium\n",
+ "#!/usr/bin/env/ python\n",
+ "#-*- coding: utf-8 -*-\n",
+ "q=1.6*10.**-19.#Coulomb #charge of an electron\n",
+ "ni=2.5*10.**19.#per m**3 #concentration\n",
+ "un=0.36#m**2/Vs #mobility of electron\n",
+ "up=0.17#m**2/Vs #mobility of holes\n",
+ "con=q*ni*(un+up); #conductivity\n",
+ "res=(1./con); #resistivity\n",
+ "print '%s %.2f %s' %(\"The conductivty is =\",con,'S/m');\n",
+ "print '%s %.2f %s' %(\"The resistivity is =\",res,'ohm m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is = 2.12 S/m\n",
+ "The resistivity is = 0.47 ohm m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ecample E2 - pg 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the conductivity of extrinsic semiconductor\n",
+ "#given\n",
+ "e=1.6*10.**-19.;#Coulomb #charge of an electron\n",
+ "ni=1.5*10.**16.;#per m**3 #concentration\n",
+ "un=0.13;#m**2/Vs #mobility of electron\n",
+ "up=0.05;#m**2/Vs #mobility of holes\n",
+ "Si=5.*10.**28.;#per m**3 #atomic density in silicon\n",
+ "dop=(1./(2.*10.**8.)); #concentration of an antimony per silicon atoms\n",
+ "Nd=dop*Si;#per m**3 #donor concentraion\n",
+ "n=Nd;#per m**3 #free electron concentration\n",
+ "p=(ni**2/Nd);#per m **3 # hole concentration\n",
+ "con=e*(n*un+p*up);\n",
+ "print '%s %.1f %s' %(\"The conductivty is=\",con, 'S/m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is= 5.2 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03.ipynb new file mode 100755 index 00000000..280ee382 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03.ipynb @@ -0,0 +1,644 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1e101b9e385e167bfc6f71dcc655515c9c3942d49c6f6361f5ace95f1aed05a9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 03:Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Page 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the value of threshold voltage\n",
+ "#given\n",
+ "t1=25.;#degrees C#initial temperature\n",
+ "t2=100.;#degrees C#final temperature\n",
+ "V=2.*10.**-3.;#V per celsius degree#decrease in barrier potential per degree\n",
+ "V0=0.7#V#Potential at normal temperature\n",
+ "Vd=(t2-t1)*V;#decrease in barrier potential\n",
+ "Vt=V0-Vd;#threshold volatge at 100degree C\n",
+ "print '%s %.2f %s' %(\"Threshold volatge at 100 degrees C =\",Vt,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Threshold volatge at 100 degrees C = 0.55 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#detrenmine dc resistance of silicon diode\n",
+ "#given\n",
+ "#At Id = 2 mA\n",
+ "Id=2.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.5;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Id = 20 mA\n",
+ "Id=20.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.75;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.1f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Vd = - 10 V \n",
+ "Id=-2.*10.**-6.;#Ampere#diode current(from given curve)\n",
+ "Vd=-10.;#V#voltage\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf/10**6,\"M ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance is = 250 ohm\n",
+ "\n",
+ "The dc resistance is = 37.5 ohm\n",
+ "\n",
+ "The dc resistance is = 5 M ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc & ac resistance of silicon diode\n",
+ "#given\n",
+ "Id=20.*10.**-3.;#A#diode current\n",
+ "Vd=0.75;#V# as given in the V-I graph\n",
+ "Rf=Vd/Id;\n",
+ "print '%s %.1f %s' %(\"The dc resistance of diode is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#From Graph the values of dynamic voltage and current are\n",
+ "#which is equal to MN and NL repectively (in graph)\n",
+ "del_Vd=(0.8-0.68);#V\n",
+ "del_Id=(40-0)*10.**-3.;#A\n",
+ "rf=del_Vd/del_Id;\n",
+ "print '%s %.f %s' %(\"The ac resistance of the diode is =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance of diode is = 37.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is = 3 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine ac resistance of silicon diode\n",
+ "#given\n",
+ "#At Id =10mA\n",
+ "Id=10.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.1f %s' %(\"The ac resistance of the diode is(At Id= 10mA) =\",rf,\"ohm\\n\")\n",
+ "\n",
+ "#At Id =20mA\n",
+ "Id=20.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.2f %s' %(\"The ac resistance of the diode is(At Id= 20mA) =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac resistance of the diode is(At Id= 10mA) = 2.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is(At Id= 20mA) = 1.25 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through diode\n",
+ "#given\n",
+ "Vt=0.3;#V#Threshold voltage\n",
+ "rf=25.;#ohm# average resistance\n",
+ "\n",
+ "#assuming it to be ideal\n",
+ "#from fig 3.19\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=45.;#ohm\n",
+ "R2=5.;#ohm\n",
+ "Vab=Vaa*R2/(R1+R2);\n",
+ "#Vab>Vt therefore diode is forward bias and no current flow through R2\n",
+ "Idi=Vaa/R1; #for ideal\n",
+ "print '%s %.f %s' %(\"The diode current (for ideal) is =\",Idi*1000,\"mA\\n\");\n",
+ "\n",
+ "#assuming it to be real\n",
+ "#Thevenins equivalent circuit parameters of fig 3.19\n",
+ "Vth=Vaa*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "Idr=(Vth-Vt)/(Rth+rf); #for real\n",
+ "print '%s %.1f %s' %(\"The diode current (for real) is =\",Idr*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diode current (for ideal) is = 222 mA\n",
+ "\n",
+ "The diode current (for real) is = 23.7 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through resistance in given figure\n",
+ "#From fig\n",
+ "Vaa=20.;#V#supply\n",
+ "Vt=0.7;#V#threshold voltage of diode\n",
+ "rf=5.;#ohm #forward resistance\n",
+ "R=90.;#ohm#given resistor\n",
+ "\n",
+ "#Diode D1 and D4 are forward bias and D2 and D3 are reverse biased\n",
+ "\n",
+ "Vnet=Vaa-Vt-Vt;\n",
+ "Rt=R+rf+rf;\n",
+ "I=Vnet/Rt;\n",
+ "print '%s %.f %s' %(\"Current through 90 ohm resistor is =\",I*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 90 ohm resistor is = 186 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current drawn by the battery\n",
+ "#From fig\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=100.;#ohm\n",
+ "R2=100.;#ohm\n",
+ "\n",
+ "#Forward Bias\n",
+ "Id=Vaa/R1;\n",
+ "print '%s %.1f %s' %(\"Current drawn from battery (forward bias) =\",Id,\"A\\n\");\n",
+ "\n",
+ "#Reverse Bias\n",
+ "Rnet=R1+R2;\n",
+ "Id=Vaa/Rnet;\n",
+ "print '%s %.2f %s' %(\"Current drawn from battery (reverse bias) =\",Id,\"A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from battery (forward bias) = 0.1 A\n",
+ "\n",
+ "Current drawn from battery (reverse bias) = 0.05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc current through load and rectification efficiency and peak inverse voltage\n",
+ "#given\n",
+ "import math\n",
+ "TR=31./2.;#Turn ratio of the transformer\n",
+ "rf=20.;#ohm#Dynamic forward resistance\n",
+ "Rl=1000.;#ohm#Load resistance\n",
+ "Vt=0.66;#V#Threshold voltage of diode\n",
+ "V=220.;#V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp;\n",
+ "Im=(Vm-Vt)/(rf+Rl);\n",
+ "Idc=Im/math.pi;\n",
+ "n=40.6/(1.+rf/Rl);\n",
+ "print '%s %.f %s' %(\"The dc current through load is =\",Idc*1000,\"mA\\n\");\n",
+ "print '%s %.1f %s' %(\"The rectification efficiency is =\",n,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"Peak inverse voltage =Vm = \",Vm,\"V\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current through load is = 6 mA\n",
+ "\n",
+ "The rectification efficiency is = 39.8 percent\n",
+ "\n",
+ "Peak inverse voltage =Vm = 20.07 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc voltage across load and peak inverse voltage across each diode\n",
+ "#given\n",
+ "import math\n",
+ "TR=12./1.##Turn ratio of the transformer\n",
+ "V=220.##V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp#\n",
+ "Vdc=(2.*Vm)/math.pi#\n",
+ "print '%s %.1f %s' %(\"The dc voltage across load =\",Vdc,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for bridge rectifier) =\",Vm,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for centre tap rectifier) =\",2*Vm,\"V\\n\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc voltage across load = 16.5 V\n",
+ "\n",
+ "Peak inverse voltage (for bridge rectifier) = 25.9 V\n",
+ "\n",
+ "Peak inverse voltage (for centre tap rectifier) = 51.9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc power supplied to load and efficiency and PIV rating of the diode\n",
+ "#given\n",
+ "import math\n",
+ "rf=2.;#ohm#Dynamic forward resistance\n",
+ "Rs=5.;#ohm#resistaqnce of secondary\n",
+ "Rl=25.;#ohm#Load resistance\n",
+ "Idc=0.1;#A#dc current to a load\n",
+ "Pdc=Idc**2.*Rl; #dc power\n",
+ "n=(81.2*Rl)/(Rl+rf+Rs); #efficiency\n",
+ "Im=(math.pi*Idc)/2.; #peak value current\n",
+ "Vm=Im*(Rl+rf+Rs); #peak voltage\n",
+ "Vlm=Vm-Im*(rf+Rs); #peak voltage across load\n",
+ "PIV=Vm+Vlm;\n",
+ "print '%s %.2f %s' %(\"The dc power supplied to the load is =\",Pdc,'W\\n');\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,'percent\\n');\n",
+ "print '%s %.3f %s' %(\"The peak inverse voltage is =\",PIV,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc power supplied to the load is = 0.25 W\n",
+ "\n",
+ "Efficiency = 63.44 percent\n",
+ "\n",
+ "The peak inverse voltage is = 8.954 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate output voltage and current through load and voltage across series resistor and current and power dissipated in zener diode\n",
+ "#given\n",
+ "Vi=110.;#V #input voltage\n",
+ "Rl=6.*10.**3.;# ohm #load resistance\n",
+ "Rs=2.*10.**3.;#ohm #series resistance\n",
+ "Vz=60.;#V #Zener voltage\n",
+ "V=Vi*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Vs=Vi-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Iz=Is-Il #/By applying kirchhoffs law\n",
+ "Pz=Vz*Iz #Power dissipated accross zener diode\n",
+ "\n",
+ "print '%s %.f %s' %(\"The output voltage is =\",Vo,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The current through load resistance is =\",Il*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"Voltage across series resistor is =\",Vs,\"V\\n\")\n",
+ "print '%s %.f %s' %(\"Current in zener diode is =\",Iz*1000,\"mA\\n\")\n",
+ "print '%s %.f %s' %(\"Power dissipated by zener diode =\",Pz*1000,'mW');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 60 V\n",
+ "\n",
+ "The current through load resistance is = 10 mA\n",
+ "\n",
+ "Voltage across series resistor is = 50 V\n",
+ "\n",
+ "Current in zener diode is = 15 mA\n",
+ "\n",
+ "Power dissipated by zener diode = 900 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate max and min values of zener diode current\n",
+ "#given\n",
+ "Vimin=80.;#V #minimum input voltage\n",
+ "Vimax=120.;#V #maximum input voltage\n",
+ "Rl=10.*10.**3.;# ohm #load resistance\n",
+ "Rs=5.*10.**3.;#ohm #series resistance\n",
+ "Vz=50.;#V #Zener voltage\n",
+ "V=Vimin*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "#For minimum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimin-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmin=Is-Il;\n",
+ "print '%s %.f %s' %(\"Minimum values of zener diode current is =\",Izmin*1000,\"mA\\n\");\n",
+ "\n",
+ "#For maximum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimax-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmax=Is-Il;\n",
+ "print '%s %.f %s' %(\"Maximum values of zener diode current is =\",Izmax*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum values of zener diode current is = 1 mA\n",
+ "\n",
+ "Maximum values of zener diode current is = 9 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine value of the series resistor and wattage rating\n",
+ "#given\n",
+ "Vi=12.##V #input voltage\n",
+ "Vz=7.2##V #Zener voltage\n",
+ "Izmin=10.*10.**-3.##A #min current through zener diode\n",
+ "Ilmax=100*10.**-3.##A #max current through load\n",
+ "Ilmin=12.*10.**-3.##A #min current through load\n",
+ "Vs=Vi-Vz# #Voltage drop across the series resistor\n",
+ "Is=Izmin+Ilmax# #Current through the series resistor\n",
+ "Rs=Vs/Is#\n",
+ "print '%s %.1f %s' %(\"The series resistor so that 10mA current flow through zener diode is =\",Rs,\"ohm\\n\")#\n",
+ "Izmax=Is-Ilmin#max zener through zener diode\n",
+ "Pmax=Izmax*Vz#\n",
+ "print '%s %.1f %s' %(\"The maximum wattage rating is =\",Pmax*1000,\"mW\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resistor so that 10mA current flow through zener diode is = 43.6 ohm\n",
+ "\n",
+ "The maximum wattage rating is = 705.6 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the capacitance of a varactor diode\n",
+ "#given\n",
+ "import math\n",
+ "C=5.;#pf#capcitance of varactor diode at V=4V\n",
+ "V=4.;#V\n",
+ "K=C*math.sqrt(4.);\n",
+ "#When bias voltage is increased upto 6 V\n",
+ "Vn=6.;#V#new bias voltage\n",
+ "Cn=K/(math.sqrt(Vn));\n",
+ "print '%s %.3f %s' %(\"Capacitance (At 6 V ) =\",Cn,\"pf\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance (At 6 V ) = 4.082 pf\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03_1.ipynb new file mode 100755 index 00000000..280ee382 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_03_1.ipynb @@ -0,0 +1,644 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1e101b9e385e167bfc6f71dcc655515c9c3942d49c6f6361f5ace95f1aed05a9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 03:Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Page 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the value of threshold voltage\n",
+ "#given\n",
+ "t1=25.;#degrees C#initial temperature\n",
+ "t2=100.;#degrees C#final temperature\n",
+ "V=2.*10.**-3.;#V per celsius degree#decrease in barrier potential per degree\n",
+ "V0=0.7#V#Potential at normal temperature\n",
+ "Vd=(t2-t1)*V;#decrease in barrier potential\n",
+ "Vt=V0-Vd;#threshold volatge at 100degree C\n",
+ "print '%s %.2f %s' %(\"Threshold volatge at 100 degrees C =\",Vt,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Threshold volatge at 100 degrees C = 0.55 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#detrenmine dc resistance of silicon diode\n",
+ "#given\n",
+ "#At Id = 2 mA\n",
+ "Id=2.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.5;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Id = 20 mA\n",
+ "Id=20.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.75;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.1f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Vd = - 10 V \n",
+ "Id=-2.*10.**-6.;#Ampere#diode current(from given curve)\n",
+ "Vd=-10.;#V#voltage\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf/10**6,\"M ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance is = 250 ohm\n",
+ "\n",
+ "The dc resistance is = 37.5 ohm\n",
+ "\n",
+ "The dc resistance is = 5 M ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc & ac resistance of silicon diode\n",
+ "#given\n",
+ "Id=20.*10.**-3.;#A#diode current\n",
+ "Vd=0.75;#V# as given in the V-I graph\n",
+ "Rf=Vd/Id;\n",
+ "print '%s %.1f %s' %(\"The dc resistance of diode is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#From Graph the values of dynamic voltage and current are\n",
+ "#which is equal to MN and NL repectively (in graph)\n",
+ "del_Vd=(0.8-0.68);#V\n",
+ "del_Id=(40-0)*10.**-3.;#A\n",
+ "rf=del_Vd/del_Id;\n",
+ "print '%s %.f %s' %(\"The ac resistance of the diode is =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance of diode is = 37.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is = 3 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine ac resistance of silicon diode\n",
+ "#given\n",
+ "#At Id =10mA\n",
+ "Id=10.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.1f %s' %(\"The ac resistance of the diode is(At Id= 10mA) =\",rf,\"ohm\\n\")\n",
+ "\n",
+ "#At Id =20mA\n",
+ "Id=20.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.2f %s' %(\"The ac resistance of the diode is(At Id= 20mA) =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac resistance of the diode is(At Id= 10mA) = 2.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is(At Id= 20mA) = 1.25 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through diode\n",
+ "#given\n",
+ "Vt=0.3;#V#Threshold voltage\n",
+ "rf=25.;#ohm# average resistance\n",
+ "\n",
+ "#assuming it to be ideal\n",
+ "#from fig 3.19\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=45.;#ohm\n",
+ "R2=5.;#ohm\n",
+ "Vab=Vaa*R2/(R1+R2);\n",
+ "#Vab>Vt therefore diode is forward bias and no current flow through R2\n",
+ "Idi=Vaa/R1; #for ideal\n",
+ "print '%s %.f %s' %(\"The diode current (for ideal) is =\",Idi*1000,\"mA\\n\");\n",
+ "\n",
+ "#assuming it to be real\n",
+ "#Thevenins equivalent circuit parameters of fig 3.19\n",
+ "Vth=Vaa*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "Idr=(Vth-Vt)/(Rth+rf); #for real\n",
+ "print '%s %.1f %s' %(\"The diode current (for real) is =\",Idr*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diode current (for ideal) is = 222 mA\n",
+ "\n",
+ "The diode current (for real) is = 23.7 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through resistance in given figure\n",
+ "#From fig\n",
+ "Vaa=20.;#V#supply\n",
+ "Vt=0.7;#V#threshold voltage of diode\n",
+ "rf=5.;#ohm #forward resistance\n",
+ "R=90.;#ohm#given resistor\n",
+ "\n",
+ "#Diode D1 and D4 are forward bias and D2 and D3 are reverse biased\n",
+ "\n",
+ "Vnet=Vaa-Vt-Vt;\n",
+ "Rt=R+rf+rf;\n",
+ "I=Vnet/Rt;\n",
+ "print '%s %.f %s' %(\"Current through 90 ohm resistor is =\",I*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 90 ohm resistor is = 186 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current drawn by the battery\n",
+ "#From fig\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=100.;#ohm\n",
+ "R2=100.;#ohm\n",
+ "\n",
+ "#Forward Bias\n",
+ "Id=Vaa/R1;\n",
+ "print '%s %.1f %s' %(\"Current drawn from battery (forward bias) =\",Id,\"A\\n\");\n",
+ "\n",
+ "#Reverse Bias\n",
+ "Rnet=R1+R2;\n",
+ "Id=Vaa/Rnet;\n",
+ "print '%s %.2f %s' %(\"Current drawn from battery (reverse bias) =\",Id,\"A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from battery (forward bias) = 0.1 A\n",
+ "\n",
+ "Current drawn from battery (reverse bias) = 0.05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc current through load and rectification efficiency and peak inverse voltage\n",
+ "#given\n",
+ "import math\n",
+ "TR=31./2.;#Turn ratio of the transformer\n",
+ "rf=20.;#ohm#Dynamic forward resistance\n",
+ "Rl=1000.;#ohm#Load resistance\n",
+ "Vt=0.66;#V#Threshold voltage of diode\n",
+ "V=220.;#V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp;\n",
+ "Im=(Vm-Vt)/(rf+Rl);\n",
+ "Idc=Im/math.pi;\n",
+ "n=40.6/(1.+rf/Rl);\n",
+ "print '%s %.f %s' %(\"The dc current through load is =\",Idc*1000,\"mA\\n\");\n",
+ "print '%s %.1f %s' %(\"The rectification efficiency is =\",n,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"Peak inverse voltage =Vm = \",Vm,\"V\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current through load is = 6 mA\n",
+ "\n",
+ "The rectification efficiency is = 39.8 percent\n",
+ "\n",
+ "Peak inverse voltage =Vm = 20.07 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc voltage across load and peak inverse voltage across each diode\n",
+ "#given\n",
+ "import math\n",
+ "TR=12./1.##Turn ratio of the transformer\n",
+ "V=220.##V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp#\n",
+ "Vdc=(2.*Vm)/math.pi#\n",
+ "print '%s %.1f %s' %(\"The dc voltage across load =\",Vdc,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for bridge rectifier) =\",Vm,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for centre tap rectifier) =\",2*Vm,\"V\\n\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc voltage across load = 16.5 V\n",
+ "\n",
+ "Peak inverse voltage (for bridge rectifier) = 25.9 V\n",
+ "\n",
+ "Peak inverse voltage (for centre tap rectifier) = 51.9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc power supplied to load and efficiency and PIV rating of the diode\n",
+ "#given\n",
+ "import math\n",
+ "rf=2.;#ohm#Dynamic forward resistance\n",
+ "Rs=5.;#ohm#resistaqnce of secondary\n",
+ "Rl=25.;#ohm#Load resistance\n",
+ "Idc=0.1;#A#dc current to a load\n",
+ "Pdc=Idc**2.*Rl; #dc power\n",
+ "n=(81.2*Rl)/(Rl+rf+Rs); #efficiency\n",
+ "Im=(math.pi*Idc)/2.; #peak value current\n",
+ "Vm=Im*(Rl+rf+Rs); #peak voltage\n",
+ "Vlm=Vm-Im*(rf+Rs); #peak voltage across load\n",
+ "PIV=Vm+Vlm;\n",
+ "print '%s %.2f %s' %(\"The dc power supplied to the load is =\",Pdc,'W\\n');\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,'percent\\n');\n",
+ "print '%s %.3f %s' %(\"The peak inverse voltage is =\",PIV,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc power supplied to the load is = 0.25 W\n",
+ "\n",
+ "Efficiency = 63.44 percent\n",
+ "\n",
+ "The peak inverse voltage is = 8.954 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate output voltage and current through load and voltage across series resistor and current and power dissipated in zener diode\n",
+ "#given\n",
+ "Vi=110.;#V #input voltage\n",
+ "Rl=6.*10.**3.;# ohm #load resistance\n",
+ "Rs=2.*10.**3.;#ohm #series resistance\n",
+ "Vz=60.;#V #Zener voltage\n",
+ "V=Vi*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Vs=Vi-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Iz=Is-Il #/By applying kirchhoffs law\n",
+ "Pz=Vz*Iz #Power dissipated accross zener diode\n",
+ "\n",
+ "print '%s %.f %s' %(\"The output voltage is =\",Vo,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The current through load resistance is =\",Il*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"Voltage across series resistor is =\",Vs,\"V\\n\")\n",
+ "print '%s %.f %s' %(\"Current in zener diode is =\",Iz*1000,\"mA\\n\")\n",
+ "print '%s %.f %s' %(\"Power dissipated by zener diode =\",Pz*1000,'mW');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 60 V\n",
+ "\n",
+ "The current through load resistance is = 10 mA\n",
+ "\n",
+ "Voltage across series resistor is = 50 V\n",
+ "\n",
+ "Current in zener diode is = 15 mA\n",
+ "\n",
+ "Power dissipated by zener diode = 900 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate max and min values of zener diode current\n",
+ "#given\n",
+ "Vimin=80.;#V #minimum input voltage\n",
+ "Vimax=120.;#V #maximum input voltage\n",
+ "Rl=10.*10.**3.;# ohm #load resistance\n",
+ "Rs=5.*10.**3.;#ohm #series resistance\n",
+ "Vz=50.;#V #Zener voltage\n",
+ "V=Vimin*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "#For minimum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimin-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmin=Is-Il;\n",
+ "print '%s %.f %s' %(\"Minimum values of zener diode current is =\",Izmin*1000,\"mA\\n\");\n",
+ "\n",
+ "#For maximum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimax-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmax=Is-Il;\n",
+ "print '%s %.f %s' %(\"Maximum values of zener diode current is =\",Izmax*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum values of zener diode current is = 1 mA\n",
+ "\n",
+ "Maximum values of zener diode current is = 9 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine value of the series resistor and wattage rating\n",
+ "#given\n",
+ "Vi=12.##V #input voltage\n",
+ "Vz=7.2##V #Zener voltage\n",
+ "Izmin=10.*10.**-3.##A #min current through zener diode\n",
+ "Ilmax=100*10.**-3.##A #max current through load\n",
+ "Ilmin=12.*10.**-3.##A #min current through load\n",
+ "Vs=Vi-Vz# #Voltage drop across the series resistor\n",
+ "Is=Izmin+Ilmax# #Current through the series resistor\n",
+ "Rs=Vs/Is#\n",
+ "print '%s %.1f %s' %(\"The series resistor so that 10mA current flow through zener diode is =\",Rs,\"ohm\\n\")#\n",
+ "Izmax=Is-Ilmin#max zener through zener diode\n",
+ "Pmax=Izmax*Vz#\n",
+ "print '%s %.1f %s' %(\"The maximum wattage rating is =\",Pmax*1000,\"mW\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resistor so that 10mA current flow through zener diode is = 43.6 ohm\n",
+ "\n",
+ "The maximum wattage rating is = 705.6 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the capacitance of a varactor diode\n",
+ "#given\n",
+ "import math\n",
+ "C=5.;#pf#capcitance of varactor diode at V=4V\n",
+ "V=4.;#V\n",
+ "K=C*math.sqrt(4.);\n",
+ "#When bias voltage is increased upto 6 V\n",
+ "Vn=6.;#V#new bias voltage\n",
+ "Cn=K/(math.sqrt(Vn));\n",
+ "print '%s %.3f %s' %(\"Capacitance (At 6 V ) =\",Cn,\"pf\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance (At 6 V ) = 4.082 pf\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04.ipynb new file mode 100755 index 00000000..1d5b5c35 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04.ipynb @@ -0,0 +1,420 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:17fddcb6590702d38f46f2b5d25907fb7a3d2becfbec4029a12516743d1ef624"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 04 - Bipolar Junction Transistors (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the collector and base current\n",
+ "#given\n",
+ "a=0.98;#dc alpha\n",
+ "Ie=5.*10.**-3.;#A#emitter current\n",
+ "Ico=2.*10.**-6.;#A#collector reverse leakage current\n",
+ "Ic=a*Ie+Ico;\n",
+ "Ib=Ie-Ic;\n",
+ "print '%s %.3f %s' %(\"The collector current is =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current is = 4.902 mA\n",
+ "\n",
+ "The base current is = 98 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the base and collector current and exact and approax dc alpha \n",
+ "#given\n",
+ "Ie=8.4*10.**-3.#A#emitter current\n",
+ "Icbo=0.1*10.**-6.##A#reverse leakage current\n",
+ "Ib=0.008*Ie##A#base current\n",
+ "Ic=Ie-Ib#\n",
+ "Icinj=Ic-Icbo#\n",
+ "a0=Icinj/Ie#\n",
+ "a=Ic/Ie#\n",
+ "print '%s %.1f %s' %(\"Base current is =\",Ib*10**6,\"uA\\n\")#\n",
+ "print '%s %.4f %s' %(\"Collector current =\",Ic*1000,\"mA\\n\",)#\n",
+ "print '%s %.7f %s' %(\"Exact value of alphha =\",a0,\"\\n\")#\n",
+ "print '%s %.3f' %(\"Approax value of alpha =\",a)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current is = 67.2 uA\n",
+ "\n",
+ "Collector current = 8.3328 mA\n",
+ "\n",
+ "Exact value of alphha = 0.9919881 \n",
+ "\n",
+ "Approax value of alpha = 0.992\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the base current\n",
+ "#given\n",
+ "a=0.96; #dc alpha\n",
+ "Rc=2.*10.**3.;#ohm #resistor across collector\n",
+ "Vc=4.;#V #Voltage drop across the collector resistor\n",
+ "Ic=Vc/Rc; #Colletor current\n",
+ "Ie=Ic/a; #Emmiter current\n",
+ "Ib=Ie-Ic; #Base current\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\",)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current is = 83 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Ie=2.;#mA\n",
+ "Vcb=10.;#V\n",
+ "\n",
+ "#Taking points around Ie & Vcb from graph\n",
+ "del_Ie=(2.5-1.5)*10.**-3.;#A\n",
+ "\n",
+ "#corresponding change in Veb\n",
+ "del_Veb=(0.9-0.8);#V\n",
+ "rib=del_Veb/del_Ie;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rib,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 100 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc current gain in common emitter configuration\n",
+ "#given\n",
+ "a=0.98;#dc current gain in common base configuration\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The dc current gain in common emitter configuration is=\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current gain in common emitter configuration is= 49\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac alpha and beta\n",
+ "#given\n",
+ "ic=0.995#mA#Emitter current change\n",
+ "ie=1.#mA#collector current change\n",
+ "a=ic/ie;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.3f %s' %(\"The ac alpha is =\",a,\"\\n\")\n",
+ "print '%s %.f' %(\"The common emitter ac current gain is =\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac alpha is = 0.995 \n",
+ "\n",
+ "The common emitter ac current gain is = 199\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate beta and Iceo and exact and approax collector current\n",
+ "#given\n",
+ "a0=0.992;#dc current gain in common base configuration\n",
+ "Icbo=48.*10.**-9.;#A\n",
+ "Ib=30.*10.**-6.;#A#base current\n",
+ "B=a0/(1.-a0);\n",
+ "Iceo=Icbo/(1.-a0);\n",
+ "print '%s %.f %s' %(\"Beta=\",B,\"\\n\");\n",
+ "print '%s %.f %s' %(\"Iceo=\",Iceo*10**6,\"uA\\n\");\n",
+ "Ic=B*Ib+Iceo;\n",
+ "Ica=B*Ib;#approax\n",
+ "print '%s %.3f %s' %(\"Exact collector current =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"Approax collector current =\",Ica*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta= 124 \n",
+ "\n",
+ "Iceo= 6 uA\n",
+ "\n",
+ "Exact collector current = 3.726 mA\n",
+ "\n",
+ "Approax collector current = 3.72 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Vbe=0.75;#V\n",
+ "Vce=2.;#V\n",
+ "\n",
+ "#Taking points around Vbe=0.75V from graph\n",
+ "del_Vbe=(0.98-0.9);#V\n",
+ "\n",
+ "#corresponding change in ib\n",
+ "del_ib=(68.-48.)*10.**-6.;#A\n",
+ "\n",
+ "rie=del_Vbe/del_ib;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rie/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 4 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance and dc and ac current gain\n",
+ "#given\n",
+ "Ib=30.*10.**-6.;#A\n",
+ "Vce=10.;#V\n",
+ "Ic=3.6*10.**-3.;#A #from graph\n",
+ "\n",
+ "#Taking points around Vce = 10V from graph\n",
+ "del_Vce=(12.5-7.5);#V\n",
+ "\n",
+ "#corresponding change in ic\n",
+ "del_ic=(3.7-3.5)*10.**-3.;#A\n",
+ "\n",
+ "roe=del_Vce/del_ic;\n",
+ "print '%s %.f %s' %(\"The dynamic output resistance of transistor is =\",roe/1000,\"k ohm\\n\");\n",
+ "\n",
+ "#dc current gain\n",
+ "Bo=Ic/Ib;\n",
+ "print '%s %.f %s' %(\"The dc current gain is =\",Bo,\"\\n\");\n",
+ "\n",
+ "#ac current gain\n",
+ "\n",
+ "del_ic=(4.7-2.5)*10.**-3.; #the collector current change is from 3.5mA to 4.7mA as we can see from graph when we change ib from 40mA to 20mA\n",
+ "del_ib=(40.-20.)*10.**-6.;\n",
+ "B=del_ic/del_ib;\n",
+ "print '%s %.f %s' %(\"The ac current gain is =\",B,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic output resistance of transistor is = 25 k ohm\n",
+ "\n",
+ "The dc current gain is = 120 \n",
+ "\n",
+ "The ac current gain is = 110 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac current gain in CE and CC configuration\n",
+ "#given\n",
+ "a=0.99;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The ac current gain in CE configuration is =\",B);\n",
+ "y=1.+B;\n",
+ "print '%s %.f' %(\"\\nThe ac current gain in CC configuration is =\",y);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac current gain in CE configuration is = 99\n",
+ "\n",
+ "The ac current gain in CC configuration is = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04_1.ipynb new file mode 100755 index 00000000..1d5b5c35 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_04_1.ipynb @@ -0,0 +1,420 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:17fddcb6590702d38f46f2b5d25907fb7a3d2becfbec4029a12516743d1ef624"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 04 - Bipolar Junction Transistors (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the collector and base current\n",
+ "#given\n",
+ "a=0.98;#dc alpha\n",
+ "Ie=5.*10.**-3.;#A#emitter current\n",
+ "Ico=2.*10.**-6.;#A#collector reverse leakage current\n",
+ "Ic=a*Ie+Ico;\n",
+ "Ib=Ie-Ic;\n",
+ "print '%s %.3f %s' %(\"The collector current is =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current is = 4.902 mA\n",
+ "\n",
+ "The base current is = 98 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the base and collector current and exact and approax dc alpha \n",
+ "#given\n",
+ "Ie=8.4*10.**-3.#A#emitter current\n",
+ "Icbo=0.1*10.**-6.##A#reverse leakage current\n",
+ "Ib=0.008*Ie##A#base current\n",
+ "Ic=Ie-Ib#\n",
+ "Icinj=Ic-Icbo#\n",
+ "a0=Icinj/Ie#\n",
+ "a=Ic/Ie#\n",
+ "print '%s %.1f %s' %(\"Base current is =\",Ib*10**6,\"uA\\n\")#\n",
+ "print '%s %.4f %s' %(\"Collector current =\",Ic*1000,\"mA\\n\",)#\n",
+ "print '%s %.7f %s' %(\"Exact value of alphha =\",a0,\"\\n\")#\n",
+ "print '%s %.3f' %(\"Approax value of alpha =\",a)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current is = 67.2 uA\n",
+ "\n",
+ "Collector current = 8.3328 mA\n",
+ "\n",
+ "Exact value of alphha = 0.9919881 \n",
+ "\n",
+ "Approax value of alpha = 0.992\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the base current\n",
+ "#given\n",
+ "a=0.96; #dc alpha\n",
+ "Rc=2.*10.**3.;#ohm #resistor across collector\n",
+ "Vc=4.;#V #Voltage drop across the collector resistor\n",
+ "Ic=Vc/Rc; #Colletor current\n",
+ "Ie=Ic/a; #Emmiter current\n",
+ "Ib=Ie-Ic; #Base current\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\",)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current is = 83 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Ie=2.;#mA\n",
+ "Vcb=10.;#V\n",
+ "\n",
+ "#Taking points around Ie & Vcb from graph\n",
+ "del_Ie=(2.5-1.5)*10.**-3.;#A\n",
+ "\n",
+ "#corresponding change in Veb\n",
+ "del_Veb=(0.9-0.8);#V\n",
+ "rib=del_Veb/del_Ie;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rib,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 100 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc current gain in common emitter configuration\n",
+ "#given\n",
+ "a=0.98;#dc current gain in common base configuration\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The dc current gain in common emitter configuration is=\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current gain in common emitter configuration is= 49\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac alpha and beta\n",
+ "#given\n",
+ "ic=0.995#mA#Emitter current change\n",
+ "ie=1.#mA#collector current change\n",
+ "a=ic/ie;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.3f %s' %(\"The ac alpha is =\",a,\"\\n\")\n",
+ "print '%s %.f' %(\"The common emitter ac current gain is =\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac alpha is = 0.995 \n",
+ "\n",
+ "The common emitter ac current gain is = 199\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate beta and Iceo and exact and approax collector current\n",
+ "#given\n",
+ "a0=0.992;#dc current gain in common base configuration\n",
+ "Icbo=48.*10.**-9.;#A\n",
+ "Ib=30.*10.**-6.;#A#base current\n",
+ "B=a0/(1.-a0);\n",
+ "Iceo=Icbo/(1.-a0);\n",
+ "print '%s %.f %s' %(\"Beta=\",B,\"\\n\");\n",
+ "print '%s %.f %s' %(\"Iceo=\",Iceo*10**6,\"uA\\n\");\n",
+ "Ic=B*Ib+Iceo;\n",
+ "Ica=B*Ib;#approax\n",
+ "print '%s %.3f %s' %(\"Exact collector current =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"Approax collector current =\",Ica*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta= 124 \n",
+ "\n",
+ "Iceo= 6 uA\n",
+ "\n",
+ "Exact collector current = 3.726 mA\n",
+ "\n",
+ "Approax collector current = 3.72 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Vbe=0.75;#V\n",
+ "Vce=2.;#V\n",
+ "\n",
+ "#Taking points around Vbe=0.75V from graph\n",
+ "del_Vbe=(0.98-0.9);#V\n",
+ "\n",
+ "#corresponding change in ib\n",
+ "del_ib=(68.-48.)*10.**-6.;#A\n",
+ "\n",
+ "rie=del_Vbe/del_ib;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rie/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 4 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance and dc and ac current gain\n",
+ "#given\n",
+ "Ib=30.*10.**-6.;#A\n",
+ "Vce=10.;#V\n",
+ "Ic=3.6*10.**-3.;#A #from graph\n",
+ "\n",
+ "#Taking points around Vce = 10V from graph\n",
+ "del_Vce=(12.5-7.5);#V\n",
+ "\n",
+ "#corresponding change in ic\n",
+ "del_ic=(3.7-3.5)*10.**-3.;#A\n",
+ "\n",
+ "roe=del_Vce/del_ic;\n",
+ "print '%s %.f %s' %(\"The dynamic output resistance of transistor is =\",roe/1000,\"k ohm\\n\");\n",
+ "\n",
+ "#dc current gain\n",
+ "Bo=Ic/Ib;\n",
+ "print '%s %.f %s' %(\"The dc current gain is =\",Bo,\"\\n\");\n",
+ "\n",
+ "#ac current gain\n",
+ "\n",
+ "del_ic=(4.7-2.5)*10.**-3.; #the collector current change is from 3.5mA to 4.7mA as we can see from graph when we change ib from 40mA to 20mA\n",
+ "del_ib=(40.-20.)*10.**-6.;\n",
+ "B=del_ic/del_ib;\n",
+ "print '%s %.f %s' %(\"The ac current gain is =\",B,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic output resistance of transistor is = 25 k ohm\n",
+ "\n",
+ "The dc current gain is = 120 \n",
+ "\n",
+ "The ac current gain is = 110 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac current gain in CE and CC configuration\n",
+ "#given\n",
+ "a=0.99;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The ac current gain in CE configuration is =\",B);\n",
+ "y=1.+B;\n",
+ "print '%s %.f' %(\"\\nThe ac current gain in CC configuration is =\",y);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac current gain in CE configuration is = 99\n",
+ "\n",
+ "The ac current gain in CC configuration is = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05.ipynb new file mode 100755 index 00000000..cc2f0691 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05.ipynb @@ -0,0 +1,348 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:146587be2a76fdde5f5bc903bd6d5642ad5cd4039750758587537929c4991265"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 05 - Field Effect Transistors (FETs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate saturation voltage and saturation current\n",
+ "#given\n",
+ "Vp=-4.#V #pinch off voltage\n",
+ "Idss=12.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Vgs=-2.;#V #gate to source voltage\n",
+ "Vds=Vgs-Vp;\n",
+ "Id=Idss*(Vds/Vp)**2.;\n",
+ "print '%s %.f %s' %(\"Saturation Voltage is =\",Vds,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Saturation current is =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Voltage is = 2 V\n",
+ "\n",
+ "Saturation current is = 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vgso=-5.;#V #gate to source cut off voltage\n",
+ "Idss=20.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#At vgs = -2 V\n",
+ "vgs=-2.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -2 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -4 V\n",
+ "vgs=-4.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -4 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -8 V\n",
+ "print '%s' %(\"Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current is (At vgs = -2 V) = 7.2 mA\n",
+ "\n",
+ "Drain current is (At vgs = -4 V) = 0.8 mA\n",
+ "\n",
+ "Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Vds saturation\n",
+ "#given\n",
+ "import math\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=-15.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Id=-3.*10.**-3.;#A #saturation current\n",
+ "Vgs=Vp*(1.-math.sqrt(Id/Idss));\n",
+ "Vds=Vgs-Vp;\n",
+ "print '%s %.3f %s' %(\"The gate to source voltage (Vgs) is =\",Vgs,\"V\\n\");\n",
+ "print '%s %.3f %s' %(\"The saturation voltage is Vds(sat) =\",Vds,\"V\");\n",
+ "\n",
+ "print '\\nThe value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gate to source voltage (Vgs) is = 2.764 V\n",
+ "\n",
+ "The saturation voltage is Vds(sat) = -2.236 V\n",
+ "\n",
+ "The value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for N channel\n",
+ "#given\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= - 3 V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id(For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5 V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id(For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id(For Vgs= -3V) = 2.88 mA\n",
+ "\n",
+ "The drain current Id(For Vgs= 2.5V) = 40.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for P channel\n",
+ "#given\n",
+ "Vp=-5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= -3V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id (For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id (For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id (For Vgs= -3V) = 46.08 mA\n",
+ "\n",
+ "The drain current Id (For Vgs= 2.5V) = 4.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vt=2.;#V #threshold voltage\n",
+ "K=0.25*10.**-3.;# A/V**2 #conductivity parameter\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=2.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "Id=K*(Vgs-Vt)**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 0.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of Id\n",
+ "#given\n",
+ "Vt=1.5;#V #threshold voltage\n",
+ "Id=2.*10.**-3.;#A\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=5.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "# Calculating K\n",
+ "K=Id/((Vgs-Vt)**2.); # A/V**2 #conductivity parameter\n",
+ "\n",
+ "#Calculating Id for Vgs= 5 V and Vds= 6 V\n",
+ "Vgs=5;#V #gate supply\n",
+ "Vds=6;#V #saturation voltage\n",
+ "Id=K*((Vgs-Vt)**2);\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 10.89 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the dynamic drain resistance\n",
+ "#given\n",
+ "gm=200.*10.**-6.;#S transconductance\n",
+ "u=80.;#amplification factor\n",
+ "rd=u/gm;\n",
+ "print '%s %.f %s' %(\"The dynamic drain resistance is =\",rd/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic drain resistance is = 400 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05_1.ipynb new file mode 100755 index 00000000..cc2f0691 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_05_1.ipynb @@ -0,0 +1,348 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:146587be2a76fdde5f5bc903bd6d5642ad5cd4039750758587537929c4991265"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 05 - Field Effect Transistors (FETs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate saturation voltage and saturation current\n",
+ "#given\n",
+ "Vp=-4.#V #pinch off voltage\n",
+ "Idss=12.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Vgs=-2.;#V #gate to source voltage\n",
+ "Vds=Vgs-Vp;\n",
+ "Id=Idss*(Vds/Vp)**2.;\n",
+ "print '%s %.f %s' %(\"Saturation Voltage is =\",Vds,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Saturation current is =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Voltage is = 2 V\n",
+ "\n",
+ "Saturation current is = 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vgso=-5.;#V #gate to source cut off voltage\n",
+ "Idss=20.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#At vgs = -2 V\n",
+ "vgs=-2.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -2 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -4 V\n",
+ "vgs=-4.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -4 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -8 V\n",
+ "print '%s' %(\"Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current is (At vgs = -2 V) = 7.2 mA\n",
+ "\n",
+ "Drain current is (At vgs = -4 V) = 0.8 mA\n",
+ "\n",
+ "Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Vds saturation\n",
+ "#given\n",
+ "import math\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=-15.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Id=-3.*10.**-3.;#A #saturation current\n",
+ "Vgs=Vp*(1.-math.sqrt(Id/Idss));\n",
+ "Vds=Vgs-Vp;\n",
+ "print '%s %.3f %s' %(\"The gate to source voltage (Vgs) is =\",Vgs,\"V\\n\");\n",
+ "print '%s %.3f %s' %(\"The saturation voltage is Vds(sat) =\",Vds,\"V\");\n",
+ "\n",
+ "print '\\nThe value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gate to source voltage (Vgs) is = 2.764 V\n",
+ "\n",
+ "The saturation voltage is Vds(sat) = -2.236 V\n",
+ "\n",
+ "The value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for N channel\n",
+ "#given\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= - 3 V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id(For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5 V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id(For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id(For Vgs= -3V) = 2.88 mA\n",
+ "\n",
+ "The drain current Id(For Vgs= 2.5V) = 40.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for P channel\n",
+ "#given\n",
+ "Vp=-5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= -3V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id (For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id (For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id (For Vgs= -3V) = 46.08 mA\n",
+ "\n",
+ "The drain current Id (For Vgs= 2.5V) = 4.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vt=2.;#V #threshold voltage\n",
+ "K=0.25*10.**-3.;# A/V**2 #conductivity parameter\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=2.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "Id=K*(Vgs-Vt)**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 0.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of Id\n",
+ "#given\n",
+ "Vt=1.5;#V #threshold voltage\n",
+ "Id=2.*10.**-3.;#A\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=5.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "# Calculating K\n",
+ "K=Id/((Vgs-Vt)**2.); # A/V**2 #conductivity parameter\n",
+ "\n",
+ "#Calculating Id for Vgs= 5 V and Vds= 6 V\n",
+ "Vgs=5;#V #gate supply\n",
+ "Vds=6;#V #saturation voltage\n",
+ "Id=K*((Vgs-Vt)**2);\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 10.89 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the dynamic drain resistance\n",
+ "#given\n",
+ "gm=200.*10.**-6.;#S transconductance\n",
+ "u=80.;#amplification factor\n",
+ "rd=u/gm;\n",
+ "print '%s %.f %s' %(\"The dynamic drain resistance is =\",rd/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic drain resistance is = 400 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06.ipynb new file mode 100755 index 00000000..5ae5962c --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06.ipynb @@ -0,0 +1,699 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c8db8211d13eaaf428f67dbff1442ccfba9da7e4976c038b176e3a26e0c5c3b6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 06 - Transistor Biasing and Stabilization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.2*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=270.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,'V',Ic*1000,'mA');\n",
+ "\n",
+ "#Note--In book Vce = 5.7 V because of approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 5.6 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=150.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=100.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ics*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 0 V 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Rb and percentage change in collector current due to temperature rise\n",
+ "#given\n",
+ "\n",
+ "#Calculating the base resistance\n",
+ "B=20.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Ic=1.*10.**-3.;#A #collector current\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Icbo=2.*10.**-6.;#A #collector to base leakage current\n",
+ "\n",
+ "Ib=(Ic-(1.+B)*Icbo)/B;\n",
+ "Rb=(Vcc-Vbe)/Ib;\n",
+ "\n",
+ "print '%s %.f %s' %(\"The value of resistor Ib is =\",120,'kohm');\n",
+ "\n",
+ "Rb=120.*10.**3.;#ohm approax\n",
+ "\n",
+ "#Now when temperature rise\n",
+ "Icbo=10.*10.**-6.;#A #collector to base leakage current\n",
+ "B=25.;#dc beta\n",
+ "Ic1=B*Ib+(B+1)*Icbo;# #changed collector current\n",
+ "perc=(Ic1-Ic)*100./Ic;#percentage increase\n",
+ "print '%s %.f %s' %(\"The percentage change in collector current is =\",perc,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of resistor Ib is = 120 kohm\n",
+ "The percentage change in collector current is = 46 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.1f %s' %(\"The Q point (At B=50) =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.; #dc beta\n",
+ "Ic1=B*Ib; #Colletor current\n",
+ "Ics1=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.1f %s' %(\"\\nThe Q point (At B=150) is =\",Vce,\"V\",Ics*1000,\"mA\");\n",
+ "\n",
+ "print '%s %.f' %(\"\\nThe factor at which collector current increases =\",Ics1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point (At B=50) = 6.00 V 1.5 mA\n",
+ "\n",
+ "The Q point (At B=150) is = 0 V 4.5 mA\n",
+ "\n",
+ "The factor at which collector current increases = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Q point in collector to base bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=500.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-(Ic+Ib)*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 9.1 V 1.8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the collector current and change in it if B is changed by three times of previous B\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.3f %s' %(\"Collector current (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "#Now B=150\n",
+ "B=3.*B; #three times of previous B\n",
+ "Ib1=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic1=B*Ib1; #Colletor current\n",
+ "print '%s %.2f %s' %(\"Collector current (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.f' %(\"The factor at which collector current increases =\",Ic1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current (B=50)= 1.125 mA\n",
+ "\n",
+ "Collector current (B=150)= 2.25 mA\n",
+ "\n",
+ "The factor at which collector current increases = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of all three current Ie and Ic and Ib\n",
+ "#given\n",
+ "B=90.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ie=Ic+Ib; #Emitter current\n",
+ "print '%s %.1f %s %s %.3f %s %s %.3f %s' %(\"Base current =\",Ib*10**6,\"uA\\n\",\"\\nCollector current =\",Ic*10**3,\"mA\\n\",\"\\nEmitter current =\",Ie*10**3,\"mA\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 16.5 uA\n",
+ " \n",
+ "Collector current = 1.486 mA\n",
+ " \n",
+ "Emitter current = 1.503 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max and min value of emitter current\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=75.;#ohm #resistor connected to collector\n",
+ "Re=100.;#ohm #resistor connected to emitter\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Ib=(Vcc-Vbe)/(Rb+(1.+B)*Re); #Base current\n",
+ "Ie=(1.+B)*Ib;\n",
+ "Vce=Vcc-(Rc+Re)*Ie\n",
+ "print '%s %.2f %s' %(\"Minimum emitter current =\",Ie*10**3,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"The collector to emitter volatge =\",Vce,\"V\\n\");\n",
+ "\n",
+ "#At B=300 \n",
+ "\n",
+ "B1=300.; #dc beta\n",
+ "Ib1=(Vcc-Vbe)/(Rb+(1.+B1)*Re);#Base current\n",
+ "Ie1=(1.+B1)*Ib1;\n",
+ "Vce1=Vcc-(Rc+Re)*Ie1\n",
+ "#Here Vce1= -1.4874 V but can never have negative voltage because Ie1 is wrong as it cant be more than saturation value therefore\n",
+ "Ie1=Vcc/(Rc+Re);\n",
+ "\n",
+ "#And Vce=0 V\n",
+ "\n",
+ "Vce1=0;#V\n",
+ "print '%s %.2f %s' %(\"Maximum emitter current =\",Ie1*10**3,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The collector to emitter volatge(saturation) =\",Vce1,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum emitter current = 19.25 mA\n",
+ "\n",
+ "The collector to emitter volatge = 2.63 V\n",
+ "\n",
+ "Maximum emitter current = 34.29 mA\n",
+ "\n",
+ "The collector to emitter volatge(saturation) = 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of base resistance\n",
+ "#given\n",
+ "\n",
+ "B=100.; #dc beta\n",
+ "Rc=200.;#ohm #resistor connected to collector\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Vce=4.5;#V #Collector to emitter voltage\n",
+ "Ic=(Vcc-Vce)/(Rc+Re);\n",
+ "Ib=Ic/B;\n",
+ "Rb=(Vcc-B*Re*Ib)/Ib;\n",
+ "print '%s %.f %s' %(\"The value of base resistance is =\",Rb/1000,\"kohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base resistance is = 90 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the collector current at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.;#dc beta\n",
+ "Rc=2.;#ohm #resistor connected to collector\n",
+ "Re=1000.;#ohm #resistor connected to emitter\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.2f %s' %(\"The collector current at (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.;#dc beta\n",
+ "Ib1=Vcc/(Rb+B1*Re); #Base current\n",
+ "Ic1=B1*Ib1; #Colletor current\n",
+ "print '%s %.1f %s' %(\"The collector current at (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.1f' %(\"The factor at which collector current increases=\",Ic1/Ic);\n",
+ "\n",
+ "#IN BOOK Ic(AT B=50)= 1.25 mA and Ic1/Ic=2.4 DUE TO APPROAXIMATION\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current at (B=50)= 1.29 mA\n",
+ "\n",
+ "The collector current at (B=150)= 3.0 mA\n",
+ "\n",
+ "The factor at which collector current increases= 2.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Q point in voltage divider\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.*10.**3.;#ohm #voltage divider resistor 1\n",
+ "R2=1.*10.**3.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "I=Vcc/(R1+R2); #current through voltage divider\n",
+ "Vb=I*R2; #voltage at base\n",
+ "Ve=Vb-Vbe;\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie #approaximating Ib is nearly equal to 0\n",
+ "Vc=Vcc-Ic*Rc;\n",
+ "Vce=(Vc)-Ve; \n",
+ "print '%s %.1f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Ibc=I/20.; #critical value of base current\n",
+ "Ib=Ic/B; #actual base current\n",
+ "\n",
+ "#Since Ib < Ibc, hence assumption is alright\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 3.3 V 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Solve the voltage divider accurately by applying thevenin's theorem\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.;#ohm #voltage divider resistor 1\n",
+ "R2=1.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "\n",
+ "Vth=Vcc*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent voltage Vth =\",Vth,\"V\");\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent resistance Rth =\",Rth,\"kohm\");\n",
+ "\n",
+ "Ib=(Vth-Vbe)/(Rth+(1.+B)*Re);\n",
+ "Ic=B*Ib;\n",
+ "Ie=Ic+Ib;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re; \n",
+ "print '%s %.4f %s' %(\"\\nThe accurate value of Ic =\",Ic*10**3,\"mA\");\n",
+ "print '%s %.5f %s' %(\"\\nThe accurate value of Vce =\",Vce,\"V\");\n",
+ "Icp=3.*10.**-3.; # Current calculated by voltage divider in previous example\n",
+ "Vcep=3.4; # Voltage calculated by voltage divider in previous example\n",
+ "Err_Ic=(Ic-Icp)*100./Ic;\n",
+ "Err_Vce=(Vce-Vcep)*100./Vce;\n",
+ "print '%s %.1f %s' %(\"\\nError in Ic =\",Err_Ic,\"percent\\n\");\n",
+ "print '%s %.1f %s' %(\"\\nError in Vce =\",Err_Vce,\"percent\");\n",
+ "\n",
+ "# The errors and The accurate values are different \n",
+ "# because of the approaximation in Vth and Rth in book\n",
+ "\n",
+ "# In Book Ic = 2.8436 mA and Vce = 3.73839 V\n",
+ "# Error in Ic = -5.5% \n",
+ "# Error in Vce = +9% \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin equivalent voltage Vth = 0.9 V\n",
+ "\n",
+ "Thevenin equivalent resistance Rth = 0.9 kohm\n",
+ "\n",
+ "The accurate value of Ic = 3.0152 mA\n",
+ "\n",
+ "The accurate value of Vce = 3.36060 V\n",
+ "\n",
+ "Error in Ic = 0.5 percent\n",
+ "\n",
+ "\n",
+ "Error in Vce = -1.2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the Q point for the emitter bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=5.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=10.*10.**3.;#ohm #resistor connected to emitter \n",
+ "Vcc=12.;#V #Voltage supply across the collector resistor\n",
+ "Vee=15;#V #supply at emitter\n",
+ "Ie=Vee/Re;\n",
+ "Ic=Ie;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 4.5 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Rs\n",
+ "#given\n",
+ "import math\n",
+ "Vp=2.;#V\n",
+ "Idss=1.75*10.**-3.;#A #drain current at Vgs=0\n",
+ "Vdd=24.;#V #drain to supply source\n",
+ "Id=1.*10.**-3.;#A #drain current\n",
+ "Vgs=(-Vp)*(1-math.sqrt(Id/Idss));\n",
+ "Rs=abs(Vgs)/Id;\n",
+ "print '%s %.3f %s' %(\"Vgs =\",Vgs,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Rs =\",Rs,\"ohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vgs = -0.488 V\n",
+ "\n",
+ "Rs = 488 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06_1.ipynb new file mode 100755 index 00000000..5ae5962c --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_06_1.ipynb @@ -0,0 +1,699 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c8db8211d13eaaf428f67dbff1442ccfba9da7e4976c038b176e3a26e0c5c3b6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 06 - Transistor Biasing and Stabilization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.2*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=270.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,'V',Ic*1000,'mA');\n",
+ "\n",
+ "#Note--In book Vce = 5.7 V because of approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 5.6 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=150.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=100.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ics*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 0 V 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Rb and percentage change in collector current due to temperature rise\n",
+ "#given\n",
+ "\n",
+ "#Calculating the base resistance\n",
+ "B=20.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Ic=1.*10.**-3.;#A #collector current\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Icbo=2.*10.**-6.;#A #collector to base leakage current\n",
+ "\n",
+ "Ib=(Ic-(1.+B)*Icbo)/B;\n",
+ "Rb=(Vcc-Vbe)/Ib;\n",
+ "\n",
+ "print '%s %.f %s' %(\"The value of resistor Ib is =\",120,'kohm');\n",
+ "\n",
+ "Rb=120.*10.**3.;#ohm approax\n",
+ "\n",
+ "#Now when temperature rise\n",
+ "Icbo=10.*10.**-6.;#A #collector to base leakage current\n",
+ "B=25.;#dc beta\n",
+ "Ic1=B*Ib+(B+1)*Icbo;# #changed collector current\n",
+ "perc=(Ic1-Ic)*100./Ic;#percentage increase\n",
+ "print '%s %.f %s' %(\"The percentage change in collector current is =\",perc,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of resistor Ib is = 120 kohm\n",
+ "The percentage change in collector current is = 46 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.1f %s' %(\"The Q point (At B=50) =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.; #dc beta\n",
+ "Ic1=B*Ib; #Colletor current\n",
+ "Ics1=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.1f %s' %(\"\\nThe Q point (At B=150) is =\",Vce,\"V\",Ics*1000,\"mA\");\n",
+ "\n",
+ "print '%s %.f' %(\"\\nThe factor at which collector current increases =\",Ics1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point (At B=50) = 6.00 V 1.5 mA\n",
+ "\n",
+ "The Q point (At B=150) is = 0 V 4.5 mA\n",
+ "\n",
+ "The factor at which collector current increases = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Q point in collector to base bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=500.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-(Ic+Ib)*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 9.1 V 1.8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the collector current and change in it if B is changed by three times of previous B\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.3f %s' %(\"Collector current (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "#Now B=150\n",
+ "B=3.*B; #three times of previous B\n",
+ "Ib1=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic1=B*Ib1; #Colletor current\n",
+ "print '%s %.2f %s' %(\"Collector current (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.f' %(\"The factor at which collector current increases =\",Ic1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current (B=50)= 1.125 mA\n",
+ "\n",
+ "Collector current (B=150)= 2.25 mA\n",
+ "\n",
+ "The factor at which collector current increases = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of all three current Ie and Ic and Ib\n",
+ "#given\n",
+ "B=90.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ie=Ic+Ib; #Emitter current\n",
+ "print '%s %.1f %s %s %.3f %s %s %.3f %s' %(\"Base current =\",Ib*10**6,\"uA\\n\",\"\\nCollector current =\",Ic*10**3,\"mA\\n\",\"\\nEmitter current =\",Ie*10**3,\"mA\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 16.5 uA\n",
+ " \n",
+ "Collector current = 1.486 mA\n",
+ " \n",
+ "Emitter current = 1.503 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max and min value of emitter current\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=75.;#ohm #resistor connected to collector\n",
+ "Re=100.;#ohm #resistor connected to emitter\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Ib=(Vcc-Vbe)/(Rb+(1.+B)*Re); #Base current\n",
+ "Ie=(1.+B)*Ib;\n",
+ "Vce=Vcc-(Rc+Re)*Ie\n",
+ "print '%s %.2f %s' %(\"Minimum emitter current =\",Ie*10**3,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"The collector to emitter volatge =\",Vce,\"V\\n\");\n",
+ "\n",
+ "#At B=300 \n",
+ "\n",
+ "B1=300.; #dc beta\n",
+ "Ib1=(Vcc-Vbe)/(Rb+(1.+B1)*Re);#Base current\n",
+ "Ie1=(1.+B1)*Ib1;\n",
+ "Vce1=Vcc-(Rc+Re)*Ie1\n",
+ "#Here Vce1= -1.4874 V but can never have negative voltage because Ie1 is wrong as it cant be more than saturation value therefore\n",
+ "Ie1=Vcc/(Rc+Re);\n",
+ "\n",
+ "#And Vce=0 V\n",
+ "\n",
+ "Vce1=0;#V\n",
+ "print '%s %.2f %s' %(\"Maximum emitter current =\",Ie1*10**3,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The collector to emitter volatge(saturation) =\",Vce1,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum emitter current = 19.25 mA\n",
+ "\n",
+ "The collector to emitter volatge = 2.63 V\n",
+ "\n",
+ "Maximum emitter current = 34.29 mA\n",
+ "\n",
+ "The collector to emitter volatge(saturation) = 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of base resistance\n",
+ "#given\n",
+ "\n",
+ "B=100.; #dc beta\n",
+ "Rc=200.;#ohm #resistor connected to collector\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Vce=4.5;#V #Collector to emitter voltage\n",
+ "Ic=(Vcc-Vce)/(Rc+Re);\n",
+ "Ib=Ic/B;\n",
+ "Rb=(Vcc-B*Re*Ib)/Ib;\n",
+ "print '%s %.f %s' %(\"The value of base resistance is =\",Rb/1000,\"kohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base resistance is = 90 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the collector current at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.;#dc beta\n",
+ "Rc=2.;#ohm #resistor connected to collector\n",
+ "Re=1000.;#ohm #resistor connected to emitter\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.2f %s' %(\"The collector current at (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.;#dc beta\n",
+ "Ib1=Vcc/(Rb+B1*Re); #Base current\n",
+ "Ic1=B1*Ib1; #Colletor current\n",
+ "print '%s %.1f %s' %(\"The collector current at (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.1f' %(\"The factor at which collector current increases=\",Ic1/Ic);\n",
+ "\n",
+ "#IN BOOK Ic(AT B=50)= 1.25 mA and Ic1/Ic=2.4 DUE TO APPROAXIMATION\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current at (B=50)= 1.29 mA\n",
+ "\n",
+ "The collector current at (B=150)= 3.0 mA\n",
+ "\n",
+ "The factor at which collector current increases= 2.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Q point in voltage divider\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.*10.**3.;#ohm #voltage divider resistor 1\n",
+ "R2=1.*10.**3.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "I=Vcc/(R1+R2); #current through voltage divider\n",
+ "Vb=I*R2; #voltage at base\n",
+ "Ve=Vb-Vbe;\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie #approaximating Ib is nearly equal to 0\n",
+ "Vc=Vcc-Ic*Rc;\n",
+ "Vce=(Vc)-Ve; \n",
+ "print '%s %.1f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Ibc=I/20.; #critical value of base current\n",
+ "Ib=Ic/B; #actual base current\n",
+ "\n",
+ "#Since Ib < Ibc, hence assumption is alright\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 3.3 V 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Solve the voltage divider accurately by applying thevenin's theorem\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.;#ohm #voltage divider resistor 1\n",
+ "R2=1.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "\n",
+ "Vth=Vcc*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent voltage Vth =\",Vth,\"V\");\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent resistance Rth =\",Rth,\"kohm\");\n",
+ "\n",
+ "Ib=(Vth-Vbe)/(Rth+(1.+B)*Re);\n",
+ "Ic=B*Ib;\n",
+ "Ie=Ic+Ib;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re; \n",
+ "print '%s %.4f %s' %(\"\\nThe accurate value of Ic =\",Ic*10**3,\"mA\");\n",
+ "print '%s %.5f %s' %(\"\\nThe accurate value of Vce =\",Vce,\"V\");\n",
+ "Icp=3.*10.**-3.; # Current calculated by voltage divider in previous example\n",
+ "Vcep=3.4; # Voltage calculated by voltage divider in previous example\n",
+ "Err_Ic=(Ic-Icp)*100./Ic;\n",
+ "Err_Vce=(Vce-Vcep)*100./Vce;\n",
+ "print '%s %.1f %s' %(\"\\nError in Ic =\",Err_Ic,\"percent\\n\");\n",
+ "print '%s %.1f %s' %(\"\\nError in Vce =\",Err_Vce,\"percent\");\n",
+ "\n",
+ "# The errors and The accurate values are different \n",
+ "# because of the approaximation in Vth and Rth in book\n",
+ "\n",
+ "# In Book Ic = 2.8436 mA and Vce = 3.73839 V\n",
+ "# Error in Ic = -5.5% \n",
+ "# Error in Vce = +9% \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin equivalent voltage Vth = 0.9 V\n",
+ "\n",
+ "Thevenin equivalent resistance Rth = 0.9 kohm\n",
+ "\n",
+ "The accurate value of Ic = 3.0152 mA\n",
+ "\n",
+ "The accurate value of Vce = 3.36060 V\n",
+ "\n",
+ "Error in Ic = 0.5 percent\n",
+ "\n",
+ "\n",
+ "Error in Vce = -1.2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the Q point for the emitter bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=5.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=10.*10.**3.;#ohm #resistor connected to emitter \n",
+ "Vcc=12.;#V #Voltage supply across the collector resistor\n",
+ "Vee=15;#V #supply at emitter\n",
+ "Ie=Vee/Re;\n",
+ "Ic=Ie;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 4.5 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Rs\n",
+ "#given\n",
+ "import math\n",
+ "Vp=2.;#V\n",
+ "Idss=1.75*10.**-3.;#A #drain current at Vgs=0\n",
+ "Vdd=24.;#V #drain to supply source\n",
+ "Id=1.*10.**-3.;#A #drain current\n",
+ "Vgs=(-Vp)*(1-math.sqrt(Id/Idss));\n",
+ "Rs=abs(Vgs)/Id;\n",
+ "print '%s %.3f %s' %(\"Vgs =\",Vgs,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Rs =\",Rs,\"ohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vgs = -0.488 V\n",
+ "\n",
+ "Rs = 488 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07.ipynb new file mode 100755 index 00000000..ac95ccf3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07.ipynb @@ -0,0 +1,591 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c1a591eccedac3b03d639316b4632fe3e03a9db06d23d730c93344ae026326fb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 07 - Small Signal SIngle-Stage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max current and check will the capacitor act as short for given frequency\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "Vs=1.;#V\n",
+ "Imax=Vs/(Rs+Rl);\n",
+ "fc=1./(2.*math.pi*(Rs+Rl)*C) #critical frequency\n",
+ "fh=10.*fc; #Border frequency\n",
+ "print '%s %.f %s' %(\"Maximum current is =\",Imax*10**6,\"uA\\n\");\n",
+ "print '%s %.2f %s' %(\"fh =\",fh,\"Hz\\n\");\n",
+ "print '%s %.2f %s %s' %(\"As long as source frequency is greater than\",fh,\"Hz\",\"the coupling capacitor acts like an ac short for 20Hz to 20kHz\")\n",
+ "\n",
+ "#In book Imax is 200mA but there is misprinting of 'm' in mA it should be uA\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum current is = 200 uA\n",
+ "\n",
+ "fh = 3.18 Hz\n",
+ "\n",
+ "As long as source frequency is greater than 3.18 Hz the coupling capacitor acts like an ac short for 20Hz to 20kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the capacitor is an effective bypass for the signal currents of lowest frequency 20 Hz\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "f=20.;#Hz #lowest frequency\n",
+ "Xc=1./(2.*math.pi*f*C) #reactance of capacitor at 20Hz\n",
+ "Rth=Rs*Rl/(Rs+Rl); #Thevenins equivalent resistance\n",
+ "print '%s %.1f %s %.f %s ' %(\"Xc < Rth/10 is satisfied\",Xc,\"ohm\",Rth/10,\"ohm\\n\");\n",
+ "print '%s' %(\"The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Xc < Rth/10 is satisfied 79.6 ohm 80 ohm\n",
+ " \n",
+ "The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of capacitor required\n",
+ "#given\n",
+ "import math\n",
+ "Rs1=20.*10.**3.;#ohm\n",
+ "Rs2=30.*10.**3.;#ohm\n",
+ "Rl1=40.*10.**3.;#ohm\n",
+ "Rl2=80.*10.**3.;#ohm\n",
+ "Rl3=80.*10.**3.;#ohm\n",
+ "Rth=Rs1*Rs2/(Rs1+Rs2); #Thevenins equivalent resistance\n",
+ "Rl_=Rl2*Rl3/(Rl2+Rl3);\n",
+ "Rl=Rl1*Rl_/(Rl1+Rl_); #Equivalent load\n",
+ "f=50.;#Hz #lowest frequency\n",
+ "R=Rth+Rl;\n",
+ "C=10./(2.*math.pi*f*R)\n",
+ "print '%s %.f %s' %(\"The required value of coupling capacitor is =\",C*10**6,\"uF\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of coupling capacitor is = 1 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage and current gain and input and output resistance\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "#given\n",
+ "\n",
+ "#DC analysis\n",
+ "Vcc=12.;#V\n",
+ "Rb=200.*10.**3.;#ohm\n",
+ "Rc=1.*10.**3.;#ohm\n",
+ "B=100.;# beta\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#AC analysis\n",
+ "Rl=1.*10.**3.;#ohm\n",
+ "hfe=B;\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "hoe_1=40.*10.**3.;#ohm # 1/hoe\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-hfe*Rac/hie;\n",
+ "print '%s %.2f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "\n",
+ "#Siince (1/hoe) > Rac therefore entire current will flows through Rac\n",
+ "Io=-100.*Ib;\n",
+ "Ac=Io/Ib;\n",
+ "print '%s %.2f %s' %(\"The current gain =\",Ac,\"\\n\");\n",
+ "\n",
+ "Ri=prll(Rb,hie);\n",
+ "Ro=prll(Rl,prll(Rc,hoe_1));\n",
+ "print '%s %.f %s' %(\"The input resistance =\",Ri/1000,\"kohm\\n\");\n",
+ "print '%s %.1f %s' %(\"The output resistance =\",Ro/1000,\"kohm\");\n",
+ "\n",
+ "#In book the voltage gain is 25 due to skipping of '-' in printing\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 6.00 V 6.00 mA\n",
+ "\n",
+ "The voltage gain = -25.00 \n",
+ "\n",
+ "The current gain = -100.00 \n",
+ "\n",
+ "The input resistance = 2 kohm\n",
+ "\n",
+ "The output resistance = 0.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Solve previous example using hybrid pie model\n",
+ "#soltion\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "Vcc=12.##V\n",
+ "Rb=200.*10.**3.##ohm\n",
+ "Rc=1.*10.**3.##ohm\n",
+ "Rl=1.*10.**3.##ohm\n",
+ "B=100.## beta\n",
+ "hie=2.*10.**3.##ohm\n",
+ "hoe_1=40.*10.**3.##ohm # 1/hoe\n",
+ "\n",
+ "Ib=Vcc/Rb#\n",
+ "Ic=B*Ib#\n",
+ "Rac=prll(Rc,Rl)#\n",
+ "gm=Ic/(25.*10.**-3.)#\n",
+ "rpi=B/gm#\n",
+ "ri=hie#\n",
+ "rb=ri-rpi#\n",
+ "ro=hoe_1#\n",
+ "Vpi=rpi/(rpi+rb)#\n",
+ "Vo=-gm*Vpi*Rac# #output voltage\n",
+ "Av=Vo#\n",
+ "print '%s %.2f' %(\"The voltage gain\",Av)#\n",
+ "#In book voltage gain is -24.96 due to appraoximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain -25.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of output voltage\n",
+ "#given\n",
+ "Vcc=12.;#V\n",
+ "Rb=150.*10.**3.;#ohm\n",
+ "Rc=5.*10.**3.;#ohm\n",
+ "B=200.;# beta\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "ro=60.*10.**3.;#ohm # 1/hoe\n",
+ "Vi=1.*10.**-3.;#V\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "# Icsat < Ic therefore transistor is in saturation mode and outpuut voltage wil be zero\n",
+ "Vo=0;\n",
+ "print '%s %.f %s' %(\"The output voltage=\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage= 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input resistance\n",
+ "# Function definition is here\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2);\n",
+ "\treturn z\n",
+ "\n",
+ "R1=75.*10.**3.;#ohm\n",
+ "R2=7.5*10.**3.;#ohm\n",
+ "Rc=4.7*10.**3.;#ohm\n",
+ "Re=1.2*10.**3.;#ohm\n",
+ "Rl=12.*10.**3.;#ohm\n",
+ "B=150.;\n",
+ "ri=2.*10.**3.;#ohm\n",
+ "Vcc=15.;#V\n",
+ "Vb=Vcc*R2/(R1+R2);\n",
+ "Ve=Vb; #since Vbe=0\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie;\n",
+ "Icsat=Vcc/(Rc+Re);\n",
+ "# Ic < Icsat therefore transistor is in active mode\n",
+ "Vce=Vcc-Ic*(Rc+Re);\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-B*Rac/ri;\n",
+ "print '%s %.1f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "Ri_=prll(ri,R2);\n",
+ "print '%s %.2f %s' %(\"The input resistance=\",Ri_/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 8.30 V 1.14 mA\n",
+ "\n",
+ "The voltage gain = -253.3 \n",
+ "\n",
+ "The input resistance= 1.58 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of gm at different values of Vgs\n",
+ "#given\n",
+ "\n",
+ "Idss=8.*10.**-3.;#A\n",
+ "Vp=4;#V\n",
+ "#At Vgs= -0.5 V\n",
+ "Vgs= -0.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.f %s' %(\"gmo =\",gmo*1000,\"mS\\n\");\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -0.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -1.5 V\n",
+ "Vgs= -1.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -1.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -2.5 V\n",
+ "Vgs= -2.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -2.5V) =\",gm*1000,\"mS\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gmo = 4 mS\n",
+ "\n",
+ "gm (At Vgs = -0.5V) = 3.5 mS\n",
+ "\n",
+ "gm (At Vgs = -1.5V) = 2.5 mS\n",
+ "\n",
+ "gm (At Vgs = -2.5V) = 1.5 mS\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output signal voltage of the amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Rd=12.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Cs=25.*10.**-6.;#F\n",
+ "u=80.; #amplification factor\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Vi=0.1;#V\n",
+ "f=1.*10.**3.;#Hz #input frequency\n",
+ "Xcs=1./(2.*math.pi*f*Cs);\n",
+ "#This is much smaller than Rs therefore it is bypassed\n",
+ "\n",
+ "gm=u/rd;\n",
+ "Av=gm*(rd*Rd/(rd+Rd));\n",
+ "Vo=Av*Vi;\n",
+ "print '%s %.3f %s' %(\"The output voltage is =\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 0.453 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "Rd=2.*10.**3.;#ohm\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Av=-gm*(rd*Rd/(rd+Rd));\n",
+ "Ri=Rg;\n",
+ "Ro=rd*Rd/(rd+Rd);\n",
+ "print '%s %.f %s %.f %s %s %.f %s' %(\"The small signal voltage gain =\",Av,\"\\ninput resistance=\",Ri/10**6,\"Mohm\",\"\\noutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -4 \n",
+ "input resistance= 1 Mohm \n",
+ "output resistance = 2 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=500.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Rd=5.*10.**3.;#ohm\n",
+ "Rs=100.;#ohm\n",
+ "Rl=5.*10.**3.;#ohm\n",
+ "gm=1.5*10.**-3.;#S\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Rg=R1*R2/(R1+R2);\n",
+ "Rac=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*Rac;\n",
+ "Ri=Rg;\n",
+ "Ro=(rd*Rac/(rd+Rac));\n",
+ "print '%s %.2f %s %.2f %s %s %.1f %s' %(\"The small signal voltage gain =\",Av,\"\\nInput resistance =\",Ri/1000,\"kohm\",\"\\nOutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -3.75 \n",
+ "Input resistance = 45.45 kohm \n",
+ "Output resistance = 2.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the voltage gain of the FET\n",
+ "#given\n",
+ "Idss=8.*10.**-3.##A\n",
+ "Vp=4.##V\n",
+ "rd=25.*10.**3.##ohm\n",
+ "Rd=2.2*10.**3.##ohm #by the help of figure\n",
+ "Vgs=-1.8##V\n",
+ "gmo=2.*Idss/(abs(Vp))#\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)))#\n",
+ "Av=-gm*(rd*Rd/(rd+Rd))#\n",
+ "print '%s %.2f' %(\"The voltage gain of the FET =\",Av)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain of the FET = -4.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07_1.ipynb new file mode 100755 index 00000000..ac95ccf3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_07_1.ipynb @@ -0,0 +1,591 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c1a591eccedac3b03d639316b4632fe3e03a9db06d23d730c93344ae026326fb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 07 - Small Signal SIngle-Stage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max current and check will the capacitor act as short for given frequency\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "Vs=1.;#V\n",
+ "Imax=Vs/(Rs+Rl);\n",
+ "fc=1./(2.*math.pi*(Rs+Rl)*C) #critical frequency\n",
+ "fh=10.*fc; #Border frequency\n",
+ "print '%s %.f %s' %(\"Maximum current is =\",Imax*10**6,\"uA\\n\");\n",
+ "print '%s %.2f %s' %(\"fh =\",fh,\"Hz\\n\");\n",
+ "print '%s %.2f %s %s' %(\"As long as source frequency is greater than\",fh,\"Hz\",\"the coupling capacitor acts like an ac short for 20Hz to 20kHz\")\n",
+ "\n",
+ "#In book Imax is 200mA but there is misprinting of 'm' in mA it should be uA\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum current is = 200 uA\n",
+ "\n",
+ "fh = 3.18 Hz\n",
+ "\n",
+ "As long as source frequency is greater than 3.18 Hz the coupling capacitor acts like an ac short for 20Hz to 20kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the capacitor is an effective bypass for the signal currents of lowest frequency 20 Hz\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "f=20.;#Hz #lowest frequency\n",
+ "Xc=1./(2.*math.pi*f*C) #reactance of capacitor at 20Hz\n",
+ "Rth=Rs*Rl/(Rs+Rl); #Thevenins equivalent resistance\n",
+ "print '%s %.1f %s %.f %s ' %(\"Xc < Rth/10 is satisfied\",Xc,\"ohm\",Rth/10,\"ohm\\n\");\n",
+ "print '%s' %(\"The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Xc < Rth/10 is satisfied 79.6 ohm 80 ohm\n",
+ " \n",
+ "The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of capacitor required\n",
+ "#given\n",
+ "import math\n",
+ "Rs1=20.*10.**3.;#ohm\n",
+ "Rs2=30.*10.**3.;#ohm\n",
+ "Rl1=40.*10.**3.;#ohm\n",
+ "Rl2=80.*10.**3.;#ohm\n",
+ "Rl3=80.*10.**3.;#ohm\n",
+ "Rth=Rs1*Rs2/(Rs1+Rs2); #Thevenins equivalent resistance\n",
+ "Rl_=Rl2*Rl3/(Rl2+Rl3);\n",
+ "Rl=Rl1*Rl_/(Rl1+Rl_); #Equivalent load\n",
+ "f=50.;#Hz #lowest frequency\n",
+ "R=Rth+Rl;\n",
+ "C=10./(2.*math.pi*f*R)\n",
+ "print '%s %.f %s' %(\"The required value of coupling capacitor is =\",C*10**6,\"uF\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of coupling capacitor is = 1 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage and current gain and input and output resistance\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "#given\n",
+ "\n",
+ "#DC analysis\n",
+ "Vcc=12.;#V\n",
+ "Rb=200.*10.**3.;#ohm\n",
+ "Rc=1.*10.**3.;#ohm\n",
+ "B=100.;# beta\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#AC analysis\n",
+ "Rl=1.*10.**3.;#ohm\n",
+ "hfe=B;\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "hoe_1=40.*10.**3.;#ohm # 1/hoe\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-hfe*Rac/hie;\n",
+ "print '%s %.2f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "\n",
+ "#Siince (1/hoe) > Rac therefore entire current will flows through Rac\n",
+ "Io=-100.*Ib;\n",
+ "Ac=Io/Ib;\n",
+ "print '%s %.2f %s' %(\"The current gain =\",Ac,\"\\n\");\n",
+ "\n",
+ "Ri=prll(Rb,hie);\n",
+ "Ro=prll(Rl,prll(Rc,hoe_1));\n",
+ "print '%s %.f %s' %(\"The input resistance =\",Ri/1000,\"kohm\\n\");\n",
+ "print '%s %.1f %s' %(\"The output resistance =\",Ro/1000,\"kohm\");\n",
+ "\n",
+ "#In book the voltage gain is 25 due to skipping of '-' in printing\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 6.00 V 6.00 mA\n",
+ "\n",
+ "The voltage gain = -25.00 \n",
+ "\n",
+ "The current gain = -100.00 \n",
+ "\n",
+ "The input resistance = 2 kohm\n",
+ "\n",
+ "The output resistance = 0.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Solve previous example using hybrid pie model\n",
+ "#soltion\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "Vcc=12.##V\n",
+ "Rb=200.*10.**3.##ohm\n",
+ "Rc=1.*10.**3.##ohm\n",
+ "Rl=1.*10.**3.##ohm\n",
+ "B=100.## beta\n",
+ "hie=2.*10.**3.##ohm\n",
+ "hoe_1=40.*10.**3.##ohm # 1/hoe\n",
+ "\n",
+ "Ib=Vcc/Rb#\n",
+ "Ic=B*Ib#\n",
+ "Rac=prll(Rc,Rl)#\n",
+ "gm=Ic/(25.*10.**-3.)#\n",
+ "rpi=B/gm#\n",
+ "ri=hie#\n",
+ "rb=ri-rpi#\n",
+ "ro=hoe_1#\n",
+ "Vpi=rpi/(rpi+rb)#\n",
+ "Vo=-gm*Vpi*Rac# #output voltage\n",
+ "Av=Vo#\n",
+ "print '%s %.2f' %(\"The voltage gain\",Av)#\n",
+ "#In book voltage gain is -24.96 due to appraoximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain -25.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of output voltage\n",
+ "#given\n",
+ "Vcc=12.;#V\n",
+ "Rb=150.*10.**3.;#ohm\n",
+ "Rc=5.*10.**3.;#ohm\n",
+ "B=200.;# beta\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "ro=60.*10.**3.;#ohm # 1/hoe\n",
+ "Vi=1.*10.**-3.;#V\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "# Icsat < Ic therefore transistor is in saturation mode and outpuut voltage wil be zero\n",
+ "Vo=0;\n",
+ "print '%s %.f %s' %(\"The output voltage=\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage= 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input resistance\n",
+ "# Function definition is here\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2);\n",
+ "\treturn z\n",
+ "\n",
+ "R1=75.*10.**3.;#ohm\n",
+ "R2=7.5*10.**3.;#ohm\n",
+ "Rc=4.7*10.**3.;#ohm\n",
+ "Re=1.2*10.**3.;#ohm\n",
+ "Rl=12.*10.**3.;#ohm\n",
+ "B=150.;\n",
+ "ri=2.*10.**3.;#ohm\n",
+ "Vcc=15.;#V\n",
+ "Vb=Vcc*R2/(R1+R2);\n",
+ "Ve=Vb; #since Vbe=0\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie;\n",
+ "Icsat=Vcc/(Rc+Re);\n",
+ "# Ic < Icsat therefore transistor is in active mode\n",
+ "Vce=Vcc-Ic*(Rc+Re);\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-B*Rac/ri;\n",
+ "print '%s %.1f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "Ri_=prll(ri,R2);\n",
+ "print '%s %.2f %s' %(\"The input resistance=\",Ri_/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 8.30 V 1.14 mA\n",
+ "\n",
+ "The voltage gain = -253.3 \n",
+ "\n",
+ "The input resistance= 1.58 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of gm at different values of Vgs\n",
+ "#given\n",
+ "\n",
+ "Idss=8.*10.**-3.;#A\n",
+ "Vp=4;#V\n",
+ "#At Vgs= -0.5 V\n",
+ "Vgs= -0.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.f %s' %(\"gmo =\",gmo*1000,\"mS\\n\");\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -0.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -1.5 V\n",
+ "Vgs= -1.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -1.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -2.5 V\n",
+ "Vgs= -2.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -2.5V) =\",gm*1000,\"mS\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gmo = 4 mS\n",
+ "\n",
+ "gm (At Vgs = -0.5V) = 3.5 mS\n",
+ "\n",
+ "gm (At Vgs = -1.5V) = 2.5 mS\n",
+ "\n",
+ "gm (At Vgs = -2.5V) = 1.5 mS\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output signal voltage of the amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Rd=12.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Cs=25.*10.**-6.;#F\n",
+ "u=80.; #amplification factor\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Vi=0.1;#V\n",
+ "f=1.*10.**3.;#Hz #input frequency\n",
+ "Xcs=1./(2.*math.pi*f*Cs);\n",
+ "#This is much smaller than Rs therefore it is bypassed\n",
+ "\n",
+ "gm=u/rd;\n",
+ "Av=gm*(rd*Rd/(rd+Rd));\n",
+ "Vo=Av*Vi;\n",
+ "print '%s %.3f %s' %(\"The output voltage is =\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 0.453 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "Rd=2.*10.**3.;#ohm\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Av=-gm*(rd*Rd/(rd+Rd));\n",
+ "Ri=Rg;\n",
+ "Ro=rd*Rd/(rd+Rd);\n",
+ "print '%s %.f %s %.f %s %s %.f %s' %(\"The small signal voltage gain =\",Av,\"\\ninput resistance=\",Ri/10**6,\"Mohm\",\"\\noutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -4 \n",
+ "input resistance= 1 Mohm \n",
+ "output resistance = 2 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=500.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Rd=5.*10.**3.;#ohm\n",
+ "Rs=100.;#ohm\n",
+ "Rl=5.*10.**3.;#ohm\n",
+ "gm=1.5*10.**-3.;#S\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Rg=R1*R2/(R1+R2);\n",
+ "Rac=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*Rac;\n",
+ "Ri=Rg;\n",
+ "Ro=(rd*Rac/(rd+Rac));\n",
+ "print '%s %.2f %s %.2f %s %s %.1f %s' %(\"The small signal voltage gain =\",Av,\"\\nInput resistance =\",Ri/1000,\"kohm\",\"\\nOutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -3.75 \n",
+ "Input resistance = 45.45 kohm \n",
+ "Output resistance = 2.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the voltage gain of the FET\n",
+ "#given\n",
+ "Idss=8.*10.**-3.##A\n",
+ "Vp=4.##V\n",
+ "rd=25.*10.**3.##ohm\n",
+ "Rd=2.2*10.**3.##ohm #by the help of figure\n",
+ "Vgs=-1.8##V\n",
+ "gmo=2.*Idss/(abs(Vp))#\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)))#\n",
+ "Av=-gm*(rd*Rd/(rd+Rd))#\n",
+ "print '%s %.2f' %(\"The voltage gain of the FET =\",Av)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain of the FET = -4.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08.ipynb new file mode 100755 index 00000000..8771f780 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08.ipynb @@ -0,0 +1,393 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6dc14d0f3e52d6546555bedb4c03e69e0077a9e9ecdeb40a1fe337170a8ca497"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 08 - Multistage Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Express the gain in decibel\n",
+ "#given\n",
+ "#Powere gain of 1000\n",
+ "import math\n",
+ "Pg1=1000.;\n",
+ "Pgd1=10.*math.log10(Pg1);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd1,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1000\n",
+ "Vg1=1000.;\n",
+ "Vgd1=20.*math.log10(Vg1);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd1,\"dB\\n\");\n",
+ "\n",
+ "#Powere gain of 1/100\n",
+ "Pg2=1./100.;\n",
+ "Pgd2=10.*math.log10(Pg2);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd2,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1/100\n",
+ "Vg2=1./100.;\n",
+ "Vgd2=20.*math.log10(Vg2);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd2,\"dB\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain (in dB)= 30 dB\n",
+ "\n",
+ "Voltage gain (in dB)= 60 dB\n",
+ "\n",
+ "Power gain (in dB)= -20 dB\n",
+ "\n",
+ "Voltage gain (in dB)= -40 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine power and voltage gain\n",
+ "#given\n",
+ "#For Gain = 10 dB\n",
+ "G=10.;#dB\n",
+ "Pg1=10.**(G/10.); #taking antilog\n",
+ "Vg1=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.f %s' %(\"Power gain ratio =\",Pg1,\"\\n\");\n",
+ "print '%s %.2f %s' %(\"Voltage gain ratio =\",Vg1,\"\\n\");\n",
+ "\n",
+ "#For Gain 3 dB\n",
+ "G=3.;#dB\n",
+ "Pg2=10.**(G/10.); #taking antilog\n",
+ "Vg2=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.2f %s' %(\"Power gain ratio =\",Pg2,\"\\n\");\n",
+ "print '%s %.3f %s' %(\"Voltage gain ratio =\",Vg2,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Gain 10 dB\n",
+ "\n",
+ "Power gain ratio = 10 \n",
+ "\n",
+ "Voltage gain ratio = 3.16 \n",
+ "\n",
+ "For Gain 3 dB\n",
+ "\n",
+ "Power gain ratio = 2.00 \n",
+ "\n",
+ "Voltage gain ratio = 1.413 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the overall voltage gain\n",
+ "#given\n",
+ "import math\n",
+ "A1=80.\n",
+ "A2=50.\n",
+ "A3=30.\n",
+ "Ad=20.*math.log10(A1)+20.*math.log10(A2)+20.*math.log10(A3);\n",
+ "\n",
+ "#Alternatively\n",
+ "A=A1*A2*A3;\n",
+ "Ad=20.*math.log10(A);\n",
+ "print '%s %.2f %s' %(\"The Voltage gain is =\",Ad,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Voltage gain is = 101.58 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate quiescent output voltage and small signal voltage gain\n",
+ "#given\n",
+ "#At input Voltage =3V\n",
+ "Vi1=3.##V #input voltage\n",
+ "Vbe=0.7##V\n",
+ "B=250.#\n",
+ "Vcc=10.##V #Supply\n",
+ "Re1=1.*10.**3.##ohm\n",
+ "Rc1=3.*10.**3.##ohm\n",
+ "Re2=2.*10.**3.##ohm\n",
+ "Rc2=4.*10.**3.##ohm\n",
+ "Vb1=Vi1# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo1=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage(At input Voltage = 3V) is =\",Vo1,\"V\\n\")#\n",
+ "\n",
+ "#At input Voltage =3.2 V\n",
+ "Vi2=3.2##V #input voltage\n",
+ "Vb1=Vi2# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo2=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage (At input Voltage =3.2 V) is =\",Vo2,\"V\\n\")#\n",
+ "\n",
+ "#Small Signal input and output voltage\n",
+ "vi=Vi2-Vi1#\n",
+ "vo=Vo2-Vo1#\n",
+ "Av=vo/vi#\n",
+ "print '%s %.f' %(\"The small signal voltage gain is =\",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The quiescent output voltage(At input Voltage = 3V) is = 5.2 V\n",
+ "\n",
+ "The quiescent output voltage (At input Voltage =3.2 V) is = 6.4 V\n",
+ "\n",
+ "The small signal voltage gain is = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the maximum voltage gain and bandwidth of multistage amplifier\n",
+ "#FUNCTIONS\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "rin=10.*10.**6.;#ohm #input resistance of JFET\n",
+ "Rd=10.*10.**3.;#ohm\n",
+ "Rs=500.;#ohm\n",
+ "Rg=470.*10.**3.;#ohm\n",
+ "Rl=470.*10.**3.;#ohm\n",
+ "Cc=0.01*10.**-6.;#Farad\n",
+ "Csh=100.*10.**-12.;#Farad\n",
+ "Cs=50.*10.**-6.;#Farad\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Rac2=prll(Rd,Rl);\n",
+ "Rac1=prll(Rd,Rg);\n",
+ "Req=prll(rd,prll(Rd,Rl));\n",
+ "Am=math.ceil(gm*Req);\n",
+ "Am2=Am*Am; #Voltage gain of two stage amplifier\n",
+ "print '%s %.f %s' %(\"Voltage gain of two stage amplifier=\",Am2,\"\\n\");\n",
+ "R_=prll(rd,Rd)+prll(Rg,rin);\n",
+ "f1=1./(2.*math.pi*Cc*R_); #lower cutoff frequency\n",
+ "f1_=f1/(math.sqrt(math.sqrt(2.)-1.));\n",
+ "f2=1./(2.*math.pi*Csh*Req); #upper cutoff frequency\n",
+ "f2_=f2*(math.sqrt(math.sqrt(2.)-1.));\n",
+ "BW=f2_-f1_;\n",
+ "print '%s %.f %s' %(\"Bandwidth=\",BW/1000.,\"kHz\\n\");\n",
+ "#There is a slight error in f1 due to use of R'(here R_)=479 kohm and in f2 due to approaximation of Req there is a slight variation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain of two stage amplifier= 324 \n",
+ "\n",
+ "Bandwidth= 115 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the midband voltage gain and bandwidth of cascade amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Am=8.##midband voltage gain of individual MOSFET\n",
+ "BW=500.*10.**3.#Hz\n",
+ "f2=BW#\n",
+ "n=4.#\n",
+ "A2m=Am**n#\n",
+ "f2_=f2*(math.sqrt((2.**(1./n))-1.))#\n",
+ "print '%s %.f %s' %(\"Midband voltage gain =\",A2m,\"\\n\")#\n",
+ "print '%s %.1f %s' %(\"Overall Bandwidth =\",f2_/1000,\"kHz\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Midband voltage gain = 4096 \n",
+ "\n",
+ "Overall Bandwidth = 217.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the input and output impedance and voltage gain\n",
+ "#FUNCTIONS\n",
+ "\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "hie=1.1*10.**3.;#ohm=rin\n",
+ "hfe=120.;#=B\n",
+ "#the values of Rac2, Zi, Zo are as per diagram\n",
+ "Rac2=prll(3.3*10**3,2.2*10**3);\n",
+ "Rac1=prll(6.8*10**3,prll(56*10**3,prll(5.6*10**3,1.1*10**3)));\n",
+ "Zi=prll(5.6*10**3,prll(56*10**3,1.1*10**3));\n",
+ "Zo=prll(3.3*10**3,2.2*10**3);\n",
+ "print '%s %.3f %s %s %.2f %s' %(\"Input Resistance =\",Zi/1000,\"kohm\\n\",\"\\nOutput Resistance =\",Zo/1000,\"kohm\");\n",
+ "Am2=-hfe*Rac2/(hie);\n",
+ "Am1=-hfe*Rac1/(hie);\n",
+ "Am=Am1*Am2;\n",
+ "Am=20.*math.log10(Am);\n",
+ "print '%s %.2f %s' %(\"\\nThe Overall Voltage gain is\",Am,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input Resistance = 0.905 kohm\n",
+ " \n",
+ "Output Resistance = 1.32 kohm\n",
+ "\n",
+ "The Overall Voltage gain is 81.97 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08_1.ipynb new file mode 100755 index 00000000..8771f780 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_08_1.ipynb @@ -0,0 +1,393 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6dc14d0f3e52d6546555bedb4c03e69e0077a9e9ecdeb40a1fe337170a8ca497"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 08 - Multistage Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Express the gain in decibel\n",
+ "#given\n",
+ "#Powere gain of 1000\n",
+ "import math\n",
+ "Pg1=1000.;\n",
+ "Pgd1=10.*math.log10(Pg1);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd1,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1000\n",
+ "Vg1=1000.;\n",
+ "Vgd1=20.*math.log10(Vg1);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd1,\"dB\\n\");\n",
+ "\n",
+ "#Powere gain of 1/100\n",
+ "Pg2=1./100.;\n",
+ "Pgd2=10.*math.log10(Pg2);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd2,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1/100\n",
+ "Vg2=1./100.;\n",
+ "Vgd2=20.*math.log10(Vg2);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd2,\"dB\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain (in dB)= 30 dB\n",
+ "\n",
+ "Voltage gain (in dB)= 60 dB\n",
+ "\n",
+ "Power gain (in dB)= -20 dB\n",
+ "\n",
+ "Voltage gain (in dB)= -40 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine power and voltage gain\n",
+ "#given\n",
+ "#For Gain = 10 dB\n",
+ "G=10.;#dB\n",
+ "Pg1=10.**(G/10.); #taking antilog\n",
+ "Vg1=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.f %s' %(\"Power gain ratio =\",Pg1,\"\\n\");\n",
+ "print '%s %.2f %s' %(\"Voltage gain ratio =\",Vg1,\"\\n\");\n",
+ "\n",
+ "#For Gain 3 dB\n",
+ "G=3.;#dB\n",
+ "Pg2=10.**(G/10.); #taking antilog\n",
+ "Vg2=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.2f %s' %(\"Power gain ratio =\",Pg2,\"\\n\");\n",
+ "print '%s %.3f %s' %(\"Voltage gain ratio =\",Vg2,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Gain 10 dB\n",
+ "\n",
+ "Power gain ratio = 10 \n",
+ "\n",
+ "Voltage gain ratio = 3.16 \n",
+ "\n",
+ "For Gain 3 dB\n",
+ "\n",
+ "Power gain ratio = 2.00 \n",
+ "\n",
+ "Voltage gain ratio = 1.413 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the overall voltage gain\n",
+ "#given\n",
+ "import math\n",
+ "A1=80.\n",
+ "A2=50.\n",
+ "A3=30.\n",
+ "Ad=20.*math.log10(A1)+20.*math.log10(A2)+20.*math.log10(A3);\n",
+ "\n",
+ "#Alternatively\n",
+ "A=A1*A2*A3;\n",
+ "Ad=20.*math.log10(A);\n",
+ "print '%s %.2f %s' %(\"The Voltage gain is =\",Ad,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Voltage gain is = 101.58 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate quiescent output voltage and small signal voltage gain\n",
+ "#given\n",
+ "#At input Voltage =3V\n",
+ "Vi1=3.##V #input voltage\n",
+ "Vbe=0.7##V\n",
+ "B=250.#\n",
+ "Vcc=10.##V #Supply\n",
+ "Re1=1.*10.**3.##ohm\n",
+ "Rc1=3.*10.**3.##ohm\n",
+ "Re2=2.*10.**3.##ohm\n",
+ "Rc2=4.*10.**3.##ohm\n",
+ "Vb1=Vi1# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo1=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage(At input Voltage = 3V) is =\",Vo1,\"V\\n\")#\n",
+ "\n",
+ "#At input Voltage =3.2 V\n",
+ "Vi2=3.2##V #input voltage\n",
+ "Vb1=Vi2# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo2=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage (At input Voltage =3.2 V) is =\",Vo2,\"V\\n\")#\n",
+ "\n",
+ "#Small Signal input and output voltage\n",
+ "vi=Vi2-Vi1#\n",
+ "vo=Vo2-Vo1#\n",
+ "Av=vo/vi#\n",
+ "print '%s %.f' %(\"The small signal voltage gain is =\",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The quiescent output voltage(At input Voltage = 3V) is = 5.2 V\n",
+ "\n",
+ "The quiescent output voltage (At input Voltage =3.2 V) is = 6.4 V\n",
+ "\n",
+ "The small signal voltage gain is = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the maximum voltage gain and bandwidth of multistage amplifier\n",
+ "#FUNCTIONS\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "rin=10.*10.**6.;#ohm #input resistance of JFET\n",
+ "Rd=10.*10.**3.;#ohm\n",
+ "Rs=500.;#ohm\n",
+ "Rg=470.*10.**3.;#ohm\n",
+ "Rl=470.*10.**3.;#ohm\n",
+ "Cc=0.01*10.**-6.;#Farad\n",
+ "Csh=100.*10.**-12.;#Farad\n",
+ "Cs=50.*10.**-6.;#Farad\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Rac2=prll(Rd,Rl);\n",
+ "Rac1=prll(Rd,Rg);\n",
+ "Req=prll(rd,prll(Rd,Rl));\n",
+ "Am=math.ceil(gm*Req);\n",
+ "Am2=Am*Am; #Voltage gain of two stage amplifier\n",
+ "print '%s %.f %s' %(\"Voltage gain of two stage amplifier=\",Am2,\"\\n\");\n",
+ "R_=prll(rd,Rd)+prll(Rg,rin);\n",
+ "f1=1./(2.*math.pi*Cc*R_); #lower cutoff frequency\n",
+ "f1_=f1/(math.sqrt(math.sqrt(2.)-1.));\n",
+ "f2=1./(2.*math.pi*Csh*Req); #upper cutoff frequency\n",
+ "f2_=f2*(math.sqrt(math.sqrt(2.)-1.));\n",
+ "BW=f2_-f1_;\n",
+ "print '%s %.f %s' %(\"Bandwidth=\",BW/1000.,\"kHz\\n\");\n",
+ "#There is a slight error in f1 due to use of R'(here R_)=479 kohm and in f2 due to approaximation of Req there is a slight variation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain of two stage amplifier= 324 \n",
+ "\n",
+ "Bandwidth= 115 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the midband voltage gain and bandwidth of cascade amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Am=8.##midband voltage gain of individual MOSFET\n",
+ "BW=500.*10.**3.#Hz\n",
+ "f2=BW#\n",
+ "n=4.#\n",
+ "A2m=Am**n#\n",
+ "f2_=f2*(math.sqrt((2.**(1./n))-1.))#\n",
+ "print '%s %.f %s' %(\"Midband voltage gain =\",A2m,\"\\n\")#\n",
+ "print '%s %.1f %s' %(\"Overall Bandwidth =\",f2_/1000,\"kHz\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Midband voltage gain = 4096 \n",
+ "\n",
+ "Overall Bandwidth = 217.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the input and output impedance and voltage gain\n",
+ "#FUNCTIONS\n",
+ "\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "hie=1.1*10.**3.;#ohm=rin\n",
+ "hfe=120.;#=B\n",
+ "#the values of Rac2, Zi, Zo are as per diagram\n",
+ "Rac2=prll(3.3*10**3,2.2*10**3);\n",
+ "Rac1=prll(6.8*10**3,prll(56*10**3,prll(5.6*10**3,1.1*10**3)));\n",
+ "Zi=prll(5.6*10**3,prll(56*10**3,1.1*10**3));\n",
+ "Zo=prll(3.3*10**3,2.2*10**3);\n",
+ "print '%s %.3f %s %s %.2f %s' %(\"Input Resistance =\",Zi/1000,\"kohm\\n\",\"\\nOutput Resistance =\",Zo/1000,\"kohm\");\n",
+ "Am2=-hfe*Rac2/(hie);\n",
+ "Am1=-hfe*Rac1/(hie);\n",
+ "Am=Am1*Am2;\n",
+ "Am=20.*math.log10(Am);\n",
+ "print '%s %.2f %s' %(\"\\nThe Overall Voltage gain is\",Am,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input Resistance = 0.905 kohm\n",
+ " \n",
+ "Output Resistance = 1.32 kohm\n",
+ "\n",
+ "The Overall Voltage gain is 81.97 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09.ipynb new file mode 100755 index 00000000..5ab169a5 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09.ipynb @@ -0,0 +1,277 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6837e0c595278402d51f86daeb96971ef73b1c2af8634ab23c1555337d40807f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 09 - Power Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the turns ratio of the transformer\n",
+ "#given\n",
+ "import math\n",
+ "Rl=8.;#ohm\n",
+ "Rl_=5.*10.**3.;#ohm\n",
+ "TR=math.sqrt(Rl_/Rl); #Turns ratio\n",
+ "print '%s %.f %s' %(\"Turns Ratio =\",TR,\": 1\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Turns Ratio = 25 : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the output impedance of the transistor\n",
+ "#given\n",
+ "TR=16./1.; #turn ratio\n",
+ "Rl=4.;#ohm #loudspeaker impedance\n",
+ "ro=(TR**2.)*Rl;\n",
+ "print '%s %.f %s' %(\"The output impedance of the transistor =\",ro,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output impedance of the transistor = 1024 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Determine the efficiency of a single ended transformer\n",
+ "#given\n",
+ "Vceq=10.;#V #supply voltage\n",
+ "\n",
+ "#At Vp=10V\n",
+ "Vp=10.;#V\n",
+ "Vce_max1=Vceq+Vp;\n",
+ "Vce_min1=Vceq-Vp;\n",
+ "n1=50.*((Vce_max1-Vce_min1)/(Vce_max1+Vce_min1))**2.;\n",
+ "print '%s %.f %s' %(\"Efficiency (At Vp = 10V)=\",n1,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=5V\n",
+ "Vp=5.;#V\n",
+ "Vce_max2=Vceq+Vp;\n",
+ "Vce_min2=Vceq-Vp;\n",
+ "n2=50.*((Vce_max2-Vce_min2)/(Vce_max2+Vce_min2))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 5V)=\",n2,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=1V\n",
+ "Vp=1.;#V\n",
+ "Vce_max3=Vceq+Vp;\n",
+ "Vce_min3=Vceq-Vp;\n",
+ "n3=50.*((Vce_max3-Vce_min3)/(Vce_max3+Vce_min3))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 1V)=\",n3,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency (At Vp = 10V)= 50 percent\n",
+ "\n",
+ "Efficiency (At Vp = 5V)= 12.5 percent\n",
+ "\n",
+ "Efficiency (At Vp = 1V)= 0.5 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine input and output power and efficiency\n",
+ "#given\n",
+ "import math\n",
+ "Vcc=20.;#V#supply voltage\n",
+ "Rl=4.;#ohm\n",
+ "Vp=15.;#V\n",
+ "Ip=Vp/Rl;\n",
+ "Idc=Ip/math.pi;\n",
+ "Pi=Vcc*Idc;\n",
+ "Po=((Vp/2.)**2.)/Rl;\n",
+ "n=100.*Po/Pi;\n",
+ "print '%s %.1f %s' %(\"Input power =\",Pi,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Output power =\",Po,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 23.9 W\n",
+ "\n",
+ "Output power = 14.06 W\n",
+ "\n",
+ "Efficiency = 58.90 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage increase in output power\n",
+ "#given\n",
+ "D=0.2;#harmonic distortion\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power=\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage increase in output power= 4 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n",
+ "\n",
+ "The percentage increase in output power = 1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09_1.ipynb new file mode 100755 index 00000000..5ab169a5 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_09_1.ipynb @@ -0,0 +1,277 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6837e0c595278402d51f86daeb96971ef73b1c2af8634ab23c1555337d40807f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 09 - Power Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the turns ratio of the transformer\n",
+ "#given\n",
+ "import math\n",
+ "Rl=8.;#ohm\n",
+ "Rl_=5.*10.**3.;#ohm\n",
+ "TR=math.sqrt(Rl_/Rl); #Turns ratio\n",
+ "print '%s %.f %s' %(\"Turns Ratio =\",TR,\": 1\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Turns Ratio = 25 : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the output impedance of the transistor\n",
+ "#given\n",
+ "TR=16./1.; #turn ratio\n",
+ "Rl=4.;#ohm #loudspeaker impedance\n",
+ "ro=(TR**2.)*Rl;\n",
+ "print '%s %.f %s' %(\"The output impedance of the transistor =\",ro,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output impedance of the transistor = 1024 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Determine the efficiency of a single ended transformer\n",
+ "#given\n",
+ "Vceq=10.;#V #supply voltage\n",
+ "\n",
+ "#At Vp=10V\n",
+ "Vp=10.;#V\n",
+ "Vce_max1=Vceq+Vp;\n",
+ "Vce_min1=Vceq-Vp;\n",
+ "n1=50.*((Vce_max1-Vce_min1)/(Vce_max1+Vce_min1))**2.;\n",
+ "print '%s %.f %s' %(\"Efficiency (At Vp = 10V)=\",n1,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=5V\n",
+ "Vp=5.;#V\n",
+ "Vce_max2=Vceq+Vp;\n",
+ "Vce_min2=Vceq-Vp;\n",
+ "n2=50.*((Vce_max2-Vce_min2)/(Vce_max2+Vce_min2))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 5V)=\",n2,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=1V\n",
+ "Vp=1.;#V\n",
+ "Vce_max3=Vceq+Vp;\n",
+ "Vce_min3=Vceq-Vp;\n",
+ "n3=50.*((Vce_max3-Vce_min3)/(Vce_max3+Vce_min3))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 1V)=\",n3,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency (At Vp = 10V)= 50 percent\n",
+ "\n",
+ "Efficiency (At Vp = 5V)= 12.5 percent\n",
+ "\n",
+ "Efficiency (At Vp = 1V)= 0.5 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine input and output power and efficiency\n",
+ "#given\n",
+ "import math\n",
+ "Vcc=20.;#V#supply voltage\n",
+ "Rl=4.;#ohm\n",
+ "Vp=15.;#V\n",
+ "Ip=Vp/Rl;\n",
+ "Idc=Ip/math.pi;\n",
+ "Pi=Vcc*Idc;\n",
+ "Po=((Vp/2.)**2.)/Rl;\n",
+ "n=100.*Po/Pi;\n",
+ "print '%s %.1f %s' %(\"Input power =\",Pi,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Output power =\",Po,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 23.9 W\n",
+ "\n",
+ "Output power = 14.06 W\n",
+ "\n",
+ "Efficiency = 58.90 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage increase in output power\n",
+ "#given\n",
+ "D=0.2;#harmonic distortion\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power=\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage increase in output power= 4 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n",
+ "\n",
+ "The percentage increase in output power = 1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10.ipynb new file mode 100755 index 00000000..7db9ea32 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10.ipynb @@ -0,0 +1,379 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1f2e4043038005e29398e6a31d23669297bf42551e1af00fba80d3d1e6cbef7d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 - Feedback in Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier\n",
+ "#given\n",
+ "A=100.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 9.09 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=60.;#dB #internal gain in dB\n",
+ "A=10.**(Ad/20.); #internal gain\n",
+ "B=1./20.;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "Afd=20.*math.log10(Af);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Afd,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 25.85 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of output fed back to input\n",
+ "#given\n",
+ "A=600.;#internal gain\n",
+ "Af=50.;#gain of feedback amplifier\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.3f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of output fed back to input = 1.833 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the internal gain and percentage of output fed back to input\n",
+ "#given\n",
+ "Af=80.;#gain of feedback amplifier\n",
+ "Vi=0.05;#V#input with feedback\n",
+ "Vi_=4.*10.**-3.;#V#input without feedback\n",
+ "Vo_=Af*Vi;\n",
+ "A=Vo_/Vi_;\n",
+ "print '%s %.f %s' %(\"The internal gain is =\",A,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.2f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal gain is = 1000 \n",
+ "\n",
+ "The percentage of output fed back to input = 1.15 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain with and without feedback and feedback factor\n",
+ "#given\n",
+ "Vo_=5.;#V #output voltage\n",
+ "Vi=0.2;#V #input with feedback\n",
+ "Vi_=0.05;#V #input without feedback\n",
+ "A=Vo_/Vi_;\n",
+ "Af=Vo_/Vi;\n",
+ "print '%s %.f %s' %(\"The gain without feedback is =\",A,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The gain with feedback is =\",Af,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain without feedback is = 100 \n",
+ "\n",
+ "The gain with feedback is = 25 \n",
+ "\n",
+ "The feedback factor = 3 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain of feedback amplifier and feedback factor\n",
+ "#given\n",
+ "A=100.; #internal gain\n",
+ "N=20.;#dB #negative feedback\n",
+ "B=(10.**(-N/(-20.))-1.)/A; #taking antilog\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n",
+ "print '%s %.f %s' %(\"The gain of the feedback amplifier is =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The feedback factor = 9 percent\n",
+ "\n",
+ "The gain of the feedback amplifier is = 10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "A=1000.;#internal gain\n",
+ "N=40.;#dB#negative feedback\n",
+ "D=10.**((-N)/-20.);#D=(1+AB)desensitivity\n",
+ "dA_A=10.;#percent#dA/A\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.1f %s' %(\"The percentage change in the overall gain =\",dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain = 0.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "Adb=60.;#dB#internal gain in dB\n",
+ "B=0.005;#feedback factor\n",
+ "A=10.**(Adb/(20.));#taking antilog\n",
+ "dA_A=-12.;#percent #dA/A\n",
+ "D=(1.+A*B);#D=(1+AB)desensitivity\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.f %s' %(\"The percentage change in the overall gain reduces by =\",-dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain reduces by = 2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the input resistance of feedback amplifier\n",
+ "#given\n",
+ "A=250.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Ri=1.1*10.**3.;#ohm #input resistance\n",
+ "Rif=Ri*(1.+A*B);\n",
+ "print '%s %.1f %s' %(\"The input resistance of feedback amplifier =\",Rif/1000,\"kohm\");\n",
+ "\n",
+ "#The ans in book is incorrect due to use of (2+A*B) instead of (1+A*B) the ans in book is 29.7 kohm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input resistance of feedback amplifier = 28.6 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of negative feedback to input\n",
+ "#given\n",
+ "Adb=60.;#dB #internal gain in dB\n",
+ "A=10.**(Adb/(20.)); #taking antilog\n",
+ "Ro=12.*10.**3.;#ohm #output resistance\n",
+ "Rof=600.;#ohm\n",
+ "B=(Ro/Rof-1.)/A;\n",
+ "print '%s %.1f %s' %(\"The percentage of negative feedback to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of negative feedback to input = 1.9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10_1.ipynb new file mode 100755 index 00000000..7db9ea32 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_10_1.ipynb @@ -0,0 +1,379 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1f2e4043038005e29398e6a31d23669297bf42551e1af00fba80d3d1e6cbef7d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 - Feedback in Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier\n",
+ "#given\n",
+ "A=100.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 9.09 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=60.;#dB #internal gain in dB\n",
+ "A=10.**(Ad/20.); #internal gain\n",
+ "B=1./20.;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "Afd=20.*math.log10(Af);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Afd,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 25.85 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of output fed back to input\n",
+ "#given\n",
+ "A=600.;#internal gain\n",
+ "Af=50.;#gain of feedback amplifier\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.3f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of output fed back to input = 1.833 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the internal gain and percentage of output fed back to input\n",
+ "#given\n",
+ "Af=80.;#gain of feedback amplifier\n",
+ "Vi=0.05;#V#input with feedback\n",
+ "Vi_=4.*10.**-3.;#V#input without feedback\n",
+ "Vo_=Af*Vi;\n",
+ "A=Vo_/Vi_;\n",
+ "print '%s %.f %s' %(\"The internal gain is =\",A,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.2f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal gain is = 1000 \n",
+ "\n",
+ "The percentage of output fed back to input = 1.15 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain with and without feedback and feedback factor\n",
+ "#given\n",
+ "Vo_=5.;#V #output voltage\n",
+ "Vi=0.2;#V #input with feedback\n",
+ "Vi_=0.05;#V #input without feedback\n",
+ "A=Vo_/Vi_;\n",
+ "Af=Vo_/Vi;\n",
+ "print '%s %.f %s' %(\"The gain without feedback is =\",A,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The gain with feedback is =\",Af,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain without feedback is = 100 \n",
+ "\n",
+ "The gain with feedback is = 25 \n",
+ "\n",
+ "The feedback factor = 3 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain of feedback amplifier and feedback factor\n",
+ "#given\n",
+ "A=100.; #internal gain\n",
+ "N=20.;#dB #negative feedback\n",
+ "B=(10.**(-N/(-20.))-1.)/A; #taking antilog\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n",
+ "print '%s %.f %s' %(\"The gain of the feedback amplifier is =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The feedback factor = 9 percent\n",
+ "\n",
+ "The gain of the feedback amplifier is = 10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "A=1000.;#internal gain\n",
+ "N=40.;#dB#negative feedback\n",
+ "D=10.**((-N)/-20.);#D=(1+AB)desensitivity\n",
+ "dA_A=10.;#percent#dA/A\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.1f %s' %(\"The percentage change in the overall gain =\",dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain = 0.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "Adb=60.;#dB#internal gain in dB\n",
+ "B=0.005;#feedback factor\n",
+ "A=10.**(Adb/(20.));#taking antilog\n",
+ "dA_A=-12.;#percent #dA/A\n",
+ "D=(1.+A*B);#D=(1+AB)desensitivity\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.f %s' %(\"The percentage change in the overall gain reduces by =\",-dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain reduces by = 2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the input resistance of feedback amplifier\n",
+ "#given\n",
+ "A=250.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Ri=1.1*10.**3.;#ohm #input resistance\n",
+ "Rif=Ri*(1.+A*B);\n",
+ "print '%s %.1f %s' %(\"The input resistance of feedback amplifier =\",Rif/1000,\"kohm\");\n",
+ "\n",
+ "#The ans in book is incorrect due to use of (2+A*B) instead of (1+A*B) the ans in book is 29.7 kohm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input resistance of feedback amplifier = 28.6 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of negative feedback to input\n",
+ "#given\n",
+ "Adb=60.;#dB #internal gain in dB\n",
+ "A=10.**(Adb/(20.)); #taking antilog\n",
+ "Ro=12.*10.**3.;#ohm #output resistance\n",
+ "Rof=600.;#ohm\n",
+ "B=(Ro/Rof-1.)/A;\n",
+ "print '%s %.1f %s' %(\"The percentage of negative feedback to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of negative feedback to input = 1.9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11.ipynb new file mode 100755 index 00000000..206b57f3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11.ipynb @@ -0,0 +1,186 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9f145e3575abf583b905671dc9c265339855396c0056b7d05cbca68c581ff19b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 - Tuned Volatge AMplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current and voltage across each element at resonance\n",
+ "#given\n",
+ "import math\n",
+ "R=12.;#ohm\n",
+ "L=200.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "Vs=9.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Z=R;#impedance\n",
+ "print '%s %.1f %s' %(\"The Resonant frequency =\",fo/1000,\"kHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Z,\"ohm\\n\");\n",
+ "\n",
+ "Io=Vs/R;\n",
+ "print '%s %.2f %s' %(\"The Source current =\",Io,\"A\\n\");\n",
+ "\n",
+ "Vl=Io*(2.*math.pi*fo*L);\n",
+ "Vc=Io/(2.*math.pi*fo*C);\n",
+ "Vr=Io*R;\n",
+ "print '%s %.1f %s' %(\"The voltage across the inductor =\",Vl,\"V\\n\");\n",
+ "print '%s %.1f %s' %(\"The voltage across the capacitor =\",Vc,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The voltage across the resistor =\",Vr,\"V\\n\");\n",
+ "#There is a slight variation in voltage across capacitor due to the approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 649.7 kHz\n",
+ "\n",
+ "The impedance Z = 12 ohm\n",
+ "\n",
+ "The Source current = 0.75 A\n",
+ "\n",
+ "The voltage across the inductor = 612.4 V\n",
+ "\n",
+ "The voltage across the capacitor = 612.4 V\n",
+ "\n",
+ "The voltage across the resistor = 9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current at resonance and current in coil and capacitor\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=100.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "Vs=10.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.3f %s' %(\"The Resonant frequency =\",fo/10**6,\"MHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Io=Vs/Zp;\n",
+ "print '%s %.f %s' %(\"The Source current =\",Io*10**6,\"uA\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Xc=1./(2.*math.pi*fo*C);\n",
+ "Z1=math.sqrt(Xl**2.+R**2.);\n",
+ "Z2=Xc;\n",
+ "Ic=Vs/Z2;\n",
+ "Il=Ic;\n",
+ "print '%s %.f %s' %(\"The current in the coil =\",1000,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"The current in the capacitor =\",Ic*1000,\"mA\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 1.592 MHz\n",
+ "\n",
+ "The impedance Z = 100 kohm\n",
+ "\n",
+ "The Source current = 100 uA\n",
+ "\n",
+ "The current in the coil = 1000 ohm\n",
+ "\n",
+ "The current in the capacitor = 10 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate impedance and quality factor and bandwidth\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=150.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1/(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Q=Xl/R;\n",
+ "BW=fo/Q;\n",
+ "print '%s %.1f %s' %(\"The Quality factor of the circuit =\",Q,\"\\n\");\n",
+ "print '%s %.1f %s' %(\"The Band width of the circuit =\",BW/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impedance Z = 150 kohm\n",
+ "\n",
+ "The Quality factor of the circuit = 122.5 \n",
+ "\n",
+ "The Band width of the circuit = 10.6 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11_1.ipynb new file mode 100755 index 00000000..206b57f3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_11_1.ipynb @@ -0,0 +1,186 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9f145e3575abf583b905671dc9c265339855396c0056b7d05cbca68c581ff19b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11 - Tuned Volatge AMplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current and voltage across each element at resonance\n",
+ "#given\n",
+ "import math\n",
+ "R=12.;#ohm\n",
+ "L=200.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "Vs=9.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Z=R;#impedance\n",
+ "print '%s %.1f %s' %(\"The Resonant frequency =\",fo/1000,\"kHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Z,\"ohm\\n\");\n",
+ "\n",
+ "Io=Vs/R;\n",
+ "print '%s %.2f %s' %(\"The Source current =\",Io,\"A\\n\");\n",
+ "\n",
+ "Vl=Io*(2.*math.pi*fo*L);\n",
+ "Vc=Io/(2.*math.pi*fo*C);\n",
+ "Vr=Io*R;\n",
+ "print '%s %.1f %s' %(\"The voltage across the inductor =\",Vl,\"V\\n\");\n",
+ "print '%s %.1f %s' %(\"The voltage across the capacitor =\",Vc,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The voltage across the resistor =\",Vr,\"V\\n\");\n",
+ "#There is a slight variation in voltage across capacitor due to the approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 649.7 kHz\n",
+ "\n",
+ "The impedance Z = 12 ohm\n",
+ "\n",
+ "The Source current = 0.75 A\n",
+ "\n",
+ "The voltage across the inductor = 612.4 V\n",
+ "\n",
+ "The voltage across the capacitor = 612.4 V\n",
+ "\n",
+ "The voltage across the resistor = 9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current at resonance and current in coil and capacitor\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=100.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "Vs=10.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.3f %s' %(\"The Resonant frequency =\",fo/10**6,\"MHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Io=Vs/Zp;\n",
+ "print '%s %.f %s' %(\"The Source current =\",Io*10**6,\"uA\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Xc=1./(2.*math.pi*fo*C);\n",
+ "Z1=math.sqrt(Xl**2.+R**2.);\n",
+ "Z2=Xc;\n",
+ "Ic=Vs/Z2;\n",
+ "Il=Ic;\n",
+ "print '%s %.f %s' %(\"The current in the coil =\",1000,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"The current in the capacitor =\",Ic*1000,\"mA\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 1.592 MHz\n",
+ "\n",
+ "The impedance Z = 100 kohm\n",
+ "\n",
+ "The Source current = 100 uA\n",
+ "\n",
+ "The current in the coil = 1000 ohm\n",
+ "\n",
+ "The current in the capacitor = 10 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate impedance and quality factor and bandwidth\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=150.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1/(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Q=Xl/R;\n",
+ "BW=fo/Q;\n",
+ "print '%s %.1f %s' %(\"The Quality factor of the circuit =\",Q,\"\\n\");\n",
+ "print '%s %.1f %s' %(\"The Band width of the circuit =\",BW/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impedance Z = 150 kohm\n",
+ "\n",
+ "The Quality factor of the circuit = 122.5 \n",
+ "\n",
+ "The Band width of the circuit = 10.6 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12.ipynb new file mode 100755 index 00000000..c079ebc3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12.ipynb @@ -0,0 +1,214 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:37c2b25ec56000b266acadb14fe6e60b4724f33d464388671c9f9fac03fcf98c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 - Sinusoidal Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "L=55.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.f %s' %(\"The frequency of oscillations =\",fo/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1239 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations and feedback factor and voltage gain\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "C1=0.001*10.**-6.;#F\n",
+ "C2=0.01*10.**-6.;#F\n",
+ "L=15.*10.**-6.;#H\n",
+ "C=prll(C1,C2);\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/10**6,\"MHz\\n\");\n",
+ "B=C1/C2;\n",
+ "Amin=1./B;\n",
+ "print '%s %.1f %s' %(\"The feedback factor of the circuit =\",B,\"\\n\");\n",
+ "print '%s %.f' %(\"The circuit needs a minimum voltage gain of\",Amin);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1.36 MHz\n",
+ "\n",
+ "The feedback factor of the circuit = 0.1 \n",
+ "\n",
+ "The circuit needs a minimum voltage gain of 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=10.*10.**3.;#ohm\n",
+ "C=0.01*10.**-6.;#F\n",
+ "fo=1./(2.*math.pi*R*C*math.sqrt(6.));\n",
+ "print '%s %.1f %s' %(\"The frequency of oscillations =\",fo,\"Hz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 649.7 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=22.*10.**3.;#ohm\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*R*C);\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/1000,\"KHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 72.34 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12_1.ipynb new file mode 100755 index 00000000..c079ebc3 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_12_1.ipynb @@ -0,0 +1,214 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:37c2b25ec56000b266acadb14fe6e60b4724f33d464388671c9f9fac03fcf98c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 - Sinusoidal Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "L=55.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.f %s' %(\"The frequency of oscillations =\",fo/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1239 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations and feedback factor and voltage gain\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "C1=0.001*10.**-6.;#F\n",
+ "C2=0.01*10.**-6.;#F\n",
+ "L=15.*10.**-6.;#H\n",
+ "C=prll(C1,C2);\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/10**6,\"MHz\\n\");\n",
+ "B=C1/C2;\n",
+ "Amin=1./B;\n",
+ "print '%s %.1f %s' %(\"The feedback factor of the circuit =\",B,\"\\n\");\n",
+ "print '%s %.f' %(\"The circuit needs a minimum voltage gain of\",Amin);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1.36 MHz\n",
+ "\n",
+ "The feedback factor of the circuit = 0.1 \n",
+ "\n",
+ "The circuit needs a minimum voltage gain of 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=10.*10.**3.;#ohm\n",
+ "C=0.01*10.**-6.;#F\n",
+ "fo=1./(2.*math.pi*R*C*math.sqrt(6.));\n",
+ "print '%s %.1f %s' %(\"The frequency of oscillations =\",fo,\"Hz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 649.7 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=22.*10.**3.;#ohm\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*R*C);\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/1000,\"KHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 72.34 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14.ipynb new file mode 100755 index 00000000..25528876 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14.ipynb @@ -0,0 +1,211 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b4488c471131cb2740294216bf346ae5af2217796203e0f650c4ac980ef092c1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 - Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "Acl=-Rf/R1;\n",
+ "Ricl=R1;\n",
+ "Ro=0;\n",
+ "print '%s %.f %s' %(\"The voltage gain =\",Acl,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The input resistance =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"The output resistance =\",Ro,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -100 \n",
+ "\n",
+ "The input resistance = 20 kohm\n",
+ "\n",
+ "The output resistance = 0 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output voltage\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "v1=4.;#V\n",
+ "v2=3.8;#V\n",
+ "vo=v2*(1.+Rf/R1)-(Rf/R1)*v1;\n",
+ "print '%s %.1f %s' %(\"The output voltage =\",vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -16.2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design an adder circuit using an op amp\n",
+ "#given\n",
+ "#Vo=-(V1+10*V2+100*V3)\n",
+ "Rf=100.*10.**3.;#ohm\n",
+ "C1=1.;#coefficient of V1\n",
+ "C2=10.;#coefficient of V2\n",
+ "C3=100.;#coefficient of V3\n",
+ "R1=Rf/C1;\n",
+ "R2=Rf/C2;\n",
+ "R3=Rf/C3;\n",
+ "print '%s %.f %s' %(\"R1 =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R2 =\",R2/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R3 =\",R3/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 kohm\n",
+ "\n",
+ "R2 = 10 kohm\n",
+ "\n",
+ "R3 = 1 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate CMRR in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=100.;#differential mode gain\n",
+ "Ac=0.01;#common mode gain\n",
+ "CMRR=20.*math.log10(Ad/Ac);\n",
+ "print '%s %.f %s' %(\"The CMRR in dB =\",CMRR,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The CMRR in dB = 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the output voltage\n",
+ "#given\n",
+ "Ad=2000.;#differential mode gain\n",
+ "CMRR=10000.;\n",
+ "V1=10.**-3.;#V\n",
+ "V2=0.9*10.**-3.;#V\n",
+ "Vd=V1-V2;\n",
+ "Vc=(V1+V2)/2.;\n",
+ "Vo=Ad*Vd*(1.+Vc/(CMRR*Vd));\n",
+ "print '%s %.2f %s' %(\"The output voltage is =\",Vo*1000,\"mV\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 200.19 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14_1.ipynb new file mode 100755 index 00000000..25528876 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_14_1.ipynb @@ -0,0 +1,211 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b4488c471131cb2740294216bf346ae5af2217796203e0f650c4ac980ef092c1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 14 - Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "Acl=-Rf/R1;\n",
+ "Ricl=R1;\n",
+ "Ro=0;\n",
+ "print '%s %.f %s' %(\"The voltage gain =\",Acl,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The input resistance =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"The output resistance =\",Ro,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -100 \n",
+ "\n",
+ "The input resistance = 20 kohm\n",
+ "\n",
+ "The output resistance = 0 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output voltage\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "v1=4.;#V\n",
+ "v2=3.8;#V\n",
+ "vo=v2*(1.+Rf/R1)-(Rf/R1)*v1;\n",
+ "print '%s %.1f %s' %(\"The output voltage =\",vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -16.2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design an adder circuit using an op amp\n",
+ "#given\n",
+ "#Vo=-(V1+10*V2+100*V3)\n",
+ "Rf=100.*10.**3.;#ohm\n",
+ "C1=1.;#coefficient of V1\n",
+ "C2=10.;#coefficient of V2\n",
+ "C3=100.;#coefficient of V3\n",
+ "R1=Rf/C1;\n",
+ "R2=Rf/C2;\n",
+ "R3=Rf/C3;\n",
+ "print '%s %.f %s' %(\"R1 =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R2 =\",R2/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R3 =\",R3/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 kohm\n",
+ "\n",
+ "R2 = 10 kohm\n",
+ "\n",
+ "R3 = 1 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate CMRR in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=100.;#differential mode gain\n",
+ "Ac=0.01;#common mode gain\n",
+ "CMRR=20.*math.log10(Ad/Ac);\n",
+ "print '%s %.f %s' %(\"The CMRR in dB =\",CMRR,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The CMRR in dB = 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the output voltage\n",
+ "#given\n",
+ "Ad=2000.;#differential mode gain\n",
+ "CMRR=10000.;\n",
+ "V1=10.**-3.;#V\n",
+ "V2=0.9*10.**-3.;#V\n",
+ "Vd=V1-V2;\n",
+ "Vc=(V1+V2)/2.;\n",
+ "Vo=Ad*Vd*(1.+Vc/(CMRR*Vd));\n",
+ "print '%s %.2f %s' %(\"The output voltage is =\",Vo*1000,\"mV\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 200.19 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15.ipynb new file mode 100755 index 00000000..b1eefe60 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15.ipynb @@ -0,0 +1,321 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:67e3656843a7080f843112749639096f02a0ede27ef825412c11d2b5c764c0b2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 - Electronic Instruments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance and multiplying factor\n",
+ "#given\n",
+ "Im=5.*10.**-3.;#A\n",
+ "Rm=20.;#ohm\n",
+ "I=5.;#A\n",
+ "Rsh=Rm*Im/(I-Im);\n",
+ "n=I/Im;\n",
+ "print '%s %.5f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"Multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 0.02002 ohm\n",
+ "\n",
+ "Multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance\n",
+ "#given\n",
+ "#At I= 1 mA\n",
+ "I1=1.*10.**-3.;#A\n",
+ "Im=0.1*10.**-3.;#A\n",
+ "Rm=500.;#ohm\n",
+ "Rsh=Rm*Im/(I1-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I2=10.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I2-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I3=100.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I3-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 55.5556 ohm\n",
+ "\n",
+ "Shunt resistance = 5.0505 ohm\n",
+ "\n",
+ "Shunt resistance = 0.5005 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 514"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caluclate the series resistance to convert it into voltmeter\n",
+ "#given\n",
+ "Im=100.*10.**-6.;#A\n",
+ "Rm=100.;#ohm\n",
+ "V=100.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.1f %s' %(\"The value of series resistance is\",Rs/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of series resistance is 999.9 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate multiplier resistance and voltage multiplying factor\n",
+ "#given\n",
+ "Im=50.*10.**-6.;#A\n",
+ "Rm=1000.;#ohm\n",
+ "V=50.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.f %s' %(\"The value of multiplier resistance is\",Rs/1000,\"kohm\\n\");\n",
+ "Vm=Im*Rm;\n",
+ "n=V/Vm;\n",
+ "print '%s %.f %s' %(\"Voltage multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of multiplier resistance is 999 kohm\n",
+ "\n",
+ "Voltage multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate reading and error of each voltmeter\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "S_A=1000.;# ohm/V#sensitivity\n",
+ "S_B=20000.;# ohm/V#sensitivity\n",
+ "R=50.;#V#range of voltmeter\n",
+ "Vs=150.;#V#Supply\n",
+ "R1=100.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Vt=Vs*(R2/(R1+R2));\n",
+ "\n",
+ "#Voltmeter A\n",
+ "Ri1=S_A*R;\n",
+ "Rxy_A=prll(Ri1,R2); #total resistance at X and Y\n",
+ "V1=Vs*(Rxy_A/(Rxy_A+R1));\n",
+ "print '%s %.f %s' %(\"The voltmeter indicates\",V1,\"V\\n\");\n",
+ "\n",
+ "#Voltmeter B\n",
+ "Ri2=S_B*R;\n",
+ "Rxy_B=prll(Ri2,R2); #total resistance at X and Y\n",
+ "V2=Vs*(Rxy_B/(Rxy_B+R1));\n",
+ "print '%s %.2f %s' %(\"The voltmeter indicates\",V2,\"V\\n\");\n",
+ "\n",
+ "e1=(Vt-V1)*100./Vt;\n",
+ "e2=(Vt-V2)*100./Vt;\n",
+ "print '%s %.f %s' %(\"The error in the reading of voltmeter A =\",e1,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"The error in the reading of voltmeter A =\",e2,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltmeter indicates 30 V\n",
+ "\n",
+ "The voltmeter indicates 48.39 V\n",
+ "\n",
+ "The error in the reading of voltmeter A = 40 percent\n",
+ "\n",
+ "The error in the reading of voltmeter A = 3.23 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value of the ac voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=8.3;#cm#length of the trace\n",
+ "D=5.;# V/cm#deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/(2.*math.sqrt(2.));\n",
+ "print '%s %.1f %s' %(\"The rms value of the ac voltage\",Vrms,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the ac voltage 14.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value and frequency of the sine voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=3.5;#cm #length of the trace\n",
+ "D=2.;# V/cm #deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/math.sqrt(2.);\n",
+ "print '%s %.2f %s' %(\"The rms value of the sine voltage =\",Vrms,\"V\\n\");\n",
+ "x=4.;#cm #one cycle length on x axis\n",
+ "t=0.5*10.**-3.;# s/cm #timebase setting\n",
+ "T=x*t;\n",
+ "f=1./T;\n",
+ "print '%s %.1f %s' %(\"The frequency of the sine voltage =\",f/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the sine voltage = 4.95 V\n",
+ "\n",
+ "The frequency of the sine voltage = 0.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15_1.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15_1.ipynb new file mode 100755 index 00000000..b1eefe60 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter_15_1.ipynb @@ -0,0 +1,321 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:67e3656843a7080f843112749639096f02a0ede27ef825412c11d2b5c764c0b2"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 15 - Electronic Instruments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance and multiplying factor\n",
+ "#given\n",
+ "Im=5.*10.**-3.;#A\n",
+ "Rm=20.;#ohm\n",
+ "I=5.;#A\n",
+ "Rsh=Rm*Im/(I-Im);\n",
+ "n=I/Im;\n",
+ "print '%s %.5f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"Multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 0.02002 ohm\n",
+ "\n",
+ "Multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance\n",
+ "#given\n",
+ "#At I= 1 mA\n",
+ "I1=1.*10.**-3.;#A\n",
+ "Im=0.1*10.**-3.;#A\n",
+ "Rm=500.;#ohm\n",
+ "Rsh=Rm*Im/(I1-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I2=10.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I2-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I3=100.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I3-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 55.5556 ohm\n",
+ "\n",
+ "Shunt resistance = 5.0505 ohm\n",
+ "\n",
+ "Shunt resistance = 0.5005 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 514"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caluclate the series resistance to convert it into voltmeter\n",
+ "#given\n",
+ "Im=100.*10.**-6.;#A\n",
+ "Rm=100.;#ohm\n",
+ "V=100.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.1f %s' %(\"The value of series resistance is\",Rs/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of series resistance is 999.9 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate multiplier resistance and voltage multiplying factor\n",
+ "#given\n",
+ "Im=50.*10.**-6.;#A\n",
+ "Rm=1000.;#ohm\n",
+ "V=50.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.f %s' %(\"The value of multiplier resistance is\",Rs/1000,\"kohm\\n\");\n",
+ "Vm=Im*Rm;\n",
+ "n=V/Vm;\n",
+ "print '%s %.f %s' %(\"Voltage multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of multiplier resistance is 999 kohm\n",
+ "\n",
+ "Voltage multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate reading and error of each voltmeter\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "S_A=1000.;# ohm/V#sensitivity\n",
+ "S_B=20000.;# ohm/V#sensitivity\n",
+ "R=50.;#V#range of voltmeter\n",
+ "Vs=150.;#V#Supply\n",
+ "R1=100.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Vt=Vs*(R2/(R1+R2));\n",
+ "\n",
+ "#Voltmeter A\n",
+ "Ri1=S_A*R;\n",
+ "Rxy_A=prll(Ri1,R2); #total resistance at X and Y\n",
+ "V1=Vs*(Rxy_A/(Rxy_A+R1));\n",
+ "print '%s %.f %s' %(\"The voltmeter indicates\",V1,\"V\\n\");\n",
+ "\n",
+ "#Voltmeter B\n",
+ "Ri2=S_B*R;\n",
+ "Rxy_B=prll(Ri2,R2); #total resistance at X and Y\n",
+ "V2=Vs*(Rxy_B/(Rxy_B+R1));\n",
+ "print '%s %.2f %s' %(\"The voltmeter indicates\",V2,\"V\\n\");\n",
+ "\n",
+ "e1=(Vt-V1)*100./Vt;\n",
+ "e2=(Vt-V2)*100./Vt;\n",
+ "print '%s %.f %s' %(\"The error in the reading of voltmeter A =\",e1,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"The error in the reading of voltmeter A =\",e2,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltmeter indicates 30 V\n",
+ "\n",
+ "The voltmeter indicates 48.39 V\n",
+ "\n",
+ "The error in the reading of voltmeter A = 40 percent\n",
+ "\n",
+ "The error in the reading of voltmeter A = 3.23 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value of the ac voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=8.3;#cm#length of the trace\n",
+ "D=5.;# V/cm#deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/(2.*math.sqrt(2.));\n",
+ "print '%s %.1f %s' %(\"The rms value of the ac voltage\",Vrms,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the ac voltage 14.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value and frequency of the sine voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=3.5;#cm #length of the trace\n",
+ "D=2.;# V/cm #deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/math.sqrt(2.);\n",
+ "print '%s %.2f %s' %(\"The rms value of the sine voltage =\",Vrms,\"V\\n\");\n",
+ "x=4.;#cm #one cycle length on x axis\n",
+ "t=0.5*10.**-3.;# s/cm #timebase setting\n",
+ "T=x*t;\n",
+ "f=1./T;\n",
+ "print '%s %.1f %s' %(\"The frequency of the sine voltage =\",f/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the sine voltage = 4.95 V\n",
+ "\n",
+ "The frequency of the sine voltage = 0.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter01.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter01.ipynb new file mode 100755 index 00000000..770288b1 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter01.ipynb @@ -0,0 +1,243 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c4a6fc97804f83d8aaf3c5e868daac688906bc270dd8b654ea3123010aa41bfa"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter01:Introduction to Electronics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#pg 8\n",
+ "#Find the range of tolerance\n",
+ "#soltion\n",
+ "#given\n",
+ "#color coding\n",
+ "orange=3.#\n",
+ "gold=5.#\n",
+ "yellow=4.#\n",
+ "violet=7.#\n",
+ "#band pattern\n",
+ "band1=yellow#\n",
+ "band2=violet#\n",
+ "band3=orange#\n",
+ "band4=gold#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The range of resistance =',llr/1000. ,'kOhm','to',ulr/1000,'kOhm'\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The range of resistance = 44.65 kOhm to 49.35 kOhm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the range of tolerance\n",
+ "#color coding\n",
+ "blue=6.#\n",
+ "gold=-1.#\n",
+ "gray=8.#\n",
+ "silver=10.#\n",
+ "#band pattern\n",
+ "band1=gray#\n",
+ "band2=blue#\n",
+ "band3=gold#\n",
+ "band4=silver#\n",
+ "#resistor color coding\n",
+ "r=(band1*10.+band2)*10.**(band3)#\n",
+ "tol=r*(band4/100.)#tolerance\n",
+ "ulr=r+tol##upper limit of resistance\n",
+ "llr=r-tol##lower limit of resistance\n",
+ "print 'The Range of resistance is',llr,'ohm','to',ulr,'ohm'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Range of resistance is 7.74 ohm to 9.46 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the equivalent current source\n",
+ "#given\n",
+ "Vs=2.;#Volts #dc voltage source\n",
+ "Rs=1.;#ohm #internal resistance\n",
+ "Rl=1.;#ohm #load resistance\n",
+ "Ise=Vs/Rs;#ampere #equivalent current source\n",
+ "\n",
+ "# In accordance to figure 1.23a\n",
+ "Il1=Ise*(Rs/(Rs+Rl));#using current divider concept\n",
+ "Vl1=Il1*Rl;\n",
+ "print \"In accordance to figure 1.23a\\n\"\n",
+ "print \"The Load current (current source Il=\",Il1,'A'\n",
+ "print \"The Load voltage (current source Vl=\",Vl1,'V','\\n'\n",
+ "\n",
+ "# In accordance to figure 1.23b\n",
+ "Vl2=Vs*(Rs/(Rs+Rl));#using voltage divider concept\n",
+ "Il2=Vl2/Rl;\n",
+ "print \"\\nIn accordance to figure 1.23b\"\n",
+ "print \"\\nThe Load voltage (voltage source) Vl=\",Vl2,'V'\n",
+ "print \"The Load current (voltage source) Il=\",Il2,'A'\n",
+ "print \"\\nTherefore they both provide same voltage and current to load\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.23a\n",
+ "\n",
+ "The Load current (current source Il= 1.0 A\n",
+ "The Load voltage (current source Vl= 1.0 V \n",
+ "\n",
+ "\n",
+ "In accordance to figure 1.23b\n",
+ "\n",
+ "The Load voltage (voltage source) Vl= 1.0 V\n",
+ "The Load current (voltage source) Il= 1.0 A\n",
+ "\n",
+ "Therefore they both provide same voltage and current to load\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find percentage variation in load current and load voltage\n",
+ "#given\n",
+ "Vs=10.;#volt#Supply voltage\n",
+ "Rs=100.;#ohm#internal resistance\n",
+ "\n",
+ "# In accordance to figure 1.24a\n",
+ "#For 1ohm - 10 ohm\n",
+ "Rl11=1.;#ohm#min extreme value of Rl\n",
+ "Rl12=10.;#ohm#max extreme value of Rl\n",
+ "Il11=Vs/(Rs+Rl11);\n",
+ "Il12=Vs/(Rs+Rl12);\n",
+ "Pi1=(Il11-Il12)*100./Il11;#Percentage variation in current\n",
+ "Vl11=Il11*Rl11;\n",
+ "Vl12=Il12*Rl12;\n",
+ "Pv1=(Vl12-Vl11)*100./Vl12;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24a \\n\");\n",
+ "print '%s %.2f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi1,'percent');\n",
+ "print '%s %.1f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv1,'percent\\n\\n');\n",
+ "\n",
+ "# In accordance to figure 1.24b\n",
+ "#For 1kohm - 10kohm\n",
+ "Rl21=1000.;#ohm#min extreme value of Rl\n",
+ "Rl22=10000.;#ohm#max extreme value of Rl\n",
+ "Il21=Vs/(Rs+Rl21);\n",
+ "Il22=Vs/(Rs+Rl22);\n",
+ "Pi2=(Il21-Il22)*100./Il21;#Percentage variation in current\n",
+ "Vl21=Il21*Rl21;\n",
+ "Vl22=Il22*Rl22;\n",
+ "Pv2=(Vl22-Vl21)*100./Vl22;#Percentage variation in voltage\n",
+ "print '%s' %(\"In accordance to figure 1.24b \\n\");\n",
+ "print '%s %.f %s' %(\"Percentage variation in Current(1-10 ohm)=\",Pi2,'percent');\n",
+ "print '%s %.f %s ' %(\"Percentage variation in Voltage(1-10 ohm)=\",Pv2,'percent \\n');\n",
+ "print 'In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to' \n",
+ "print 'the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "In accordance to figure 1.24a \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 8.18 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 89.1 percent\n",
+ "\n",
+ " \n",
+ "In accordance to figure 1.24b \n",
+ "\n",
+ "Percentage variation in Current(1-10 ohm)= 89 percent\n",
+ "Percentage variation in Voltage(1-10 ohm)= 8 percent \n",
+ " \n",
+ "In book the percentage variation in voltage(1kohm-10kohm) is 9 percent due to\n",
+ "the incorrect value of Il22 i.e. 0.000999 Amp correct value is 0.0009901 Amp\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter02.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter02.ipynb new file mode 100755 index 00000000..5d8b1cb8 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter02.ipynb @@ -0,0 +1,100 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:96fc4c09dfce5677e2fc09153fe84516b5c59a5f1f64280b5ec7d1d13cd315c4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter02:Semiconductor Physics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the conductivity and resistivity of germanium\n",
+ "#!/usr/bin/env/ python\n",
+ "#-*- coding: utf-8 -*-\n",
+ "q=1.6*10.**-19.#Coulomb #charge of an electron\n",
+ "ni=2.5*10.**19.#per m**3 #concentration\n",
+ "un=0.36#m**2/Vs #mobility of electron\n",
+ "up=0.17#m**2/Vs #mobility of holes\n",
+ "con=q*ni*(un+up); #conductivity\n",
+ "res=(1./con); #resistivity\n",
+ "print '%s %.2f %s' %(\"The conductivty is =\",con,'S/m');\n",
+ "print '%s %.2f %s' %(\"The resistivity is =\",res,'ohm m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is = 2.12 S/m\n",
+ "The resistivity is = 0.47 ohm m\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - pg 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the conductivity of extrinsic semiconductor\n",
+ "#given\n",
+ "e=1.6*10.**-19.;#Coulomb #charge of an electron\n",
+ "ni=1.5*10.**16.;#per m**3 #concentration\n",
+ "un=0.13;#m**2/Vs #mobility of electron\n",
+ "up=0.05;#m**2/Vs #mobility of holes\n",
+ "Si=5.*10.**28.;#per m**3 #atomic density in silicon\n",
+ "dop=(1./(2.*10.**8.)); #concentration of an antimony per silicon atoms\n",
+ "Nd=dop*Si;#per m**3 #donor concentraion\n",
+ "n=Nd;#per m**3 #free electron concentration\n",
+ "p=(ni**2/Nd);#per m **3 # hole concentration\n",
+ "con=e*(n*un+p*up);\n",
+ "print '%s %.1f %s' %(\"The conductivty is=\",con, 'S/m');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivty is= 5.2 S/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter03.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter03.ipynb new file mode 100755 index 00000000..c483de7a --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter03.ipynb @@ -0,0 +1,644 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:996be6d9ddaa0bf73287e9f8387b49ed0c7806d0e7dbe4ba43b1c30f0c65dc07"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter03:Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find the value of threshold voltage\n",
+ "#given\n",
+ "t1=25.;#degrees C#initial temperature\n",
+ "t2=100.;#degrees C#final temperature\n",
+ "V=2.*10.**-3.;#V per celsius degree#decrease in barrier potential per degree\n",
+ "V0=0.7#V#Potential at normal temperature\n",
+ "Vd=(t2-t1)*V;#decrease in barrier potential\n",
+ "Vt=V0-Vd;#threshold volatge at 100degree C\n",
+ "print '%s %.2f %s' %(\"Threshold volatge at 100 degrees C =\",Vt,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Threshold volatge at 100 degrees C = 0.55 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#detrenmine dc resistance of silicon diode\n",
+ "#given\n",
+ "#At Id = 2 mA\n",
+ "Id=2.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.5;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Id = 20 mA\n",
+ "Id=20.*10.**-3.;#Ampere#diode current\n",
+ "Vd=0.75;#V#voltage(from given curve)\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.1f %s' %(\"The dc resistance is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#At Vd = - 10 V \n",
+ "Id=-2.*10.**-6.;#Ampere#diode current(from given curve)\n",
+ "Vd=-10.;#V#voltage\n",
+ "Rf=(Vd/Id);\n",
+ "print '%s %.f %s' %(\"The dc resistance is =\",Rf/10**6,\"M ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance is = 250 ohm\n",
+ "\n",
+ "The dc resistance is = 37.5 ohm\n",
+ "\n",
+ "The dc resistance is = 5 M ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc & ac resistance of silicon diode\n",
+ "#given\n",
+ "Id=20.*10.**-3.;#A#diode current\n",
+ "Vd=0.75;#V# as given in the V-I graph\n",
+ "Rf=Vd/Id;\n",
+ "print '%s %.1f %s' %(\"The dc resistance of diode is =\",Rf,\"ohm\\n\");\n",
+ "\n",
+ "#From Graph the values of dynamic voltage and current are\n",
+ "#which is equal to MN and NL repectively (in graph)\n",
+ "del_Vd=(0.8-0.68);#V\n",
+ "del_Id=(40-0)*10.**-3.;#A\n",
+ "rf=del_Vd/del_Id;\n",
+ "print '%s %.f %s' %(\"The ac resistance of the diode is =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc resistance of diode is = 37.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is = 3 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine ac resistance of silicon diode\n",
+ "#given\n",
+ "#At Id =10mA\n",
+ "Id=10.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.1f %s' %(\"The ac resistance of the diode is(At Id= 10mA) =\",rf,\"ohm\\n\")\n",
+ "\n",
+ "#At Id =20mA\n",
+ "Id=20.;#mA\n",
+ "rf=25./Id;\n",
+ "print '%s %.2f %s' %(\"The ac resistance of the diode is(At Id= 20mA) =\",rf,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac resistance of the diode is(At Id= 10mA) = 2.5 ohm\n",
+ "\n",
+ "The ac resistance of the diode is(At Id= 20mA) = 1.25 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through diode\n",
+ "#given\n",
+ "Vt=0.3;#V#Threshold voltage\n",
+ "rf=25.;#ohm# average resistance\n",
+ "\n",
+ "#assuming it to be ideal\n",
+ "#from fig 3.19\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=45.;#ohm\n",
+ "R2=5.;#ohm\n",
+ "Vab=Vaa*R2/(R1+R2);\n",
+ "#Vab>Vt therefore diode is forward bias and no current flow through R2\n",
+ "Idi=Vaa/R1; #for ideal\n",
+ "print '%s %.f %s' %(\"The diode current (for ideal) is =\",Idi*1000,\"mA\\n\");\n",
+ "\n",
+ "#assuming it to be real\n",
+ "#Thevenins equivalent circuit parameters of fig 3.19\n",
+ "Vth=Vaa*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "Idr=(Vth-Vt)/(Rth+rf); #for real\n",
+ "print '%s %.1f %s' %(\"The diode current (for real) is =\",Idr*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diode current (for ideal) is = 222 mA\n",
+ "\n",
+ "The diode current (for real) is = 23.7 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current through resistance in given figure\n",
+ "#From fig\n",
+ "Vaa=20.;#V#supply\n",
+ "Vt=0.7;#V#threshold voltage of diode\n",
+ "rf=5.;#ohm #forward resistance\n",
+ "R=90.;#ohm#given resistor\n",
+ "\n",
+ "#Diode D1 and D4 are forward bias and D2 and D3 are reverse biased\n",
+ "\n",
+ "Vnet=Vaa-Vt-Vt;\n",
+ "Rt=R+rf+rf;\n",
+ "I=Vnet/Rt;\n",
+ "print '%s %.f %s' %(\"Current through 90 ohm resistor is =\",I*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 90 ohm resistor is = 186 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find current drawn by the battery\n",
+ "#From fig\n",
+ "Vaa=10.;#V#supply\n",
+ "R1=100.;#ohm\n",
+ "R2=100.;#ohm\n",
+ "\n",
+ "#Forward Bias\n",
+ "Id=Vaa/R1;\n",
+ "print '%s %.1f %s' %(\"Current drawn from battery (forward bias) =\",Id,\"A\\n\");\n",
+ "\n",
+ "#Reverse Bias\n",
+ "Rnet=R1+R2;\n",
+ "Id=Vaa/Rnet;\n",
+ "print '%s %.2f %s' %(\"Current drawn from battery (reverse bias) =\",Id,\"A\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current drawn from battery (forward bias) = 0.1 A\n",
+ "\n",
+ "Current drawn from battery (reverse bias) = 0.05 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc current through load and rectification efficiency and peak inverse voltage\n",
+ "#given\n",
+ "import math\n",
+ "TR=31./2.;#Turn ratio of the transformer\n",
+ "rf=20.;#ohm#Dynamic forward resistance\n",
+ "Rl=1000.;#ohm#Load resistance\n",
+ "Vt=0.66;#V#Threshold voltage of diode\n",
+ "V=220.;#V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp;\n",
+ "Im=(Vm-Vt)/(rf+Rl);\n",
+ "Idc=Im/math.pi;\n",
+ "n=40.6/(1.+rf/Rl);\n",
+ "print '%s %.f %s' %(\"The dc current through load is =\",Idc*1000,\"mA\\n\");\n",
+ "print '%s %.1f %s' %(\"The rectification efficiency is =\",n,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"Peak inverse voltage =Vm = \",Vm,\"V\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current through load is = 6 mA\n",
+ "\n",
+ "The rectification efficiency is = 39.8 percent\n",
+ "\n",
+ "Peak inverse voltage =Vm = 20.07 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dc voltage across load and peak inverse voltage across each diode\n",
+ "#given\n",
+ "import math\n",
+ "TR=12./1.##Turn ratio of the transformer\n",
+ "V=220.##V#input voltage of transformer\n",
+ "Vp=math.sqrt(2.)*220.#V#peak value of primary voltage\n",
+ "Vm=(1./TR)*Vp#\n",
+ "Vdc=(2.*Vm)/math.pi#\n",
+ "print '%s %.1f %s' %(\"The dc voltage across load =\",Vdc,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for bridge rectifier) =\",Vm,\"V\\n\")#\n",
+ "print '%s %.1f %s' %(\"Peak inverse voltage (for centre tap rectifier) =\",2*Vm,\"V\\n\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc voltage across load = 16.5 V\n",
+ "\n",
+ "Peak inverse voltage (for bridge rectifier) = 25.9 V\n",
+ "\n",
+ "Peak inverse voltage (for centre tap rectifier) = 51.9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc power supplied to load and efficiency and PIV rating of the diode\n",
+ "#given\n",
+ "import math\n",
+ "rf=2.;#ohm#Dynamic forward resistance\n",
+ "Rs=5.;#ohm#resistaqnce of secondary\n",
+ "Rl=25.;#ohm#Load resistance\n",
+ "Idc=0.1;#A#dc current to a load\n",
+ "Pdc=Idc**2.*Rl; #dc power\n",
+ "n=(81.2*Rl)/(Rl+rf+Rs); #efficiency\n",
+ "Im=(math.pi*Idc)/2.; #peak value current\n",
+ "Vm=Im*(Rl+rf+Rs); #peak voltage\n",
+ "Vlm=Vm-Im*(rf+Rs); #peak voltage across load\n",
+ "PIV=Vm+Vlm;\n",
+ "print '%s %.2f %s' %(\"The dc power supplied to the load is =\",Pdc,'W\\n');\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,'percent\\n');\n",
+ "print '%s %.3f %s' %(\"The peak inverse voltage is =\",PIV,'V');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc power supplied to the load is = 0.25 W\n",
+ "\n",
+ "Efficiency = 63.44 percent\n",
+ "\n",
+ "The peak inverse voltage is = 8.954 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate output voltage and current through load and voltage across series resistor and current and power dissipated in zener diode\n",
+ "#given\n",
+ "Vi=110.;#V #input voltage\n",
+ "Rl=6.*10.**3.;# ohm #load resistance\n",
+ "Rs=2.*10.**3.;#ohm #series resistance\n",
+ "Vz=60.;#V #Zener voltage\n",
+ "V=Vi*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Vs=Vi-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Iz=Is-Il #/By applying kirchhoffs law\n",
+ "Pz=Vz*Iz #Power dissipated accross zener diode\n",
+ "\n",
+ "print '%s %.f %s' %(\"The output voltage is =\",Vo,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The current through load resistance is =\",Il*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"Voltage across series resistor is =\",Vs,\"V\\n\")\n",
+ "print '%s %.f %s' %(\"Current in zener diode is =\",Iz*1000,\"mA\\n\")\n",
+ "print '%s %.f %s' %(\"Power dissipated by zener diode =\",Pz*1000,'mW');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 60 V\n",
+ "\n",
+ "The current through load resistance is = 10 mA\n",
+ "\n",
+ "Voltage across series resistor is = 50 V\n",
+ "\n",
+ "Current in zener diode is = 15 mA\n",
+ "\n",
+ "Power dissipated by zener diode = 900 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate max and min values of zener diode current\n",
+ "#given\n",
+ "Vimin=80.;#V #minimum input voltage\n",
+ "Vimax=120.;#V #maximum input voltage\n",
+ "Rl=10.*10.**3.;# ohm #load resistance\n",
+ "Rs=5.*10.**3.;#ohm #series resistance\n",
+ "Vz=50.;#V #Zener voltage\n",
+ "V=Vimin*Rl/(Rs+Rl);\n",
+ "\n",
+ "#This V>Vz therefore Zener diode is ON\n",
+ "\n",
+ "#For minimum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimin-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmin=Is-Il;\n",
+ "print '%s %.f %s' %(\"Minimum values of zener diode current is =\",Izmin*1000,\"mA\\n\");\n",
+ "\n",
+ "#For maximum value of zener diode\n",
+ "\n",
+ "Vo=Vz; #output voltage\n",
+ "Vs=Vimax-Vo; #Voltage drop across the series resistor\n",
+ "Is=Vs/Rs #current through the series resistor\n",
+ "Il=Vo/Rl; #Current through load resistance\n",
+ "Izmax=Is-Il;\n",
+ "print '%s %.f %s' %(\"Maximum values of zener diode current is =\",Izmax*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum values of zener diode current is = 1 mA\n",
+ "\n",
+ "Maximum values of zener diode current is = 9 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine value of the series resistor and wattage rating\n",
+ "#given\n",
+ "Vi=12.##V #input voltage\n",
+ "Vz=7.2##V #Zener voltage\n",
+ "Izmin=10.*10.**-3.##A #min current through zener diode\n",
+ "Ilmax=100*10.**-3.##A #max current through load\n",
+ "Ilmin=12.*10.**-3.##A #min current through load\n",
+ "Vs=Vi-Vz# #Voltage drop across the series resistor\n",
+ "Is=Izmin+Ilmax# #Current through the series resistor\n",
+ "Rs=Vs/Is#\n",
+ "print '%s %.1f %s' %(\"The series resistor so that 10mA current flow through zener diode is =\",Rs,\"ohm\\n\")#\n",
+ "Izmax=Is-Ilmin#max zener through zener diode\n",
+ "Pmax=Izmax*Vz#\n",
+ "print '%s %.1f %s' %(\"The maximum wattage rating is =\",Pmax*1000,\"mW\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resistor so that 10mA current flow through zener diode is = 43.6 ohm\n",
+ "\n",
+ "The maximum wattage rating is = 705.6 mW\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the capacitance of a varactor diode\n",
+ "#given\n",
+ "import math\n",
+ "C=5.;#pf#capcitance of varactor diode at V=4V\n",
+ "V=4.;#V\n",
+ "K=C*math.sqrt(4.);\n",
+ "#When bias voltage is increased upto 6 V\n",
+ "Vn=6.;#V#new bias voltage\n",
+ "Cn=K/(math.sqrt(Vn));\n",
+ "print '%s %.3f %s' %(\"Capacitance (At 6 V ) =\",Cn,\"pf\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Capacitance (At 6 V ) = 4.082 pf\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter04.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter04.ipynb new file mode 100755 index 00000000..9ad4ce75 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter04.ipynb @@ -0,0 +1,420 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:12896fc25e43375cf1d0cff293b48413389e0aa67a527bcf3d773f54a9aaa70f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter04:Bipolar Junction Transistors (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the collector and base current\n",
+ "#given\n",
+ "a=0.98;#dc alpha\n",
+ "Ie=5.*10.**-3.;#A#emitter current\n",
+ "Ico=2.*10.**-6.;#A#collector reverse leakage current\n",
+ "Ic=a*Ie+Ico;\n",
+ "Ib=Ie-Ic;\n",
+ "print '%s %.3f %s' %(\"The collector current is =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current is = 4.902 mA\n",
+ "\n",
+ "The base current is = 98 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the base and collector current and exact and approax dc alpha \n",
+ "#given\n",
+ "Ie=8.4*10.**-3.#A#emitter current\n",
+ "Icbo=0.1*10.**-6.##A#reverse leakage current\n",
+ "Ib=0.008*Ie##A#base current\n",
+ "Ic=Ie-Ib#\n",
+ "Icinj=Ic-Icbo#\n",
+ "a0=Icinj/Ie#\n",
+ "a=Ic/Ie#\n",
+ "print '%s %.1f %s' %(\"Base current is =\",Ib*10**6,\"uA\\n\")#\n",
+ "print '%s %.4f %s' %(\"Collector current =\",Ic*1000,\"mA\\n\",)#\n",
+ "print '%s %.7f %s' %(\"Exact value of alphha =\",a0,\"\\n\")#\n",
+ "print '%s %.3f' %(\"Approax value of alpha =\",a)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current is = 67.2 uA\n",
+ "\n",
+ "Collector current = 8.3328 mA\n",
+ "\n",
+ "Exact value of alphha = 0.9919881 \n",
+ "\n",
+ "Approax value of alpha = 0.992\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the base current\n",
+ "#given\n",
+ "a=0.96; #dc alpha\n",
+ "Rc=2.*10.**3.;#ohm #resistor across collector\n",
+ "Vc=4.;#V #Voltage drop across the collector resistor\n",
+ "Ic=Vc/Rc; #Colletor current\n",
+ "Ie=Ic/a; #Emmiter current\n",
+ "Ib=Ie-Ic; #Base current\n",
+ "print '%s %.f %s' %(\"The base current is =\",Ib*10**6,\"uA\",)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current is = 83 uA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Ie=2.;#mA\n",
+ "Vcb=10.;#V\n",
+ "\n",
+ "#Taking points around Ie & Vcb from graph\n",
+ "del_Ie=(2.5-1.5)*10.**-3.;#A\n",
+ "\n",
+ "#corresponding change in Veb\n",
+ "del_Veb=(0.9-0.8);#V\n",
+ "rib=del_Veb/del_Ie;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rib,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 100 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#find dc current gain in common emitter configuration\n",
+ "#given\n",
+ "a=0.98;#dc current gain in common base configuration\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The dc current gain in common emitter configuration is=\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dc current gain in common emitter configuration is= 49\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac alpha and beta\n",
+ "#given\n",
+ "ic=0.995#mA#Emitter current change\n",
+ "ie=1.#mA#collector current change\n",
+ "a=ic/ie;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.3f %s' %(\"The ac alpha is =\",a,\"\\n\")\n",
+ "print '%s %.f' %(\"The common emitter ac current gain is =\",B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac alpha is = 0.995 \n",
+ "\n",
+ "The common emitter ac current gain is = 199\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate beta and Iceo and exact and approax collector current\n",
+ "#given\n",
+ "a0=0.992;#dc current gain in common base configuration\n",
+ "Icbo=48.*10.**-9.;#A\n",
+ "Ib=30.*10.**-6.;#A#base current\n",
+ "B=a0/(1.-a0);\n",
+ "Iceo=Icbo/(1.-a0);\n",
+ "print '%s %.f %s' %(\"Beta=\",B,\"\\n\");\n",
+ "print '%s %.f %s' %(\"Iceo=\",Iceo*10**6,\"uA\\n\");\n",
+ "Ic=B*Ib+Iceo;\n",
+ "Ica=B*Ib;#approax\n",
+ "print '%s %.3f %s' %(\"Exact collector current =\",Ic*1000,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"Approax collector current =\",Ica*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta= 124 \n",
+ "\n",
+ "Iceo= 6 uA\n",
+ "\n",
+ "Exact collector current = 3.726 mA\n",
+ "\n",
+ "Approax collector current = 3.72 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance\n",
+ "#given\n",
+ "Vbe=0.75;#V\n",
+ "Vce=2.;#V\n",
+ "\n",
+ "#Taking points around Vbe=0.75V from graph\n",
+ "del_Vbe=(0.98-0.9);#V\n",
+ "\n",
+ "#corresponding change in ib\n",
+ "del_ib=(68.-48.)*10.**-6.;#A\n",
+ "\n",
+ "rie=del_Vbe/del_ib;\n",
+ "print '%s %.f %s' %(\"The dynamic input resistance of transistor is =\",rie/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic input resistance of transistor is = 4 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine dynamic input resistance and dc and ac current gain\n",
+ "#given\n",
+ "Ib=30.*10.**-6.;#A\n",
+ "Vce=10.;#V\n",
+ "Ic=3.6*10.**-3.;#A #from graph\n",
+ "\n",
+ "#Taking points around Vce = 10V from graph\n",
+ "del_Vce=(12.5-7.5);#V\n",
+ "\n",
+ "#corresponding change in ic\n",
+ "del_ic=(3.7-3.5)*10.**-3.;#A\n",
+ "\n",
+ "roe=del_Vce/del_ic;\n",
+ "print '%s %.f %s' %(\"The dynamic output resistance of transistor is =\",roe/1000,\"k ohm\\n\");\n",
+ "\n",
+ "#dc current gain\n",
+ "Bo=Ic/Ib;\n",
+ "print '%s %.f %s' %(\"The dc current gain is =\",Bo,\"\\n\");\n",
+ "\n",
+ "#ac current gain\n",
+ "\n",
+ "del_ic=(4.7-2.5)*10.**-3.; #the collector current change is from 3.5mA to 4.7mA as we can see from graph when we change ib from 40mA to 20mA\n",
+ "del_ib=(40.-20.)*10.**-6.;\n",
+ "B=del_ic/del_ib;\n",
+ "print '%s %.f %s' %(\"The ac current gain is =\",B,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic output resistance of transistor is = 25 k ohm\n",
+ "\n",
+ "The dc current gain is = 120 \n",
+ "\n",
+ "The ac current gain is = 110 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#calculate ac current gain in CE and CC configuration\n",
+ "#given\n",
+ "a=0.99;\n",
+ "B=a/(1.-a);\n",
+ "print '%s %.f' %(\"The ac current gain in CE configuration is =\",B);\n",
+ "y=1.+B;\n",
+ "print '%s %.f' %(\"\\nThe ac current gain in CC configuration is =\",y);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac current gain in CE configuration is = 99\n",
+ "\n",
+ "The ac current gain in CC configuration is = 100\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter05.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter05.ipynb new file mode 100755 index 00000000..a9d55805 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter05.ipynb @@ -0,0 +1,347 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c38375c3ed3aba849cd6bba227790fa8eedb466f2a80c8f732771b0fc6e2b503"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter05:Field Effect Transistors (FETs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 161"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate saturation voltage and saturation current\n",
+ "#given\n",
+ "Vp=-4.#V #pinch off voltage\n",
+ "Idss=12.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Vgs=-2.;#V #gate to source voltage\n",
+ "Vds=Vgs-Vp;\n",
+ "Id=Idss*(Vds/Vp)**2.;\n",
+ "print '%s %.f %s' %(\"Saturation Voltage is =\",Vds,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Saturation current is =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation Voltage is = 2 V\n",
+ "\n",
+ "Saturation current is = 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 162"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vgso=-5.;#V #gate to source cut off voltage\n",
+ "Idss=20.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#At vgs = -2 V\n",
+ "vgs=-2.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -2 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -4 V\n",
+ "vgs=-4.;#V input voltage\n",
+ "Id=Idss*(1.-(vgs/Vgso))**2.; #Schockleys equation\n",
+ "print '%s %.1f %s' %(\"Drain current is (At vgs = -4 V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#At vgs = -8 V\n",
+ "print '%s' %(\"Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current is (At vgs = -2 V) = 7.2 mA\n",
+ "\n",
+ "Drain current is (At vgs = -4 V) = 0.8 mA\n",
+ "\n",
+ "Drain current is 0 A (At vgs = -8 V) because gate is biased beyond cut off \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 163"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Vds saturation\n",
+ "#given\n",
+ "import math\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=-15.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "Id=-3.*10.**-3.;#A #saturation current\n",
+ "Vgs=Vp*(1.-math.sqrt(Id/Idss));\n",
+ "Vds=Vgs-Vp;\n",
+ "print '%s %.3f %s' %(\"The gate to source voltage (Vgs) is =\",Vgs,\"V\\n\");\n",
+ "print '%s %.3f %s' %(\"The saturation voltage is Vds(sat) =\",Vds,\"V\");\n",
+ "\n",
+ "print '\\nThe value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gate to source voltage (Vgs) is = 2.764 V\n",
+ "\n",
+ "The saturation voltage is Vds(sat) = -2.236 V\n",
+ "\n",
+ "The value of Vgs = 2.115V and Vds= -2.885V in book because of the calculation error\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for N channel\n",
+ "#given\n",
+ "Vp=5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= - 3 V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id(For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5 V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id(For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id(For Vgs= -3V) = 2.88 mA\n",
+ "\n",
+ "The drain current Id(For Vgs= 2.5V) = 40.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 167"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate drain current Id for P channel\n",
+ "#given\n",
+ "Vp=-5.#V #pinch off voltage\n",
+ "Idss=18.*10.**-3.;#A #drain to source current with gate shorted\n",
+ "\n",
+ "#For Vgs= -3V\n",
+ "Vgs=-3.;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current Id (For Vgs= -3V) =\",Id*10**3,\"mA\\n\");\n",
+ "\n",
+ "#For Vgs= 2.5V\n",
+ "Vgs=2.5;#V\n",
+ "Id=Idss*(1.-(Vgs/(-Vp)))**2.;\n",
+ "print '%s %.1f %s' %(\"The drain current Id (For Vgs= 2.5V) =\",Id*10**3,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current Id (For Vgs= -3V) = 46.08 mA\n",
+ "\n",
+ "The drain current Id (For Vgs= 2.5V) = 4.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of drain current\n",
+ "#given\n",
+ "Vt=2.;#V #threshold voltage\n",
+ "K=0.25*10.**-3.;# A/V**2 #conductivity parameter\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=2.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "Id=K*(Vgs-Vt)**2.;\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 0.25 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the value of Id\n",
+ "#given\n",
+ "Vt=1.5;#V #threshold voltage\n",
+ "Id=2.*10.**-3.;#A\n",
+ "Vgs=3.;#V #gate supply\n",
+ "Vds=5.;#V #saturation voltage\n",
+ "Vdsm=Vgs-Vt; #minimum voltage required to pinch off\n",
+ "\n",
+ "# Vds > Vdsm therefore the device is in saturation region\n",
+ "\n",
+ "# Calculating K\n",
+ "K=Id/((Vgs-Vt)**2.); # A/V**2 #conductivity parameter\n",
+ "\n",
+ "#Calculating Id for Vgs= 5 V and Vds= 6 V\n",
+ "Vgs=5;#V #gate supply\n",
+ "Vds=6;#V #saturation voltage\n",
+ "Id=K*((Vgs-Vt)**2);\n",
+ "print '%s %.2f %s' %(\"The drain current is =\",Id*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drain current is = 10.89 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the dynamic drain resistance\n",
+ "#given\n",
+ "gm=200.*10.**-6.;#S transconductance\n",
+ "u=80.;#amplification factor\n",
+ "rd=u/gm;\n",
+ "print '%s %.f %s' %(\"The dynamic drain resistance is =\",rd/1000,\"k ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic drain resistance is = 400 k ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter06.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter06.ipynb new file mode 100755 index 00000000..5865234b --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter06.ipynb @@ -0,0 +1,698 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7be33daa1d7e9b1e217f1a71b195a0e8c1c9026233035f683a45d209e0003c84"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter06:Transistor Biasing and Stabilization"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.2*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=270.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,'V',Ic*1000,'mA');\n",
+ "\n",
+ "#Note--In book Vce = 5.7 V because of approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 5.6 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point\n",
+ "#given\n",
+ "B=150.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=100.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.7;#V #base to emitter voltage\n",
+ "Ib=(Vcc-Vbe)/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ics*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 0 V 10 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine Rb and percentage change in collector current due to temperature rise\n",
+ "#given\n",
+ "\n",
+ "#Calculating the base resistance\n",
+ "B=20.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Ic=1.*10.**-3.;#A #collector current\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Icbo=2.*10.**-6.;#A #collector to base leakage current\n",
+ "\n",
+ "Ib=(Ic-(1.+B)*Icbo)/B;\n",
+ "Rb=(Vcc-Vbe)/Ib;\n",
+ "\n",
+ "print '%s %.f %s' %(\"The value of resistor Ib is =\",120,'kohm');\n",
+ "\n",
+ "Rb=120.*10.**3.;#ohm approax\n",
+ "\n",
+ "#Now when temperature rise\n",
+ "Icbo=10.*10.**-6.;#A #collector to base leakage current\n",
+ "B=25.;#dc beta\n",
+ "Ic1=B*Ib+(B+1)*Icbo;# #changed collector current\n",
+ "perc=(Ic1-Ic)*100./Ic;#percentage increase\n",
+ "print '%s %.f %s' %(\"The percentage change in collector current is =\",perc,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of resistor Ib is = 120 kohm\n",
+ "The percentage change in collector current is = 46 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the Q point at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/Rb; #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.1f %s' %(\"The Q point (At B=50) =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.; #dc beta\n",
+ "Ic1=B*Ib; #Colletor current\n",
+ "Ics1=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values i.e. Ic(sat) and since the transistor is in saturation mode therefore Vce will become 0\n",
+ "\n",
+ "Vce=0;\n",
+ "print '%s %.f %s %.1f %s' %(\"\\nThe Q point (At B=150) is =\",Vce,\"V\",Ics*1000,\"mA\");\n",
+ "\n",
+ "print '%s %.f' %(\"\\nThe factor at which collector current increases =\",Ics1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point (At B=50) = 6.00 V 1.5 mA\n",
+ "\n",
+ "The Q point (At B=150) is = 0 V 4.5 mA\n",
+ "\n",
+ "The factor at which collector current increases = 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine Q point in collector to base bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=500.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ics=Vcc/Rc; #Colletor saturation current\n",
+ "\n",
+ "#Actual Ic is the smaller of the above two values\n",
+ "\n",
+ "Vce=Vcc-(Ic+Ib)*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 9.1 V 1.8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the collector current and change in it if B is changed by three times of previous B\n",
+ "#given\n",
+ "B=50.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Ib=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.3f %s' %(\"Collector current (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "#Now B=150\n",
+ "B=3.*B; #three times of previous B\n",
+ "Ib1=Vcc/(Rb+B*Rc); #Base current\n",
+ "Ic1=B*Ib1; #Colletor current\n",
+ "print '%s %.2f %s' %(\"Collector current (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.f' %(\"The factor at which collector current increases =\",Ic1/Ic);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector current (B=50)= 1.125 mA\n",
+ "\n",
+ "Collector current (B=150)= 2.25 mA\n",
+ "\n",
+ "The factor at which collector current increases = 2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of all three current Ie and Ic and Ib\n",
+ "#given\n",
+ "B=90.; #dc beta\n",
+ "Rc=1.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=500.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "Ie=Ic+Ib; #Emitter current\n",
+ "print '%s %.1f %s %s %.3f %s %s %.3f %s' %(\"Base current =\",Ib*10**6,\"uA\\n\",\"\\nCollector current =\",Ic*10**3,\"mA\\n\",\"\\nEmitter current =\",Ie*10**3,\"mA\");\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 16.5 uA\n",
+ " \n",
+ "Collector current = 1.486 mA\n",
+ " \n",
+ "Emitter current = 1.503 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max and min value of emitter current\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.; #dc beta\n",
+ "Rc=75.;#ohm #resistor connected to collector\n",
+ "Re=100.;#ohm #resistor connected to emitter\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=6.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #for germanium\n",
+ "Ib=(Vcc-Vbe)/(Rb+(1.+B)*Re); #Base current\n",
+ "Ie=(1.+B)*Ib;\n",
+ "Vce=Vcc-(Rc+Re)*Ie\n",
+ "print '%s %.2f %s' %(\"Minimum emitter current =\",Ie*10**3,\"mA\\n\");\n",
+ "print '%s %.2f %s' %(\"The collector to emitter volatge =\",Vce,\"V\\n\");\n",
+ "\n",
+ "#At B=300 \n",
+ "\n",
+ "B1=300.; #dc beta\n",
+ "Ib1=(Vcc-Vbe)/(Rb+(1.+B1)*Re);#Base current\n",
+ "Ie1=(1.+B1)*Ib1;\n",
+ "Vce1=Vcc-(Rc+Re)*Ie1\n",
+ "#Here Vce1= -1.4874 V but can never have negative voltage because Ie1 is wrong as it cant be more than saturation value therefore\n",
+ "Ie1=Vcc/(Rc+Re);\n",
+ "\n",
+ "#And Vce=0 V\n",
+ "\n",
+ "Vce1=0;#V\n",
+ "print '%s %.2f %s' %(\"Maximum emitter current =\",Ie1*10**3,\"mA\\n\");\n",
+ "print '%s %.f %s' %(\"The collector to emitter volatge(saturation) =\",Vce1,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum emitter current = 19.25 mA\n",
+ "\n",
+ "The collector to emitter volatge = 2.63 V\n",
+ "\n",
+ "Maximum emitter current = 34.29 mA\n",
+ "\n",
+ "The collector to emitter volatge(saturation) = 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of base resistance\n",
+ "#given\n",
+ "\n",
+ "B=100.; #dc beta\n",
+ "Rc=200.;#ohm #resistor connected to collector\n",
+ "Re=500.;#ohm #resistor connected to emitter\n",
+ "Vcc=9.;#V #Voltage supply across the collector as it is PNP so taking positive\n",
+ "Vce=4.5;#V #Collector to emitter voltage\n",
+ "Ic=(Vcc-Vce)/(Rc+Re);\n",
+ "Ib=Ic/B;\n",
+ "Rb=(Vcc-B*Re*Ib)/Ib;\n",
+ "print '%s %.f %s' %(\"The value of base resistance is =\",Rb/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base resistance is = 90 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 200"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the collector current at two different B\n",
+ "#given\n",
+ "\n",
+ "#At B=50\n",
+ "\n",
+ "B=50.;#dc beta\n",
+ "Rc=2.;#ohm #resistor connected to collector\n",
+ "Re=1000.;#ohm #resistor connected to emitter\n",
+ "Rb=300.*10.**3.;#ohm #resistor connected to base\n",
+ "Vcc=9.;#V #Voltage supply across the collector resistor\n",
+ "Ib=Vcc/(Rb+B*Re); #Base current\n",
+ "Ic=B*Ib; #Colletor current\n",
+ "print '%s %.2f %s' %(\"The collector current at (B=50)=\",Ic*1000,\"mA\\n\");\n",
+ "\n",
+ "#At B=150\n",
+ "\n",
+ "B1=150.;#dc beta\n",
+ "Ib1=Vcc/(Rb+B1*Re); #Base current\n",
+ "Ic1=B1*Ib1; #Colletor current\n",
+ "print '%s %.1f %s' %(\"The collector current at (B=150)=\",Ic1*1000,\"mA\\n\");\n",
+ "print '%s %.1f' %(\"The factor at which collector current increases=\",Ic1/Ic);\n",
+ "\n",
+ "#IN BOOK Ic(AT B=50)= 1.25 mA and Ic1/Ic=2.4 DUE TO APPROAXIMATION\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current at (B=50)= 1.29 mA\n",
+ "\n",
+ "The collector current at (B=150)= 3.0 mA\n",
+ "\n",
+ "The factor at which collector current increases= 2.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Q point in voltage divider\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.*10.**3.;#ohm #voltage divider resistor 1\n",
+ "R2=1.*10.**3.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "I=Vcc/(R1+R2); #current through voltage divider\n",
+ "Vb=I*R2; #voltage at base\n",
+ "Ve=Vb-Vbe;\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie #approaximating Ib is nearly equal to 0\n",
+ "Vc=Vcc-Ic*Rc;\n",
+ "Vce=(Vc)-Ve; \n",
+ "print '%s %.1f %s %.f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Ibc=I/20.; #critical value of base current\n",
+ "Ib=Ic/B; #actual base current\n",
+ "\n",
+ "#Since Ib < Ibc, hence assumption is alright\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 3.3 V 3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Solve the voltage divider accurately by applying thevenin's theorem\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=2.*10.**3.;#ohm #resistor connected to collector\n",
+ "R1=10.;#ohm #voltage divider resistor 1\n",
+ "R2=1.;#ohm #voltage divider resistor 2\n",
+ "Re=200.;#ohm #resistor connected to emitter\n",
+ "Vcc=10.;#V #Voltage supply across the collector resistor\n",
+ "Vbe=0.3;#V #base to emitter voltage\n",
+ "\n",
+ "Vth=Vcc*R2/(R1+R2);\n",
+ "Rth=R1*R2/(R1+R2);\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent voltage Vth =\",Vth,\"V\");\n",
+ "print '%s %.1f %s' %(\"\\nThevenin equivalent resistance Rth =\",Rth,\"kohm\");\n",
+ "\n",
+ "Ib=(Vth-Vbe)/(Rth+(1.+B)*Re);\n",
+ "Ic=B*Ib;\n",
+ "Ie=Ic+Ib;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re; \n",
+ "print '%s %.4f %s' %(\"\\nThe accurate value of Ic =\",Ic*10**3,\"mA\");\n",
+ "print '%s %.5f %s' %(\"\\nThe accurate value of Vce =\",Vce,\"V\");\n",
+ "Icp=3.*10.**-3.; # Current calculated by voltage divider in previous example\n",
+ "Vcep=3.4; # Voltage calculated by voltage divider in previous example\n",
+ "Err_Ic=(Ic-Icp)*100./Ic;\n",
+ "Err_Vce=(Vce-Vcep)*100./Vce;\n",
+ "print '%s %.1f %s' %(\"\\nError in Ic =\",Err_Ic,\"percent\\n\");\n",
+ "print '%s %.1f %s' %(\"\\nError in Vce =\",Err_Vce,\"percent\");\n",
+ "\n",
+ "# The errors and The accurate values are different \n",
+ "# because of the approaximation in Vth and Rth in book\n",
+ "\n",
+ "# In Book Ic = 2.8436 mA and Vce = 3.73839 V\n",
+ "# Error in Ic = -5.5% \n",
+ "# Error in Vce = +9% "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin equivalent voltage Vth = 0.9 V\n",
+ "\n",
+ "Thevenin equivalent resistance Rth = 0.9 kohm\n",
+ "\n",
+ "The accurate value of Ic = 3.0152 mA\n",
+ "\n",
+ "The accurate value of Vce = 3.36060 V\n",
+ "\n",
+ "Error in Ic = 0.5 percent\n",
+ "\n",
+ "\n",
+ "Error in Vce = -1.2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 209"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#determine the Q point for the emitter bias circuit\n",
+ "#given\n",
+ "B=100.; #dc beta\n",
+ "Rc=5.*10.**3.;#ohm #resistor connected to collector\n",
+ "Rb=10.*10.**3.;#ohm #resistor connected to base\n",
+ "Re=10.*10.**3.;#ohm #resistor connected to emitter \n",
+ "Vcc=12.;#V #Voltage supply across the collector resistor\n",
+ "Vee=15;#V #supply at emitter\n",
+ "Ie=Vee/Re;\n",
+ "Ic=Ie;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.1f %s %.1f %s' %(\"The Q point is =\",Vce,\"V\",Ic*1000,\"mA\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point is = 4.5 V 1.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate Vgs and Rs\n",
+ "#given\n",
+ "import math\n",
+ "Vp=2.;#V\n",
+ "Idss=1.75*10.**-3.;#A #drain current at Vgs=0\n",
+ "Vdd=24.;#V #drain to supply source\n",
+ "Id=1.*10.**-3.;#A #drain current\n",
+ "Vgs=(-Vp)*(1-math.sqrt(Id/Idss));\n",
+ "Rs=abs(Vgs)/Id;\n",
+ "print '%s %.3f %s' %(\"Vgs =\",Vgs,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"Rs =\",Rs,\"ohm\");\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vgs = -0.488 V\n",
+ "\n",
+ "Rs = 488 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter07.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter07.ipynb new file mode 100755 index 00000000..6bd6d425 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter07.ipynb @@ -0,0 +1,592 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c173021e2b7fbdc477decea90b9573f8e45713d84c6fe5e0bdfc01c8abeb68c8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter07:Small Signal SIngle-Stage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate max current and check will the capacitor act as short for given frequency\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "Vs=1.;#V\n",
+ "Imax=Vs/(Rs+Rl);\n",
+ "fc=1./(2.*math.pi*(Rs+Rl)*C) #critical frequency\n",
+ "fh=10.*fc; #Border frequency\n",
+ "print '%s %.f %s' %(\"Maximum current is =\",Imax*10**6,\"uA\\n\");\n",
+ "print '%s %.2f %s' %(\"fh =\",fh,\"Hz\\n\");\n",
+ "print '%s %.2f %s %s' %(\"As long as source frequency is greater than\",fh,\"Hz\",\"the coupling capacitor acts like an ac short for 20Hz to 20kHz\")\n",
+ "\n",
+ "#In book Imax is 200mA but there is misprinting of 'm' in mA it should be uA\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum current is = 200 uA\n",
+ "\n",
+ "fh = 3.18 Hz\n",
+ "\n",
+ "As long as source frequency is greater than 3.18 Hz the coupling capacitor acts like an ac short for 20Hz to 20kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Check whether the capacitor is an effective bypass for the signal currents of lowest frequency 20 Hz\n",
+ "#given\n",
+ "import math\n",
+ "C=100.*10.**-6.;#Farad\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Rl=4.*10.**3.;#ohm\n",
+ "f=20.;#Hz #lowest frequency\n",
+ "Xc=1./(2.*math.pi*f*C) #reactance of capacitor at 20Hz\n",
+ "Rth=Rs*Rl/(Rs+Rl); #Thevenins equivalent resistance\n",
+ "print '%s %.1f %s %.f %s ' %(\"Xc < Rth/10 is satisfied\",Xc,\"ohm\",Rth/10,\"ohm\\n\");\n",
+ "print '%s' %(\"The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Xc < Rth/10 is satisfied 79.6 ohm 80 ohm\n",
+ " \n",
+ "The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the value of capacitor required\n",
+ "#given\n",
+ "import math\n",
+ "Rs1=20.*10.**3.;#ohm\n",
+ "Rs2=30.*10.**3.;#ohm\n",
+ "Rl1=40.*10.**3.;#ohm\n",
+ "Rl2=80.*10.**3.;#ohm\n",
+ "Rl3=80.*10.**3.;#ohm\n",
+ "Rth=Rs1*Rs2/(Rs1+Rs2); #Thevenins equivalent resistance\n",
+ "Rl_=Rl2*Rl3/(Rl2+Rl3);\n",
+ "Rl=Rl1*Rl_/(Rl1+Rl_); #Equivalent load\n",
+ "f=50.;#Hz #lowest frequency\n",
+ "R=Rth+Rl;\n",
+ "C=10./(2.*math.pi*f*R)\n",
+ "print '%s %.f %s' %(\"The required value of coupling capacitor is =\",C*10**6,\"uF\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of coupling capacitor is = 1 uF\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage and current gain and input and output resistance\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "#given\n",
+ "\n",
+ "#DC analysis\n",
+ "Vcc=12.;#V\n",
+ "Rb=200.*10.**3.;#ohm\n",
+ "Rc=1.*10.**3.;#ohm\n",
+ "B=100.;# beta\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "#AC analysis\n",
+ "Rl=1.*10.**3.;#ohm\n",
+ "hfe=B;\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "hoe_1=40.*10.**3.;#ohm # 1/hoe\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-hfe*Rac/hie;\n",
+ "print '%s %.2f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "\n",
+ "#Siince (1/hoe) > Rac therefore entire current will flows through Rac\n",
+ "Io=-100.*Ib;\n",
+ "Ac=Io/Ib;\n",
+ "print '%s %.2f %s' %(\"The current gain =\",Ac,\"\\n\");\n",
+ "\n",
+ "Ri=prll(Rb,hie);\n",
+ "Ro=prll(Rl,prll(Rc,hoe_1));\n",
+ "print '%s %.f %s' %(\"The input resistance =\",Ri/1000,\"kohm\\n\");\n",
+ "print '%s %.1f %s' %(\"The output resistance =\",Ro/1000,\"kohm\");\n",
+ "\n",
+ "#In book the voltage gain is 25 due to skipping of '-' in printing\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 6.00 V 6.00 mA\n",
+ "\n",
+ "The voltage gain = -25.00 \n",
+ "\n",
+ "The current gain = -100.00 \n",
+ "\n",
+ "The input resistance = 2 kohm\n",
+ "\n",
+ "The output resistance = 0.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Solve previous example using hybrid pie model\n",
+ "#soltion\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "Vcc=12.##V\n",
+ "Rb=200.*10.**3.##ohm\n",
+ "Rc=1.*10.**3.##ohm\n",
+ "Rl=1.*10.**3.##ohm\n",
+ "B=100.## beta\n",
+ "hie=2.*10.**3.##ohm\n",
+ "hoe_1=40.*10.**3.##ohm # 1/hoe\n",
+ "\n",
+ "Ib=Vcc/Rb#\n",
+ "Ic=B*Ib#\n",
+ "Rac=prll(Rc,Rl)#\n",
+ "gm=Ic/(25.*10.**-3.)#\n",
+ "rpi=B/gm#\n",
+ "ri=hie#\n",
+ "rb=ri-rpi#\n",
+ "ro=hoe_1#\n",
+ "Vpi=rpi/(rpi+rb)#\n",
+ "Vo=-gm*Vpi*Rac# #output voltage\n",
+ "Av=Vo#\n",
+ "print '%s %.2f' %(\"The voltage gain\",Av)#\n",
+ "#In book voltage gain is -24.96 due to appraoximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain -25.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the value of output voltage\n",
+ "#given\n",
+ "Vcc=12.;#V\n",
+ "Rb=150.*10.**3.;#ohm\n",
+ "Rc=5.*10.**3.;#ohm\n",
+ "B=200.;# beta\n",
+ "hie=2.*10.**3.;#ohm\n",
+ "ro=60.*10.**3.;#ohm # 1/hoe\n",
+ "Vi=1.*10.**-3.;#V\n",
+ "Ib=Vcc/Rb;\n",
+ "Ic=B*Ib;\n",
+ "Icsat=Vcc/Rc;\n",
+ "# Icsat < Ic therefore transistor is in saturation mode and outpuut voltage wil be zero\n",
+ "Vo=0;\n",
+ "print '%s %.f %s' %(\"The output voltage=\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage= 0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input resistance\n",
+ "# Function definition is here\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2);\n",
+ "\treturn z\n",
+ "\n",
+ "R1=75.*10.**3.;#ohm\n",
+ "R2=7.5*10.**3.;#ohm\n",
+ "Rc=4.7*10.**3.;#ohm\n",
+ "Re=1.2*10.**3.;#ohm\n",
+ "Rl=12.*10.**3.;#ohm\n",
+ "B=150.;\n",
+ "ri=2.*10.**3.;#ohm\n",
+ "Vcc=15.;#V\n",
+ "Vb=Vcc*R2/(R1+R2);\n",
+ "Ve=Vb; #since Vbe=0\n",
+ "Ie=Ve/Re;\n",
+ "Ic=Ie;\n",
+ "Icsat=Vcc/(Rc+Re);\n",
+ "# Ic < Icsat therefore transistor is in active mode\n",
+ "Vce=Vcc-Ic*(Rc+Re);\n",
+ "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
+ "\n",
+ "Rac=prll(Rc,Rl);\n",
+ "Av=-B*Rac/ri;\n",
+ "print '%s %.1f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
+ "Ri_=prll(ri,R2);\n",
+ "print '%s %.2f %s' %(\"The input resistance=\",Ri_/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Q point of DC analysis= 8.30 V 1.14 mA\n",
+ "\n",
+ "The voltage gain = -253.3 \n",
+ "\n",
+ "The input resistance= 1.58 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Calculate the value of gm at different values of Vgs\n",
+ "#given\n",
+ "\n",
+ "Idss=8.*10.**-3.;#A\n",
+ "Vp=4;#V\n",
+ "#At Vgs= -0.5 V\n",
+ "Vgs= -0.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.f %s' %(\"gmo =\",gmo*1000,\"mS\\n\");\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -0.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -1.5 V\n",
+ "Vgs= -1.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -1.5V) =\",gm*1000,\"mS\\n\");\n",
+ "\n",
+ "#At Vgs= -2.5 V\n",
+ "Vgs= -2.5;#V\n",
+ "gmo=2.*Idss/(abs(Vp));\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)));\n",
+ "print '%s %.1f %s' %(\"gm (At Vgs = -2.5V) =\",gm*1000,\"mS\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "gmo = 4 mS\n",
+ "\n",
+ "gm (At Vgs = -0.5V) = 3.5 mS\n",
+ "\n",
+ "gm (At Vgs = -1.5V) = 2.5 mS\n",
+ "\n",
+ "gm (At Vgs = -2.5V) = 1.5 mS\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output signal voltage of the amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Rd=12.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "Rs=1.*10.**3.;#ohm\n",
+ "Cs=25.*10.**-6.;#F\n",
+ "u=80.; #amplification factor\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Vi=0.1;#V\n",
+ "f=1.*10.**3.;#Hz #input frequency\n",
+ "Xcs=1./(2.*math.pi*f*Cs);\n",
+ "#This is much smaller than Rs therefore it is bypassed\n",
+ "\n",
+ "gm=u/rd;\n",
+ "Av=gm*(rd*Rd/(rd+Rd));\n",
+ "Vo=Av*Vi;\n",
+ "print '%s %.3f %s' %(\"The output voltage is =\",Vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 0.453 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "Rd=2.*10.**3.;#ohm\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "Rg=1.*10.**6.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Av=-gm*(rd*Rd/(rd+Rd));\n",
+ "Ri=Rg;\n",
+ "Ro=rd*Rd/(rd+Rd);\n",
+ "print '%s %.f %s %.f %s %s %.f %s' %(\"The small signal voltage gain =\",Av,\"\\ninput resistance=\",Ri/10**6,\"Mohm\",\"\\noutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -4 \n",
+ "input resistance= 1 Mohm \n",
+ "output resistance = 2 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the small signal voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=500.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Rd=5.*10.**3.;#ohm\n",
+ "Rs=100.;#ohm\n",
+ "Rl=5.*10.**3.;#ohm\n",
+ "gm=1.5*10.**-3.;#S\n",
+ "rd=200.*10.**3.;#ohm\n",
+ "Rg=R1*R2/(R1+R2);\n",
+ "Rac=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*Rac;\n",
+ "Ri=Rg;\n",
+ "Ro=(rd*Rac/(rd+Rac));\n",
+ "print '%s %.2f %s %.2f %s %s %.1f %s' %(\"The small signal voltage gain =\",Av,\"\\nInput resistance =\",Ri/1000,\"kohm\",\"\\nOutput resistance =\",Ro/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The small signal voltage gain = -3.75 \n",
+ "Input resistance = 45.45 kohm \n",
+ "Output resistance = 2.5 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the voltage gain of the FET\n",
+ "#given\n",
+ "Idss=8.*10.**-3.##A\n",
+ "Vp=4.##V\n",
+ "rd=25.*10.**3.##ohm\n",
+ "Rd=2.2*10.**3.##ohm #by the help of figure\n",
+ "Vgs=-1.8##V\n",
+ "gmo=2.*Idss/(abs(Vp))#\n",
+ "gm=gmo*(1.-(Vgs/(-Vp)))#\n",
+ "Av=-gm*(rd*Rd/(rd+Rd))#\n",
+ "print '%s %.2f' %(\"The voltage gain of the FET =\",Av)#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain of the FET = -4.45\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter08.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter08.ipynb new file mode 100755 index 00000000..7ccf524b --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter08.ipynb @@ -0,0 +1,393 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5a78eb3c7cc2f82cd21ccad707b4376bdb45f22452d4892c16308b1bdd58f45f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter08:Multistage Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Express the gain in decibel\n",
+ "#given\n",
+ "#Powere gain of 1000\n",
+ "import math\n",
+ "Pg1=1000.;\n",
+ "Pgd1=10.*math.log10(Pg1);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd1,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1000\n",
+ "Vg1=1000.;\n",
+ "Vgd1=20.*math.log10(Vg1);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd1,\"dB\\n\");\n",
+ "\n",
+ "#Powere gain of 1/100\n",
+ "Pg2=1./100.;\n",
+ "Pgd2=10.*math.log10(Pg2);\n",
+ "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd2,\"dB\\n\");\n",
+ "\n",
+ "#Voltage gain of 1/100\n",
+ "Vg2=1./100.;\n",
+ "Vgd2=20.*math.log10(Vg2);\n",
+ "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd2,\"dB\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power gain (in dB)= 30 dB\n",
+ "\n",
+ "Voltage gain (in dB)= 60 dB\n",
+ "\n",
+ "Power gain (in dB)= -20 dB\n",
+ "\n",
+ "Voltage gain (in dB)= -40 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine power and voltage gain\n",
+ "#given\n",
+ "#For Gain = 10 dB\n",
+ "G=10.;#dB\n",
+ "Pg1=10.**(G/10.); #taking antilog\n",
+ "Vg1=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.f %s' %(\"Power gain ratio =\",Pg1,\"\\n\");\n",
+ "print '%s %.2f %s' %(\"Voltage gain ratio =\",Vg1,\"\\n\");\n",
+ "\n",
+ "#For Gain 3 dB\n",
+ "G=3.;#dB\n",
+ "Pg2=10.**(G/10.); #taking antilog\n",
+ "Vg2=10.**(G/20.); #taking antilog\n",
+ "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
+ "print '%s %.2f %s' %(\"Power gain ratio =\",Pg2,\"\\n\");\n",
+ "print '%s %.3f %s' %(\"Voltage gain ratio =\",Vg2,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Gain 10 dB\n",
+ "\n",
+ "Power gain ratio = 10 \n",
+ "\n",
+ "Voltage gain ratio = 3.16 \n",
+ "\n",
+ "For Gain 3 dB\n",
+ "\n",
+ "Power gain ratio = 2.00 \n",
+ "\n",
+ "Voltage gain ratio = 1.413 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the overall voltage gain\n",
+ "#given\n",
+ "import math\n",
+ "A1=80.\n",
+ "A2=50.\n",
+ "A3=30.\n",
+ "Ad=20.*math.log10(A1)+20.*math.log10(A2)+20.*math.log10(A3);\n",
+ "\n",
+ "#Alternatively\n",
+ "A=A1*A2*A3;\n",
+ "Ad=20.*math.log10(A);\n",
+ "print '%s %.2f %s' %(\"The Voltage gain is =\",Ad,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Voltage gain is = 101.58 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate quiescent output voltage and small signal voltage gain\n",
+ "#given\n",
+ "#At input Voltage =3V\n",
+ "Vi1=3.##V #input voltage\n",
+ "Vbe=0.7##V\n",
+ "B=250.#\n",
+ "Vcc=10.##V #Supply\n",
+ "Re1=1.*10.**3.##ohm\n",
+ "Rc1=3.*10.**3.##ohm\n",
+ "Re2=2.*10.**3.##ohm\n",
+ "Rc2=4.*10.**3.##ohm\n",
+ "Vb1=Vi1# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo1=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage(At input Voltage = 3V) is =\",Vo1,\"V\\n\")#\n",
+ "\n",
+ "#At input Voltage =3.2 V\n",
+ "Vi2=3.2##V #input voltage\n",
+ "Vb1=Vi2# #Voltage at the base of transistor T1\n",
+ "Ve1=Vb1-Vbe# #Voltage at the emitter of transistor T1\n",
+ "Ie1=Ve1/Re1#\n",
+ "Ic1=Ie1#\n",
+ "Vc1=Vcc-Ic1*Rc1#\n",
+ "Vb2=Vc1#\n",
+ "Ve2=Vb2-Vbe#\n",
+ "Ie2=Ve2/Re2#\n",
+ "Ic2=Ie2#\n",
+ "Vo2=Vcc-Ic2*Rc2#\n",
+ "print '%s %.1f %s' %(\"The quiescent output voltage (At input Voltage =3.2 V) is =\",Vo2,\"V\\n\")#\n",
+ "\n",
+ "#Small Signal input and output voltage\n",
+ "vi=Vi2-Vi1#\n",
+ "vo=Vo2-Vo1#\n",
+ "Av=vo/vi#\n",
+ "print '%s %.f' %(\"The small signal voltage gain is =\",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The quiescent output voltage(At input Voltage = 3V) is = 5.2 V\n",
+ "\n",
+ "The quiescent output voltage (At input Voltage =3.2 V) is = 6.4 V\n",
+ "\n",
+ "The small signal voltage gain is = 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the maximum voltage gain and bandwidth of multistage amplifier\n",
+ "#FUNCTIONS\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "rin=10.*10.**6.;#ohm #input resistance of JFET\n",
+ "Rd=10.*10.**3.;#ohm\n",
+ "Rs=500.;#ohm\n",
+ "Rg=470.*10.**3.;#ohm\n",
+ "Rl=470.*10.**3.;#ohm\n",
+ "Cc=0.01*10.**-6.;#Farad\n",
+ "Csh=100.*10.**-12.;#Farad\n",
+ "Cs=50.*10.**-6.;#Farad\n",
+ "rd=100.*10.**3.;#ohm\n",
+ "gm=2.*10.**-3.;#S\n",
+ "Rac2=prll(Rd,Rl);\n",
+ "Rac1=prll(Rd,Rg);\n",
+ "Req=prll(rd,prll(Rd,Rl));\n",
+ "Am=math.ceil(gm*Req);\n",
+ "Am2=Am*Am; #Voltage gain of two stage amplifier\n",
+ "print '%s %.f %s' %(\"Voltage gain of two stage amplifier=\",Am2,\"\\n\");\n",
+ "R_=prll(rd,Rd)+prll(Rg,rin);\n",
+ "f1=1./(2.*math.pi*Cc*R_); #lower cutoff frequency\n",
+ "f1_=f1/(math.sqrt(math.sqrt(2.)-1.));\n",
+ "f2=1./(2.*math.pi*Csh*Req); #upper cutoff frequency\n",
+ "f2_=f2*(math.sqrt(math.sqrt(2.)-1.));\n",
+ "BW=f2_-f1_;\n",
+ "print '%s %.f %s' %(\"Bandwidth=\",BW/1000.,\"kHz\\n\");\n",
+ "#There is a slight error in f1 due to use of R'(here R_)=479 kohm and in f2 due to approaximation of Req there is a slight variation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain of two stage amplifier= 324 \n",
+ "\n",
+ "Bandwidth= 115 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the midband voltage gain and bandwidth of cascade amplifier\n",
+ "#given\n",
+ "import math\n",
+ "Am=8.##midband voltage gain of individual MOSFET\n",
+ "BW=500.*10.**3.#Hz\n",
+ "f2=BW#\n",
+ "n=4.#\n",
+ "A2m=Am**n#\n",
+ "f2_=f2*(math.sqrt((2.**(1./n))-1.))#\n",
+ "print '%s %.f %s' %(\"Midband voltage gain =\",A2m,\"\\n\")#\n",
+ "print '%s %.1f %s' %(\"Overall Bandwidth =\",f2_/1000,\"kHz\")#\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Midband voltage gain = 4096 \n",
+ "\n",
+ "Overall Bandwidth = 217.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the input and output impedance and voltage gain\n",
+ "#FUNCTIONS\n",
+ "\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "\n",
+ "import math\n",
+ "hie=1.1*10.**3.;#ohm=rin\n",
+ "hfe=120.;#=B\n",
+ "#the values of Rac2, Zi, Zo are as per diagram\n",
+ "Rac2=prll(3.3*10**3,2.2*10**3);\n",
+ "Rac1=prll(6.8*10**3,prll(56*10**3,prll(5.6*10**3,1.1*10**3)));\n",
+ "Zi=prll(5.6*10**3,prll(56*10**3,1.1*10**3));\n",
+ "Zo=prll(3.3*10**3,2.2*10**3);\n",
+ "print '%s %.3f %s %s %.2f %s' %(\"Input Resistance =\",Zi/1000,\"kohm\\n\",\"\\nOutput Resistance =\",Zo/1000,\"kohm\");\n",
+ "Am2=-hfe*Rac2/(hie);\n",
+ "Am1=-hfe*Rac1/(hie);\n",
+ "Am=Am1*Am2;\n",
+ "Am=20.*math.log10(Am);\n",
+ "print '%s %.2f %s' %(\"\\nThe Overall Voltage gain is\",Am,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input Resistance = 0.905 kohm\n",
+ " \n",
+ "Output Resistance = 1.32 kohm\n",
+ "\n",
+ "The Overall Voltage gain is 81.97 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter09.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter09.ipynb new file mode 100755 index 00000000..1d9f850d --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter09.ipynb @@ -0,0 +1,311 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:8ef26de80c6669dcd55ce081279263a5231dd84d81c7a5c7530a5f89da39e8f3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter09:Power Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the turns ratio of the transformer\n",
+ "#given\n",
+ "import math\n",
+ "Rl=8.;#ohm\n",
+ "Rl_=5.*10.**3.;#ohm\n",
+ "TR=math.sqrt(Rl_/Rl); #Turns ratio\n",
+ "print '%s %.f %s' %(\"Turns Ratio =\",TR,\": 1\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Turns Ratio = 25 : 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the output impedance of the transistor\n",
+ "#given\n",
+ "TR=16./1.; #turn ratio\n",
+ "Rl=4.;#ohm #loudspeaker impedance\n",
+ "ro=(TR**2.)*Rl;\n",
+ "print '%s %.f %s' %(\"The output impedance of the transistor =\",ro,\"ohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output impedance of the transistor = 1024 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Determine the efficiency of a single ended transformer\n",
+ "#given\n",
+ "Vceq=10.;#V #supply voltage\n",
+ "\n",
+ "#At Vp=10V\n",
+ "Vp=10.;#V\n",
+ "Vce_max1=Vceq+Vp;\n",
+ "Vce_min1=Vceq-Vp;\n",
+ "n1=50.*((Vce_max1-Vce_min1)/(Vce_max1+Vce_min1))**2.;\n",
+ "print '%s %.f %s' %(\"Efficiency (At Vp = 10V)=\",n1,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=5V\n",
+ "Vp=5.;#V\n",
+ "Vce_max2=Vceq+Vp;\n",
+ "Vce_min2=Vceq-Vp;\n",
+ "n2=50.*((Vce_max2-Vce_min2)/(Vce_max2+Vce_min2))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 5V)=\",n2,\"percent\\n\");\n",
+ "\n",
+ "#At Vp=1V\n",
+ "Vp=1.;#V\n",
+ "Vce_max3=Vceq+Vp;\n",
+ "Vce_min3=Vceq-Vp;\n",
+ "n3=50.*((Vce_max3-Vce_min3)/(Vce_max3+Vce_min3))**2.;\n",
+ "print '%s %.1f %s' %(\"Efficiency (At Vp = 1V)=\",n3,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiency (At Vp = 10V)= 50 percent\n",
+ "\n",
+ "Efficiency (At Vp = 5V)= 12.5 percent\n",
+ "\n",
+ "Efficiency (At Vp = 1V)= 0.5 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine input and output power and efficiency\n",
+ "#given\n",
+ "import math\n",
+ "Vcc=20.;#V#supply voltage\n",
+ "Rl=4.;#ohm\n",
+ "Vp=15.;#V\n",
+ "Ip=Vp/Rl;\n",
+ "Idc=Ip/math.pi;\n",
+ "Pi=Vcc*Idc;\n",
+ "Po=((Vp/2.)**2.)/Rl;\n",
+ "n=100.*Po/Pi;\n",
+ "print '%s %.1f %s' %(\"Input power =\",Pi,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Output power =\",Po,\"W\\n\");\n",
+ "print '%s %.2f %s' %(\"Efficiency =\",n,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input power = 23.9 W\n",
+ "\n",
+ "Output power = 14.06 W\n",
+ "\n",
+ "Efficiency = 58.90 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage increase in output power\n",
+ "#given\n",
+ "D=0.2;#harmonic distortion\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power=\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage increase in output power= 4 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n",
+ "#Calculate harmonic distortion and percentage increase in output voltage due to this\n",
+ "#given\n",
+ "import math\n",
+ "I1=60.;#A\n",
+ "I2=6.;#A\n",
+ "I3=1.2;#A\n",
+ "I4=0.6;#A\n",
+ "D2=I2/I1;\n",
+ "D3=I3/I1;\n",
+ "D4=I4/I1;\n",
+ "print '%s %.f %s %s %.f %s %s %.f %s' %(\"The Harmonic distortion of each component \\nD2=\",D2*100,\"percent\\n\",\"\\nD3=\",D3*100,\"percent\\n\",\"\\nD4=\",D4*100,\"percent\\n\");\n",
+ "D=math.sqrt((D2)**2.+(D3)**2.+(D4)**2.);\n",
+ "print '%s %.f %s' %(\"The Total Harmonic distortion =\",D*100,\"percent\\n\");\n",
+ "P=(1.+D**2.);#Total power increase\n",
+ "#percent increase= (Pi*(1+D**2)-Pi)*100/Pi;\n",
+ "#taking out and cancelling Pi\n",
+ "PI=(P-1.)*100.;\n",
+ "print '%s %.f %s' %(\"The percentage increase in output power =\",PI,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "The percentage increase in output power = 1 percent\n",
+ "The Harmonic distortion of each component \n",
+ "D2= 10 percent\n",
+ " \n",
+ "D3= 2 percent\n",
+ " \n",
+ "D4= 1 percent\n",
+ "\n",
+ "The Total Harmonic distortion = 10 percent\n",
+ "\n",
+ "The percentage increase in output power = 1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter10.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter10.ipynb new file mode 100755 index 00000000..eade58c0 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter10.ipynb @@ -0,0 +1,379 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:350cd45bd4706ef780ba3db9c23f80c7425e6c49ca99aabcbf016879dc8eee58"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter10:Feedback in Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier\n",
+ "#given\n",
+ "A=100.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 9.09 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the gain of feedback amplifier in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=60.;#dB #internal gain in dB\n",
+ "A=10.**(Ad/20.); #internal gain\n",
+ "B=1./20.;#feedback factor\n",
+ "Af=A/(1.+A*B);\n",
+ "Afd=20.*math.log10(Af);\n",
+ "print '%s %.2f %s' %(\"The gain of feedback amplifier =\",Afd,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain of feedback amplifier = 25.85 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of output fed back to input\n",
+ "#given\n",
+ "A=600.;#internal gain\n",
+ "Af=50.;#gain of feedback amplifier\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.3f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of output fed back to input = 1.833 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the internal gain and percentage of output fed back to input\n",
+ "#given\n",
+ "Af=80.;#gain of feedback amplifier\n",
+ "Vi=0.05;#V#input with feedback\n",
+ "Vi_=4.*10.**-3.;#V#input without feedback\n",
+ "Vo_=Af*Vi;\n",
+ "A=Vo_/Vi_;\n",
+ "print '%s %.f %s' %(\"The internal gain is =\",A,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.2f %s' %(\"The percentage of output fed back to input =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The internal gain is = 1000 \n",
+ "\n",
+ "The percentage of output fed back to input = 1.15 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain with and without feedback and feedback factor\n",
+ "#given\n",
+ "Vo_=5.;#V #output voltage\n",
+ "Vi=0.2;#V #input with feedback\n",
+ "Vi_=0.05;#V #input without feedback\n",
+ "A=Vo_/Vi_;\n",
+ "Af=Vo_/Vi;\n",
+ "print '%s %.f %s' %(\"The gain without feedback is =\",A,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The gain with feedback is =\",Af,\"\\n\");\n",
+ "B=(A/Af-1.)/A;\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain without feedback is = 100 \n",
+ "\n",
+ "The gain with feedback is = 25 \n",
+ "\n",
+ "The feedback factor = 3 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the gain of feedback amplifier and feedback factor\n",
+ "#given\n",
+ "A=100.; #internal gain\n",
+ "N=20.;#dB #negative feedback\n",
+ "B=(10.**(-N/(-20.))-1.)/A; #taking antilog\n",
+ "Af=A/(1.+A*B);\n",
+ "print '%s %.f %s' %(\"The feedback factor =\",B*100,\"percent\\n\");\n",
+ "print '%s %.f %s' %(\"The gain of the feedback amplifier is =\",Af,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The feedback factor = 9 percent\n",
+ "\n",
+ "The gain of the feedback amplifier is = 10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "A=1000.;#internal gain\n",
+ "N=40.;#dB#negative feedback\n",
+ "D=10.**((-N)/-20.);#D=(1+AB)desensitivity\n",
+ "dA_A=10.;#percent#dA/A\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.1f %s' %(\"The percentage change in the overall gain =\",dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain = 0.1 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate percentage change in the overall gain\n",
+ "#given\n",
+ "Adb=60.;#dB#internal gain in dB\n",
+ "B=0.005;#feedback factor\n",
+ "A=10.**(Adb/(20.));#taking antilog\n",
+ "dA_A=-12.;#percent #dA/A\n",
+ "D=(1.+A*B);#D=(1+AB)desensitivity\n",
+ "dAf_Af=dA_A/D;#dAf/Af\n",
+ "print '%s %.f %s' %(\"The percentage change in the overall gain reduces by =\",-dAf_Af,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage change in the overall gain reduces by = 2 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the input resistance of feedback amplifier\n",
+ "#given\n",
+ "A=250.;#internal gain\n",
+ "B=0.1;#feedback factor\n",
+ "Ri=1.1*10.**3.;#ohm #input resistance\n",
+ "Rif=Ri*(1.+A*B);\n",
+ "print '%s %.1f %s' %(\"The input resistance of feedback amplifier =\",Rif/1000,\"kohm\");\n",
+ "\n",
+ "#The ans in book is incorrect due to use of (2+A*B) instead of (1+A*B) the ans in book is 29.7 kohm\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The input resistance of feedback amplifier = 28.6 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the percentage of negative feedback to input\n",
+ "#given\n",
+ "Adb=60.;#dB #internal gain in dB\n",
+ "A=10.**(Adb/(20.)); #taking antilog\n",
+ "Ro=12.*10.**3.;#ohm #output resistance\n",
+ "Rof=600.;#ohm\n",
+ "B=(Ro/Rof-1.)/A;\n",
+ "print '%s %.1f %s' %(\"The percentage of negative feedback to input =\",B*100,\"percent\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The percentage of negative feedback to input = 1.9 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter11.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter11.ipynb new file mode 100755 index 00000000..1e3dc387 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter11.ipynb @@ -0,0 +1,186 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:9a7fe549367b746663f0b647c4096703a98ac7fb9574e6f135fdada17ce95d67"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter11:Tuned Volatge Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current and voltage across each element at resonance\n",
+ "#given\n",
+ "import math\n",
+ "R=12.;#ohm\n",
+ "L=200.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "Vs=9.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Z=R;#impedance\n",
+ "print '%s %.1f %s' %(\"The Resonant frequency =\",fo/1000,\"kHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Z,\"ohm\\n\");\n",
+ "\n",
+ "Io=Vs/R;\n",
+ "print '%s %.2f %s' %(\"The Source current =\",Io,\"A\\n\");\n",
+ "\n",
+ "Vl=Io*(2.*math.pi*fo*L);\n",
+ "Vc=Io/(2.*math.pi*fo*C);\n",
+ "Vr=Io*R;\n",
+ "print '%s %.1f %s' %(\"The voltage across the inductor =\",Vl,\"V\\n\");\n",
+ "print '%s %.1f %s' %(\"The voltage across the capacitor =\",Vc,\"V\\n\");\n",
+ "print '%s %.f %s' %(\"The voltage across the resistor =\",Vr,\"V\\n\");\n",
+ "#There is a slight variation in voltage across capacitor due to the approaximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 649.7 kHz\n",
+ "\n",
+ "The impedance Z = 12 ohm\n",
+ "\n",
+ "The Source current = 0.75 A\n",
+ "\n",
+ "The voltage across the inductor = 612.4 V\n",
+ "\n",
+ "The voltage across the capacitor = 612.4 V\n",
+ "\n",
+ "The voltage across the resistor = 9 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency and impedance and current at resonance and current in coil and capacitor\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=100.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "Vs=10.;#V\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.3f %s' %(\"The Resonant frequency =\",fo/10**6,\"MHz\\n\");\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Io=Vs/Zp;\n",
+ "print '%s %.f %s' %(\"The Source current =\",Io*10**6,\"uA\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Xc=1./(2.*math.pi*fo*C);\n",
+ "Z1=math.sqrt(Xl**2.+R**2.);\n",
+ "Z2=Xc;\n",
+ "Ic=Vs/Z2;\n",
+ "Il=Ic;\n",
+ "print '%s %.f %s' %(\"The current in the coil =\",1000,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"The current in the capacitor =\",Ic*1000,\"mA\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Resonant frequency = 1.592 MHz\n",
+ "\n",
+ "The impedance Z = 100 kohm\n",
+ "\n",
+ "The Source current = 100 uA\n",
+ "\n",
+ "The current in the coil = 1000 ohm\n",
+ "\n",
+ "The current in the capacitor = 10 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate impedance and quality factor and bandwidth\n",
+ "#given\n",
+ "import math\n",
+ "R=10.;#ohm\n",
+ "L=150.*10.**-6.;#H\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1/(2.*math.pi*math.sqrt(L*C));\n",
+ "Zp=L/(C*R); #impedance\n",
+ "print '%s %.f %s' %(\"The impedance Z =\",Zp/1000,\"kohm\\n\");\n",
+ "\n",
+ "Xl=(2.*math.pi*fo*L);\n",
+ "Q=Xl/R;\n",
+ "BW=fo/Q;\n",
+ "print '%s %.1f %s' %(\"The Quality factor of the circuit =\",Q,\"\\n\");\n",
+ "print '%s %.1f %s' %(\"The Band width of the circuit =\",BW/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The impedance Z = 150 kohm\n",
+ "\n",
+ "The Quality factor of the circuit = 122.5 \n",
+ "\n",
+ "The Band width of the circuit = 10.6 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter12.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter12.ipynb new file mode 100755 index 00000000..30b79553 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter12.ipynb @@ -0,0 +1,232 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:ea4ffd68aac20fcc9a7413fc9ab8e0a2e574e16a66c6b5413621ddd0c8d4148d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter12:Sinusoidal Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "L=55.*10.**-6.;#H\n",
+ "C=300.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.f %s' %(\"The frequency of oscillations =\",fo/1000,\"kHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1239 kHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 425"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations and feedback factor and voltage gain\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "C1=0.001*10.**-6.;#F\n",
+ "C2=0.01*10.**-6.;#F\n",
+ "L=15.*10.**-6.;#H\n",
+ "C=prll(C1,C2);\n",
+ "fo=1./(2.*math.pi*math.sqrt(L*C));\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/10**6,\"MHz\\n\");\n",
+ "B=C1/C2;\n",
+ "Amin=1./B;\n",
+ "print '%s %.1f %s' %(\"The feedback factor of the circuit =\",B,\"\\n\");\n",
+ "print '%s %.f' %(\"The circuit needs a minimum voltage gain of\",Amin);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 1.36 MHz\n",
+ "\n",
+ "The feedback factor of the circuit = 0.1 \n",
+ "\n",
+ "The circuit needs a minimum voltage gain of 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=10.*10.**3.;#ohm\n",
+ "C=0.01*10.**-6.;#F\n",
+ "fo=1./(2.*math.pi*R*C*math.sqrt(6.));\n",
+ "print '%s %.1f %s' %(\"The frequency of oscillations =\",fo,\"Hz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 649.7 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate frequency of oscillations\n",
+ "#given\n",
+ "import math\n",
+ "R=22.*10.**3.;#ohm\n",
+ "C=100.*10.**-12.;#F\n",
+ "fo=1./(2.*math.pi*R*C);\n",
+ "print '%s %.2f %s' %(\"The frequency of oscillations =\",fo/1000,\"KHz\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The frequency of oscillations = 72.34 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n",
+ "#Determine the series and parallel resonant frequencies\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "import math\n",
+ "L=3.;#H\n",
+ "Cm=10.*10.**-12.;#F\n",
+ "Cs=0.05*10.**-12.;#F\n",
+ "fs=1./(2.*math.pi*math.sqrt(L*Cs));\n",
+ "print '%s %.f %s' %(\"The series resonant frequency =\",fs/1000,\"kHz\\n\");\n",
+ "\n",
+ "Cp=prll(Cm,Cs);\n",
+ "fp=1./(2.*math.pi*math.sqrt(L*Cp));\n",
+ "print '%s %.f %s' %(\"The parallel resonant frequency =\",fp/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n",
+ "The series resonant frequency = 411 kHz\n",
+ "\n",
+ "The parallel resonant frequency = 412 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter14.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter14.ipynb new file mode 100755 index 00000000..673776d8 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter14.ipynb @@ -0,0 +1,211 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7c251177630c670baed25ee0afd361e04e5bd22335ff25a75110b7cde3268100"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter14:Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate voltage gain and input and output resistance\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "Acl=-Rf/R1;\n",
+ "Ricl=R1;\n",
+ "Ro=0;\n",
+ "print '%s %.f %s' %(\"The voltage gain =\",Acl,\"\\n\");\n",
+ "print '%s %.f %s' %(\"The input resistance =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"The output resistance =\",Ro,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -100 \n",
+ "\n",
+ "The input resistance = 20 kohm\n",
+ "\n",
+ "The output resistance = 0 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Find the output voltage\n",
+ "#given\n",
+ "R1=20.*10.**3.;#ohm\n",
+ "Rf=2000.*10.**3.;#ohm\n",
+ "v1=4.;#V\n",
+ "v2=3.8;#V\n",
+ "vo=v2*(1.+Rf/R1)-(Rf/R1)*v1;\n",
+ "print '%s %.1f %s' %(\"The output voltage =\",vo,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -16.2 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 475"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Design an adder circuit using an op amp\n",
+ "#given\n",
+ "#Vo=-(V1+10*V2+100*V3)\n",
+ "Rf=100.*10.**3.;#ohm\n",
+ "C1=1.;#coefficient of V1\n",
+ "C2=10.;#coefficient of V2\n",
+ "C3=100.;#coefficient of V3\n",
+ "R1=Rf/C1;\n",
+ "R2=Rf/C2;\n",
+ "R3=Rf/C3;\n",
+ "print '%s %.f %s' %(\"R1 =\",R1/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R2 =\",R2/1000,\"kohm\\n\");\n",
+ "print '%s %.f %s' %(\"R3 =\",R3/1000,\"kohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 kohm\n",
+ "\n",
+ "R2 = 10 kohm\n",
+ "\n",
+ "R3 = 1 kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate CMRR in dB\n",
+ "#given\n",
+ "import math\n",
+ "Ad=100.;#differential mode gain\n",
+ "Ac=0.01;#common mode gain\n",
+ "CMRR=20.*math.log10(Ad/Ac);\n",
+ "print '%s %.f %s' %(\"The CMRR in dB =\",CMRR,\"dB\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The CMRR in dB = 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 484"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate the output voltage\n",
+ "#given\n",
+ "Ad=2000.;#differential mode gain\n",
+ "CMRR=10000.;\n",
+ "V1=10.**-3.;#V\n",
+ "V2=0.9*10.**-3.;#V\n",
+ "Vd=V1-V2;\n",
+ "Vc=(V1+V2)/2.;\n",
+ "Vo=Ad*Vd*(1.+Vc/(CMRR*Vd));\n",
+ "print '%s %.2f %s' %(\"The output voltage is =\",Vo*1000,\"mV\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage is = 200.19 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter15.ipynb b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter15.ipynb new file mode 100755 index 00000000..cd977045 --- /dev/null +++ b/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter15.ipynb @@ -0,0 +1,321 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:246707d96e3b84083bd218a775428cfb0782bf8a60e397f9fdb6240bd50142c9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "chapter15:Electronic Instruments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance and multiplying factor\n",
+ "#given\n",
+ "Im=5.*10.**-3.;#A\n",
+ "Rm=20.;#ohm\n",
+ "I=5.;#A\n",
+ "Rsh=Rm*Im/(I-Im);\n",
+ "n=I/Im;\n",
+ "print '%s %.5f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "print '%s %.f %s' %(\"Multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 0.02002 ohm\n",
+ "\n",
+ "Multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 512"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate shunt resistance\n",
+ "#given\n",
+ "#At I= 1 mA\n",
+ "I1=1.*10.**-3.;#A\n",
+ "Im=0.1*10.**-3.;#A\n",
+ "Rm=500.;#ohm\n",
+ "Rsh=Rm*Im/(I1-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I2=10.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I2-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n",
+ "\n",
+ "\n",
+ "#At I= 1 mA\n",
+ "I3=100.*10.**-3.;#A\n",
+ "Rsh=Rm*Im/(I3-Im);\n",
+ "print '%s %.4f %s' %(\"Shunt resistance =\",Rsh,\"ohm\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Shunt resistance = 55.5556 ohm\n",
+ "\n",
+ "Shunt resistance = 5.0505 ohm\n",
+ "\n",
+ "Shunt resistance = 0.5005 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 514"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Caluclate the series resistance to convert it into voltmeter\n",
+ "#given\n",
+ "Im=100.*10.**-6.;#A\n",
+ "Rm=100.;#ohm\n",
+ "V=100.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.1f %s' %(\"The value of series resistance is\",Rs/1000,\"kohm\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of series resistance is 999.9 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate multiplier resistance and voltage multiplying factor\n",
+ "#given\n",
+ "Im=50.*10.**-6.;#A\n",
+ "Rm=1000.;#ohm\n",
+ "V=50.;#V\n",
+ "Rs=V/Im-Rm;\n",
+ "print '%s %.f %s' %(\"The value of multiplier resistance is\",Rs/1000,\"kohm\\n\");\n",
+ "Vm=Im*Rm;\n",
+ "n=V/Vm;\n",
+ "print '%s %.f %s' %(\"Voltage multiplying factor =\",n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of multiplier resistance is 999 kohm\n",
+ "\n",
+ "Voltage multiplying factor = 1000 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E5 - Pg 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Calculate reading and error of each voltmeter\n",
+ "#given\n",
+ "def prll(r1,r2):\n",
+ "\tz=r1*r2/(r1+r2)#\n",
+ "\treturn z\n",
+ "S_A=1000.;# ohm/V#sensitivity\n",
+ "S_B=20000.;# ohm/V#sensitivity\n",
+ "R=50.;#V#range of voltmeter\n",
+ "Vs=150.;#V#Supply\n",
+ "R1=100.*10.**3.;#ohm\n",
+ "R2=50.*10.**3.;#ohm\n",
+ "Vt=Vs*(R2/(R1+R2));\n",
+ "\n",
+ "#Voltmeter A\n",
+ "Ri1=S_A*R;\n",
+ "Rxy_A=prll(Ri1,R2); #total resistance at X and Y\n",
+ "V1=Vs*(Rxy_A/(Rxy_A+R1));\n",
+ "print '%s %.f %s' %(\"The voltmeter indicates\",V1,\"V\\n\");\n",
+ "\n",
+ "#Voltmeter B\n",
+ "Ri2=S_B*R;\n",
+ "Rxy_B=prll(Ri2,R2); #total resistance at X and Y\n",
+ "V2=Vs*(Rxy_B/(Rxy_B+R1));\n",
+ "print '%s %.2f %s' %(\"The voltmeter indicates\",V2,\"V\\n\");\n",
+ "\n",
+ "e1=(Vt-V1)*100./Vt;\n",
+ "e2=(Vt-V2)*100./Vt;\n",
+ "print '%s %.f %s' %(\"The error in the reading of voltmeter A =\",e1,\"percent\\n\");\n",
+ "print '%s %.2f %s' %(\"The error in the reading of voltmeter A =\",e2,\"percent\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltmeter indicates 30 V\n",
+ "\n",
+ "The voltmeter indicates 48.39 V\n",
+ "\n",
+ "The error in the reading of voltmeter A = 40 percent\n",
+ "\n",
+ "The error in the reading of voltmeter A = 3.23 percent\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E6 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value of the ac voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=8.3;#cm#length of the trace\n",
+ "D=5.;# V/cm#deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/(2.*math.sqrt(2.));\n",
+ "print '%s %.1f %s' %(\"The rms value of the ac voltage\",Vrms,\"V\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the ac voltage 14.7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Determine rms value and frequency of the sine voltage\n",
+ "#given\n",
+ "import math\n",
+ "l=3.5;#cm #length of the trace\n",
+ "D=2.;# V/cm #deflection sensitivity\n",
+ "Vpp=l*D;\n",
+ "Vrms=Vpp/math.sqrt(2.);\n",
+ "print '%s %.2f %s' %(\"The rms value of the sine voltage =\",Vrms,\"V\\n\");\n",
+ "x=4.;#cm #one cycle length on x axis\n",
+ "t=0.5*10.**-3.;# s/cm #timebase setting\n",
+ "T=x*t;\n",
+ "f=1./T;\n",
+ "print '%s %.1f %s' %(\"The frequency of the sine voltage =\",f/1000,\"kHz\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rms value of the sine voltage = 4.95 V\n",
+ "\n",
+ "The frequency of the sine voltage = 0.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |