diff options
author | hardythe1 | 2015-07-03 12:23:43 +0530 |
---|---|---|
committer | hardythe1 | 2015-07-03 12:23:43 +0530 |
commit | 9d260e6fae7328d816a514130b691fbd0e9ef81d (patch) | |
tree | 9e6035702fca0f6f8c5d161de477985cacad7672 /sample_notebooks/WaseemAhmad Ansari/Chapter2.ipynb | |
parent | afcd9e5397e3e1bde0392811d0482d76aac391dc (diff) | |
download | Python-Textbook-Companions-9d260e6fae7328d816a514130b691fbd0e9ef81d.tar.gz Python-Textbook-Companions-9d260e6fae7328d816a514130b691fbd0e9ef81d.tar.bz2 Python-Textbook-Companions-9d260e6fae7328d816a514130b691fbd0e9ef81d.zip |
add/remove books
Diffstat (limited to 'sample_notebooks/WaseemAhmad Ansari/Chapter2.ipynb')
-rwxr-xr-x | sample_notebooks/WaseemAhmad Ansari/Chapter2.ipynb | 348 |
1 files changed, 348 insertions, 0 deletions
diff --git a/sample_notebooks/WaseemAhmad Ansari/Chapter2.ipynb b/sample_notebooks/WaseemAhmad Ansari/Chapter2.ipynb new file mode 100755 index 00000000..d902c695 --- /dev/null +++ b/sample_notebooks/WaseemAhmad Ansari/Chapter2.ipynb @@ -0,0 +1,348 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:3942a48c51f6e66ddeb010a1a5acaeebd4c9f56b964a269d92588d67ccc10453" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 : Introduction to operational amplifier" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.1 Page no. 88" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "\n", + "R1 = 10*10**3 #R1 input resistance \n", + "Rf = 100*10**3 # Rf feedback resistance\n", + "vi = float(1) #input voltage \n", + "RL = 25*10**3\n", + "#calculating the values \n", + "\n", + "i1 = float((vi/R1)*10**3) # input resistace id the ratio of input voltage to the input resitance \n", + "vo = float(-(Rf/R1)*vi) # finding the output voltage \n", + "iL = float((abs(vo)/RL)*10**3) # calculating the load current \n", + "io = float((i1+iL)) # calculating the output current which is equal to the sum of input current and load current\n", + "\n", + "#printing the values \n", + "\n", + "print \"The input current i1 =\",i1,\"mA\"\n", + "print \"The output voltage vo =\",vo,\"V\"\n", + "print \"The load current iL =\",iL,\"mA\"\n", + "print \"The output current io =\",io,\"mA\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The input current i1 = 0.1 mA\n", + "The output voltage vo = -10.0 V\n", + "The load current iL = 0.4 mA\n", + "The output current io = 0.5 mA\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.2 Page no.89" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "\n", + "ACL = 5 # Gain of the amplifier\n", + "R1 = 10*10**3 # input resisitance in ohms \n", + "\n", + "# calculations\n", + "\n", + "Rf = (5-1) * R1 # calculating the resistance of feedback resistor \n", + "\n", + "# printing the values \n", + "\n", + "print \"The value of feedback resistor = \", (Rf/10**3),\"kohms\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of feedback resistor = 40 kohms\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.4 Page no.92" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Given Data\n", + "\n", + "R1 = 5*10**3\n", + "Rf = 20*10**3\n", + "vi = 1 \n", + "RL = 5*10**3\n", + "\n", + "# calculating the values \n", + "vo = float((1+(Rf/R1))*vi) \n", + "ACL = int(vo/vi)\n", + "iL = int((vo/RL)*10**3)\n", + "i1 = float(((vo - vi)/Rf))*(10**3)\n", + "io = iL+i1\n", + " \n", + " \n", + "# printing the values\n", + "print \"Output voltage vo = \",vo,\"V\"\n", + "print \"Gain ACL = \",ACL\n", + "print \"Load current iL = \",iL,\"mA\"\n", + "print \"The value of i1 = \",i1,\"mA\"\n", + "print \"Output current io = \", io,\"mA\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Output voltage vo = 5.0 V\n", + "Gain ACL = 5\n", + "Load current iL = 1 mA\n", + "The value of i1 = 0.2 mA\n", + "Output current io = 1.2 mA\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.5 Page No.94" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given Data\n", + "import math\n", + "Beta = 200\n", + "ICQ = 100*10**-6\n", + "ADM = 100\n", + "CMRR = 80\n", + "\n", + "# finding the solution \n", + "# for VT =25 milli volt \n", + "VT = 25*10**-3\n", + "gm = float(ICQ/VT)\n", + "Rc = (ADM/gm) \n", + "CMRR = 10**(80/20) # log inverse is equal to powers of 10\n", + "RE = float((CMRR-1)/gm)\n", + "x = Decimal((RE/10**6))\n", + "\n", + "# printing the values \n", + "\n", + "print \" The value of gm =\",int(math.ceil((gm*10**3))),\"mMho\" #converting the answer into milli Mho\n", + "print \" The value of Rc =\",int((Rc/10**3)),\"kohm\" #converting the answer into kohm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " The value of gm = 4 mMho\n", + " The value of Rc = 25 kohm\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.6 Page no. 95" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data \n", + "\n", + "gm = 4*10**-3\n", + "RC = 125*10*3\n", + "RE = 1.25*10**3\n", + "beta0 = 200\n", + "\n", + "# calculating the values\n", + "\n", + "rpi = beta0/gm # value is in ohms \n", + "ADM =-500 # Given Value\n", + "ACM = -((200*RC)/(402*RE)+rpi)*10**-6\n", + "print \"ACM is =\",round(ACM,2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "ACM is = -0.05\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.9 Page No.63" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "from fractions import Fraction \n", + "# Given data\n", + "\n", + "beta0 = 100\n", + "IQ = 5*10**-4\n", + "RC = 10*10**3\n", + "RE = 150\n", + "VT = 25*10**-3 \n", + "\n", + "# calculations \n", + "\n", + "ICQ = float(IQ/2)\n", + "gm = float(ICQ / VT)\n", + "rpi = beta0/gm\n", + "# calculaing the gain in Differential mode\n", + "ADM = ((0.5)*(beta0*RC))/(rpi+((1+beta0)*RE))\n", + "# To get the differentila mode gain multiply the value by 2\n", + "ADM2 = (ADM*2)\n", + "\n", + "# print the values \n", + "\n", + "print \"ICQ value is =\",ICQ*10**3,\"mA\"\n", + "print \"gm value is =\",Fraction(gm).limit_denominator(100),\"Mho\" \n", + "print \"rpi value is =\",int(rpi/10**3),\"kilo Ohm\"\n", + "print \"THe gain is =\",int(math.ceil(ADM2)),\"V/V\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "ICQ value is = 0.25 mA\n", + "gm value is = 1/100 Mho\n", + "rpi value is = 10 kilo Ohm\n", + "THe gain is = 40 V/V\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.8 Page no.97" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given data\n", + "import math\n", + "I0 = 10*10**-6\n", + "VCC =10\n", + "VBE = 0.7\n", + "beta = 125\n", + "VT = 25*10**-3\n", + "\n", + "# Solution of the problem is \n", + "Iref = 10**-3 # Assumption\n", + "\n", + "R1 = (VCC - VBE)/Iref\n", + "# Finding the value RE from the equation 2.74\n", + "RE = (VT/(1+(1/beta)*I0))*math.log(Iref/I0)\n", + "\n", + "# printing the values \n", + "\n", + "print \"The value of R1 =\",R1/10**3,\"Kilo Ohms\"\n", + "print \"The value of RE =\",round(RE*100,1),\"Kilo Ohms\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of R1 = 9.3 Kilo Ohms\n", + "The value of RE = 11.5 Kilo Ohms\n" + ] + } + ], + "prompt_number": 13 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |