diff options
author | Trupti Kini | 2016-01-18 23:30:16 +0600 |
---|---|---|
committer | Trupti Kini | 2016-01-18 23:30:16 +0600 |
commit | 6763b086d1b1db7a34e1746f589d4fadcb50bf00 (patch) | |
tree | a81468f04719d918b341703340197d867de3f33e /sample_notebooks | |
parent | 2ec8fc25ee45e790f91f2dc0fb342712cc3de4b7 (diff) | |
download | Python-Textbook-Companions-6763b086d1b1db7a34e1746f589d4fadcb50bf00.tar.gz Python-Textbook-Companions-6763b086d1b1db7a34e1746f589d4fadcb50bf00.tar.bz2 Python-Textbook-Companions-6763b086d1b1db7a34e1746f589d4fadcb50bf00.zip |
Added(A)/Deleted(D) following books
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER01.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER02.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER03.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER04.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER07.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER09.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER11.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER15.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER16.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER18.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER19.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER20.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER23.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/CHAPTER24.ipynb
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/screenshots/Capture02.png
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/screenshots/Capture04.png
A Electrical_Engineering_Fundamentals_by__Del_Toro_Vincent_/screenshots/Capture20.png
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/Chapter9_4.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter1_4.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter2_4.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter3_4.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter4_4.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter6_4.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter7_4.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter8_4.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter_5_4.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/Ex1.2_1.png
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/Ex3.7_1.png
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/Ex6.7_1.png
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter02_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter03_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter04_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter05_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter06_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter07_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter08_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter09_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter10_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/Chapter11_1.ipynb
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/screenshots/Capture02_1.png
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/screenshots/Capture04_1.png
A Solid_State_Devices_and_Circuits___by_V._Chaudhary_and_H._K._Maity/screenshots/Capture10_1.png
A "sample_notebooks/AjayKumar Verma/Chapter02.ipynb"
A sample_notebooks/Haseen/Ch2.ipynb
A sample_notebooks/karansingh/Ch4.ipynb
Diffstat (limited to 'sample_notebooks')
-rw-r--r-- | sample_notebooks/AjayKumar Verma/Chapter02.ipynb | 265 | ||||
-rw-r--r-- | sample_notebooks/Haseen/Ch2.ipynb | 452 | ||||
-rw-r--r-- | sample_notebooks/karansingh/Ch4.ipynb | 397 |
3 files changed, 1114 insertions, 0 deletions
diff --git a/sample_notebooks/AjayKumar Verma/Chapter02.ipynb b/sample_notebooks/AjayKumar Verma/Chapter02.ipynb new file mode 100644 index 00000000..d4d9f66e --- /dev/null +++ b/sample_notebooks/AjayKumar Verma/Chapter02.ipynb @@ -0,0 +1,265 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:dbdab30ceee2e893077ec98e42cc102488d52b9f8506602ce6aaa24ef3e22c61" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter02 : Op-amp Fundamentals" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.2 : page 79" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division \n", + "#given data\n", + "Iio=20 #in nA\n", + "IB=100 #in nA\n", + "# Eqn(1) : Iio=IB1-IB2=20\n", + "#Eqn(2) : 2*IB=IB1+IB2=200\n", + "IB1=(200+20)/2 #in nA\n", + "print \"IB1 = %0.f nA\"%IB1\n", + "IB2=IB1-Iio #in nA\n", + "print \"IB2 = %0.f nA\"%IB2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "IB1 = 110 nA\n", + "IB2 = 90 nA\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.3 : page 82" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#given data\n", + "G=120 #unitless\n", + "To=20 #in degree centigrade\n", + "T=50 #in degree centigrade\n", + "Dvoff=0.13 #in mV/degree centigrade\n", + "#input change\n", + "dVin=Dvoff*(T-To) #in mVolt\n", + "#output change\n", + "Vo=G*dVin #in mVolt\n", + "print \"Output voltage = %0.f mV\" %Vo" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Output voltage = 468 mV\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.4 : page 83" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#given data\n", + "dt=5 #in uSec\n", + "Vp=5 #in Volt\n", + "dV=(0.9-0.1)*Vp\n", + "SR=dV/dt #in V/uSec\n", + "print \"Calculated SR = %0.2f V/uSec\"%SR" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Calculated SR = 0.80 V/uSec\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.5 : page 83" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#given data\n", + "Vo=10 #in Volt\n", + "SR=1 #in V/uSec\n", + "dV=(0.9-0.1)*Vo\n", + "dt=dV/SR #in uSec\n", + "print \"Rise time = %0.f uSec\"%dt" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rise time = 8 uSec\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.6 : page 84" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#given data\n", + "V1=-5 #in Volt\n", + "V2=5 #in Volt\n", + "SR=0.5 #in V/uSec\n", + "dV=V2-V1 # in Volt\n", + "dt=dV/SR #in uSec\n", + "print \"Rise time = %0.f uSec\"%dt" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rise time = 20 uSec\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.7 : page 84" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import numpy as np\n", + "#given data\n", + "fm=50 #in kHz\n", + "SR=0.5 #in V/uSec\n", + "#formula : SR=2*pie*fm*Vm\n", + "Vm=(SR*10**6)/(2*np.pi*fm*10**3) #in Volts\n", + "print \"Maximum voltage = %0.2f Volt \"%Vm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum voltage = 1.59 Volt \n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Exa 2.8 : page 84" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import numpy as np\n", + "#given data\n", + "SR=6 #in V/uSec\n", + "#formula : SR=2*pie*fm*Vm\n", + "# part (i) Vm=1 volt\n", + "Vm=1 #in Volts\n", + "fm=((SR*10**6)/(2*np.pi*Vm))/1000 #in kHz\n", + "print \"when Vm=1 volt the limiting frequency = %0.f kHz\"%fm\n", + "# part (ii) Vm=10 volt\n", + "Vm=10 #in Volts\n", + "fm=((SR*10**6)/(2*np.pi*Vm))/1000 #in kHz\n", + "print \"when Vm=10 Volt the limiting frequency = %0.1f kHz\"%fm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "when Vm=1 volt the limiting frequency = 955 kHz\n", + "when Vm=10 Volt the limiting frequency = 95.5 kHz\n" + ] + } + ], + "prompt_number": 18 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/Haseen/Ch2.ipynb b/sample_notebooks/Haseen/Ch2.ipynb new file mode 100644 index 00000000..7ffe554f --- /dev/null +++ b/sample_notebooks/Haseen/Ch2.ipynb @@ -0,0 +1,452 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:5f773c85e1dfab84f7a94d7a8dae80fafd68f7320fe878d3eb9f67c265c3b4c6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch2 : The p-n junction diode" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1: Page 185" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "print \"Part (a)\" \n", + "# Applying Thevnin's theorem at XX', in Fig. 2.5(a)\n", + "Vth=15*20e3/(10e3+20e3) # Thevnin equivalent voltage in volts\n", + "Zth=10e3*20e3/(10e3+20e3) # Thevnin equivalent resistance in ohms\n", + "# From the figure 2.5(c)\n", + "I=Vth/(Zth+20e3) # Labelled current in amperes\n", + "Vo=I*20e3 # Labelled voltage in volts\n", + "I=I*1e3 # Labelled current in miliamperes\n", + "print \"Labelled current I = %0.2f mA\"%I \n", + "print \"Labelled voltage Vo = %0.2f V\" %Vo\n", + "\n", + "print \"Part (b)\" \n", + "# Applying Thevnin's theorem at XX' and YY', in Fig. 2.5(b)\n", + "Vth1=15*10e3/(10e3+10e3) # Thevnin equivalent voltage at XX' in volts\n", + "Zth1=10e3*10e3/(10e3+10e3) # Thevnin equivalent resistance at YY' in ohms\n", + "Vth2=5 # Thevnin equivalent voltage at YY' in volts\n", + "Zth2=5e3 # Thevnin equivalent resistance at YY' in ohms\n", + "# From the figure 2.5(d)\n", + "I=0 # Labelled current in amperes\n", + "Vo=5-7.5 # Labelled voltage in volts\n", + "print \"Labelled current I = %0.2f mA\"%I \n", + "print \"Labelled voltage Vo = %0.2f V\" %Vo " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part (a)\n", + "Labelled current I = 0.38 mA\n", + "Labelled voltage Vo = 7.50 V\n", + "Part (b)\n", + "Labelled current I = 0.00 mA\n", + "Labelled voltage Vo = -2.50 V\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.2: Page 186" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import log\n", + "ID1=1 # Let the initial diode current be 1 A\n", + "ID2=15*ID1 # Final diode current\n", + "VT=25e-3 # Voltage equivalent to temperatue at room temperature in volts\n", + "eta=1 # for Ge\n", + "deltaVD=eta*VT*log(ID2/ID1) # Change in diode voltage in volts\n", + "deltaVD=deltaVD*1e3 # Change in diode voltage in milivolts\n", + "print \"Change in diode voltage (for Ge) = %0.2f mV\"%deltaVD\n", + "eta=2 # for Si\n", + "deltaVD=eta*VT*log(ID2/ID1) # Change in diode voltage in volts\n", + "deltaVD=deltaVD*1e3 # Change in diode voltage in milivolts\n", + "print \"Change in diode voltage (for Si) = %0.3f mV\" %deltaVD" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in diode voltage (for Ge) = 67.70 mV\n", + "Change in diode voltage (for Si) = 135.403 mV\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3: Page 187" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import exp\n", + "print \"Part (a)\" \n", + "eta=1 # for Ge\n", + "T=300 # Room temperature in kelvins\n", + "VT=T/11600 # Voltage equivalent to temperatue at room temperature in volts\n", + "IS=1 # Let reverse saturation current be 1 A\n", + "I=-0.9*IS # Reverse current\n", + "V=eta*VT*log(1+(I/IS)) # Voltagei in volts\n", + "V=V*1e3 # Voltage in milivolts\n", + "print \"Voltage = %0.2f mV \" %V\n", + "\n", + "print \"Part (b)\" \n", + "V=0.05 # Voltage in volts\n", + "If_Ir=(exp(V/(eta*VT))-1)/(exp(-V/(eta*VT))-1) # Ratio of current in forward bias to that in reverse bias\n", + "print \"Ratio of current in forward bias to that in reverse bias = %0.3f\"%If_Ir \n", + "\n", + "print \"Part (c)\" \n", + "IS=10e-6 # Reverse saturation current in amperes\n", + "V=0.1 # Voltage in volts\n", + "ID=IS*(exp(V/(eta*VT))-1) # Forward current for 0.1 V in amperes\n", + "ID=ID*1e6 # Forward current for 0.1 V in micro-amperes\n", + "print \"Forward current for 0.1 V = %0.2f \u03bcA \" %ID\n", + "V=0.2 # Voltage in volts\n", + "ID=IS*(exp(V/(eta*VT))-1) # Forward current for 0.1 V in amperes\n", + "ID=ID*1e3 # Forward current for 0.1 V in miliamperes\n", + "print \"Forward current for 0.1 V = %0.2f mA\"%ID \n", + "V=0.3 # Voltage in volts\n", + "ID=IS*(exp(V/(eta*VT))-1) # Forward current for 0.1 V in amperes\n", + "print \"Forward current for 0.1 V = %0.2f A\" %ID" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part (a)\n", + "Voltage = -59.55 mV \n", + "Part (b)\n", + "Ratio of current in forward bias to that in reverse bias = -6.913\n", + "Part (c)\n", + "Forward current for 0.1 V = 467.83 \u03bcA \n", + "Forward current for 0.1 V = 22.82 mA\n", + "Forward current for 0.1 V = 1.09 A\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4 Page 187" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "IS=10e-6 # Reverse saturation current in amperes\n", + "eta=1 # for Ge\n", + "VT=25e-3 # Voltage equivalent to temperatue at room temperature in volts\n", + "\n", + "print \"Part (a)\" \n", + "VD=-24 # Reverse bias in volts\n", + "ID=IS*(exp(VD/(eta*VT))-1) # Current in amperes\n", + "ID=ID*1e6 # Current in micro-amperes\n", + "print \"Current = %0.2f \u03bcA \"%ID \n", + "\n", + "print \"Part (b)\" \n", + "VD=-0.02 # Reverse bias in volts\n", + "ID=IS*(exp(VD/(eta*VT))-1) # Current in amperes\n", + "ID=ID*1e6 # Current in micro-amperes\n", + "print \"Current = %0.2f \u03bcA \"%ID \n", + "\n", + "print \"Part (c)\" \n", + "VD=0.3 # Forward bias in volts\n", + "ID=IS*(exp(VD/(eta*VT))-1) # Current in amperes\n", + "print \"Current = %0.2f A \"%ID" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part (a)\n", + "Current = -10.00 \u03bcA \n", + "Part (b)\n", + "Current = -5.51 \u03bcA \n", + "Part (c)\n", + "Current = 1.63 A \n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5: Page 188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "T=300 # Operating temperature in kelvins\n", + "VT=T/11600 # Voltage equivalent to temperatue at room temperature in volts\n", + "ID1=1 # Let the initial diode current be 1 A\n", + "ID2=10*ID1 # Final diode current\n", + "eta=1 # for Ge\n", + "deltaVD=eta*VT*log(ID2/ID1) # Change in diode voltage in volts\n", + "deltaVD=deltaVD*1e3 # Change in diode voltage in milivolts\n", + "print \"Change in diode voltage (for Ge) = %0.2f mV \" %deltaVD\n", + "eta=2 # for Si\n", + "deltaVD=eta*VT*log(ID2/ID1) # Change in diode voltage in volts\n", + "deltaVD=deltaVD*1e3 # Change in diode voltage in milivolts\n", + "print \"Change in diode voltage (for Si) = %0.2f mV \" %deltaVD" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Change in diode voltage (for Ge) = 59.55 mV \n", + "Change in diode voltage (for Si) = 119.10 mV \n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.6: Page 188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# In the circuit given in Fig. 2.7\n", + "V=50e-3 # Output voltage\n", + "VD1=0.7 # Voltage across diode 1 in volts\n", + "I1=10e-3 # Current through diode 1 at 0.7 V in amperes\n", + "VD2=0.8 # Voltage across diode 2 in volts\n", + "I2=100e-3 # Current through diode 2 at 0.8 V in amperes\n", + "eta_VT=(VD2-VD1)/log(I2/I1) # Product of \u03b7 and VT\n", + "I=10e-3/(exp(V/eta_VT)+1) # Current through diode 1 in amperes\n", + "R=V/I \n", + "print \"R = %0.2f \u03a9 \"%R " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "R = 20.81 \u03a9 \n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.7: Page 189" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "VDD=5 # Applied voltage in volts\n", + "VD=0.7 # Diode voltage in volts\n", + "I1=1e-3 # Current in amperes at diode voltage = 0.7 V\n", + "R=1000 # R in ohms\n", + "deltaVD=0.1 # Change in diode voltage in volts for every decade change in current\n", + "ratioI=10 # Decade change in current\n", + "eta_VT=deltaVD/log(ratioI) # Product of \u03b7 and VT\n", + "ID=(VDD-VD)/R # Diode current in amperes\n", + "VD2=VD+eta_VT*log(ID/I1) # Diode voltage in volts\n", + "ID=ID*1e3 # Diode current in miliamperes\n", + "print \"Diode current = %0.2f mA\" %ID\n", + "print \"Diode voltage = %0.2f V \"%VD2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Diode current = 4.30 mA\n", + "Diode voltage = 0.76 V \n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.8: Page 190" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print \"Part (a)\" \n", + "# Since both the diodes are in OFF state\n", + "Vo=5 # Output voltage in volts\n", + "print \"Output voltage = %0.2f V \"%Vo \n", + "\n", + "print \"Part (b)\" \n", + "#Since diode D1 is in OFF state and diode D2 is in ON state\n", + "# From Fig. 2.16(C)\n", + "I=(5-0.6)/(4.7e3+300) # Current flowing through the diode D2 in amperes\n", + "Vo=5-I*4.7e3 # Output voltage in volts\n", + "print \"Output voltage = %0.2f V \"%Vo\n", + "\n", + "print \"Part (c)\" \n", + "# Since both diodes are in ON state\n", + "# Applying KVL in Fig. 2.16(d)\n", + "I=(5-0.6)/(2*4.7e3+300) # Current flowing through diode D1 or diode D2 in amperes\n", + "Vo=5-2*I*4.7e3 # Output voltage in volts\n", + "print \"Output voltage = %0.2f V \"%Vo" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part (a)\n", + "Output voltage = 5.00 V \n", + "Part (b)\n", + "Output voltage = 0.86 V \n", + "Part (c)\n", + "Output voltage = 0.74 V \n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.9 Page 190" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "Vy=0.7 # Cut-in voltage in volts\n", + "# In the Fig. 2.17\n", + "R1=5e3 \n", + "R2=10e3 \n", + "\n", + "print \"Part (a)\" \n", + "# Since diode D1 is OFF and diode D2 is ON\n", + "ID1=0 # A\n", + "ID2=(5-Vy-(-5))/(R1+R2) # Current through diode D2 in amperes\n", + "Vo=5-ID2*R1 # Output voltage\n", + "ID2=ID2*1e3 # Current through diode D2 in miliamperes\n", + "print \"Output voltage = %0.2f V \" %Vo\n", + "print \"Current through diode D1 = %0.2f mA\"%ID1 \n", + "print \"Current through diode D2 = %0.2f mA \"%ID2 \n", + "\n", + "print \"Part (b)\" \n", + "# Since both the diodes are ON\n", + "VA=4-Vy # In the fig.\n", + "Vo=VA+Vy # Output voltage\n", + "ID2=(5-Vo)/R1 # Current through diode D2 in amperes\n", + "IR2=(VA-(-5))/R2 # Current through diode R2 in amperes\n", + "ID1=IR2-ID2 # Current through diode D1 in amperes\n", + "ID1=ID1*1e3 # Current through diode D1 in miliamperes\n", + "ID2=ID2*1e3 # Current through diode D2 in miliamperes\n", + "print \"Output voltage = %0.2f V \" %Vo\n", + "print \"Current through diode D1 = %0.2f mA\"%ID1 \n", + "print \"Current through diode D2 = %0.2f mA \"%ID2 " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part (a)\n", + "Output voltage = 1.90 V \n", + "Current through diode D1 = 0.00 mA\n", + "Current through diode D2 = 0.62 mA \n", + "Part (b)\n", + "Output voltage = 4.00 V \n", + "Current through diode D1 = 0.63 mA\n", + "Current through diode D2 = 0.20 mA \n" + ] + } + ], + "prompt_number": 21 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/karansingh/Ch4.ipynb b/sample_notebooks/karansingh/Ch4.ipynb new file mode 100644 index 00000000..5c8ea38c --- /dev/null +++ b/sample_notebooks/karansingh/Ch4.ipynb @@ -0,0 +1,397 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:31068ba7d72c538c2034ff141729c374b5adab63db5f8b55f3d177e0fb459ae4" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4:Operational Amplifier" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1 : Page 245" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# For an op-amp circuit find a) closed loop gain Acl b) input impedance Zin c) output impedance Zo\n", + "\n", + "from __future__ import division\n", + "ro = 85 # ohm\n", + "A = 150*10**3 # ohm\n", + "R2 = 350*10**3 # ohm # Feedback resistance\n", + "R1 = 10*10**3 # ohm # Input resistance\n", + "\n", + "# a) closed loop gain\n", + "# ACL = abs(Vo/Vin) = abs(R2/R1)\n", + "ACL = abs(R2/R1) \n", + "print ' closed loop gain of an op-amp is = ',ACL,' ' # 1/beta = ACL\n", + "beta = (1/ACL) \n", + "\n", + "# b) the input impedance Zin\n", + "Zin = R1 \n", + "print ' the input impedance Zin = ',Zin,' ohm ' \n", + "\n", + "# c0 the output impedance Z0\n", + "Z0 = (ro)/(1+(beta*A)) \n", + "print ' the output impedance Z0 = %0.3f'%Z0,' ohm ' " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " closed loop gain of an op-amp is = 35.0 \n", + " the input impedance Zin = 10000 ohm \n", + " the output impedance Z0 = 0.020 ohm \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2 : Page 245" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Determine the differece voltage and open loop gain of an op-amp\n", + " \n", + "V1 = -5 # volt # input voltage\n", + "V2 = 5 # volt\n", + "Vo = 20 #volt # output voltage\n", + "\n", + "# the difference voltage is given by \n", + "Vd = V2-V1 \n", + "print ' The difference voltage is = ',Vd,' V ' \n", + "\n", + "# open loop gain \n", + "A = (Vo/Vd) \n", + "print ' The open loop gain is = ',A,' ' " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The difference voltage is = 10 V \n", + " The open loop gain is = 2.0 \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3 : Page 246" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Determine the differece voltage and open loop gain of an op-amp\n", + " \n", + "V1 = -5 # volt # input voltage\n", + "V2 = 0 # volt # GND\n", + "Vo = 20 #volt # output voltage\n", + "\n", + "# the difference voltage is given by \n", + "Vd = V2-V1 \n", + "print ' The difference voltage is = ',Vd,' V ' \n", + "\n", + "# open loop gain \n", + "A = (Vo/Vd) \n", + "print ' The open loop gain is = ',A,' ' " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The difference voltage is = 5 V \n", + " The open loop gain is = 4.0 \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4 : Page 247" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Determine the differece voltage and open loop gain of an op-amp\n", + " \n", + "V1 = 0 # volt # input voltage # GND\n", + "V2 = 5 # volt \n", + "Vo = 20 #volt # output voltage\n", + "\n", + "# the difference voltage is given by \n", + "Vd = V2-V1 \n", + "print ' The difference voltage is = ',Vd,' V ' \n", + "\n", + "# open loop gain \n", + "A = (Vo/Vd) \n", + "print ' The open loop gain is = ',A,' ' " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The difference voltage is = 5 V \n", + " The open loop gain is = 4.0 \n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5 : Page 247" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Determine the differece voltage and open loop gain of an op-amp\n", + " \n", + "V1 = 5 # volt # input voltage # GND\n", + "V2 = -5 # volt \n", + "Vo = -20 #volt # output voltage\n", + "\n", + "# the difference voltage is given by \n", + "Vd = V2-V1 \n", + "print ' The difference voltage is = ',Vd,' V ' \n", + "\n", + "# open loop gain \n", + "A = (Vo/Vd) \n", + "print ' The open loop gain is = ',A,' ' " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The difference voltage is = -10 V \n", + " The open loop gain is = 2.0 \n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6 : Page 248" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# To find closed loop gain and output voltage Vo of an inverting op-amp\n", + "R1 = 10 #kilo ohm # input resistance\n", + "R2 = 25 # kilo ohm # feedback resistance\n", + "Vin = 10 #volt # input voltage\n", + "\n", + "# Closed loop gain of an inverting op-amp\n", + "Ac = -(R2/R1) \n", + "print 'The Closed loop gain of an inverting op-amp is = ',Ac,' ' \n", + "Ac = abs(Ac) \n", + "print 'The |Ac| Closed loop gain of an inverting op-amp is = ',Ac,' ' \n", + "\n", + "# the output voltage of an inverting op-amp\n", + "Vo = -(R2/R1)*Vin \n", + "print 'The output voltage of an inverting op-amp is = ',Vo,' V ' " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Closed loop gain of an inverting op-amp is = -2.5 \n", + "The |Ac| Closed loop gain of an inverting op-amp is = 2.5 \n", + "The output voltage of an inverting op-amp is = -25.0 V \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.7 : Page 248" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# To find closed loop gain and output voltage Vo of an non-inverting op-amp\n", + "R1 = 10 #kilo ohm # input resistance\n", + "R2 = 25 # kilo ohm # feedback resistance\n", + "Vin = 10 #volt # input voltage\n", + "\n", + "# Closed loop gain of an non-inverting op-amp\n", + "Ac = 1+(R2/R1) \n", + "Ac = abs(Ac) \n", + "print 'The Closed loop gain of an non-inverting op-amp is = ',Ac,' ' \n", + "\n", + "# the output voltage of an inverting op-amp\n", + "Vo = (1+R2/R1)*Vin \n", + "print 'The output voltage of an non-inverting op-amp is = ',Vo,' V ' " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Closed loop gain of an non-inverting op-amp is = 3.5 \n", + "The output voltage of an non-inverting op-amp is = 35.0 V \n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.8 : Page 249" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# to find out closed loop gain and output voltage Vo\n", + "R1 = 10 #kilo ohm # input resistance\n", + "R3 = 10 #kilo ohm # input resistance\n", + "R2 = 25 # kilo ohm # feedback resistance\n", + "R4 = 25 # kilo ohm # feedback resistance\n", + "Vin2 = 10 #volt # input voltage\n", + "Vin1 = -10 #volt # input voltage\n", + "\n", + "# closed loop gain of differntial op-amp is given by\n", + "Ac = (R2/R1) \n", + "Ac = abs(Ac) \n", + "print 'The closed loop gain of differntial op-amp is = ',Ac,' ' \n", + "\n", + "# the output voltage of an non-inverting op-amp is given by\n", + "Vo = (R2/R1)*(Vin2-Vin1) \n", + "print 'The output voltage of an non-inverting op-amp is= ',Vo,' V ' " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The closed loop gain of differntial op-amp is = 2.5 \n", + "The output voltage of an non-inverting op-amp is= 50.0 V \n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.9 : Page 249" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Determine the non-inverting input voltage\n", + "R1 = 10 #kilo ohm # input resistance\n", + "R2 = 25 #kilo ohm # feedback resistance\n", + "Voh = 10 # volt #output voltage\n", + "Vol = -10 # volt # output voltage\n", + "\n", + "# upper voltage\n", + "V = (R1/(R1+R2)*Voh) \n", + "print ' The upper voltage is = %0.3f'%V,' V ' \n", + "\n", + "# Lower voltage\n", + "V = (R1/(R1+R2)*Vol) \n", + "print ' The lower voltage is = %0.3f'%V,' V ' " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The upper voltage is = 2.857 V \n", + " The lower voltage is = -2.857 V \n" + ] + } + ], + "prompt_number": 18 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |