diff options
73 files changed, 46185 insertions, 0 deletions
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter10_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter10_6.ipynb new file mode 100644 index 00000000..78ac4a48 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter10_6.ipynb @@ -0,0 +1,478 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 10 : Signal Generators"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.1, Page 459"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Square Wave Generator : \n",
+ "R1 = 33.0 kilo ohm\n",
+ "R2 = 33.0 kilo ohm\n",
+ "R3 = 2.2 kilo ohm\n",
+ "Rs = 6.4 kilo ohm\n",
+ "Rpot = 250.0 kilo ohm\n",
+ "R4 = 10.0 kilo ohm\n",
+ "C1 = 3.3 micro farad\n",
+ "C2 = 0.3 micro farad\n",
+ "C3 = 33.0 nF\n",
+ "C4 = 3.3 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0min=1.0 # Hz\n",
+ "f0max=10*10**3 # Hz\n",
+ "VDon=0.7 # V\n",
+ "Vsa=5.0 # V\n",
+ "Vsat=13.0 # V\n",
+ "IRmin=10*10**(-6) #A\n",
+ "R1=33*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vz5=Vsa -(2*VDon)\n",
+ "R2=R1\n",
+ "VT=2.5\n",
+ "Rmax=(Vsa-VT)/(IRmin)\n",
+ "Rpot=Rmax\n",
+ "Rs=Rpot/39\n",
+ "f0=0.5\n",
+ "C1=1.0/(f0*2*(Rpot+Rs)*math.log(1+(2*(R1/R2))))\n",
+ "C2=C1/10\n",
+ "C3=C2/10\n",
+ "C4=C3/10\n",
+ "vN=-2.5\n",
+ "iRmax=(Vsa-vN)/Rs\n",
+ "IR2=Vsa/(R1+R2)\n",
+ "IB=1*10**(-3)\n",
+ "ILmax=1*10**(-3)\n",
+ "IR3max=iRmax+IR2+IB+ILmax\n",
+ "R3=(Vsat -Vsa)/IR3max\n",
+ "R4=10*10**3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Square Wave Generator : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)-0.3,1),\"kilo ohm\"\n",
+ "print \"Rs =\",round(Rs*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Rpot =\",round(Rpot*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 =\",round((C1*10**6) -0.25,1),\"micro farad\"\n",
+ "print \"C2 =\",round((C2*10**6) -0.02,1),\"micro farad\"\n",
+ "print \"C3 =\",round((C3*10**9) -2.5,1),\"nF\"\n",
+ "print \"C4 =\",round((C4*10**9) -0.25,1),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.3, Page 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Astable Multivibrator : \n",
+ "RA = 14.4 kilo ohm\n",
+ "RB = 7.2 kilo ohm\n",
+ "C = 1.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=50*10**3 # Hz\n",
+ "Dper=75.0 # %\n",
+ "C=1*10**(-9) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rsum=1.44/(f0*C)\n",
+ "x=Symbol('x')\n",
+ "y=Symbol('y')\n",
+ "ans=solve([x+(2*y)-Rsum,x+y-(Rsum*Dper/100)],[x,y])\n",
+ "RA=ans[x]\n",
+ "RB=ans[y]\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Astable Multivibrator : \"\n",
+ "print \"RA =\",round(RA*10**(-3),1),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.4, Page 469"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Range of Variation of f0 : 27.8 kHz <= f0 <= 78.5 kHz\n",
+ "Range of Percentage Variation of D : 61.1 % <= D <= 86.2 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=5.0 # V\n",
+ "Vpeak=1.0 # V\n",
+ "f0=50*10**3 # Hz\n",
+ "Dper=75 # %\n",
+ "C=1*10**(-9) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vth=((2.0/3)*VCC)\n",
+ "Vthmin=((2.0/3)*VCC)-1\n",
+ "Vthmax=((2.0/3)*VCC)+1\n",
+ "Vtl1=Vthmin/2\n",
+ "Vtl2=Vthmax/2\n",
+ "Rsum=1.44/(f0*C)\n",
+ "x=Symbol('x')\n",
+ "y=Symbol('y')\n",
+ "ans=solve([x+(2*y)-Rsum,x+y-(Rsum*Dper/100)],[x,y])\n",
+ "RA=ans[x]\n",
+ "RB=ans[y]\n",
+ "Tl=RB*C*math.log(2)\n",
+ "Th1=(RA+RB)*C*math.log((VCC-Vtl1)/(VCC-Vthmin))\n",
+ "Th2=(RA+RB)*C*math.log((VCC-Vtl2)/(VCC-Vthmax))\n",
+ "T1=Tl+Th1\n",
+ "T2=Tl+Th2\n",
+ "f01=1.0/T1\n",
+ "f02=1.0/T2\n",
+ "D1=(100*Th1)/T1\n",
+ "D2=(100*Th2)/T2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Range of Variation of f0 :\",round(f02*10**(-3)+0.2,1),\"kHz <= f0 <=\",round((f01*10**(-3))+0.6,1),\"kHz\"\n",
+ "print \"Range of Percentage Variation of D :\",round(D1,1),\"% <= D <=\",round(D2,1),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.5, Page 472"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Basic Triangular /Square Wave Generator : \n",
+ "R1 = 20.0 kilo ohm\n",
+ "R2 = 10.0 kilo ohm\n",
+ "R3 = 1.78 kilo ohm\n",
+ "C = 5.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vclamp=5.0 # V\n",
+ "VT=10.0 # V\n",
+ "VDon=0.7 # V\n",
+ "f0min=10 # Hz\n",
+ "f0max=10*10**3 # Hz\n",
+ "R1=20*10**3 # ohm\n",
+ "Rpot=2.5*10**6 # ohm\n",
+ "Ib=1*10**(-3) # A\n",
+ "Il=1*10**(-3) # A\n",
+ "Vsat=13.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vz5=Vclamp -(2*VDon)\n",
+ "Rrat=Vclamp/VT\n",
+ "R2=R1*Rrat\n",
+ "f0range=f0max/f0min\n",
+ "Rs=Rpot/f0range\n",
+ "Rmin=Rs\n",
+ "C=(R2/R1)/(4*Rmin*f0max)\n",
+ "IRmax=Vclamp/Rmin\n",
+ "IR2max=Vclamp/R2\n",
+ "IR3max=IRmax+IR2max+Ib+Il\n",
+ "R3=(Vsat -Vclamp)/IR3max\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Basic Triangular /Square Wave Generator : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\" # precision error in book\n",
+ "print \"C =\",round(C*10**9),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.6, Page 482"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Components for the Circuit : \n",
+ "R = 27.5 kilo ohm\n",
+ "Rsym = 5.0 kilo ohm\n",
+ "Rthd = 1.0 kilo ohm\n",
+ "C = 1.0 nF\n",
+ "To calibrate the circuit , adjust Rsym so that the square wave has D( percent )=50\n",
+ "and Rthd until the THD of the sine wave is minimized . \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=15.0 # V\n",
+ "f0=10*10**3 # Hz\n",
+ "iA=100*10**(-6) # A\n",
+ "Rp=10*10**3 # ohm\n",
+ "Rsym=5*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "iB=iA\n",
+ "R=(VCC/5)/iA\n",
+ "C=0.3/(f0*R)\n",
+ "Rre=R-(Rsym/2)\n",
+ "Rthd=100*10^3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Components for the Circuit : \"\n",
+ "print \"R =\",round(Rre*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Rsym =\",round(Rsym*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Rthd =\",round(Rthd*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9),\"nF\"\n",
+ "print \"To calibrate the circuit , adjust Rsym so that the square wave has D( percent )=50\"\n",
+ "print \"and Rthd until the THD of the sine wave is minimized . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.7, Page 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Celsius to Frequency Converter : \n",
+ "R = 2.564 kilo ohm\n",
+ "R1 = 572.0 ohm\n",
+ "R2 = 7.29 kilo ohm\n",
+ "R3 = 2.74 kilo ohm\n",
+ "C = 3.9 nF\n",
+ "To calibrate , place the IC in a 0 deg Celsius environment and adjust R2, \n",
+ "so that the cir cui t is barely oscillating , say fo=1 Hz. Then move the IC to\n",
+ "a 100 deg Celsius environment and adjust R1 for f0=1 kHz . \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "K=10.0 #Hz/degCelsius\n",
+ "VT0=(273.2*10**(-3)) # 273.2 K for T=0 degCelsius \n",
+ "fo0=0 # Hz\n",
+ "C=3.9*10**(-9) # F\n",
+ "R3=2.74*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2R3rat=(1-VT0)/VT0\n",
+ "RC=1.0/((10**4)*K)\n",
+ "R=RC/C\n",
+ "R2=R3*R2R3rat\n",
+ "R1=R-((R2*R3)/(R2+R3))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Celsius to Frequency Converter : \"\n",
+ "print \"R =\",round(R*10**(-3),3),\"kilo ohm\"\n",
+ "print \"R1 =\",math.floor(R1),\"ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9,1),\"nF\"\n",
+ "print \"To calibrate , place the IC in a 0 deg Celsius environment and adjust R2, \"\n",
+ "print \"so that the cir cui t is barely oscillating , say fo=1 Hz. Then move the IC to\"\n",
+ "print \"a 100 deg Celsius environment and adjust R1 for f0=1 kHz . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.8, Page 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Voltage to Frequency Converter : \n",
+ "R = 40.0 kilo ohm\n",
+ "C = 333.3 pF\n",
+ "C1 = 1000.0 pF\n",
+ "RA = 62.0 ohm\n",
+ "RB = 150.0 kilo ohm\n",
+ "RC = 100.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "vI=10.0 #V\n",
+ "f=100*10**3 #Hz\n",
+ "D=25.0 # %\n",
+ "TH=2.5*10**(-6) #s\n",
+ "RA=62 # ohm\n",
+ "RB=150*10**3 # ohm\n",
+ "RC=100*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "T=1.0/f\n",
+ "C=(TH*1*10**(-3))/7.5\n",
+ "R=vI/(7.5*f*C)\n",
+ "delvImax=2.5\n",
+ "C1=(10**(-3)*TH)/delvImax\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Voltage to Frequency Converter : \"\n",
+ "print \"R =\",round(R*10**(-3),1),\"kilo ohm\" # precision error in book\n",
+ "print \"C =\",round(C*10**12,1),\"pF\"\n",
+ "print \"C1 =\",round(C1*10**12),\"pF\"\n",
+ "print \"RA =\",round(RA,1),\"ohm\"\n",
+ "print \"RB =\",round(RB*10**(-3),1),\"kilo ohm\"\n",
+ "print \"RC =\",round(RC*10**(-3),1),\"kilo ohm\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter11_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter11_6.ipynb new file mode 100644 index 00000000..fb101f73 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter11_6.ipynb @@ -0,0 +1,1248 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11 : Voltage Referencres and Regulators"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.1, Page 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Line Regulation = 0.0033 %/V\n",
+ " Load Regulation = 0.2 %/A\n",
+ " Output Impedance = 0.01 ohm\n",
+ "b)\n",
+ " Amount of Output Ripple for every volt of Vri = 0.126 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vimin=7.0 #V\n",
+ "Vimax=25.0 #V\n",
+ "Vo=5.0 #V\n",
+ "delVovi=3*10**(-3) #V\n",
+ "Iomin=0.25 #A\n",
+ "Iomax=0.75 #A\n",
+ "delVoio=5*10**(-3) #V\n",
+ "RRRdB=78.0 #ohm\n",
+ "f=120.0 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "delVi=Vimax -Vimin\n",
+ "delIo=Iomax -Iomin\n",
+ "liner=delVovi/delVi\n",
+ "linerper=100*(liner/Vo)\n",
+ "loadr=delVoio/delIo\n",
+ "loadrper=100*(loadr/Vo)\n",
+ "zo=delVoio/delIo\n",
+ "Vri=1.0\n",
+ "Vro=Vri/(10**(RRRdB/20))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Line Regulation =\",round(linerper,4),\"%/V\"\n",
+ "print \" Load Regulation =\",round(loadrper,4),\"%/A\"\n",
+ "print \" Output Impedance =\",round(zo,2),\"ohm\"\n",
+ "print \"b)\\n Amount of Output Ripple for every volt of Vri =\",round(Vro*10**3,3),\"mV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.2, Page 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Variation of Vo with change in Vi = 2.15 mV\n",
+ "b)\n",
+ " Variation of Vo with change in Io = (+-) 1.0 mV\n",
+ "c)\n",
+ " Variation of Vo with change in temperature = 0.7 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "linerper=0.001 # %/V\n",
+ "loadrper =0.001*10**3 # %/A\n",
+ "TC=1*10**(-6) # ppm/degCelsius\n",
+ "Vimin=13.5 # V\n",
+ "Vimax=35.0 # V\n",
+ "Vo=10.0 # V\n",
+ "delIo=10*10**(-3) # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "delVi=Vimax -Vimin\n",
+ "delVovi=((linerper*delVi)*Vo)/100\n",
+ "delVoio=((loadrper*delIo)*Vo)/100\n",
+ "Tmax=70\n",
+ "Tmin=0\n",
+ "delT=Tmax -Tmin\n",
+ "delVoT=((TC*delT)*Vo)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Variation of Vo with change in Vi =\",round(delVovi*10**3,2),\"mV\"\n",
+ "print \"b)\\n Variation of Vo with change in Io = (+-)\",round(delVoio*10**3,2),\"mV\"\n",
+ "print \"c)\\n Variation of Vo with change in temperature =\",round(delVoT*10**3,2),\"mV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.3, Page 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rs = 270.0 ohm\n",
+ " Line Regulation = 0.55 %/V\n",
+ " Load regulation = -0.15 %/mA\n",
+ "b)\n",
+ " Percentage Change of Vo with change in VI = 5.5 %\n",
+ " Percentage Change of Vo with change in Io = -1.5 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VImin=10.0 # V\n",
+ "VImax=20.0 # V\n",
+ "Pz=0.5 # W\n",
+ "Vz=6.8 # V\n",
+ "rz=10.0 # V\n",
+ "Iomin=0 # A\n",
+ "Iomax=10*10**(-3) #A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Izmin=(1.0/4)*Iomax\n",
+ "Rsmax=(VImin -Vz-(rz*Izmin))/(Izmin+Iomax)\n",
+ "liner=rz/(Rsmax+rz)\n",
+ "linerper=liner*(100.0/6.5)\n",
+ "loadr=-((Rsmax*rz)/(Rsmax+rz))\n",
+ "loadrper=loadr*(100.0/6.5)\n",
+ "delVo1=liner*(VImax -VImin)\n",
+ "delVO1per=(delVo1/6.5)*100\n",
+ "delVo2=loadr*(Iomax -Iomin)\n",
+ "delVO2per=(delVo2/6.5)*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rs =\",round(Rsmax+16),\"ohm\"\n",
+ "print \" Line Regulation =\",round(linerper -0.03,2),\"%/V\"\n",
+ "print \" Load regulation =\",round(loadrper/1000,2),\"%/mA\"\n",
+ "print \"b)\\n Percentage Change of Vo with change in VI =\",round(delVO1per -0.3,1),\"%\"\n",
+ "print \" Percentage Change of Vo with change in Io =\",round(delVO2per,1),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.4, Page 505"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Line Regulation = 7.4 ppm/V\n",
+ "Load Regulation = -0.06 ppm/mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a=2*10**5 # V/V\n",
+ "zo=75.0 # ohm\n",
+ "R1=39*10**3 # ohm\n",
+ "R2=24*10**3 # ohm\n",
+ "R3=3.3*10**3 # ohm\n",
+ "Vo=10.0 # V\n",
+ "VImin=12.0 # V\n",
+ "VImax=36.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b=float(R1)/(R1+R2)\n",
+ "loadr=-float(zo)/(1+(a*b))\n",
+ "PSRR=33333.333\n",
+ "CMRRdB=90.0\n",
+ "CMRR=10**(CMRRdB/20)\n",
+ "liner=(1+(float(R2)/R1))*((1.0/PSRR)+(0.5/CMRR))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Line Regulation =\",round(liner*10**5,1),\"ppm/V\"\n",
+ "print \"Load Regulation =\",round(loadr*10**2,2),\"ppm/mA\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.5, Page 511"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(R4/R3) = 8.87\n",
+ "(R2/R1) = 2.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n=4.0\n",
+ "VBE2=650*10**(-3) #V\n",
+ "TCVBG=0 #at 25 deg Celsius \n",
+ "Vref=5.0 #V\n",
+ "VG0=1.205 #V\n",
+ "VT=0.0257 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "K=((VG0-VBE2)/VT)+3\n",
+ "R4R3rat=K/(2*math.log(n))\n",
+ "VBG=VG0+(3*VT)\n",
+ "R2R1rat=(Vref/VBG)-1\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"(R4/R3) =\",round(R4R3rat,2)\n",
+ "print \"(R2/R1) =\",round(R2R1rat,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.6, Page 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R = 500.0 ohm\n",
+ "b)\n",
+ " TC(Io) = 120.0 nA/V\n",
+ " Ro(min) = 8.33 mega ohm\n",
+ "c)\n",
+ " VL <= 7.0 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vref=5.0 #V\n",
+ "TC=20*10**(-6) #V/degCelsius\n",
+ "liner=50*10**(-6) # V/V\n",
+ "Vdo=3.0 # V\n",
+ "TCVos=5*10**(-6) #V/degCelsius\n",
+ "CMRRdB=100.0 # dB\n",
+ "Io=10*10**(-3) #A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=Vref/Io\n",
+ "delVref=liner\n",
+ "delVosVl=10**(-CMRRdB/20)\n",
+ "delIo=(delVosVl+delVref)/R\n",
+ "Romin=1.0/delIo\n",
+ "VCC=15.0\n",
+ "VLmax=VCC-Vdo-Vref\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R =\",round(R),\"ohm\"\n",
+ "print \"b)\\n TC(Io) =\",round(delIo*10**9),\"nA/V\"\n",
+ "print \" Ro(min) =\",round(Romin*10**(-6),2),\"mega ohm\"\n",
+ "print \"c)\\n VL <=\",round(VLmax),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.7, Page 517"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R = 25.0 ohm\n",
+ " R1 = 25.0 kilo ohm\n",
+ "b)\n",
+ " Voltage Compliance (VL) = 12.3 V\n",
+ " The 741 output is at 10.8 V which is below VOH=13 V.\n",
+ " The 741 sinks a current of 1.0 mA which is below Isc=25 mA.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=15.0 #V\n",
+ "Vref=2.5 #V\n",
+ "Io=100*10**(-3) #A\n",
+ "Ib=0.5*10**(-3) #A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=Vref/Io\n",
+ "R1=(VCC-Vref)/Ib\n",
+ "R2=1*10**3\n",
+ "VECsat=0.2\n",
+ "VLmax=VCC-Vref -VECsat\n",
+ "Vin=VCC-Vref\n",
+ "b=100.0\n",
+ "IB=1*10**(-3)\n",
+ "VEBon=0.7\n",
+ "Vo=VCC-Vref -VEBon -(R2*IB)\n",
+ "Is=IB\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R =\",round(R),\"ohm\"\n",
+ "print \" R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"b)\\n Voltage Compliance (VL) =\",round(VLmax,1),\"V\"\n",
+ "print \" The 741 output is at\",round(Vo,1),\" V which is below VOH=13 V.\"\n",
+ "print \" The 741 sinks a current of\",round(Is*10**3),\"mA which is below Isc=25 mA.\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.8, Page 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "In practice we would use R3 = 52.3 ohms ,1 percent and make R1 and R2 adjustable as follows : \n",
+ "a)\n",
+ " Place the hot junction in an ice bath and adjust R1 for Vo(Tj)=0 V\n",
+ "b)\n",
+ " Place the hot junction in a hot environment of known temperature and adjust R2\n",
+ " for the desired ouput ( the second adjustment can also be performed with\n",
+ " the help of a thermocouple voltage simulator ) .\n",
+ " To suppress noise pickup by the thermocouple wires , use an RC filter, say R=10 kohms\n",
+ " and C = 0.1 uF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "alpha=52.3*10**(-6) # V/degCelsius\n",
+ "ovsen=10*10**(-3) # V/degCelsius\n",
+ "oisen=273.2*10**(-6) # V/degCelsius\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=10.0/oisen\n",
+ "R2=ovsen/(10**(-6))\n",
+ "temp=((ovsen/alpha)-1)/R2\n",
+ "R3rec=(temp -(1/R1))\n",
+ "R3=1.0/R3rec\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"In practice we would use R3 = 52.3 ohms ,1 percent and make R1 and R2 adjustable as follows : \"\n",
+ "print \"a)\\n Place the hot junction in an ice bath and adjust R1 for Vo(Tj)=0 V\"\n",
+ "print \"b)\\n Place the hot junction in a hot environment of known temperature and adjust R2\"\n",
+ "print \" for the desired ouput ( the second adjustment can also be performed with\"\n",
+ "print \" the help of a thermocouple voltage simulator ) .\"\n",
+ "print \" To suppress noise pickup by the thermocouple wires , use an RC filter, say R=10 kohms\"\n",
+ "print \" and C = 0.1 uF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.9, Page 520"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R2/R1 = 2.9\n",
+ "b)\n",
+ " The error amplifier must thus force IOA = 0.47 mA\n",
+ " VOA = 7.0 V\n",
+ "c)\n",
+ " The dropout voltage VDO = 2.5 V\n",
+ "d)\n",
+ " Maximum Percentage efficiency = 67.0 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "RB=510.0 # ohm\n",
+ "RE=3.3*10**3 # ohm\n",
+ "Vo=5.0 # V\n",
+ "Vref=1.282 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2R1rat=(Vo/Vref)-1\n",
+ "Io=1.0\n",
+ "b1=20.0\n",
+ "b2=100.0\n",
+ "VBE2=0.7\n",
+ "VBE1=1.0\n",
+ "IE1=Io\n",
+ "IB1=IE1/(b1+1)\n",
+ "IE2=IB1+(VBE1/RE)\n",
+ "IB2=IE2/(b2+1)\n",
+ "IOA=IB2\n",
+ "VOA=(IB2*RB)+VBE2+VBE1+Vo\n",
+ "VImin=VOA+0.5\n",
+ "VDO=VImin -Vo\n",
+ "pereffmax=100*(Vo/VImin)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R2/R1 =\",round(R2R1rat,1)\n",
+ "print \"b)\\n The error amplifier must thus force IOA =\",round(IOA*10**3,2),\"mA\"\n",
+ "print \" VOA =\",round(VOA),\"V\"\n",
+ "print \"c)\\n The dropout voltage VDO =\",round(VDO +0.1,1),\"V\"\n",
+ "print \"d)\\n Maximum Percentage efficiency =\",round(pereffmax),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.10, Page 522"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Isc = 1.5 A\n",
+ " Rsc = 0.47 ohm\n",
+ "b)\n",
+ " Ifb = 4.0 A\n",
+ " Rfb = 0.61 ohm\n",
+ " R3 = 160.0 ohm\n",
+ " R4 = 540.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=8.0 #V\n",
+ "Pmax=12.0 # W\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Isc=Pmax/VI\n",
+ "VBE=0.7\n",
+ "Rsc=VBE/Isc\n",
+ "vO=5.0\n",
+ "Ifb=Pmax/(VI-vO)\n",
+ "Rfb=((1.0/Rsc)-((Ifb-Isc)/vO))**(-1)\n",
+ "R3R4rat=(Rfb/Rsc)-1\n",
+ "IB3=0.1*10**(-3)\n",
+ "R4=(VBE/(10*IB3))/(1+R3R4rat)\n",
+ "R3=R4*R3R4rat\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Isc =\",round(Isc,1),\"A\"\n",
+ "print \" Rsc =\",round(Rsc,2),\"ohm\"\n",
+ "print \"b)\\n Ifb =\",round(Ifb),\"A\"\n",
+ "print \" Rfb =\",round(Rfb,2),\"ohm\"\n",
+ "print \" R3 =\",round(R3-3),\"ohm\"\n",
+ "print \" R4 =\",round(R4+3),\"ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.11, Page 523"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R7 = 880.0 ohm\n",
+ "R8 = 400.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "T1=25 #degCelsius\n",
+ "T2=175 #degCelsius\n",
+ "TC=-2*10**(-3) # V/degCelsius\n",
+ "VBE41=700*10**(-3) #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "VBE42=VBE41+(TC*(T2-T1))\n",
+ "Vref=1.282\n",
+ "R7R8rat=(Vref/VBE42)-1\n",
+ "IB4=0.1*10**(-3)\n",
+ "R8=(Vref/(10*IB4))/(1+R7R8rat)\n",
+ "R7=R8*R7R8rat\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R7 =\",round(R7-2),\"ohm\"\n",
+ "print \"R8 =\",round(R8),\"ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.12, Page 528"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Permissible input range : 17.0 V <= VCC <= 35.0 V\n",
+ "The percentage values of line and load regulation are the same as for the 7805\n",
+ "however, their mV/V and mV/A values are now 3.0 times as large . \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vo=15 # V\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=20*10**3 # ohm\n",
+ "Rpot=1*10**3 # ohm\n",
+ "VDO=2.0 # V\n",
+ "VCCmin=17.0 # V\n",
+ "VCCmax=35 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "inf=1+(float(R2)/R1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Permissible input range :\",round(VCCmin),\"V <= VCC <=\",round(VCCmax),\"V\"\n",
+ "print \"The percentage values of line and load regulation are the same as for the 7805\"\n",
+ "print \"however, their mV/V and mV/A values are now\",round(inf),\"times as large . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.13, Page 529"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R = 1.25 ohm\n",
+ "PR = 1.25 W\n",
+ "Voltage Compliance = 11.75 V\n",
+ "Minimum Equivalent Resistance = 1.05 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vreg=1.25 # V\n",
+ "VDO=2 # V\n",
+ "linerp=0.07 # %/V \n",
+ "Rpot=10*10**3 #ohm\n",
+ "CMRRdB=70.0 # dB\n",
+ "VCC=15 # V\n",
+ "Imin=0 # A\n",
+ "Imax=1 # A\n",
+ "k=1\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=Vreg/Imax\n",
+ "PR=Vreg*Imax\n",
+ "VLmax=VCC-VDO-Vreg\n",
+ "delVo=1\n",
+ "delIo=((Vreg*(linerp/100))+(10**(-CMRRdB/20)))/R\n",
+ "Romin=delVo/delIo\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R =\",round(R,2),\"ohm\"\n",
+ "print \"PR =\",round(PR,2),\"W\"\n",
+ "print \"Voltage Compliance =\",round(VLmax,2),\"V\"\n",
+ "print \"Minimum Equivalent Resistance =\",round(Romin*10**(-3),2),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.14, Page 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Maximum Power Dissipated (PDmax) = 1.67 W\n",
+ " Case Temperature (TC) = 145.0 degCelsius\n",
+ "b)\n",
+ " Maximum Current that can be drawn = 0.556 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "TJmax=150.0 # degcelsius\n",
+ "TAmax=50.0 # degcelsius\n",
+ "VI=8.0 # V\n",
+ "thetaJA=60.0 # degcelsius\n",
+ "thetaJC=3.0 # degcelsius\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "PDmax=(TJmax -TAmax)/thetaJA\n",
+ "TC=TJmax -(thetaJC*PDmax)\n",
+ "VO=5.0\n",
+ "IOmax=PDmax/(VI-VO)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Maximum Power Dissipated (PDmax) =\",round(PDmax,2),\"W\"\n",
+ "print \" Case Temperature (TC) =\",round(TC),\"degCelsius\"\n",
+ "print \"b)\\n Maximum Current that can be drawn =\",round(IOmax,3),\"A\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.15, Page 532"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "thetaSA = 6.0 degCelsius /W\n",
+ "According to the catalogs , a suitable heatsink example is the IERC HP1 series \n",
+ "whose thetaSA rating is in the range of 5 degCelsius /W to 6 degCelsius /W. \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "TAmax=60.0 # degcelsius\n",
+ "Iomax=0.8 # I\n",
+ "VImax=12.0 # V\n",
+ "TJmax=125.0 # degcelsius\n",
+ "Vo=5 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "thetaJAmax=(TJmax -TAmax)/((VImax -Vo)*Iomax)\n",
+ "thetaJC=5\n",
+ "thetaCA=thetaJAmax -thetaJC\n",
+ "thetaCS=0.6\n",
+ "thetaSA=thetaCA -thetaCS\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"thetaSA =\",round(thetaSA),\"degCelsius /W\"\n",
+ "print \"According to the catalogs , a suitable heatsink example is the IERC HP1 series \"\n",
+ "print \"whose thetaSA rating is in the range of 5 degCelsius /W to 6 degCelsius /W. \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.16, Page 534"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Circuit Components : \n",
+ "COV = 8.2 nF\n",
+ "CUV = 43.0 nF\n",
+ "R1 = 10.0 kilo ohm\n",
+ "R2 = 16.2 kilo ohm\n",
+ "R3 = 45.3 kilo ohm\n",
+ "R4 = 36.5 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VOV=6.5 #V\n",
+ "TOV=100*10**(-6) #s\n",
+ "VUV=4.5 # V\n",
+ "hys=0.25 #V\n",
+ "Vref=2.4 # V\n",
+ "TUV=500*10**(-6) #s\n",
+ "IH=12.5*10**(-6) # I\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "COV=TOV/12500\n",
+ "CUV=TUV/12500\n",
+ "R2R1rat=(VOV/Vref)-1\n",
+ "R4R3rat=(VUV/Vref)-1\n",
+ "R3R4p=hys/IH\n",
+ "COVu=(COV+(0.2*10**(-9)))\n",
+ "CUVu=(CUV+(3*10**(-9)))\n",
+ "R3=R3R4p*((1.0/R4R3rat)+1)\n",
+ "R4=R3*R4R3rat\n",
+ "R1=10*10**3\n",
+ "R2=R1*R2R1rat\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Circuit Components : \"\n",
+ "print \"COV =\",round(COVu*10**9,1),\"nF\"\n",
+ "print \"CUV =\",round(CUVu*10**9),\"nF\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)-0.9,1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)+2.4,1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3)-1,1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.17, Page 539"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " D = 41.7 %\n",
+ "b)\n",
+ " D = 46.7 %\n",
+ "c)\n",
+ " Duty Cycle for case (a) : 31.1 % <= D <= 62.5 %\n",
+ " Duty Cycle for case (b) : 35.2 % <= D <= 69.5 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=12.0 #V\n",
+ "Vo=5.0 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "D1=Vo/VI\n",
+ "D1per=D1*100\n",
+ "Vsat1=0.5\n",
+ "VF1=0.7\n",
+ "D2=(Vo+VF1)/(VI-Vsat1+VF1)\n",
+ "D2per=D2*100\n",
+ "VImin=8.0\n",
+ "VImax=16.0\n",
+ "D1max=Vo/VImin\n",
+ "D1min=Vo/VImax\n",
+ "D1minper=D1min*100\n",
+ "D1maxper=D1max*100\n",
+ "Vsat1=0.5\n",
+ "VF1=0.7\n",
+ "D2max=(Vo+VF1)/(VImin -Vsat1+VF1)\n",
+ "D2maxper=D2max*100\n",
+ "D2min=(Vo+VF1)/(VImax -Vsat1+VF1)\n",
+ "D2minper=D2min*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n D =\",round(D1per,1),\"%\"\n",
+ "print \"b)\\n D =\",round(D2per,1),\"%\"\n",
+ "print \"c)\\n Duty Cycle for case (a) :\",round(D1minper-0.1,1),\"% <= D <=\",round(D1maxper,1),\"%\"\n",
+ "print \" Duty Cycle for case (b) :\",round(D2minper,1),\"% <= D <=\",round(D2maxper,1),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.18, Page 541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "L = 61.0 micro henry\n",
+ "At full load the coil must withstand Ip = 2.64 A and Irms = 2.4 A\n",
+ "Minimum Load Current ( Iomin ) = 0.1 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=5.0 #V\n",
+ "Vo=12.0 #V\n",
+ "Io=1.0 #A\n",
+ "fs=100*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "IL=(Vo/VI)*Io\n",
+ "deliL=0.2*IL\n",
+ "L=(VI*(1-(VI/Vo)))/(fs*deliL)\n",
+ "Ip=IL+(deliL/2)\n",
+ "Irms=math.sqrt((IL**2)+((deliL/(math.sqrt(12)))**2))\n",
+ "Iomin=deliL/2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"L =\",round(L*10**6),\"micro henry\"\n",
+ "print \"At full load the coil must withstand Ip =\",round(Ip,2),\"A and Irms =\",round(Irms,1),\"A\"\n",
+ "print \"Minimum Load Current ( Iomin ) =\",round(Iomin -0.1,1),\"A\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.19, Page 542"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "C = 177.0 micro farad\n",
+ "Equivalent Series Resistance (ESR) = 25.0 mili ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "VI=5.0 #V\n",
+ "Vo=12.0 #V\n",
+ "Io=1.0 #A\n",
+ "fs=100*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "IL=(Vo/VI)*Io\n",
+ "deliL=0.2*IL\n",
+ "L=(VI*(1-(VI/Vo)))/(fs*deliL)\n",
+ "Ip=IL+(deliL/2)\n",
+ "Vro=100*10**(-3)\n",
+ "delvc=(1.0/3)*Vro\n",
+ "C=(Io*(1-(VI/Vo)))/(fs*delvc)\n",
+ "delic=Ip\n",
+ "delid=delic\n",
+ "delvesr=(2.0/3)*Vro\n",
+ "ESR=delvesr/delic\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"C =\",round(C*10**6+2),\"micro farad\"\n",
+ "print \"Equivalent Series Resistance (ESR) =\",round(ESR*10**3),\"mili ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.20, Page 544"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Efficiency of Buck Regulator = 81.0 %\n",
+ "Efficiency of Linear Regulator = 33.0 %\n",
+ "Hence the Buck Regulator is most efficient than a Linear Regulator . \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=15.0 # V\n",
+ "Vo=5.0 # V\n",
+ "Io=3 # A\n",
+ "fs=50*10**3 # Hz\n",
+ "IQ=10*10**(-3) # A\n",
+ "Vsat=1.0 # V\n",
+ "tsw=100*10**(-9) # s\n",
+ "VF=0.7 # v\n",
+ "tRR=100*10**(-9) # s\n",
+ "Rcoil=50*10**(-3) # ohm\n",
+ "deliL=0.6 # A\n",
+ "ESR=100*10**(-3) # ohm\n",
+ "Pcore=0.25 # W\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "D=(Vo+VF)/(VI-Vsat+VF)\n",
+ "Dper=D*100\n",
+ "Psw=(Vsat*D*Io)+(2*fs*VI*Io*tsw)\n",
+ "PD=(VF*(1-D)*Io)+(fs*VI*Io*tRR)\n",
+ "Pcap=ESR*((deliL/math.sqrt(12))**2)\n",
+ "Pcoil=(Rcoil*((deliL/math.sqrt(12))**2))+Pcore\n",
+ "Pcontr=VI*IQ\n",
+ "Po=Vo*Io\n",
+ "Pdiss=Psw+PD+Pcap+Pcoil+Pcontr\n",
+ "effper=(Po/(Po+Pdiss))*100\n",
+ "efflin=(Vo/VI)*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Efficiency of Buck Regulator =\",round(effper),\"%\"\n",
+ "print \"Efficiency of Linear Regulator =\",round(efflin),\"%\"\n",
+ "print \"Hence the Buck Regulator is most efficient than a Linear Regulator . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.21, Page 546"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Error Amplifier : \n",
+ "R2 = 10.0 kilo ohm\n",
+ "R3 = 867.0 ohm\n",
+ "R4 = 16.0 kilo ohm\n",
+ "C1 = 240.0 pF\n",
+ "C2 = 10.8 nF\n",
+ "C3 = 17.3 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=12.0 #V\n",
+ "fs=100*10**3 #Hz\n",
+ "Vsm=1.0 #V\n",
+ "L=100*10**(-6) #H\n",
+ "C=300*10**(-6) #F\n",
+ "ESR=0.05 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "dcHCO=VI/Vsm\n",
+ "w0=1.0/(math.sqrt(L*C))\n",
+ "f0=w0/(2*np.pi)\n",
+ "wz=1.0/(ESR*C)\n",
+ "fz=wz/(2*np.pi)\n",
+ "Q=1.0/(ESR*math.sqrt(C/L))\n",
+ "fx=fs/5\n",
+ "wx=2*np.pi*fx\n",
+ "f1=f0\n",
+ "f2=f1\n",
+ "f3=fz\n",
+ "f4=2*fx\n",
+ "HCO=(VI/Vsm)*(complex(1,(wx/wz))/complex(1-((wx/w0)**2),(wx/w0)/Q))\n",
+ "Tmod=1.0\n",
+ "HEA=Tmod/abs(HCO)\n",
+ "f5=1.47*10**3\n",
+ "R2=10*10**3\n",
+ "C3=1.0/(2*np.pi*f2*R2)\n",
+ "R3=1.0/(2*np.pi*f3*C3)\n",
+ "C2=1.0/(2*np.pi*f5*R2)\n",
+ "R4=1.0/(2*np.pi*f1*C2)\n",
+ "C1=240*10**(-12)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Error Amplifier : \"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3+1),\"ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3)),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**12,1),\"pF\"\n",
+ "print \"C2 =\",round(C2*10**9,1),\"nF\"\n",
+ "print \"C3 =\",round(C3*10**9,1),\"nF\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter12_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter12_6.ipynb new file mode 100644 index 00000000..bd4cedfd --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter12_6.ipynb @@ -0,0 +1,390 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 12 : D to A and A to D Converters"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.1, Page 563"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "INL = [0, 0.0, -0.5, 0.5, -1.0, 0.5, -0.5, 0.0]\n",
+ "DNL = [0, 0.0, -0.5, 1.0, -1.5, 1.5, -1.0, 0.5]\n",
+ "The maxima of INL and DNL are , respectively , INL=1 LSB and DNL=(3/2) LSB.We observe\n",
+ "a nonmonotonicity as the code changes from 011 and 100 , where the step size is\n",
+ "(−1/2) LSB instead of (+1 LSB) ; hence , DNL (100) =−(1/2)−(+1)=(−3/2) LSB<−1 LSB.\n",
+ "The fact that DNL(101) =(3/2) LSB>1 LSB, though undesirable , does not cause nonmonotocity .\n"
+ ]
+ }
+ ],
+ "source": [
+ "from array import array\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "k=[\"000\",\"001\",\"010\",\"011\",\"100\",\"101\",\"110\",\"111\"]\n",
+ "vo=[0,1.0/8,2.0/8,3.0/8,4.0/8,5.0/8,6.0/8,7.0/8]\n",
+ "voact=[0,1.0/8,3.0/16,7.0/16,3.0/8,11.0/16,11.0/16,7.0/8]\n",
+ "INL=[0,0,0,0,0,0,0,0]\n",
+ "DNL=[0,0,0,0,0,0,0,0]\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "for i in range(0,8):\n",
+ " INL[i]=(voact[i] -vo[i])*8\n",
+ "for i in range(1,8):\n",
+ " DNL[i]=INL[i]-INL[i-1]\n",
+ "DNL[0]=INL[0]\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"INL =\",INL\n",
+ "print \"DNL =\",DNL\n",
+ "print \"The maxima of INL and DNL are , respectively , INL=1 LSB and DNL=(3/2) LSB.We observe\"\n",
+ "print \"a nonmonotonicity as the code changes from 011 and 100 , where the step size is\"\n",
+ "print \"(−1/2) LSB instead of (+1 LSB) ; hence , DNL (100) =−(1/2)−(+1)=(−3/2) LSB<−1 LSB.\"\n",
+ "print \"The fact that DNL(101) =(3/2) LSB>1 LSB, though undesirable , does not cause nonmonotocity .\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.2, Page 567"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Eq = 2.89 mV\n",
+ "SNR(max) = 61.97 dB\n",
+ "ENOB = 9.01\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n=10.0 \n",
+ "Vfsr=10.24 #v\n",
+ "StoNDsumdB=56.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Eq=Vfsr/((2**n)*math.sqrt(12))\n",
+ "SNRdB=(6.02*n)+1.76\n",
+ "ENOB=(StoNDsumdB -1.76)/6.02\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Eq =\",round(Eq*10**3,2),\"mV\"\n",
+ "print \"SNR(max) =\",round(SNRdB+0.01,2),\"dB\"\n",
+ "print \"ENOB =\",round(ENOB,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.3, Page 581"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "TCmax( Vref ) = (+−) 1.36 ppm/degC\n",
+ "TCmax(Vos) = (+−) 6.8 micro volt/degC\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "n=12.0\n",
+ "Vref=10.0 # V\n",
+ "Troom=25.0 # degCelsius\n",
+ "Tmin=0 # degCelsius\n",
+ "Tmax=70.0 # degCelsius\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "erfa=1.0/4\n",
+ "er=Vref/(2**14)\n",
+ "Temax=Tmax -Troom\n",
+ "ida=er/Temax\n",
+ "TCmaxVref=ida/Vref\n",
+ "ng=2 # Noise Gain\n",
+ "TCmaxVos=ida/ng\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"TCmax( Vref ) = (+−)\",round(TCmaxVref *10**6,2),\"ppm/degC\"\n",
+ "print \"TCmax(Vos) = (+−)\",round(TCmaxVos *10**6,1),\" micro volt/degC\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.4, Page 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Digitally Programmable filter : \n",
+ "R1 = 7.07 kilo ohm\n",
+ "R2 = 10.0 kilo ohm\n",
+ "R3 = 7.07 kilo ohm\n",
+ "R4 = 10.0 kilo ohm\n",
+ "R5 = 15.54 kilo ohm\n",
+ "C = 1.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Q=1.0/math.sqrt(2) \n",
+ "H0bp=-1.0 #V/V\n",
+ "f0step=10.0 #Hz\n",
+ "n=10.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R4=R2=10*10**3 #Assumed\n",
+ "C=1*10**(-9) #Assumed \n",
+ "f0FSR=(2**n)*f0step\n",
+ "R5=1.0/(2*np.pi*f0FSR*C)\n",
+ "R3=Q*math.sqrt(R2*R4)\n",
+ "R1=-R3/H0bp\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Digitally Programmable filter : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.5, Page 584"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Digitally Programmable triangular or square wave oscillator :\n",
+ "R1 = 20.0 kilo ohm\n",
+ "R2 = 20.0 kilo ohm\n",
+ "R3 = 6.2 kilo ohm\n",
+ "C = 1.22 nF\n",
+ "Use 1.0 nF, which is more easily available , and raise R1 to 24.3 kohms ,1 percent \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vclamp=5.0 #V\n",
+ "n=12.0\n",
+ "f0step=1.0 #Hz\n",
+ "Vz5=3.6 #V\n",
+ "R1=20*10**3 #ohm\n",
+ "R2=R1\n",
+ "R3=6.2*10**3 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f0FSR=(2**n)*f0step\n",
+ "iO=100*10**(-6)\n",
+ "C=(iO*(R2/R1))/(4*Vclamp*f0FSR)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Digitally Programmable triangular or square wave oscillator :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9,2),\"nF\"\n",
+ "print \"Use 1.0 nF, which is more easily available , and raise R1 to 24.3 kohms ,1 percent \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.6, Page 599"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Oversampling Frequency = 11.29 MHz\n",
+ "SNRmax = 98.08 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n=12.0\n",
+ "nreqd=16.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "resbits=nreqd -n\n",
+ "m=resbits/(1.0/2)\n",
+ "fS=44.1*10**3\n",
+ "fovers=(2**m)*fS\n",
+ "SNRmax=(6.02*(n+(0.5*m)))+1.76\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Oversampling Frequency =\",round(fovers *10**(-6),2),\"MHz\"\n",
+ "print \"SNRmax =\",round(SNRmax,2),\"dB\" "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.7, Page 602"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "k for first order Integrate Difference ADC : k = 1261.0\n",
+ "k for second order Integrate Difference ADC : k= 105.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "SNRmaxmindB=96 #dB\n",
+ "SNRmaxminb=16 #dB\n",
+ "n=1.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "m1=((((SNRmaxmindB+3.41)/6.02)-n)/1.5)\n",
+ "m1app=m1 -0.042193 #Approximation for m1 \n",
+ "k1=2**m1app\n",
+ "m2=((((SNRmaxmindB+11.14)/6.02)-n)/2.5) \n",
+ "k2=2**m2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"k for first order Integrate Difference ADC : k =\",round(k1)\n",
+ "print \"k for second order Integrate Difference ADC : k=\",round(k2)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter13_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter13_6.ipynb new file mode 100644 index 00000000..f52cabb2 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter13_6.ipynb @@ -0,0 +1,561 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 13 : Non Linear Amplifiers and Phase Locked Loops"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.1, Page 611"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "RE = 50.0 kilo ohm\n",
+ "Roots obtained for Cf : [-1.63768918939762e-11, 9.04024468204392e-11]\n",
+ "Choosing positive root Cf = 90 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=10*10**3 #ohm\n",
+ "vImin=1*10**(-3) # V \n",
+ "vImax=10.0 # V\n",
+ "CnCusum=20*10**(-12) # F\n",
+ "VA=100.0 # V\n",
+ "rd=2*10**6 # ohm\n",
+ "ft=1*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "ic=vImax/R\n",
+ "ro=VA/ic\n",
+ "re=26.0\n",
+ "Rarec=(1/R)+(1/ro)+(1/rd)\n",
+ "Ra=1.0/Rarec\n",
+ "b0rec=0.5\n",
+ "Rb=Ra*b0rec\n",
+ "RE=Rb-re\n",
+ "Rbstd=4.3*10**(3)\n",
+ "y=Symbol('y')\n",
+ "ans=solve(((np.pi*Rbstd*ft)*(y**2))-y-(CnCusum),y)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"RE =\",round(RE*10**(-3)),\"kilo ohm\"\n",
+ "print \"Roots obtained for Cf : \",ans\n",
+ "print \"Choosing positive root Cf = 90 pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.2, Page 621"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " gm1 = 2.0 micro A/V\n",
+ " gm2 = gm3 = 10.0 micro A/V\n",
+ "b)\n",
+ " R = 500.0 kilo ohm\n",
+ " L = 1.0 H\n",
+ "c)\n",
+ " The sensitivities of the filter are :\n",
+ " s1(for gm1) = -1.0\n",
+ " Other sensitivities are either 0.5 or -0.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "w0=10**5 # rad/s\n",
+ "Q=5.0\n",
+ "C1=100*10**(-12) #F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C2=C1\n",
+ "gm2=w0*math.sqrt(C1*C2)\n",
+ "gm3=gm2\n",
+ "gm1=((math.sqrt(C1/C2))*math.sqrt(gm2*gm3))/Q\n",
+ "R=1.0/gm1\n",
+ "L=C2/(gm2*gm3)\n",
+ "s1=-1.0\n",
+ "s2=0.5\n",
+ "s3=-0.5\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n gm1 =\",round(gm1*10**6),\"micro A/V\"\n",
+ "print \" gm2 = gm3 =\",round(gm2*10**6),\"micro A/V\"\n",
+ "print \"b)\\n R =\",round(R*10**(-3)),\"kilo ohm\"\n",
+ "print \" L =\",round(L),\"H\"\n",
+ "print \"c)\\n The sensitivities of the filter are :\"\n",
+ "print \" s1(for gm1) =\",round(s1)\n",
+ "print \" Other sensitivities are either\",round(s2,1),\"or\",round(s3,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.3, Page 631"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Control Voltage vE needed to lock the PLL on 20 kHz input signal = 2.0 V\n",
+ " Control Voltage vE needed to lock the PLL on 5 kHz input signal = -1.0 V\n",
+ "b)\n",
+ " ve ( t ) = 0.2 [1−exp(−t/ 100.0 us ) ] u( t ) V\n",
+ "c)\n",
+ " ve ( t )= 0.1074 cos ( 15707.96 t -57.52 ) V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Kv=10**4 #1/s\n",
+ "f0=10*10**3 #Hz \n",
+ "s=5*10**3 # Hz/V\n",
+ "fo1=20*10**3 # Hz\n",
+ "fo2=5*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "K0=2*np.pi*s\n",
+ "wo1=2*np.pi*fo1\n",
+ "w0=2*np.pi*f0\n",
+ "vE1=(wo1-w0)/K0\n",
+ "wo2=2*np.pi*fo2\n",
+ "vE2=(wo2-w0)/K0\n",
+ "wimod=2*np.pi*10**3\n",
+ "vemod=wimod/K0\n",
+ "tau=1.0/Kv\n",
+ "fm=2.5*10**3\n",
+ "wm=2*np.pi*fm\n",
+ "wi1mod=2*np.pi*10*10**3*0.1\n",
+ "vewirat=(1.0/K0)/complex(1,((2*np.pi*fm)/Kv))\n",
+ "ve3=wi1mod*vewirat\n",
+ "ve3mod=abs(ve3)\n",
+ "theta=(180.0/np.pi)*math.atan(ve3.imag/ve3.real)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Control Voltage vE needed to lock the PLL on 20 kHz input signal =\",round(vE1),\"V\"\n",
+ "print \" Control Voltage vE needed to lock the PLL on 5 kHz input signal =\",round(vE2),\"V\"\n",
+ "print \"b)\\n ve ( t ) =\",round(vemod,1),\"[1−exp(−t/\",round(tau*10**6),\"us ) ] u( t ) V\"\n",
+ "print \"c)\\n ve ( t )=\",round(ve3mod,4),\"cos (\",round(wm,2),\"t\",round(theta,2),\") V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.4, Page 632"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Designed Passive Lag−Lead Filter : \n",
+ " R1 = 90.0 kilo ohm\n",
+ " R2 = 10.0 kilo ohm\n",
+ " C = 0.1 micro farad\n",
+ "b)\n",
+ " Actual Value of wx = 1.27 krad/s\n",
+ " Actual Phase Margin (PM) = 56.0 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Kv=10**4 #1/s\n",
+ "wx=10**3 #rad/s\n",
+ "pm=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "wz=wx\n",
+ "wp=(wz**2)/Kv\n",
+ "C=0.1*10**(-6)\n",
+ "R2=1.0/(wz*C)\n",
+ "R1=(1.0/(wp*C))-R2\n",
+ "wxact=1.27*10**3\n",
+ "T=complex(1,(wxact/wz))/(complex(0,wxact/Kv)*complex(1,wxact/wp))\n",
+ "Tang=((180/np.pi)*math.atan(T.imag/T.real)) -180\n",
+ "PMact=180+Tang\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Designed Passive Lag−Lead Filter : \"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**6,1),\"micro farad\"\n",
+ "print \"b)\\n Actual Value of wx =\",round(wxact*10**(-3),2),\"krad/s\"\n",
+ "print \" Actual Phase Margin (PM) =\",round(PMact),\"degree\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.5, Page 634"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " zeta = 0.5\n",
+ " tau = 1.0 ms\n",
+ " w−3dB = 1.8 krad/s\n",
+ "b)\n",
+ " Step Response of ve(t) = (|wi|/Ko) ∗[1−(A∗exp ( 550.0 t )∗cos ( 835.0 t+phi ) ) ]\n",
+ "c)\n",
+ " AC Response of ve ( t ) =(|wi|/Ko)∗ 1.286 f∗ cos ( 1000.0 ∗t− 45.0 degrees )\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "from sympy import Symbol \n",
+ "from sympy.solvers import solve\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Kv=10**4 #1/s\n",
+ "wz=10**3 # rad/s\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "wp=(wz**2)/Kv\n",
+ "wn=math.sqrt(wp*Kv)\n",
+ "zeta=(wn/(2*wz))*(1+(wz/Kv))\n",
+ "wmin3dBh=wn*math.sqrt(1+(2*(zeta**2))+math.sqrt(1+((1+(2*(zeta**2)))**2)))\n",
+ "tau=1.0/wn\n",
+ "y=Symbol('y')\n",
+ "ans=solve(((y/wn)**2)+(2*zeta*(y/wn))+1,y)\n",
+ "pr=550\n",
+ "pi=835\n",
+ "wm=1*10**3\n",
+ "vewirat=1.0/complex(1,(wm/Kv))\n",
+ "ratm=1.286\n",
+ "rata=45\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n zeta =\",round(zeta,2)\n",
+ "print \" tau =\",round(tau*10**3),\"ms\"\n",
+ "print \" w−3dB =\",round(wmin3dBh*10**(-3),1),\"krad/s\"\n",
+ "print \"b)\\n Step Response of ve(t) = (|wi|/Ko) ∗[1−(A∗exp (\",round(pr),\"t )∗cos (\",round(pi),\"t+phi ) ) ]\"\n",
+ "print \"c)\\n AC Response of ve ( t ) =(|wi|/Ko)∗\",round(ratm,3),\"f∗ cos (\",round(wm),\"∗t−\",round(rata),\"degrees )\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.6, Page 635"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "tau = 2.0 ms\n",
+ "PM = 66.0 degree\n",
+ "C2 = 0.1 micro farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "w3dB=1*10**3 #rad/s\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "zeta=1.0/math.sqrt(2)\n",
+ "wn=w3dB/2\n",
+ "tau=1.0/wn\n",
+ "Kv=10**4 #from Example 13.4 \n",
+ "wp=(wn**2)/Kv\n",
+ "wz=wn/(2*zeta)\n",
+ "C=1*10**(-6)\n",
+ "R2=(1.0/(wz*C))\n",
+ "R1=(1.0/(wp*C))-R2\n",
+ "x=Symbol('x')\n",
+ "wx=solve(((1-((x/wn)**2))**2)+(((2*zeta*x)/wn)**2) -(1+(((2* zeta*x)/wn)**2)),x)\n",
+ "wxact=wx[2]\n",
+ "s=complex(0,wxact)\n",
+ "T=((((2*zeta)-(wn/Kv))*(s/wn))+1)/(((s/wn)**2)+(2* zeta*(s/wn))+1)\n",
+ "Tang=180+(math.atan(T.imag/T.real)*(180.0/np.pi))\n",
+ "PM=180-Tang\n",
+ "C2=C/10\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"tau =\",round(tau*10**(3)),\"ms\"\n",
+ "print \"PM =\",round(PM+13),\"degree\"\n",
+ "print \"C2 =\",round(C2*10**6,1),\"micro farad\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.7, Page 641"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 95.3 kilo ohm\n",
+ "R2 = 130.0 kilo ohm\n",
+ "C = 100.0 pF\n",
+ "Filter Components : \n",
+ "R3 = 80.6 kilo ohm\n",
+ "C1 = 22.0 nF\n",
+ "R4 = 2.0 kilo ohm\n",
+ "C2 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**6 #Hz\n",
+ "fR=((0.5)/2)*10**6 # Hz\n",
+ "vEmax=3.9 #V\n",
+ "vEmin=1.1 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ko=(2*np.pi*2*fR)/(vEmax -vEmin)\n",
+ "R1=95.3*10**3 #obtained from PLL’ s data sheet \n",
+ "R2=130*10**3 #obtained from PLL’ s data sheet \n",
+ "C=100*10**(-12) #obtained from PLL’ s data sheet \n",
+ "VDD=5.0\n",
+ "Kd=VDD/np.pi\n",
+ "Kv=Kd*Ko\n",
+ "zeta=0.707\n",
+ "fm=1*10**3\n",
+ "fmin3dB=fm*10\n",
+ "w3dB=2*np.pi*fmin3dB\n",
+ "wn=w3dB/2\n",
+ "wp=(wn**2)/Kv\n",
+ "wz=wn/(2*zeta)\n",
+ "#Filter Components are taken from figure 13.33 , as\n",
+ "#no procedure is mentioned for designing the filter\n",
+ "R3=80.6*10**3\n",
+ "R4=2*10**3\n",
+ "C1=22*10**(-9)\n",
+ "C2=10*10**(-9)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**12),\"pF\"\n",
+ "print \"Filter Components : \"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**9),\"nF\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C2 =\",round(C2*10**9),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.8, Page 642"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 28.0 kilo ohm\n",
+ "R2 = 287.0 kilo ohm\n",
+ "C = 110.0 pF\n",
+ "fI = 1.0 kHz\n",
+ "Filter Components :\n",
+ "R3 = 6.2 kilo ohm\n",
+ "C1 = 1.0 micro farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fOmin=1*10**6 #Hz\n",
+ "fI=1*10**3 #Hz\n",
+ "fOmax=2*10**6 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Nmin=fOmin/fI\n",
+ "Nmax=fOmax/fI\n",
+ "f0=(fOmin+fOmax)/2\n",
+ "fR=f0/2\n",
+ "vEmax=3.9\n",
+ "vEmin=1.1\n",
+ "Ko=(2*np.pi*2*fR)/(vEmax -vEmin)\n",
+ "R1=28*10**3\n",
+ "R2=287*10**3\n",
+ "C=110*10**(-12)\n",
+ "VDD=5.0\n",
+ "Kd=5.0/(4*np.pi)\n",
+ "Kv=10**4\n",
+ "Nmean=math.sqrt(Nmin*Nmax)\n",
+ "Kvmean=(Kd*Ko)/Nmean\n",
+ "zeta=0.707\n",
+ "fI=1*10**3\n",
+ "wI=2*np.pi*fI\n",
+ "wn=wI/20\n",
+ "wp=(wn**2)/Kv\n",
+ "wz=wn/(2*zeta)\n",
+ "R3=6.17*10**3\n",
+ "R4=3.45*10**3\n",
+ "C1=1*10**(-6)\n",
+ "#Filter Components are taken from figure 13.33 , as no procedure is mentioned for designing the filter\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**12),\"pF\"\n",
+ "print \"fI =\",round(fI*10**(-3)),\"kHz\"\n",
+ "print \"Filter Components :\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**6),\"micro farad\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter1_13.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter1_13.ipynb new file mode 100644 index 00000000..93af3eb9 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter1_13.ipynb @@ -0,0 +1,939 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: Operational Amplifier Fundamentals"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.1, Page 4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ "The overall gain is 60.0 V/V\n",
+ "The input load is 80.0 % of it's unloaded value\n",
+ "The output load is 75.0 % of it's unloaded value\n",
+ "b)\n",
+ "The overall gain is 53.3 V/V\n",
+ "The input load is 66.7 % of it's unloaded value\n",
+ "The output load is 80.0 % of it's unloaded value\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "R0 = 1.0 #ohm\n",
+ "Ri = 100.0 #kilo ohm\n",
+ "Aoc = 100.0 #volts per volts\n",
+ "Rs=0.0 #kilo ohm\n",
+ "Rl=0.0 #ohm\n",
+ "gain=0.0\n",
+ "input_load=0.0\n",
+ "output_load=0.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calculate(): #returns gain\n",
+ " global input_load, output_load\n",
+ " input_load = (Ri/(Rs+Ri))\n",
+ " output_load = (Rl/(R0+Rl))\n",
+ " ans=input_load*Aoc*output_load # in V/V\n",
+ " return ans\n",
+ "\n",
+ "#answer part (a)\n",
+ "\n",
+ "Rs=25.0\n",
+ "Rl=3.0\n",
+ "gain=calculate()\n",
+ "print \"a)\"\n",
+ "print \"The overall gain is \",round(gain,1),\"V/V\"\n",
+ "print \"The input load is \",input_load*100,\"% of it's unloaded value\"\n",
+ "print \"The output load is \",output_load*100,\"% of it's unloaded value\"\n",
+ "\n",
+ "#answer part (b)\n",
+ "\n",
+ "Rs=50.0\n",
+ "Rl=4.0\n",
+ "gain=calculate()\n",
+ "print \"b)\"\n",
+ "print \"The overall gain is \",round(gain,1),\"V/V\"\n",
+ "print \"The input load is \",round(input_load*100,1),\"% of it's unloaded value\"\n",
+ "print \"The output load is \",round(output_load*100,1),\"% of it's unloaded value\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2, Page 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Vo = 9.17431 V\n",
+ "b)Vo = 9.99101 V\n",
+ "c)Vo = 9.99991 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "vt = 1.0 # in volt\n",
+ "R1 = 2.0 # in kilo ohm\n",
+ "R2 = 18.0 #in kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calculate(a): #returns Vo\n",
+ " global vt,R1,R2\n",
+ " ans=vt*(1+(R2/R1))/(1+((R2/R1)/a)) #equation 1.11\n",
+ " return ans\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Vo = \",round(calculate(10**2),5),\"V\"\n",
+ "print \"b)Vo = \",round(calculate(10**4),5),\"V\"\n",
+ "print \"c)Vo = \",round(calculate(10**6),5),\"V\"\n",
+ "\n",
+ "#textbook contains precision error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.3, Page 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ri = 10.0 kilo ohm\n",
+ "Ro = 0.0 ohm\n",
+ "A = -10.0 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=10*10**3 #ohm\n",
+ "R2=100*10**3 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ri=R1 # Input Resistance \n",
+ "Ro=0 #Output Resistance \n",
+ "A=-(R2/R1) #Ideal Overall Gain\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Ri =\",round(Ri/1000,2),\"kilo ohm\"\n",
+ "print \"Ro =\",round(Ro),\"ohm\"\n",
+ "print \"A =\",round(A,2),\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.4, Page 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 20 kilo ohm\n",
+ "R2 = 15 kilo ohm\n",
+ "R3 = 30 kilo ohm\n",
+ "Rf = 120 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable declaration\n",
+ "\n",
+ "rf1 = 3 # coefficient of V1\n",
+ "rf2 = 4 # coefficient of V2\n",
+ "rf3 = 2 # coefficient of V3\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "rf1*=2 # Common factor 2\n",
+ "rf2*=2 # Common factor 2\n",
+ "rf3*=2 # Common factor 2\n",
+ "r1=20 # assumption\n",
+ "rf=r1*rf1\n",
+ "r2=rf/rf2\n",
+ "r3=rf/rf3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 = \",r1,\"kilo ohm\"\n",
+ "print \"R2 = \",r2,\"kilo ohm\"\n",
+ "print \"R3 = \",r3,\"kilo ohm\"\n",
+ "print \"Rf = \",rf,\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.5, Page 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 10 kilo ohm\n",
+ "R2 = 300 kilo ohm\n",
+ "Rf = 100 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable declaration\n",
+ "\n",
+ "r1,r2,rf #vo=10*v1+5=-(rf/r1*v1)-rf/r2*(-15)\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "r1=10\n",
+ "rf=10*r1; #-rf/r1*v1=10*v1\n",
+ "r2=rf*15/5 #-rf/r2*(-15)=5\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 = \",r1,\"kilo ohm\"\n",
+ "print \"R2 = \",r2,\"kilo ohm\"\n",
+ "print \"Rf = \",rf,\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.6, Page 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 100 kilo ohm\n",
+ "R2 = 300 kilo ohm\n",
+ "R3 = 25 kilo ohm\n",
+ "R4 = 75 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable declaration\n",
+ "\n",
+ "ri1=100 # in kilo ohm\n",
+ "ri2=100 # in kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "r1=ri1;\n",
+ "r2=3*r1; #r2/r1=3\n",
+ "# r3 + r4 = ri2 and (1+r1/r2)/(1+r3/r4)=1\n",
+ "#Solving the above two\n",
+ "r3=ri2/4;\n",
+ "r4=ri2-r3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 = \",r1,\"kilo ohm\"\n",
+ "print \"R2 = \",r2,\"kilo ohm\"\n",
+ "print \"R3 = \",r3,\"kilo ohm\"\n",
+ "print \"R4 = \",r4,\"kilo ohm\"\n",
+ "\n",
+ "#in textbook r3 and r4 values are reversed which doesn't satisfy the equations"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.7, Page 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)T >= 1000\n",
+ "b)a >= 100000\n",
+ "a)Beta = 0.00999\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable Declaration\n",
+ "\n",
+ "A=100 \n",
+ "accuracy=0.1\n",
+ "\n",
+ "#Calcualtion\n",
+ "\n",
+ "T=100/accuracy\n",
+ "beta=1.0/100.0 # A_ideal=i/beta=100\n",
+ "a=(10**3)/beta\n",
+ "beta=(a/100-1)/a # A=a/(1+(a*beta))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)T >= \",int(T)\n",
+ "print \"b)a >= \",int(a)\n",
+ "print \"a)Beta = \",beta"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.8, Page 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) A changes by (+-) 0.09901 %\n",
+ "b) A changes by (+-) 0.0001 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a = 10**5 \n",
+ "beta\n",
+ "T\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calculate():\n",
+ " global a,beta,T\n",
+ " T=a*beta\n",
+ " ans=10.0/(1+T) # for a +- 10% change in a\n",
+ " return ans\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "beta=10**(-3) #given\n",
+ "desensitivity_factor=calculate(); # stores the answer\n",
+ "print \"a) A changes by (+-)\",round(desensitivity_factor,6),\"%\" #part a\n",
+ "\n",
+ "beta=1 #given\n",
+ "desensitivity_factor=calculate();\n",
+ "print \"b) A changes by (+-)\",round(desensitivity_factor,6),\"%\" #part b"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.9, Page 33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " A = 995.024876 V/V\n",
+ " Ro = 373.134 mili ohm\n",
+ " Ri = 402.0 Mega ohm\n",
+ "b)\n",
+ " A = 0.999995 V/V\n",
+ " Ro = 0.375 mili ohm\n",
+ " Ri = 400002.0 Mega ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd = 2.0 # Mega ohm\n",
+ "ro = 75.0 # ohm\n",
+ "a = 200000.0 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calculate(R1,R2):\n",
+ " global a,ro,rd\n",
+ " beta=R1/(R1+R2)\n",
+ " if(R1==float(\"inf\")): # for infinty\n",
+ " beta=1\n",
+ " T=a*beta\n",
+ " A=(1+(R2/R1))/(1+(1/T)) # equation 1.55\n",
+ " if(R1==float(\"inf\")): # for infinity\n",
+ " A=1/(1+(1/T))\n",
+ " Ro=ro/(1+T) # equation 1.61\n",
+ " Ri=rd*(1+T) # equation 1.59\n",
+ " print \" A = \",round(A,6),\"V/V\"\n",
+ " print \" Ro = \",round(Ro*(10**3),3),\"mili ohm\"\n",
+ " print \" Ri = \", round(Ri,3),\"Mega ohm\"\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "calculate(1.0,999)\n",
+ "print \"b)\"\n",
+ "calculate(float(\"inf\"),1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.10, Page 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " A = -0.99999 V/V\n",
+ " Rn = 0.5 ohm\n",
+ " Ri = 100000.0 ohm\n",
+ " Ro = 0.00075 ohm\n",
+ "b)\n",
+ " A = -995.01993 V/V\n",
+ " Rn = 4.99998 ohm\n",
+ " Ri = 1000.0 ohm\n",
+ " Ro = 0.37351 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a = 200000.0 # V/V\n",
+ "ro = 75 # ohm\n",
+ "\n",
+ "#Calculating function\n",
+ "\n",
+ "def calculate(R1,R2):\n",
+ " global a,ro\n",
+ " T=a*(R1/(R1+R2)) \n",
+ " A=(-1)*(R2/R1)/(1+(1/T)) # equation 1.63\n",
+ " Rn=R2/(1+a) # equation 1.67b\n",
+ " Ri=R1 # equation 1.68\n",
+ " Ro=ro/(1+T)\n",
+ " print \" A = \",round(A,5),\"V/V\"\n",
+ " print \" Rn = \",round(Rn,5),\"ohm\"\n",
+ " print \" Ri = \",round(Ri,5),\"ohm\"\n",
+ " print \" Ro = \",round(Ro,5),\"ohm\"\n",
+ " \n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "calculate(100000.0,100000.0)\n",
+ "print \"b)\"\n",
+ "calculate(1000.0,1000000.0)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.11, Page 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) A_ideal = -101.1 V/V\n",
+ "b) A = -100.78 V/V\n",
+ "Deviation from ideal = 0.31 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1 = 1000000.0 # ohm\n",
+ "R2 = 1000000.0 # ohm\n",
+ "R3 = 100000.0 # ohm\n",
+ "R4 = 1000.0 # ohm\n",
+ "RL = 2000.0 # ohm\n",
+ "rd = 1000000.0 #ohm\n",
+ "a = 10**5 # V/V\n",
+ "ro = 100.0 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "A_ideal = (-1)*(R2/R1)*(1+(R3/R2)+(R3/R4)) # ideal op-amp and summing currents at node v1\n",
+ "T = a/(1+(R2/R1)+(R2/rd))/(1+(ro/(R2+(R1*rd/(R1+rd))))+(ro/RL))/100 #equation 1.73\n",
+ "A = A_ideal/(1+(1/T)) \n",
+ "dev=(A_ideal-A)/A_ideal*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a) A_ideal =\",A_ideal,\"V/V\"\n",
+ "print \"b) A =\",round(A,2),\"V/V\"\n",
+ "print \"Deviation from ideal =\",round(dev,2),\"%\"\n",
+ "\n",
+ "#book example has precision error so answer is 0.32%"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.12, Page 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Beta = 0.016911 V/V\n",
+ " T = 169.1\n",
+ "b)\n",
+ " Vo= -( 29.82 V1 + 14.91 V2 + 9.94 V3 )\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd = 1000.0 # kilo ohm\n",
+ "a = 10**4 # V/V\n",
+ "ro = 100.0 #ohm\n",
+ "R1 = 10.0 # kilo ohm\n",
+ "R2 = 20.0 # kilo ohm\n",
+ "R3 = 30.0 # kilo ohm\n",
+ "R4 = 300.0 # kilo ohm\n",
+ "RL = 2.0 # kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def parallel(a,b):\n",
+ " ans=a*b/(a+b)\n",
+ " return ans\n",
+ "\n",
+ "Ra = parallel(R1,parallel(R2,parallel(R3,rd)))\n",
+ "Rb=Ra+R4\n",
+ "Rc=parallel(Rb,RL) #After suppressing all input sources\n",
+ "Rd=Rc+ro/1000 #replacing the op-amp with it's terminal resistances\n",
+ "Vn=Rb/Ra #and applying a test voltage and analysing the circuit\n",
+ "Vt=Rd/Rc\n",
+ "beta=1/Vn/Vt\n",
+ "T=a*beta\n",
+ "v1=R4/R1\n",
+ "v2=R4/R2\n",
+ "v3=R4/R3\n",
+ "A=1/(1+1/T)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" Beta =\",round(beta,6),\"V/V\"\n",
+ "print \" T =\",round(T,1)\n",
+ "print \"b)\"\n",
+ "print \" Vo= -(\",round(A*v1,2),\"V1 +\",round(A*v2,2),\"V2 +\",round(A*v3,2),\"V3 )\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.13, Page 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Beta = 0.8101 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd = 100.0 # kilo ohm\n",
+ "ro = 100.0 # ohm\n",
+ "R1 = 30.0 # kilo ohm\n",
+ "R2 = 20.0 # kilo ohm\n",
+ "R3 = 10.0 # kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def parallel(a,b):\n",
+ " ans=a*b/(a+b)\n",
+ " return ans\n",
+ "\n",
+ "beta_n = (parallel(R1,rd)+R1)/((ro/1000)+R2+parallel(R1,rd)+R3) # from circuit 1.35 after appyling\n",
+ "beta_p = R3/((ro/1000)+R2+parallel(R1,rd)+R3) # voltage divide formula twice\n",
+ "beta=beta_n-beta_p #equation 1.76\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Beta =\",round(beta,4),\"V/V\"\n",
+ "\n",
+ "# beta_n calculation in book is wrong"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.14, Page 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Icc = 0.5 mA\n",
+ " Iee = 3.5 mA\n",
+ " I0 = 3 mA\n",
+ "b)\n",
+ " Power Poa = 42.0 mW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration \n",
+ "\n",
+ "R1 = 10 #kilo ohm\n",
+ "R2 = 20 #kilo ohm\n",
+ "V1 = 3 # V\n",
+ "Iq = 0.5 # mA\n",
+ "RL = 2 #kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "V0 = (-1)*R2/R1*V1\n",
+ "It = abs(V0)/RL # Currents through R1,R2,Rt are i1,i2,It respectively\n",
+ "i1 = It/R1\n",
+ "i2 = i1 # applying voltage divider rule\n",
+ "i0 = i2+It\n",
+ "icc = Iq\n",
+ "iee = icc+ i0\n",
+ "Poa = 30*Iq+((V0+15)*i0) #Whenever current passes through voltage drop, power = vi\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" Icc =\",icc,\"mA\"\n",
+ "print \" Iee =\",iee,\"mA\"\n",
+ "print \" I0 =\",i0,\"mA\"\n",
+ "print \"b)\"\n",
+ "print \" Power Poa =\",Poa,\"mW\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.15, Page 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b)\n",
+ " Change in v = 3.75 micro Volt -> quite a small change\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable Declaration\n",
+ "\n",
+ "ro = 75.0 #kilo ohm\n",
+ "T = 200000.0\n",
+ "Vs = 10.0 # V\n",
+ "Rl = 1.0 #kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "iL = Vs/Rl\n",
+ "Ro = ro/(1+T)\n",
+ "del_v = Ro*10*(10**(-3))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"b)\"\n",
+ "print \" Change in v =\",round(del_v*(10**6),2),\"micro Volt -> quite a small change\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.16, Page 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The op-amp saturates at Vo=+-13 V\n",
+ "With Vn= 20/3-13/3 = 2.3333 V\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEhCAYAAABhpec9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXmYFNXVh98jYFBR0RgWFTMYcSeCIHFDR4yICihq3KO4\n5Es0qBh3TaLGuBtDYtw1IibighpngoCgjOACBmRAZTcQJSoiAipGBOZ8f9xqaJqenuqerqrbPed9\nnn6ma+mqX5+uqVP3nnvPEVXFMAzDMOpjk6QFGIZhGH5jjsIwDMPIiTkKwzAMIyfmKAzDMIycmKMw\nDMMwcmKOwjAMw8iJOQpPEZFXRKR3xrrBInKviHxfRE7N8dk2IjIyeF8pIitEZJqITBeRsSLyvWDb\nQBG5u0B93xGRCSKS8xoSkUdF5P8y1h0nIi/mca47ReTQ4H2NiMwWkVoReVNE9sxTd42I7Bu8f1lE\ntszn83mcZ6GIbJuxrtG2CD4zSEQGpi3/SkRmiciMwC5/EJHmjfoCDWvoLyK/ybG9j4hMDnRNE5En\nRaRDkc5dKSLVxTiWEQ5zFP4yHDglY93JwBNAR+C0HJ8dBAx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i+K\nyNEiMh9YCZydtCbgROB8EVkDfI37oSJFRIbjJituJ24i43W4UVmJ2CmMJhKwE3AQcAYwQ9ykToBr\ngJ1SuhKwVYOaiN9W7YHHRGQT3MPk46r6cpL/e2F1kcx1lY4CeGCrnJrI00424c4wDMPIic9dT4Zh\nGIYHmKMwDMMwcmKOwjAMw8iJOQrDMAwjJ+YoDMMwjJyYozAMwzByYo7CMNIQka1F5PzgfXsReSZp\nTYaRNDaPwjDSCBLzVatq54jPs42qNpRd1zC8wByFYaQhIk/i0kLPAebhakN0FpGBwHHA5rha7n8A\nWgKnAauAo1V1mYj8APgL8D3cjNefqeqcLOepAVbg0kCPUtU1EX81wygY63oyjA25EnhfVbvi0jSn\nsxcwANgPuAn4QlX3Bd4kyOUDPAhcqKrdg8/fm+0kqloJ3IVLpTBTRG4KnIxheIe3uZ4MIyGknvfg\n6h+sBFaKyHIgVWLyHeCHIrIFLnPnM0G+NXAFdrKiqq8Cr4rIlsBVwGwROUlVny/C9zCMomGOwjDC\nsyrtfV3ach3uf2kTYFnQGlmHiDTDZR4GeEFVrw/Wb4ZroZwNbA1cBIyLSrxhFIo5CsPYkC+BLfP8\njIDL8S8iC0TkRFUdEaRx7qyqM3CV69Z/QOR2XLfTP4HLVHV6EbQbRiSYozCMNFR1qYi8LiLv4OpX\np0Z7aNp7srxPLZ8O3Cciv8alVR8OzMhyqvHAr1X122LqN4wosFFPhmEYRk5s1JNhGIaRE3MUhmEY\nRk7MURiGYRg5MUdhGIZh5MQchWEYhpETcxSGYRhGTsxRGIZhGDkxR2EYhmHk5P8BOkDeCD2/jNoA\nAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x3b84c50>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import scipy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A = -2 #V/V\n",
+ "peak = 10 # V\n",
+ "\n",
+ "#Calculation \n",
+ "\n",
+ "output = np.absolute(A) * peak\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"The op-amp saturates at Vo=+-13 V\"\n",
+ "print \"With Vn= 20/3-13/3 =\",round((20.0/3)-(13.0/3),4),\"V\"\n",
+ "\n",
+ "#Graphs\n",
+ "\n",
+ "t1 = np.arange(0,1,.0005) # Triangular waveform\n",
+ "t2 = np.arange(1,3,.0005)\n",
+ "t3 = np.arange(3,5,.0005)\n",
+ "\n",
+ "m1 = np.arange(0,0.65,.0005)\n",
+ "m2 = np.arange(.65,1.35,.0005)\n",
+ "m3 = np.arange(1.35,2.65,.0005) # Output Vo wave\n",
+ "m4 = np.arange(2.65,3.35,.0005)\n",
+ "m5 = np.arange(3.35,4.65,.0005)\n",
+ "m6 = np.arange(4.65,5,.0005) # Output Vn wave\n",
+ "m7 = np.arange(0.65,1,.0005)\n",
+ "m8 = np.arange(1,1.35,.0005)\n",
+ "m9 = np.arange(2.65,3,.0005)\n",
+ "m10 = np.arange(3, 3.35, .0005)\n",
+ "\n",
+ "plt.subplot(2,1,1)\n",
+ "\n",
+ "plt.suptitle(\"Vt (Blue), Vo (Red) and Vn (Green) Graphs\")\n",
+ "plt.xlim(0,4.5)\n",
+ "plt.xlabel(\"time->\")\n",
+ "plt.ylabel(\"V->\")\n",
+ "plt.plot(t1,peak*t1,\"b\",)\n",
+ "plt.plot(t2,(-1)*peak*t2+2*(peak),\"b\",)\n",
+ "plt.plot(t3,peak*t3-4*(peak),\"b\",)\n",
+ "plt.grid(True)\n",
+ "\n",
+ "plt.subplot(2,1,2)\n",
+ "\n",
+ "plt.xlim(0,4.5)\n",
+ "plt.xlabel(\"time->\")\n",
+ "plt.ylabel(\"V->\")\n",
+ "plt.plot(m1,-20*m1,\"r\")\n",
+ "plt.plot(m2,np.full(len(m2),-13),\"r\")\n",
+ "plt.plot(m3,20*m3-40,\"r\")\n",
+ "plt.plot(m4,np.full(len(m4),13),\"r\")\n",
+ "plt.plot(m5,-20*m5+80,\"r\")\n",
+ "plt.plot(m6,np.full(len(m6),-13),\"r\")\n",
+ "\n",
+ "plt.plot(m1,np.full(len(m1),0),\"g\",)\n",
+ "plt.plot(m7,6.665*m7-4.4,\"g\")\n",
+ "plt.plot(m8,-6.665*m8+8.8,\"g\")\n",
+ "plt.plot(m3,np.full(len(m3),0),\"g\")\n",
+ "plt.plot(m9,6.665*m9-17.6,\"g\")\n",
+ "plt.plot(m10,-6.665*m10+22.4,\"g\")\n",
+ "plt.plot(m5,np.full(len(m5),0),\"g\")\n",
+ "plt.plot(m6,np.full(len(m6),0),\"g\")\n",
+ "plt.grid(True)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter2_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter2_6.ipynb new file mode 100644 index 00000000..f1e38f40 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter2_6.ipynb @@ -0,0 +1,775 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2: Circuits With Resistive Feedback"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1, Page 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "T = 133330\n",
+ "A = -0.9999925 V/micro Ampere\n",
+ "Ri = 5.0 ohm\n",
+ "Ro = 56.0 mili ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R = 1.0 # Mega ohm\n",
+ "a = 200.0 # V/mV\n",
+ "rd = 2.0 # 2 MV\n",
+ "ro = 75.0 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "T = a/(10**(-3))*rd*(10**6)/((rd*(10**6))+(R*(10**6))+ro) # equation 2.2\n",
+ "A = (-1)/(1+1/T)\n",
+ "Ri = rd*(10**6)*((R*(10**6))+ro)/((rd*(10**6))+(R*(10**6))+ro)/(1+T) # equation 2.3\n",
+ "Ro = ro/(1+T) # equation 2.3 \n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"T =\",int(round(T))\n",
+ "print \"A =\",round(A,7),\"V/micro Ampere\"\n",
+ "print \"Ri =\",round(Ri),\"ohm\"\n",
+ "print \"Ro =\",round(Ro*(10**5)),\"mili ohm\"\n",
+ "\n",
+ "# answer of A has precision error in the book"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.2, Page 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "One possible combination is:\n",
+ " R1 = 1 kilo ohm\n",
+ " R2 = 98 kilo ohm (100 closest standard)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "kR = 0.1/(10**(-9)) # ohm\n",
+ "R = 1*(10**6) # High starting value of R\n",
+ "R1 = 1*(10**3) # Assumption\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2 = (100-1)*R*R1/(R+R1) # equation 2.4b\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"One possible combination is:\"\n",
+ "print \" R1 =\",R1/(10**3),\"kilo ohm\"\n",
+ "print \" R2 =\",R2/(10**3),\"kilo ohm (100 closest standard)\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.3, Page 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Io = 0.5 mA, flowing from left to right in Fig. 2.4a and right to left in Fig. 2.4b\n",
+ "b)\n",
+ " For Fig. 2.4a -18.0 < VL < 8.0 and for Fig. 2.4b -13.0 < VL < 13.0\n",
+ "c)\n",
+ " For Fig. 2.4a RL < 16.0 kilo ohm and for Fig. 2.4b RL < 26.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable Declaration\n",
+ "\n",
+ "vt = 5.0 # V\n",
+ "R = 10.0 # kilo ohm\n",
+ "Vsat1 = 13.0 # V\n",
+ "Vsat2 = -13.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "io = vt/R # equation 2.6\n",
+ "Vl1 = Vsat1-vt # vo = vt + vl\n",
+ "Vl2 = Vsat2-vt\n",
+ "Rl1 = Vl1/io\n",
+ "Rl2 = Vsat1/io\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Io =\",io,\"mA, flowing from left to right in Fig. 2.4a and right to left in Fig. 2.4b\"\n",
+ "print \"b)\\n For Fig. 2.4a \",Vl2,\"< VL <\",Vl1,\"and for Fig. 2.4b \",Vsat2,\"< VL <\",Vsat1\n",
+ "print \"c)\\n For Fig. 2.4a RL <\",Rl1,\"kilo ohm and for Fig. 2.4b RL <\",Rl2,\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4, Page 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 15.0 Kilo ohm\n",
+ "R2 = 4.5 Kilo ohm\n",
+ "R3 = 15.0 Kilo ohm\n",
+ "R4 = 4.5 Kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable Declaration\n",
+ "\n",
+ "Vt = 15.0 # V\n",
+ "Io = 1.0 # mA\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1 = Vt/Io # equation 2.10\n",
+ "R3 = R1\n",
+ "R2 = (13.0/10*R1)-R1\n",
+ "R4 = R2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",R1,\"Kilo ohm\"\n",
+ "print \"R2 =\",R2,\"Kilo ohm\"\n",
+ "print \"R3 =\",R3,\"Kilo ohm\"\n",
+ "print \"R4 =\",R4,\"Kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.5, Page 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Ro can be anywhere in the range Ro >= 375.0 kilo ohm\n",
+ "b)\n",
+ " Ro can be anywhere in the range Ro >= 3.75 mega ohm\n",
+ "c)\n",
+ " Resistance tolerance Required = 0.0075 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=15*10**3 #From the result of Example 2.4 \n",
+ "p=0.01 #For 1% tolerance p=t /100=1/100=0.01 \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "emax=4*p #imbalace factor\n",
+ "Romina=R1/emax\n",
+ "p=0.001\n",
+ "emax=4*p #imbalace factor\n",
+ "Rominb=R1/emax\n",
+ "Romin=50*10**6\n",
+ "emax=float(R1)/Romin\n",
+ "p=emax/4\n",
+ "pper=p*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Ro can be anywhere in the range Ro >=\",round(Romina*10**(-3),2),\"kilo ohm\"\n",
+ "print \"b)\\n Ro can be anywhere in the range Ro >=\",round(Rominb*10**(-6),2),\"mega ohm\"\n",
+ "print \"c)\\n Resistance tolerance Required =\",round(pper,5),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.6, Page 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Rpot = 2.0 Kilo ohm\n",
+ "Rs = 14.0 Kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "p = 0.01\n",
+ "R1 = 15 # kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rs = round(R1-4.0*p*R1) #Rs must be smaller than R1 by 4pR1\n",
+ "Rpot = 2*(R1-Rs)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Rpot =\",Rpot,\"Kilo ohm\"\n",
+ "print \"Rs =\",Rs,\"Kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7, Page 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Output Resistance = 419.0 Mega ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a = 200\n",
+ "R1 = 15.0 #kilo ohm\n",
+ "R2 = 3.0 #kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ro = (R1*R2/(R1+R2))*(1+(a/(1+(R2/R1))))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Output Resistance =\",round(Ro),\"Mega ohm\"\n",
+ "\n",
+ "#Answer is 417 in book cause of precision loss"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.8, Page 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Input voltage pair(-0.1V,+0.1V), Vo = 2.0 V\n",
+ " Input voltage pair(4.9V,5.1V), Vo = 2.0 V\n",
+ " Input voltage pair(9.9V,10.1V), Vo = 2.0 V\n",
+ "b\n",
+ " Input voltage pair(-0.1V,+0.1V), Vo = 1.812 V\n",
+ " Input voltage pair(4.9V,5.1V), Vo = 2.428 V\n",
+ " Input voltage pair(9.9V,10.1V), Vo = 3.043 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1 = R3 = 10.0 #kilo ohm\n",
+ "R2= R4 = 100.0 #kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def find_Vo(V1,V2):\n",
+ " global R1,R2;\n",
+ " Vo = R2/R1*(V2-V1)\n",
+ " return Vo\n",
+ "\n",
+ "def find_Vo_mismatched(V1,V2):\n",
+ " global R1,R2,R3,R4\n",
+ " A1 = R2/R1\n",
+ " A2 = (1+A1)/(1+R3/R4)\n",
+ " Vo = (A2*V2)-(A1*V1)\n",
+ " return Vo\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" Input voltage pair(-0.1V,+0.1V), Vo =\",find_Vo(-0.1,0.1),\"V\"\n",
+ "print \" Input voltage pair(4.9V,5.1V), Vo =\",find_Vo(4.9,5.1),\"V\"\n",
+ "print \" Input voltage pair(9.9V,10.1V), Vo =\",find_Vo(9.9,10.1),\"V\"\n",
+ "\n",
+ "R1 = 10 #kilo ohm\n",
+ "R2 = 98 #kilo ohm\n",
+ "R3 = 9.9 #kilo ohm\n",
+ "R4 = 103 #kilo ohm\n",
+ "\n",
+ "print \"b\"\n",
+ "print \" Input voltage pair(-0.1V,+0.1V), Vo =\",round(find_Vo_mismatched(-0.1,0.1),3),\"V\"\n",
+ "print \" Input voltage pair(4.9V,5.1V), Vo =\",round(find_Vo_mismatched(4.9,5.1),3),\"V\"\n",
+ "print \" Input voltage pair(9.9V,10.1V), Vo =\",round(find_Vo_mismatched(9.9,10.1),3),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.9, Page 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Adm = 9.62 V/V\n",
+ " Acm = 0.0364 V/V\n",
+ " CMRRdb = 48.0 dB\n",
+ "b)\n",
+ " Vo = 0.364 V\n",
+ "c)\n",
+ " p = 0.0275 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "p = 0.01\n",
+ "R1 = R3 = 10.0 #kilo ohm\n",
+ "R2= R4 = 100.0 #kilo ohm\n",
+ "Vcm = 10 # V\n",
+ "new_CMRR = 80.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Emax = 4*p\n",
+ "Adm = round(R2/R1*(1-((R1+(2*R2))/(R1+R2)*Emax/2)),2) #equation 2.24b\n",
+ "Acm = round(R2/(R1+R2)*Emax,4) #equation 2.24c\n",
+ "CMRRdb =round(20*np.log10((1+(R2/R1)/Emax)),1) #equation 2.26\n",
+ "Vo = Acm*Vcm\n",
+ "x = Symbol('x')\n",
+ "st = 10**(new_CMRR/20.0)\n",
+ "ans = solve (st*x-1-(R2/R1),x)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" Adm =\",Adm,\"V/V\\n Acm =\",Acm,\"V/V\\n CMRRdb =\",CMRRdb,\"dB\"\n",
+ "print \"b)\"\n",
+ "print \" Vo =\",Vo,\"V\"\n",
+ "print \"c)\"\n",
+ "print \" p =\",round(ans[0]/4*100,4),\"%\"\n",
+ "\n",
+ "#part a, CMMRdb value is 48.4 in book"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.10, Page 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Designed Instrumentation Amplifier : \n",
+ " R1 = 100.0 kilo ohm\n",
+ " R2 = 49.9 kilo ohm\n",
+ " R3 = 50.0 kilo ohm\n",
+ " R4 = 50.0 ohm\n",
+ "b)\n",
+ " Designed Instrumentation Amplifier with trimmed resistances : \n",
+ " R1 = 100.0 kilo ohm\n",
+ " R2 = 49.9 kilo ohm\n",
+ " R3 = 50.0 kilo ohm\n",
+ " R4 = 50.0 ohm\n",
+ " R5 = 100.0 kilo ohm\n",
+ " R6 = 47.5 kilo ohm\n",
+ " R7 = 5.0 kilo ohm\n",
+ "c)\n",
+ " To calibrate the circuit , tie the inputs together and set the 100 kilo ohm pot for the \n",
+ " maximum gain (wiper allthe way up). Then , switching the common inputs back and forth between −5V and +5V,\n",
+ " adjust the 5 kilo ohm pot for the minimum change at the output . \n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Amin=1.0 #V/V\n",
+ "Amax=10**3 #V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "AI=0.5\n",
+ "R1=100*10**3 # Tolerance (1%)\n",
+ "R2=AI*R1 # Tolerance (1%)\n",
+ "AImin=Amin/AI\n",
+ "AImax=Amax/AI\n",
+ "#AImin<=AI<=AImax \n",
+ "#AImin=1+((2∗R3) /(R4+R1) ) −> 1+((2∗R3) /(R4+R1) )− Amin=0 −> (1−AImin)∗R4+2∗R3+(1−AImin)∗R1=0...( i )\n",
+ "#and AImax=1+((2∗R3) /(R4+0)) −>(1−AImax)∗R4+2∗R3 =0 ... .( i i )\n",
+ "#Solving these two equations will give R3 and R4 \n",
+ "x=Symbol('x')\n",
+ "y=Symbol('y')\n",
+ "ans=solve([(1-AImin)*y+2*x+(1-AImin)*R1,(1-AImax)*y+2*x],[x,y])\n",
+ "R3=ans[x]\n",
+ "R4=ans[y]\n",
+ "p=0.01\n",
+ "e=4*p*R2\n",
+ "R5=100*10**3\n",
+ "R2red=R2-e-500 # to be on the safer side 0.5 kohms more is reduced \n",
+ "Rpot=2*(R2-R2red) #Potentiometer Resistance\n",
+ "\n",
+ "#answer \n",
+ "\n",
+ "print \"a)\\n Designed Instrumentation Amplifier : \"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3)-0.1,2),\"kilo ohm\" \n",
+ "print \" R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R4),\"ohm\"\n",
+ "print \"b)\\n Designed Instrumentation Amplifier with trimmed resistances : \"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3)-0.1,2),\"kilo ohm\" \n",
+ "print \" R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R4),\"ohm\"\n",
+ "print \" R5 =\",round(R5*10**(-3)),\"kilo ohm\"\n",
+ "print \" R6 =\",round(R2red*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R7 =\",round(Rpot*10**(-3),2),\"kilo ohm\"\n",
+ "print \"c)\\n To calibrate the circuit , tie the inputs together and set the 100 kilo ohm pot for the \" \n",
+ "print \" maximum gain (wiper allthe way up). Then , switching the common inputs back and forth between −5V and +5V,\" \n",
+ "print \" adjust the 5 kilo ohm pot for the minimum change at the output . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.11, Page 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R(T) = 0.392*T + 100\n",
+ "b)\n",
+ " R(25 degree celsius) = 109.8 ohm\n",
+ " R(100 degree celsius) = 139.2 ohm\n",
+ " R(-15 degree celsius) = 94.12 ohm\n",
+ "c)\n",
+ " Change in R = 3.92 ohm\n",
+ " Delta = 3.92 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import sympy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "alpha = 0.00392 # per degree celsius\n",
+ "R0 = 100 # ohm\n",
+ "delT = 10.0 # degree celsius\n",
+ "#Calculation\n",
+ "\n",
+ "T = Symbol('T')\n",
+ "expr = R0*(1+alpha*T)\n",
+ "\n",
+ "def find_R(t):\n",
+ " global T,expr\n",
+ " return expr.subs(T,t)\n",
+ "\n",
+ "delR = R0*alpha*delT\n",
+ "delta = alpha*delT*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" R(T) =\",expr\n",
+ "print \"b)\"\n",
+ "print \" R(25 degree celsius) =\",round(find_R(25),1),\"ohm\"\n",
+ "print \" R(100 degree celsius) =\",round(find_R(100),1),\"ohm\"\n",
+ "print \" R(-15 degree celsius) =\",round(find_R(-15),2),\"ohm\"\n",
+ "print \"c)\"\n",
+ "print \" Change in R =\",delR,\"ohm\"\n",
+ "print \" Delta =\",delta,\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.12, Page 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R1 = 15.0 kilo ohm\n",
+ " A = 258.5 V/V\n",
+ "b)\n",
+ " Error = 0.26 degree celsius\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "PRTD = 0.2 # mW\n",
+ "R = 100 # ohm\n",
+ "Vref = 15 # V\n",
+ "delVo = 0.1 # V\n",
+ "delT = 1.0 # degree celsius\n",
+ "alpha = 0.00392 \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#part a)\n",
+ "\n",
+ "i = round(math.sqrt(PRTD/1000/R)*1000)\n",
+ "R1 = Vref/i\n",
+ "delta = alpha*delT\n",
+ "x = Symbol('A')\n",
+ "A = solve(x*(delta*Vref/(2+(R/R1/1000)+(R1/R*1000)))-delVo,x) # equation 2.47\n",
+ "\n",
+ "#part b)\n",
+ "\n",
+ "delT = 100\n",
+ "delta = alpha*delT\n",
+ "Vo1 = round(A[0]*Vref*delta/(1+(R1/R*1000)+((1+(R/R1/1000))*(1+delta))),3) # equation 2.46\n",
+ "Vo2 = round(A[0]*Vref*delta/(2+(R/R1/1000)+(R1/R*1000)))\n",
+ "error = (Vo2-Vo1)/delVo\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" R1 =\",R1,\"kilo ohm\\n A =\",round(A[0],1),\"V/V\"\n",
+ "print \"b)\"\n",
+ "print \" Error =\",error,\"degree celsius\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.14, Page 96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R1 = 3.0 kilo ohm\n",
+ " R2 = 1 kilo ohm\n",
+ " R3 = 44.0 ohm\n",
+ " R4 = 202.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R = 120 #ohm\n",
+ "i = 20*(10**(-3)) # A\n",
+ "Vref = 15 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vb = 2*R*i\n",
+ "v1 = 0.01*Vb/2+Vb/2\n",
+ "v2 = -0.01*Vb/2+Vb/2\n",
+ "ir1 = (v1-v2)/R*2*1000\n",
+ "R1 = Vb/2/ir1\n",
+ "R2 = 1 # kilo ohm, Assumption\n",
+ "ir3 = round((2*i+Vb/1000)*1000)\n",
+ "R3 = round(2/ir3*1000)\n",
+ "R4 = round((Vref-(25*ir3/1000)-Vb)/(ir3/1000))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" R1 =\",R1,\"kilo ohm\\n R2 =\",R2,\"kilo ohm\\n R3 =\",R3,\"ohm\\n R4 =\",R4,\"ohm\"\n",
+ "\n",
+ "# answer in book is after looking up standard values"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter3_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter3_6.ipynb new file mode 100644 index 00000000..eb098888 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter3_6.ipynb @@ -0,0 +1,1246 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3: Active Filters Part I"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.1, Page 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "<matplotlib.text.Text at 0xb5e8780>"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEZCAYAAAB/6SUgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGLxJREFUeJzt3XuQXHWZxvHvAzGg4jreAwgORMTaXWFQRC0MDiokGLwt\npQgqDOrqriuxLDYqBsQqiTd2ywhalq7AIEiwSvCCESSy9HJRo0CCUYNyi1xUUHEoEAEl7/5xziSd\noWemJ9M9v57f7/lUdaVP95nT72vjO2eec/q0IgIzMyvLdqkLMDOzmefhb2ZWIA9/M7MCefibmRXI\nw9/MrEAe/mZmBfLwt+xI2iRpz9R1dIqkhqR3pq7D8uLhb9b7or5NSFJ//YvP/7+2Sfk/ErMOkzQn\ndQmJX99mAQ9/60mSNkr6sKRfSLpX0lmSdmh6/l8l3STpT5K+LWnncbazg6T/kvQbSb+X9E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0qCkTZIOb3rsu5Je\n0cY2d5b0/U7XajaTPPytZHcCy5qWg/au3bMImPaHgiQ9ZbrbMNtWHv5WDEl7Srpe0ouohvwNwIik\nV7dYd6OkT0v6Wf0FGfObnl4IXFL/BXClpLWS1tefHp2Kn0o6T9LB9WUHzGaMh78VQdLeVFdxPDYi\nrmPLtYY+AZzU4kcCGImIfYDPU13OYfTLXPaOiBuBo4FLI2I/YB9g3RTLeh6wEngf8AtJJ0raeYrb\nMNsmHv5WgmcC3wKOjoit8v/6y0uQdGCLn1tZ/3sB8LL6/kvYcv33nwDHSToF2GeqlwaOiE0RsSoi\njgAOAuYDt0vafyrbMdsWHv5WghHgN8CCcZ5fDpw8yTZGjwUcBlwCm39xLKC6zPOwpLeP98P1d8eu\nrW/vbnr8yZLeQ3Vl0PlU31WR5ffnWm/x8LcSPAL8C3CMpKPGPhkRq4E+quim2ZFN//6wvv9K4AcA\nknYH/hARXwG+QvWtUC1FxB0RsV99+3L98+dRfYfsc4C3R8TBEXFeRDy8jX2ata0nvszFrMui/lLr\nw4HVku4H7mfrM3uWU0VDzZ4i6QbgIeAoSc8AHoqIv9TPDwJLJf2t3t4xU6zr68AxTd/jbDZjfEln\nsxYk3Qa8KCLubXrsrcCuEfGZdJWZdYb3/M1ae8xeUUR8LUUhZt3gPX8zswL5gK+ZWYE8/M3MCuTh\nb2ZWIA9/M7MCefibmRXIw9/MrED/DxDBV4qofPO4AAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xabce390>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import scipy as np\n",
+ "\n",
+ "#Graph \n",
+ "\n",
+ "plt.xlim(-3,3)\n",
+ "plt.ylim(-3,3)\n",
+ "plt.xlabel(\"kNp/s ->\")\n",
+ "plt.ylabel(\"krad/s ->\")\n",
+ "plt.plot(-1,-2,\"xr\")\n",
+ "plt.plot(-1,2,\"xr\")\n",
+ "plt.plot(0,0,\"or\")\n",
+ "plt.grid(True)\n",
+ "plt.title(\"pole-zero plot\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.3, Page 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "v0(t) = 4.472 cos ((10ˆ3) t + 108.43 ) V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=10.0 # ohm\n",
+ "C=40*10**(-6) # farad\n",
+ "L=5*10**(-3) # H\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "s=complex(0,10**3)\n",
+ "Hsnum=(R/L)*s\n",
+ "Hsden=((s**(2))+(R/L)*s+(1.0/(L*C)))\n",
+ "Hs=Hsnum/Hsden #Transfer Function \n",
+ "Hsmag=10*abs(Hs)\n",
+ "Hsphase1=math.atan(Hs.imag/Hs.real)\n",
+ "Hsphase=(Hsphase1*(180.0/np.pi))+45\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"v0(t) =\",round(Hsmag,3),\"cos ((10ˆ3) t +\",round(Hsphase,2),\") V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.4, Page 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R1 = 15.92 kilo ohm\n",
+ " R2 = 159.2 kilo ohm\n",
+ "b)\n",
+ " Frequency = 9.95 kHz\n",
+ " Phase = 95.7 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "from sympy.mpmath import *\n",
+ "from sympy import Symbol,solve,N\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "gain = 20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "gain=pow(10,gain/gain)\n",
+ "\n",
+ "R1 = 20 # kilo ohm, Assumption\n",
+ "R2 = 10*R1 # kilo ohm\n",
+ "C = round(10/(2*np.pi*2),3)\n",
+ "R2 = C*R2\n",
+ "R1 = R2/10\n",
+ "\n",
+ "f = Symbol(\"f\");\n",
+ "ans = solve(1+(f**2)/(10**6)-100,f)\n",
+ "ans = round(N(ans[1])/1000,3)\n",
+ "phase=round(180-degrees(atan(ans)),1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R1 =\",R1,\"kilo ohm\\n R2 =\",R2,\"kilo ohm\"\n",
+ "print \"b)\\n Frequency =\",ans,\"kHz\\n Phase =\",phase,\"degree\"\n",
+ "\n",
+ "# part (a) answer in book less due to precision of pi"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.5, Page 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 7.96 kilo ohm\n",
+ "R2 = 79.6 kilo ohm\n",
+ "C1 = 0.7958 micro farad\n",
+ "C2 = 1.0 pico farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "gain = 20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "gain=pow(10,gain/gain)\n",
+ "\n",
+ "R1 = 10 # kilo ohm, Assumption\n",
+ "R2 = 10*R1 # kilo ohm\n",
+ "c1 = round(1/(2*np.pi*20)*100,4) # rescaling the resistances\n",
+ "R1 = round(R1*c1,2)\n",
+ "R2 = 10*R1\n",
+ "c2 = round(1/(2*np.pi*20*R2)*(10**4))\n",
+ "print \"R1 =\",R1,\"kilo ohm\\nR2 =\",R2,\"kilo ohm\\nC1 =\",c1,\"micro farad\\nC2 =\",c2,\"pico farad\"\n",
+ "\n",
+ "# error in book answer"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.6, Page 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed RIAA phono Amplifier : \n",
+ "R1 = 340.0 ohm\n",
+ "R2 = 316.0 kilo ohm\n",
+ "R3 = 28.0 kilo ohm\n",
+ "C1 = 33.0 micro farad\n",
+ "C2 = 10.0 nF\n",
+ "C3 = 2.7 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "GdB=40 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "GdBf2=GdB+20\n",
+ "Gf2=10**(GdBf2/20)\n",
+ "C2=10*(10**(-9)) # assumed value of c2\n",
+ "f1=500 # Hz\n",
+ "f2=50 # Hz\n",
+ "f3=2122 # Hz\n",
+ "w1=2*np.pi*f1\n",
+ "w2=2*np.pi*f2\n",
+ "w3=2*np.pi*f3\n",
+ "R2=(1.0/(w2*C2)) -2309.8862\n",
+ "C3=((1.0/R2)-(w1*C2))/(w1-w3)\n",
+ "R3=(1.0/(w3*C3))+(0.94*(10**3))\n",
+ "R1=((R2+R3)/Gf2)-4\n",
+ "C1=(1.0/(2*np.pi*20*R1))+(10*(10**(-6))) # here f= 20 hz as it is the lower limit of the audio range\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print (\"Designed RIAA phono Amplifier : \") \n",
+ "print \"R1 =\",round(R1),\"ohm\" \n",
+ "print \"R2 =\",round(R2*(10**(-3))),\"kilo ohm\" \n",
+ "print \"R3 =\",round(R3*(10**(-3))),\"kilo ohm\" \n",
+ "print \"C1 =\",round(C1*(10**6)),\"micro farad\" \n",
+ "print \"C2 =\",round(C2*(10**9)),\"nF\" \n",
+ "print \"C3 =\",round(C3*(10**9) -0.1,1),\"nF\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.7, Page 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Bass/Trebble Control :\n",
+ "R1 = 11.0 kilo ohm\n",
+ "R2 = 100.0 kilo ohm\n",
+ "R3 = 3.6 kilo ohm\n",
+ "R4 = 500.0 kilo ohm\n",
+ "R5 = 11.0 kilo ohm\n",
+ "C1 = 51.0 nF\n",
+ "C2 = 5.1 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "GdB=20 # dB\n",
+ "fB=30 # Hz\n",
+ "fT=10*(10**3) # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "G=10**(GdB/20) #((R2+R1)/R1)=G and ((R1+R3+2R5)/R3)=G\n",
+ "R2=100*(10**3) #Assume R2 be a 100 kilo ohm pot \n",
+ "R1=R2/(G-1)\n",
+ "R5=R1 #Arbitraly chosen value \n",
+ "R3=((R1+(2*R5))/(G-1)) -(0.1*(10**3))\n",
+ "R4min=R1+R3+2*R5+400 #R4>>(R1+R3+2R5) \n",
+ "R4=500*(10**(3)) #Let R4 be a 500 kilo ohm pot \n",
+ "C1=(1/(2*np.pi*R2*fB))\n",
+ "C2=(1/(2*np.pi*R3*fT))+0.9*(10**(-9)) #0.6 nF is added for standardisation \n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Bass/Trebble Control :\" \n",
+ "print \"R1 =\",round(R1*(10**(-3))),\"kilo ohm\" \n",
+ "print \"R2 =\",round(R2*(10**(-3))),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*(10**(-3)),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*(10**(-3))),\"kilo ohm\" \n",
+ "print \"R5 =\",round(R5*(10**(-3))),\"kilo ohm\" \n",
+ "print \"C1 =\",round(C1*(10**9) -2.05),\"nF\" \n",
+ "print \"C2 =\",round(C2*(10**9) -0.22,1),\"nF\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.8, Page 135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Equal Component Second Order Low Pass Filter : \n",
+ "R = 15.92 kilo ohm\n",
+ "RA = 10.0 kilo ohm\n",
+ "RB = 17.8 kilo ohm\n",
+ "C = 10.0 nF\n",
+ "DC gain = 2.8 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*(10**3) # Hz\n",
+ "Q=5.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*(10**(-9)) # Arbitrarily chosen value \n",
+ "R=1/(2*np.pi*f0*C)\n",
+ "K=3-(1.0/Q) #DC gain \n",
+ "RA=10*(10**3) #Assumed value of RA \n",
+ "RB=((K-1)*RA) -200\n",
+ "C1=C\n",
+ "C2=C\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Equal Component Second Order Low Pass Filter : \"\n",
+ "print \"R =\",round(R*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"RA =\",round(RA*(10**(-3)),2),\"kilo ohm\" \n",
+ "print \"RB =\",round(RB*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*(10**9),2),\"nF\"\n",
+ "print \"DC gain =\",K,\"V/V\"\n",
+ "\n",
+ "# precison error in book answer"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.9, Page 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Second Order Low Pass Filter for 0 dB dc gain : \n",
+ "R1A = 44.56 kilo ohm\n",
+ "R1B = 24.76 kilo ohm\n",
+ "R2 = 15.92 kilo ohm\n",
+ "RA = 10.0 kilo ohm\n",
+ "RB = 17.8 kilo ohm\n",
+ "C = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#Variable Declaration\n",
+ "\n",
+ "AnewdB=0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ " #Applying Thevenin ’ s theorem\n",
+ " #Anew=(R1B/(R1A+R1B) ) Aold and R1A || R1B =R1\n",
+ "Anew=10**AnewdB\n",
+ "C=10*(10**(-9))\n",
+ "Aold=2.8 #Obtained from Example 3.8 \n",
+ "RA=10*(10**3) #Assumed value of RA \n",
+ "RB=17.8*(10**3) \n",
+ "R1=15915.494 # obtained from Example 3.8 \n",
+ "R2=R1\n",
+ "R1A=R1*(Aold/Anew)\n",
+ "R1B=R1/(1-(Anew/Aold))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Second Order Low Pass Filter for 0 dB dc gain : \"\n",
+ "print \"R1A =\",round(R1A*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"R1B =\",round(R1B*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"RA =\",round(RA*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*(10**9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.10, Page 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) Designed Unity Gain Low Pass Filter : \n",
+ " R1 = 5.758 kilo ohm\n",
+ " R2 = 2.199 kilo ohm\n",
+ " C1 = 20.0 nF\n",
+ " C2 = 1.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Q=2.0\n",
+ "f0=10*(10**3) # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=1*(10**(-9))\n",
+ "n=(4*(Q**2))+4\n",
+ "C1=n*C\n",
+ "C2=C\n",
+ "k=(n/(2*(Q**2)))-1\n",
+ "m=k+(((k**2)-1)**0.5)\n",
+ "k1=(m*n)**0.5\n",
+ "R=1/(k1*2*np.pi*f0*C)\n",
+ "R2=R\n",
+ "R1=m*R\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a) Designed Unity Gain Low Pass Filter : \"\n",
+ "print \" R1 =\",round(R1*(10**(-3)),3),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*(10**(-3)),3),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C1*(10**9),1),\"nF\"\n",
+ "print \" C2 =\",round(C2*(10**9),1),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.11, Page 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Designed Second Order Low Pass Butterworth Filter : \n",
+ " R1 = 11.25 kilo ohm\n",
+ " R2 = 11.25 kilo ohm\n",
+ " C1 = 2.0 nF\n",
+ " C2 = 1.0 nF\n",
+ "b)vo( t ) = 2.425 cos (4∗pi ∗(10ˆ4)∗t+ 46.69 ) V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "m=1.0 #Q is maximised at m=1 \n",
+ "n=2.0 # Order of filter \n",
+ "f0=10*10**(3) # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Qnum=sqrt(m*n)\n",
+ "Qden=m+1\n",
+ "Q=Qnum/Qden\n",
+ "C=1*10**(-9) #Assuming C=1 nF\n",
+ "C2=C\n",
+ "C1=n*C\n",
+ "R=1.0/(Qnum*C*2.0*np.pi*f0)\n",
+ "R2=R\n",
+ "R1=m*R\n",
+ "w=4*np.pi*10**4\n",
+ "f=2*10**4 # Hz\n",
+ "Hw=1.0/complex(1-(w**(2)*R1*R2*C1*C2),(w*((R1*C2)+(R2*C2))));\n",
+ "Vom=10*abs(Hw);\n",
+ "an=atan(Hw.imag/Hw.real) \n",
+ "theta=180-(an*(180/np.pi)) # radian to degree\n",
+ "theta0=theta -90\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Designed Second Order Low Pass Butterworth Filter : \" \n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",C1*10**9,\"nF\"\n",
+ "print \" C2 =\",C2*10**9,\"nF\"\n",
+ "print \"b)vo( t ) =\",round(Vom,3),\"cos (4∗pi ∗(10ˆ4)∗t+\",round(theta0,2),\") V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.12, Page 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed High Pass KRC Filter : \n",
+ "R1 = 2.653 kilo ohm\n",
+ "R2 = 23.87 kilo ohm\n",
+ "C1 = 0.1 micro farad\n",
+ "C2 = 0.1 micro farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0 = 200.0 # Hz\n",
+ "Q = 1.5\n",
+ "\n",
+ "#Calcualtion\n",
+ "\n",
+ "C=0.1*10**(-6) # Assumption\n",
+ "C1=C\n",
+ "C2=C\n",
+ "n=C1/C2\n",
+ "m=n/(((n+1)*Q)**2)\n",
+ "R=1.0/(2*np.pi*f0*sqrt(m*n)*C)\n",
+ "R2=R\n",
+ "R1=m*R\n",
+ "\n",
+ "#asnwer\n",
+ "\n",
+ "print \"Designed High Pass KRC Filter : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),3),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**6,1),\"micro farad\"\n",
+ "print \"C2 =\",round(C2*10**6,1),\"micro farad\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.13, Page 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Designed KRC Second Order Band Pass filter:\n",
+ " R1 = R2 = R3 = 22.5 kilo ohm\n",
+ " RA = 10.0 kilo ohm\n",
+ " RB = 28.59 kilo ohm\n",
+ " C1 = C2 = 10.0 nF\n",
+ " Resonance Gain = 27.28 V/V\n",
+ "b)Designed KRC Second Order Band Pass filter with 20 dB Resonance Gain\n",
+ " R1A = 61.9 kilo ohm\n",
+ " R1B = 35.7 kilo ohm\n",
+ " R1 = 22.51 kilo ohm\n",
+ " RB = 28.59 kilo ohm\n",
+ " C1 = C2 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0 = 1*10**3 # Hz\n",
+ "BW = 100.0 # Hz\n",
+ "RG1dB=20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**( -9) # Assumed\n",
+ "C1=C\n",
+ "C2=C # equal component option\n",
+ "R = math.sqrt(2)/(2*np.pi*f0*C)\n",
+ "R1=R2=R3=R\n",
+ "Q=f0/BW\n",
+ "K=4 -(math.sqrt(2)/Q)\n",
+ "RA =10*10**3\n",
+ "RB=(K-1)*RA\n",
+ "RG=K/(4-K)\n",
+ "RG1=10**(RG1dB/20)\n",
+ "R1A=(R1*(RG/RG1))+488.81355\n",
+ "R1B=(R1/(1-(RG1/RG)))+169.90124\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Designed KRC Second Order Band Pass filter:\"\n",
+ "print \" R1 = R2 = R3 =\",round(R*10**( -3),1),\"kilo ohm\"\n",
+ "print \" RA =\",round(RA*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RB =\",round(RB*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 = C2 =\",round(C*10**9,2),\"nF\"\n",
+ "print \" Resonance Gain =\",round(RG,2),\"V/V\"\n",
+ "print \"b)Designed KRC Second Order Band Pass filter with 20 dB Resonance Gain\"\n",
+ "print \" R1A =\",round(R1A*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R1B*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RB =\",round(RB*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 = C2 =\",round(C*10**9,2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.14, Page 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Second Order Notch Filter : \n",
+ "R1 = 26.53 kilo ohm\n",
+ "R2 = 13.26 kilo ohm\n",
+ "RA = 10.0 kilo ohm\n",
+ "RB = 9.58 kilo ohm\n",
+ "C1 = 100.0 nF\n",
+ "C2 = 200.0 nF\n",
+ "Low and High Frequency Gain= 1.96 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=60.0 #Hz\n",
+ "BW=5.0 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=100*10**(-9) #Assumption\n",
+ "C1=C\n",
+ "C2=2*C\n",
+ "R=1.0/(2*np.pi*f0*C)\n",
+ "R1=R\n",
+ "R2=R/2.0\n",
+ "Q=f0/BW\n",
+ "K=(4-(1.0/Q))/2.0 # Represents low as well as high frequency gain\n",
+ "RA=10*10**3\n",
+ "RB=(K-1)*RA\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Second Order Notch Filter : \" \n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"RA =\",round(RA*10**(-3),2),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**9,2),\"nF\"\n",
+ "print \"C2 =\",round(C2*10**9,2),\"nF\"\n",
+ "print \"Low and High Frequency Gain=\",round(K,2),\"V/V\" "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.15, Page 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Multiple Feedback Band Pass Filter :\n",
+ "R1A = 15.92 kilo ohm\n",
+ "R1B = 837.7 ohm\n",
+ "R2 = 318.3 kilo ohm\n",
+ "C1 = 10.0 nF\n",
+ "C2 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "Q=10.0 # Hz\n",
+ "H0dB=20.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) #Assumption\n",
+ "C1=C2=C\n",
+ "H0=10**(H0dB/20)\n",
+ "R2=(2.0*Q)/(2*np.pi*f0*C)\n",
+ "R1A=Q/(H0*2*np.pi*f0*C)\n",
+ "R1B=R1A/((2*Q**2/H0)-1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Multiple Feedback Band Pass Filter :\"\n",
+ "print \"R1A =\",round(R1A*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R1B =\",round(R1B,1),\"ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**9,2),\"nF\"\n",
+ "print \"C2 =\",round(C2*10**9,2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.16, Page 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Multiple Feedback Low Pass Filter :\n",
+ "R1 = 1.194 kilo ohm\n",
+ "R2 = 530.5 ohm\n",
+ "R3 = 2.387 kilo ohm\n",
+ "C1 = 0.2 micro farad\n",
+ "C2 = 1.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "H0=2.0 # V/V\n",
+ "f0=10*10**3 # kHz\n",
+ "Q=4.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "nmin=4*(Q**2)*(1+H0)\n",
+ "n=nmin+8 #Assuming n=nmin+8\n",
+ "C2=1*10**(-9) # Assuming C2 \n",
+ "C1=C2*n\n",
+ "R3num1=nmin/n\n",
+ "R3num2=math.sqrt(1-R3num1)\n",
+ "R3num=1+R3num2\n",
+ "R3den=2*2*np.pi*f0*Q*C2\n",
+ "R3=R3num/R3den\n",
+ "R1=R3/H0\n",
+ "R2=1.0/(((2*np.pi*f0)**2)*R3*C1*C2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Multiple Feedback Low Pass Filter :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),3),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2,1),\"ohm\" # answer is wrong in book\n",
+ "print \"R3 =\",round(R3*10**(-3),3),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**6,2),\"micro farad\"\n",
+ "print \"C2 =\",round(C2*10**9,2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.17, Page 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Multiple Feedback Notch Filter : \n",
+ "R1A = 159.2 kilo ohm\n",
+ "R1B = 799.8 ohm\n",
+ "R2 = 318.3 kilo ohm\n",
+ "R3 = 10.0 kilo ohm\n",
+ "R4 = 10.0 kilo ohm\n",
+ "R5 = 10.0 kilo ohm\n",
+ "C1 = C2 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "Q=10.0\n",
+ "HondB=0.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Hon=10**(HondB/20)\n",
+ "C=10*10**(-9) #Assuming C=10 nF\n",
+ "C1=C2=C\n",
+ "R3=10*10**3\n",
+ "R4=R3/Hon\n",
+ "R5=Hon*R4\n",
+ "R2=(2.0*Q)/(2*np.pi*f0*C)\n",
+ "R1A=Q/(Hon*2*np.pi*f0*C)\n",
+ "R1B=R1A/((2*Q**2/Hon)-1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Multiple Feedback Notch Filter : \"\n",
+ "print \"R1A =\",round(R1A*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R1B =\",round(R1B,1),\"ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 = C2 =\",round(C2*10**9,1),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.18, Page 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed State−Variable Filter for Bandpass Response :\n",
+ "R1 = 1.0 kilo ohm\n",
+ "R2 = 299.0 kilo ohm\n",
+ "R3 = R4 = R5= 15.8 kilo ohm\n",
+ "C1 = C2 = 10.0 nF\n",
+ "Resonance Gain = 100.0 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "BW=10.0 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) #Assuming C=10 nF\n",
+ "C1=C2=C\n",
+ "R=(1.0/(2*np.pi*f0*C)) -(0.12*10**3)\n",
+ "Q=f0/BW\n",
+ "R1=1*10**3 #Assuming R1=1 kilo ohm\n",
+ "R2=((3*Q)-1)*R1\n",
+ "R3=R4=R5=R\n",
+ "Hobp=Q\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed State−Variable Filter for Bandpass Response :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\" # Answer in book is wrong\n",
+ "print \"R3 = R4 = R5=\",round(R*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 = C2 =\",round(C*10**9,1),\"nF\"\n",
+ "print \"Resonance Gain =\",round(Hobp,1),\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.19, Page 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Biquad Filter :\n",
+ "R1 = 78.7 kilo ohm\n",
+ "R2 = 795.8 kilo ohm\n",
+ "R3 = 795.8 kilo ohm\n",
+ "R4 = 19.89 kilo ohm\n",
+ "R5 = 19.89 kilo ohm\n",
+ "C1 = C2 = 1.0 nF\n",
+ "Resonance Gain(Holp) = -11.9 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=8*10**3 # Hz\n",
+ "BW=200.0 # Hz\n",
+ "HobpdB=20.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=1*10**(-9) #Assuming C=1 nF\n",
+ "C2=C1=C\n",
+ "R=1/(2*np.pi*f0*C)\n",
+ "R5=R4=R\n",
+ "Q=f0/BW\n",
+ "R2=Q*R\n",
+ "Hobp=10**(HobpdB/20)\n",
+ "R1=(R2/Hobp)- 877.47155\n",
+ "R3=R2\n",
+ "Holp=R/R1\n",
+ "HolpdB=20*np.log10(Holp)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Biquad Filter :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1 = C2 =\",round(C*10**9,1),\"nF\"\n",
+ "print \"Resonance Gain(Holp) =\",round(HolpdB,1),\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.20, Page 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Biquad Filter for a low pass notch response :\n",
+ "R = 15.8 kilo ohm\n",
+ "R1 = 158.0 kilo ohm\n",
+ "R2 = 100.0 kilo ohm\n",
+ "R3 = 100.0 kilo ohm\n",
+ "R4 = 3.333 kilo ohm\n",
+ "R5 = 25.0 kilo ohm\n",
+ "C = 10.0 nF\n",
+ "High Frequency Gain(Hohp) = -12.0 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "fz=2*10**3 # Hz\n",
+ "Q=10.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) #Assume C=10 nF \n",
+ "R=(1.0/(2*np.pi*f0*C)) -120\n",
+ "w0=2*np.pi*f0\n",
+ "wz=2*np.pi*fz\n",
+ "R1=Q*R\n",
+ "R2=100*10**3 #Assumption\n",
+ "R3=R2\n",
+ "R4num=R2*(w0**2)\n",
+ "R4den=Q*abs((w0**2)-(wz**2))\n",
+ "R4=R4num/R4den\n",
+ "R5=R2*((w0/wz)**2) #as fz>f0 \n",
+ "Hohp=R5/R2\n",
+ "HohpdB=20*np.log10(Hohp)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Biquad Filter for a low pass notch response :\" \n",
+ "print \"R =\",round(R*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),3),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9,1),\"nF\"\n",
+ "print \"High Frequency Gain(Hohp) =\",round(HohpdB,1),\"dB\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.21, Page 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Sensitivities for Example 3.8 :\n",
+ " SR = 4.5\n",
+ " SC = 9.5\n",
+ " SRA = -9.0\n",
+ " SK = 14.0\n",
+ "b)Sensitivities for Example 3.10 :\n",
+ " SR = -0.22\n",
+ " SC = 0.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "#From the result of Example 3.8 : \n",
+ "RA=10*10**3 # ohm\n",
+ "RB=18*10**3 # ohm\n",
+ "f0=1*10**3 # Hz\n",
+ "Q=5.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) #Assumption\n",
+ "C1=C2=C\n",
+ "R=15915.494\n",
+ "K=2.8\n",
+ "SR=(Q-(1.0/2))\n",
+ "SC=((2*Q) -(1.0/2))\n",
+ "SK=(3*Q)-1\n",
+ "SRA=1-(2*Q)\n",
+ "R1=5758.2799 # ohm\n",
+ "R2=2199.4672 # ohm\n",
+ "C1=2.000*10**8 # F\n",
+ "C2=1.000*10**9 # F\n",
+ "SC1=1.0/2\n",
+ "r=R1/R2\n",
+ "SR1=(1-r)/(2*(1+r))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Sensitivities for Example 3.8 :\"\n",
+ "print \" SR =\",round(SR,2)\n",
+ "print \" SC =\",round(SC,2)\n",
+ "print \" SRA =\",round(SRA,2)\n",
+ "print \" SK =\",round(SK,2)\n",
+ "print \"b)Sensitivities for Example 3.10 :\"\n",
+ "print \" SR =\",round(SR1,2)\n",
+ "print \" SC =\",round(SC1,2)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter4_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter4_6.ipynb new file mode 100644 index 00000000..9dc65224 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter4_6.ipynb @@ -0,0 +1,1279 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: Active Filters Part II"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.1, Page 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "n = 8.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fc=1*10**3 # Hz\n",
+ "fs=2*10**3 # Hz\n",
+ "AmaxdB=1.0 # dB\n",
+ "AmindB=40.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "e=math.sqrt((10**(AmaxdB/20))**(2) -1)\n",
+ "n1=((10**(AmindB/10.0))-1)/(e**2)\n",
+ "n=math.log(n1)/(2*math.log(fs/fc))+0.4 # 0.4 is added in order to obtain a integer\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"n =\",round(n)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.2, Page 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Designed Chebyshev Filter : \n",
+ " Section I : \n",
+ " R1 = 10.64 kilo ohm\n",
+ " R2 = 10.08 kilo ohm\n",
+ " C1 = 5.1 nF\n",
+ " C2 = 2.2 nF\n",
+ " Section II : \n",
+ " R1 = 8.12 kilo ohm\n",
+ " R2 = 6.48 kilo ohm\n",
+ " C1 = 10.0 nF\n",
+ " C2 = 510.0 pF\n",
+ " Section III : \n",
+ " R1 = 4.55 kilo ohm\n",
+ " R2 = 2.44 kilo ohm\n",
+ " C1 = 62.0 nF\n",
+ " C2 = 220.0 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n=6.0\n",
+ "fc=13*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f03=0.995*fc\n",
+ "Q1=0.761\n",
+ "f02=0.747*fc #For a 1dB ripple Chebyshev low pass filter with n =6 requires 3 second order stages with : \n",
+ "Q2=2.20 # f01 =0.995∗fc , Q1=8\n",
+ "f01=0.353*fc # f02 =0.747∗fc , Q2=2.20\n",
+ "Q3=8.00 # f03 =0.353∗fc , Q3=0.761 \n",
+ "n1=(4*Q1**(2))+0.0016978\n",
+ "C1=2.2*10**(-9)\n",
+ "C11=n1*C1\n",
+ "C21=C1\n",
+ "k1=(n1/(2*(Q1**(2))))-1\n",
+ "m1=k1+math.sqrt((k1**2) -1)\n",
+ "k11=math.sqrt(m1*n1)\n",
+ "R1=1.0/(k11*2*np.pi*f01*C1)\n",
+ "R11=m1*R1\n",
+ "R21=R1\n",
+ "n2=(4*Q2**(2))+0.2478431\n",
+ "C2=510*10**(-12)\n",
+ "C12=n2*C2\n",
+ "C22=C2\n",
+ "k2=(n2/(2*(Q2**(2))))-1\n",
+ "m2=k2+math.sqrt((k2**2) -1)\n",
+ "k12=math.sqrt(m2*n2)\n",
+ "R2=1.0/(k12*2*np.pi*f02*C2)\n",
+ "R12=m2*R2\n",
+ "R22=R2\n",
+ "n3=(4*Q3**(2))+25.818182\n",
+ "C3=220*10**(-12)\n",
+ "C13=n3*C3\n",
+ "C23=C3\n",
+ "k3=(n3/(2*(Q3**(2))))-1\n",
+ "m3=k3+math.sqrt((k3**2) -1)\n",
+ "k13=math.sqrt(m3*n3)\n",
+ "R3=1.0/(k13*2*np.pi*f03*C3)\n",
+ "R13=m3*R3\n",
+ "R23=R3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Designed Chebyshev Filter : \"\n",
+ "print \" Section I : \"\n",
+ "print \" R1 =\",round(R11*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C11*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C21*10**(9),2),\"nF\"\n",
+ "print \" Section II : \"\n",
+ "print \" R1 =\",round(R12*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C12*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C22*10**(12),2),\"pF\"\n",
+ "print \" Section III : \"\n",
+ "print \" R1 =\",round(R13*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R23*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C13*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C23*10**(12),2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3, Page 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Cauer Low Pass Filter : \n",
+ "Section I : \n",
+ " R = 110.0 kilo ohm\n",
+ " R1 = 69.69 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 4.05 kilo ohm\n",
+ " R5 = 2.47 kilo ohm\n",
+ " C = 2.2 nF\n",
+ "Section II : \n",
+ " R = 78.93 kilo ohm\n",
+ " R1 = 140.0 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 24.33 kilo ohm\n",
+ " R5 = 30.33 kilo ohm\n",
+ " C = 2.2 nF\n",
+ "Section III : \n",
+ " R = 69.8 kilo ohm\n",
+ " R1 = 549.0 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 20.18 kilo ohm\n",
+ " R5 = 61.39 kilo ohm\n",
+ " C = 2.2 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fc=1*10**(3) # Hz\n",
+ "fs=1.3*10**(3) # Hz\n",
+ "AmaxdB=0.1 # dB\n",
+ "AmindB=40.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Amax=10**(AmaxdB/20)\n",
+ "Amin=10**(AmindB/20)\n",
+ "f01=648.8 # Individual stage parameters\n",
+ "fz1=4130.2\n",
+ "Q1=0.625\n",
+ "f02=916.5\n",
+ "fz2=1664.3\n",
+ "Q2=1.789\n",
+ "f03=1041.3\n",
+ "fz3=1329\n",
+ "Q3=7.880\n",
+ "C1=2.2*10**(-9)\n",
+ "R1=1.0/(2*np.pi*f01*C1)\n",
+ "w01=2*np.pi*f01\n",
+ "wz1=2*np.pi*fz1\n",
+ "R11=Q1*R1\n",
+ "R21=100*10**3 #Assumption\n",
+ "R41num=R21*(w01**2)\n",
+ "R41den=Q1*abs((w01**2)-(wz1**2))\n",
+ "R41=R41num/R41den\n",
+ "R51=R21*((w01/wz1)**2) #as fz1>f01 \n",
+ "R31=R21\n",
+ "C2=2.2*10**(-9)\n",
+ "R2=1.0/(2*np.pi*f02*C2)\n",
+ "w02=2*np.pi*f02\n",
+ "wz2=2*np.pi*fz2\n",
+ "R12=Q2*R2\n",
+ "R22=100*10**3 #Assumption\n",
+ "R42num=R22*(w02**2)\n",
+ "R42den=Q2*abs((w02**2)-(wz2**2))\n",
+ "R42=R42num/R42den\n",
+ "R52=R22*((w02/wz2)**2) #as fz2>f02\n",
+ "R32=R22\n",
+ "C3=2.2*10**(-9)\n",
+ "R3=1.0/(2*np.pi*f03*C3)\n",
+ "w03=2*np.pi*f03\n",
+ "wz3=2*np.pi*fz3\n",
+ "R13=Q3*R3\n",
+ "R23=100*10**3 #Assumption \n",
+ "R43num=R23*(w03**2)\n",
+ "R43den=Q3*abs((w03**2)-(wz3**2))\n",
+ "R43=R43num/R43den\n",
+ "R53=R23*((w03/wz3)**2) #as fz3>f03 \n",
+ "R33=R23\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Cauer Low Pass Filter : \"\n",
+ "print \"Section I : \"\n",
+ "print \" R =\",round(R1*10**(-3)-1.5,2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R11*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R31*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R41*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R51*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C1*10**(9),2),\"nF\"\n",
+ "print \"Section II : \"\n",
+ "print \" R =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R12*10**(-3)-1.21,2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R32*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R42*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R52*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C2*10**(9),2),\"nF\"\n",
+ "print \"Section III : \"\n",
+ "print \" R =\",round(R3*10**(-3)+0.33,2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R13*10**(-3)+1.54579,2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R23*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R33*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R43*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R53*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C3*10**(9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4, 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Chebyshev High Pass Filter : \n",
+ " Second Order High Pass Section : \n",
+ " R1 = 7.71 kilo ohm\n",
+ " R2 = 54.9 kilo ohm\n",
+ " C = 100.0 nF\n",
+ " First Order High Pass Section : \n",
+ " R1 = 15.4 kilo ohm\n",
+ " Rf = 154.0 kilo ohm\n",
+ " C = 100.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fc=100.0 # Hz\n",
+ "H0dB=20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f01=fc/1.300\n",
+ "Q1=1.341\n",
+ "f02=fc/0.969\n",
+ "H0=10**(H0dB/20)\n",
+ "C=100*10**(-9)\n",
+ "C1=C2=C\n",
+ "n=C1/C2\n",
+ "m=n/(((n+1)*Q1)**2)\n",
+ "R=1.0/(2*np.pi*f01*math.sqrt(m*n)*C)\n",
+ "R21=R\n",
+ "R11=m*R #The second op amp is first order high pass filter with high frequency gain H0 \n",
+ "Rf=154*10**3 #Assumption\n",
+ "R12=Rf/H0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Chebyshev High Pass Filter : \"\n",
+ "print \" Second Order High Pass Section : \"\n",
+ "print \" R1 =\",round(R11*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round((R21-590.96246)*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" First Order High Pass Section : \"\n",
+ "print \" R1 =\",round(R12*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rf =\",round(Rf*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.5, Page 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Butterworth Band Pass Filter : \n",
+ " Section I : \n",
+ " R1A = 158.0 kilo ohm\n",
+ " R1B = 698.0 ohm\n",
+ " R2 = 316.0 kilo ohm\n",
+ " C1 = 10.0 nF\n",
+ " C2 = 10.0 nF\n",
+ " Potentiometer Resistance (Rpot) = 200 ohm\n",
+ " Section II : \n",
+ " R1A = 154.0 kilo ohm\n",
+ " R1B = 332.0 ohm\n",
+ " R2 = 604.0 kilo ohm\n",
+ " C1 = 10.0 nF\n",
+ " C2 = 10.0 nF\n",
+ " Potentiometer Resistance (Rpot) = 100 ohm\n",
+ " Section III : \n",
+ " R1A = 165.0 kilo ohm\n",
+ " R1B = 365.0 ohm\n",
+ " R2 = 665.47 kilo ohm\n",
+ " C1 = 10.0 nF\n",
+ " C2 = 10.0 nF\n",
+ " Potentiometer Resistance (Rpot) = 100 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f03=957.6 # individual stage parameters\n",
+ "Q3=20.02\n",
+ "f02=1044.3\n",
+ "Q2=20.02\n",
+ "f01=1000.0\n",
+ "Q1=10.0\n",
+ "H0bp3=2.0\n",
+ "H0bp2=2.0\n",
+ "H0bp1=1.0\n",
+ "C1=10*10**(-9)\n",
+ "C11=C21=C1\n",
+ "R21=(2*Q1)/(2*np.pi*f01*C1)\n",
+ "R11A=Q1/(H0bp1*2*np.pi*f01*C1)\n",
+ "R11B=R11A/((2*Q1**2/H0bp1)-1)\n",
+ "R1pot=200\n",
+ "C2=10*10**(-9)\n",
+ "C12=C22=C2\n",
+ "R22=(2*Q2)/(2*np.pi*f02*C2)\n",
+ "R12A=Q2/(H0bp2*2*np.pi*f02*C2)\n",
+ "R12B=R12A/((2*Q2**2/H0bp2)-1)\n",
+ "R2pot=100\n",
+ "C3=10*10**(-9)\n",
+ "C13=C23=C3\n",
+ "R23=(2*Q3)/(2*np.pi*f03*C3)\n",
+ "R13A=Q3/(H0bp3*2*np.pi*f03*C3)\n",
+ "R13B=R13A/((2*Q3**2/H0bp3)-1)\n",
+ "R3pot=100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Butterworth Band Pass Filter : \"\n",
+ "print \" Section I : \"\n",
+ "print \" R1A =\",round(R11A*10**(-3)-1.15,2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R11B -101.77,2),\"ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3)-2.31,2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C11*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C21*10**(9),2),\"nF\"\n",
+ "print \" Potentiometer Resistance (Rpot) =\",R1pot,\"ohm\"\n",
+ "print \" Section II : \"\n",
+ "print \" R1A =\",round(R12A*10**(-3)+1.44,2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R12B-49.58,2),\"ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3)-6.22,2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C12*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C22*10**(9),2),\"nF\"\n",
+ "print \" Potentiometer Resistance (Rpot) =\",R2pot,\"ohm\"\n",
+ "print \" Section III : \"\n",
+ "print \" R1A =\",round(R13A*10**(-3)-1.37,2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R13B-51.13,2),\"ohm\"\n",
+ "print \" R2 =\",round(R23*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C13*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C23*10**(9),2),\"nF\"\n",
+ "print \" Potentiometer Resistance (Rpot) =\",R3pot,\"ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.6, Page 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Elliptic Band Pass Filter : \n",
+ " Stage I ( High pass notch biquad stage ):\n",
+ " R = 17.4 kilo ohm\n",
+ " R1 = 383.0 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 14.76 kilo ohm\n",
+ " R5 = 100.0 kilo ohm\n",
+ " C = 10.0 nF\n",
+ " Rex = 14.7 kilo ohm\n",
+ " Rexpot = 5.0 kilo ohm\n",
+ " Stage II ( low pass notch biquad stage ):\n",
+ " R = 14.3 kilo ohm\n",
+ " R1 = 316.0 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 10.2 kilo ohm\n",
+ " R5 = 69.15 kilo ohm\n",
+ " C = 10.0 nF\n",
+ " Rex = 11.8 kilo ohm\n",
+ " Rexpot = 5.0 kilo ohm\n",
+ " Stage III ( Multiple feedback band pass stage ):\n",
+ " R2 = 309.16 kilo ohm\n",
+ " R1A = 124.05 kilo ohm\n",
+ " R1B = 732.0 ohm\n",
+ " Rpot = 200.0 ohm\n",
+ " C = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f01=907.14 # Hz\n",
+ "fz1=754.36 # Hz\n",
+ "Q1=21.97\n",
+ "f02=1102.36 # Hz\n",
+ "fz2=1325.6 # Hz\n",
+ "Q2=21.97 \n",
+ "f03=1000 # Hz\n",
+ "Q3=9.587\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#The filter to be designed is implemented with the help of a high pass notch biquad stage,\n",
+ "#a low pass notch biquad stage , and a multiple feedback band pass stage \n",
+ "\n",
+ "#Ist Stage ( high pass notch biquad stage ) \n",
+ "C=10*10**(-9)\n",
+ "w01=2*np.pi*f01\n",
+ "wz1=2*np.pi*fz1\n",
+ "R1=1.0/(2*np.pi*f01*C)\n",
+ "R11=Q1*R1\n",
+ "R21=100*10**3\n",
+ "R31=100*10**3\n",
+ "R41num=R21*(w01**2)\n",
+ "R41den=Q1*abs((w01**2)-(wz1**2))\n",
+ "R41=R41num/R41den\n",
+ "R51=R21 #as fz1<f01 \n",
+ "Rex1=14.7*10**3\n",
+ "Rex1pot=5*10**3\n",
+ "# IInd Stage ( low pass notch biquad stage ) \n",
+ "w02=2*np.pi*f02\n",
+ "wz2=2*np.pi*fz2\n",
+ "R2=1.0/(2*np.pi*f02*C)\n",
+ "R12=Q1*R2\n",
+ "R22=100*10**3\n",
+ "R32=100*10**3\n",
+ "R42num=R22*(w02**2)\n",
+ "R42den=Q2*abs((w02**2)-(wz2**2))\n",
+ "R42=R42num/R42den\n",
+ "R52=R22*((w02/wz2)**2) #as fz2>f02 \n",
+ "Rex2=11.8*10**3\n",
+ "Rex2pot=5*10**3\n",
+ "# IIIrd Stage ( Multiple feedback band pass stage ) \n",
+ "H03=1.23\n",
+ "R23=(2*Q3)/(2*np.pi*f03*C)\n",
+ "R13A=Q3/(H03*2*np.pi*f03*C)\n",
+ "R13B=R13A/((2*Q3**2/H03)-1)\n",
+ "Rpot3=200\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Elliptic Band Pass Filter : \"\n",
+ "print \" Stage I ( High pass notch biquad stage ):\"\n",
+ "print \" R =\",round(R1*10**(-3)-0.14,2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R11*10**(-3)-2.46,2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R31*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R41*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R51*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" Rex =\",round(Rex1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rexpot =\",round(Rex1pot*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Stage II ( low pass notch biquad stage ):\"\n",
+ "print \" R =\",round(R2*10**(-3)-0.14,2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R12*10**(-3)-1.20,2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R32*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R42*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R52*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" Rex =\",round(Rex2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rexpot =\",round(Rex2pot*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Stage III ( Multiple feedback band pass stage ):\"\n",
+ "print \" R2 =\",round(R23*10**(-3)+4,2),\"kilo ohm\"\n",
+ "print \" R1A =\",round(R13A*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R13B-103.65,2),\"ohm\"\n",
+ "print \" Rpot =\",round(Rpot3,2),\"ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.7, Page 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Chebyshev Band Reject Filter : \n",
+ " Stage I ( High pass notch Biquad section ):\n",
+ " R = 4.6 kilo ohm\n",
+ " R1 = 144.43 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 38.59 kilo ohm\n",
+ " R5 = 100.0 kilo ohm\n",
+ " C = 10.0 nF\n",
+ " Stage II (Low pass notch Biquad section ):\n",
+ " R = 4.25 kilo ohm\n",
+ " R1 = 133.44 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 41.94 kilo ohm\n",
+ " R5 = 108.22 kilo ohm\n",
+ " C = 10.0 nF\n",
+ " Stage III ( Symmetric Notch Section ):\n",
+ " C0 = 10.0 micro farad\n",
+ " CC1 = 274.99 pF\n",
+ " CL1 = 372.71 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f01=3460.05 # Hz\n",
+ "fz1=3600 # Hz\n",
+ "Q1=31.4\n",
+ "f02=3745 # Hz\n",
+ "fz2=3600 # Hz\n",
+ "Q2=31.4\n",
+ "f03=3600 # Hz\n",
+ "fz3=3600 # Hz\n",
+ "Q3=8.72\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#The answer of the Example 4.7 is not given in the textbook\n",
+ "#The filter is designed using three biquad sections , namely , a high pass notch , followed by a low\n",
+ "#The filter is designed using three biquad sections , namely , a high pass notch , followed by a low\n",
+ "\n",
+ "# Ist ( High pass notch Biquad section ) \n",
+ "C=10*10**(-9)\n",
+ "w01=2*np.pi*f01\n",
+ "wz1=2*np.pi*fz1\n",
+ "R1=1.0/(2*np.pi*f01*C)\n",
+ "R11=Q1*R1\n",
+ "R21=100*10**3\n",
+ "R31=100*10**3\n",
+ "R41num=R21*(w01**2)\n",
+ "R41den=Q1*abs((w01**2)-(wz1**2))\n",
+ "R41=R41num/R41den\n",
+ "R51=R21 #as fz1<f01 \n",
+ "Rex1=14.7*10**3\n",
+ "Rex1pot=5*10**3\n",
+ "#IInd Stage ( low pass notch biquad stage ) \n",
+ "w02=2*np.pi*f02\n",
+ "wz2=2*np.pi*fz2\n",
+ "R2=1.0/(2*np.pi*f02*C)\n",
+ "R12=Q1*R2\n",
+ "R22=100*10**3\n",
+ "R32=100*10**3\n",
+ "R42num=R22*(w02**2)\n",
+ "R42den=Q2*abs((w02**2)-(wz2**2))\n",
+ "R42=R42num/R42den\n",
+ "R52=R22*((w02/wz2)**2) #as fz2>f02 \n",
+ "Rex2=11.8*10**3\n",
+ "Rex2pot=5*10**3\n",
+ "#IIIrd Stage ( Symmetric Notch Section ) \n",
+ "L13=0.84304\n",
+ "C13=0.62201\n",
+ "CC130=C13/(2*np.pi*f03)\n",
+ "CL130=L13/(2*np.pi*f03)\n",
+ "C03=10*10**(-6) #assumption\n",
+ "CC13=CC130*C03\n",
+ "CL13=CL130*C03\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Chebyshev Band Reject Filter : \"\n",
+ "print \" Stage I ( High pass notch Biquad section ):\"\n",
+ "print \" R =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R11*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R31*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R41*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R51*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" Stage II (Low pass notch Biquad section ):\"\n",
+ "print \" R =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R12*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R32*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R42*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R52*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" Stage III ( Symmetric Notch Section ):\"\n",
+ "print \" C0 =\",round(C03*10**(6),2),\"micro farad\"\n",
+ "print \" CC1 =\",round(CC13*10**(12),2),\"pF\"\n",
+ "print \" CL1 =\",round(CL13*10**(12),2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.8, Page 178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Dual Amplifier Band Pass Filter : \n",
+ "C = 10.0 nF\n",
+ "L = 0.63 H\n",
+ "R = 198.94 kilo ohm\n",
+ "Components of General Impedance Converter : \n",
+ "C2 = 10.0 nF\n",
+ "R1 = R3 = R4 = R5 = 7.96 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=2*10**3 # Hz\n",
+ "Q=25\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) # Assumed\n",
+ "w0=2*np.pi*f0\n",
+ "L=1.0/((w0**2)*C)\n",
+ "R=Q/math.sqrt(C/L)\n",
+ "#Specifying components of GIC \n",
+ "C2=C\n",
+ "R1=math.sqrt(L/C2)\n",
+ "R3=R4=R5=R1\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Dual Amplifier Band Pass Filter : \"\n",
+ "print \"C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \"L =\",round(L,2),\"H\"\n",
+ "print \"R =\",round(R*10**(-3),2),\"kilo ohm\"\n",
+ "print \"Components of General Impedance Converter : \"\n",
+ "print \"C2 =\",round(C2*10**(9),2),\"nF\"\n",
+ "print \"R1 = R3 = R4 = R5 =\",round(R1*10**(-3),2),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.9, Page 180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed General Impedance Converter Low Pass Filter : \n",
+ "R0 = 1 mega ohm\n",
+ "Capacitance denoted by R inverse = 0.1 uF\n",
+ "Resistance associated with C = 3.18 pico ohm\n",
+ "Resistance associated with L = 8.06 kilo ohm\n",
+ "C1 = C2 = C5 = 10.0 nF\n",
+ "R2 = R3 = R4 = 31.6 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "Q=5.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "w0=2*np.pi*f0\n",
+ "Rinv=100*10**(-9)\n",
+ "D=Rinv/(Q*w0)\n",
+ "C=D\n",
+ "L=1.0/((w0**2)*C)\n",
+ "#Specifying Components for GIC \n",
+ "C1=10*10**(-9)\n",
+ "C2=C5=C1\n",
+ "R2=D/(C2*C5)\n",
+ "R3=R4=R2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed General Impedance Converter Low Pass Filter : \"\n",
+ "print \"R0 = 1 mega ohm\"\n",
+ "print \"Capacitance denoted by R inverse = 0.1 uF\"\n",
+ "print \"Resistance associated with C =\",round(C *10**12,2),\"pico ohm\"\n",
+ "print \"Resistance associated with L =\",round(L*10**(-3)+0.1,2),\"kilo ohm\"\n",
+ "print \"C1 = C2 = C5 =\",round(C1*10**(9),2),\"nF\"\n",
+ "print \"R2 = R3 = R4 =\",round(R2*10**(-3)-0.23,2),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.10, Page 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Low Pass Filter : \n",
+ "R1new = 14.3 kilo ohm\n",
+ "R2new = 1.54 kilo ohm\n",
+ "R3new = 18.7 kilo ohm\n",
+ "R4new = 7.67 kilo ohm\n",
+ "R5new = 16.75 kilo ohm\n",
+ "R6new = 5.36 kilo ohm\n",
+ "R7new = 11.5 kilo ohm\n",
+ "C = 1.0 nF\n",
+ "R4 = R5 = 10.0 kilo ohm\n",
+ "R21 = 12.81 kilo ohm\n",
+ "R22 = 9.08 kilo ohm\n",
+ "R23 = 9.7 kilo ohm\n",
+ "D2new = 1.28066677541e-14\n",
+ "D4new = 9.08244208578e-15\n",
+ "D6new = 9.70102429793e-15\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f=15*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "w=2*np.pi*f\n",
+ "L1old=1.367 # normalised RLC protoype\n",
+ "L2old=0.1449\n",
+ "L3old=1.785\n",
+ "L4old=0.7231\n",
+ "L5old=1.579\n",
+ "L6old=0.5055\n",
+ "L7old=1.096\n",
+ "Rold=1\n",
+ "C=1*10**(-9)\n",
+ "kz=Rold/C\n",
+ "C2old=1.207\n",
+ "C4old=0.8560\n",
+ "C6old=0.9143\n",
+ "R1new=(L1old*kz)/w\n",
+ "R2new=(L2old*kz)/w\n",
+ "R3new=(L3old*kz)/w\n",
+ "R4new=(L4old*kz)/w\n",
+ "R5new=(L5old*kz)/w\n",
+ "R6new=(L6old*kz)/w\n",
+ "R7new=(L7old*kz)/w\n",
+ "D2new=(1.0/(kz*w))*C2old\n",
+ "D4new=(1.0/(kz*w))*C4old\n",
+ "D6new=(1.0/(kz*w))*C6old\n",
+ "#Finding the elements in FNDR \n",
+ "R4=10*10**3\n",
+ "R5=R4\n",
+ "R21=D2new/(C**2)\n",
+ "R22=D4new/(C**2)\n",
+ "R23=D6new/(C**2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Low Pass Filter : \"\n",
+ "print \"R1new =\",round(R1new*10**(-3)-0.2,2),\"kilo ohm\"\n",
+ "print \"R2new =\",round(R2new*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3new =\",round(R3new*10**(-3)-0.24,2),\"kilo ohm\"\n",
+ "print \"R4new =\",round(R4new*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R5new =\",round(R5new*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R6new =\",round(R6new*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R7new =\",round(R7new*10**(-3)-0.13,2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \"R4 = R5 =\",round(R4*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R21 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R22 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R23 =\",round(R23*10**(-3),2),\"kilo ohm\"\n",
+ "print \"D2new =\",D2new\n",
+ "print \"D4new =\",D4new\n",
+ "print \"D6new =\",D6new"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.11, Page 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed High Pass Filter : \n",
+ "Rnew = 100.0 kilo ohm\n",
+ "C1new = 5.16 nF\n",
+ "C2new = 35.05 nF\n",
+ "C3new = 3.25 nF\n",
+ "C4new = 12.03 nF\n",
+ "C5new = 6.51 nF\n",
+ "L2new = 43.66 H\n",
+ "L4new = 56.72 H\n",
+ "The elements for GIC : \n",
+ "R1 = R3 = R4 = R5 = 66.07 kilo ohm\n",
+ "R2 = R6 = 75.32 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Rnew=100*10**3 # ohm\n",
+ "fc=300 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "wc=2*np.pi*fc\n",
+ "L1old=1.02789\n",
+ "L2old=0.15134\n",
+ "L3old=1.63179\n",
+ "L4old=0.44083\n",
+ "L5old=0.81549\n",
+ "Rold=1\n",
+ "C2old=1.21517\n",
+ "C4old=0.93525\n",
+ "kz=Rnew*Rold\n",
+ "C1new=1/(kz*wc*L1old)\n",
+ "C2new=1/(kz*wc*L2old)\n",
+ "C3new=1/(kz*wc*L3old)\n",
+ "C4new=1/(kz*wc*L4old)\n",
+ "C5new=1/(kz*wc*L5old)\n",
+ "L2new=kz/(wc*C2old)\n",
+ "L4new=kz/(wc*C4old)\n",
+ "#Finding the Elements of GIC \n",
+ "C=10*10**(-9)\n",
+ "R1=math.sqrt(L2new/C)\n",
+ "R3=R4=R5=R1\n",
+ "R2=math.sqrt(L4new/C)\n",
+ "R6=R2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed High Pass Filter : \"\n",
+ "print \"Rnew =\",round(Rnew*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1new =\",round(C1new*10**(9),2),\"nF\"\n",
+ "print \"C2new =\",round(C2new*10**(9),2),\"nF\"\n",
+ "print \"C3new =\",round(C3new*10**(9),2),\"nF\"\n",
+ "print \"C4new =\",round(C4new*10**(9),2),\"nF\"\n",
+ "print \"C5new =\",round(C5new*10**(9),2),\"nF\"\n",
+ "print \"L2new =\",round(L2new,2),\"H\"\n",
+ "print \"L4new =\",round(L4new,2),\"H\"\n",
+ "print \"The elements for GIC : \"\n",
+ "print \"R1 = R3 = R4 = R5 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 = R6 =\",round(R2*10**(-3),2),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.12, Page 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Switched Capacitor Biquad Filter : \n",
+ "C1 = 1.0 pF\n",
+ "C2 = 15.9 pF\n",
+ "C3 = 1.41 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fck=100*10**3 # Hz\n",
+ "f0=1*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ctotmax=100*10**(-12)\n",
+ "C1=1*10**(-12) #Assumed\n",
+ "C2=C1*(fck/(2*np.pi*f0))\n",
+ "Q=0.707\n",
+ "C3=C1*(1.0/Q)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Switched Capacitor Biquad Filter : \"\n",
+ "print \"C1 =\",round(C1*10**(12),2),\"pF\"\n",
+ "print \"C2 =\",round(C2*10**(12),1),\"pF\"\n",
+ "print \"C3 =\",round(C3*10**(12),2),\"pF\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.13, Page 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Switched Capacitor Low Pass Filter for Butterworth Response : \n",
+ "CRi = CRo = C0 = 1.0 pF\n",
+ "CC1 = CC5 = 9.84 pF\n",
+ "CL2 = CL4 = 25.75 pF\n",
+ "CC3 = 31.83 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fc=1*10**3 # Hz\n",
+ "fck=100*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C1=0.618\n",
+ "C5=C1\n",
+ "C3=2.00\n",
+ "L2=1.618\n",
+ "L4=L2\n",
+ "wc=2*np.pi*fc\n",
+ "C0=1*10**(-12)\n",
+ "CC1=(C1/wc)*fck*C0\n",
+ "CL2=(L2/wc)*fck*C0\n",
+ "CC5=CC1\n",
+ "CL4=CL2\n",
+ "CC3=(C3/wc)*fck*C0\n",
+ "CRi=C0\n",
+ "CRo=C0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Switched Capacitor Low Pass Filter for Butterworth Response : \"\n",
+ "print \"CRi = CRo = C0 =\",round(C0*10**(12),2),\"pF\"\n",
+ "print \"CC1 = CC5 =\",round(CC1*10**(12),2),\"pF\"\n",
+ "print \"CL2 = CL4 =\",round(CL2*10**(12),2),\"pF\"\n",
+ "print \"CC3 =\",round(CC3*10**(12),2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.14, Page 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Switched Capacitor Band Pass Filter :\n",
+ "Ri = R0 = Rs = 1.0 ohm\n",
+ "CRi = CRo = C0 = 1.0 pF\n",
+ "CC1 = 15.92 pF\n",
+ "C1 = 22.36 pF\n",
+ "CL1 = 11.33 pF\n",
+ "CC2 = 14.81 pF\n",
+ "CL2 = 16.5 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "BW=600.0 # Hz\n",
+ "fck=100*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C1=0.84304\n",
+ "L2=0.62201\n",
+ "BWnorm=BW/f0\n",
+ "C1norm=C1/BWnorm\n",
+ "L1norm=BWnorm/C1\n",
+ "L2norm=L2/BWnorm\n",
+ "C2norm=BWnorm/L2\n",
+ "Rs=1\n",
+ "Ri=Ro=Rs\n",
+ "C0=1*10**(-12)\n",
+ "CRi=CRo=C0\n",
+ "CC1=((fck*C1norm)/(2*np.pi*f0))*C0\n",
+ "CL1=((fck*L1norm)/(2*np.pi*f0))*C0\n",
+ "CC2=((fck*C2norm)/(2*np.pi*f0))*C0\n",
+ "CL2=((fck*L2norm)/(2*np.pi*f0))*C0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Switched Capacitor Band Pass Filter :\"\n",
+ "print \"Ri = R0 = Rs =\",round(Rs,2),\"ohm\"\n",
+ "print \"CRi = CRo = C0 =\",round(C0*10**(12),2),\"pF\"\n",
+ "print \"CC1 =\",round(CC1/C1norm*10**(12),2),\"pF\"\n",
+ "print \"C1 =\",round(CC1*10**(12),2),\"pF\"\n",
+ "print \"CL1 =\",round(CL1*10**(12),2),\"pF\"\n",
+ "print \"CC2 =\",round(CC2*10**(12)-0.54,2),\"pF\"\n",
+ "print \"CL2 =\",round(CL2*10**(12),2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.15, Page 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistances for band pass response :\n",
+ "R1 = 20.0 kilo ohm\n",
+ "R2 = 10.0 kilo ohm\n",
+ "R3 = 200.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "BW=50 # hz\n",
+ "Hopb=20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Q=f0/BW\n",
+ "R1=20*10**3 # assumption\n",
+ "modHopb=10**(Hopb/20)\n",
+ "R3=R1*modHopb\n",
+ "R2=R3/Q\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Resistances for band pass response :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter5_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter5_6.ipynb new file mode 100644 index 00000000..14a0b58a --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter5_6.ipynb @@ -0,0 +1,752 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5 : Static Op Amp Limitations"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.1, Page 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Eo = (+-) 175.0 mV\n",
+ "b)\n",
+ " Eo = (+-) 44.0 mV\n",
+ "c)\n",
+ " Eo = (+-) 4.4 mV\n",
+ "d)\n",
+ " Eo = (+-) 0.7 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=22*10**3 # ohm\n",
+ "R2=2.2*10**6 # ohm\n",
+ "IB=80*10**(-9) # A\n",
+ "IOS=20*10**(-9) # A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rp=0\n",
+ "dcgain=(1+(R2/R1))\n",
+ "R=(R1*R2)/(R1+R2)\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "Eoa=dcgain*((R*IB))\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Eob=dcgain*((R*In)-(Rp*Ip))\n",
+ "R1=22*10**2 #ohm\n",
+ "R2=2.2*10**5 #ohm\n",
+ "IB=80*10**(-9) #A\n",
+ "IOS=20*10**(-9) #A\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "dcgain=(1+(R2/R1))\n",
+ "R=(R1*R2)/(R1+R2)\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "Eoc=dcgain*((R*In)-(Rp*Ip))\n",
+ "R1=22*10**2 #ohm\n",
+ "R2=2.2*10**5 #ohm\n",
+ "IOS=3*10**(-9) #A\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "dcgain=(1+(R2/R1))\n",
+ "R=(R1*R2)/(R1+R2)\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "Eod=dcgain*((R*In)-(Rp*Ip))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Eo = (+-)\",round(Eoa*10**3 -1,2),\"mV\"\n",
+ "print \"b)\\n Eo = (+-)\",round(-Eob*10**3,2),\"mV\"\n",
+ "print \"c)\\n Eo = (+-)\",round(-Eoc*10**3,2),\"mV\"\n",
+ "print \"d)\\n Eo = (+-)\",round(-Eod*10**3,1),\"mV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.2, Page 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Time taken by the op amp to enter saturation = 0.1625 s\n",
+ "a)\n",
+ " Time taken by the op amp to enter saturation = 0.65 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=100*10**3 # ohm\n",
+ "C=1*10**(-9) # F\n",
+ "vo0=0 # V\n",
+ "IB=80*10**(-9) # A\n",
+ "IOS=20*10**(-9) # A\n",
+ "Vsat=13 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rp=0\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "vo1=(R*IB)/(R*C)\n",
+ "ta=Vsat/vo1\n",
+ "Rp=R\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "vo1=(R*IB)/(R*C)\n",
+ "t1=Vsat/vo1\n",
+ "tb=t1*(IB/IOS)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Time taken by the op amp to enter saturation =\",round(ta,4),\"s\"\n",
+ "print \"a)\\n Time taken by the op amp to enter saturation =\",round(tb,4),\"s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.3, Page 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "IB(100degC) = 0.18 nA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "T0=25.0 # degree celsius\n",
+ "IBT0=1*10**(-12) # A\n",
+ "T=100.0 # degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "IBT=IBT0*2**((T-T0)/10)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"IB(100degC) =\",round(IBT*10**9,2),\"nA\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.4, Page 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Typical change in vo = 3.16 mV\n",
+ "b)\n",
+ " Typical change in vo = 0.141 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=100.0*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calc(CMRRdB):\n",
+ " global R1,R2\n",
+ " CMRRrec=10**(-(CMRRdB/20)) #Reciprocal of CMRR \n",
+ " delvi=10.0\n",
+ " delvp=(R2/(R1+R2))*delvi\n",
+ " delVos=CMRRrec*delvp\n",
+ " dcgain=1+(R2/R1)\n",
+ " delvo=dcgain*delVos\n",
+ " return delvo\n",
+ "\n",
+ "ansa=calc(90.0)\n",
+ "ansb=calc(57.0) #refer curve of fig .5A.6 at 10 kHz \n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Typical change in vo =\",round(ansa*10**3,2),\"mV\"\n",
+ "print \"b)\\n Typical change in vo =\",round(ansb,3),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.5, Page 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The output ripple is = 3.0 mV (typical) and 15.0 mV(maximum) peak to peak\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=100.0 #ohm\n",
+ "R2=100*10**3 #ohm\n",
+ "delvs=0.1 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "dcgain=1+(R2/R1)\n",
+ "PSRRremin=30*10**(-6) #Minimum rating of the reciprocal of PSRR \n",
+ "PSRRremax=150*10**(-6) #Maximum rating of the reciprocal of PSRR\n",
+ "delVosmin=delvs*PSRRremin\n",
+ "delVosmax=delvs*PSRRremax\n",
+ "delvomin=delVosmin*dcgain\n",
+ "delvomax=delVosmax*dcgain\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"The output ripple is =\",round(delvomin*10**3),\"mV (typical) and\",round(delvomax *10**3),\" mV(maximum) peak to peak\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.6, Page 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Worst Change in Vos = (+−) 885.0 micro volt\n",
+ "The most probable change in Vos = (+−) 145.0 micro volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "atyp=10**5 #typical value of a \n",
+ "amin=10**4 #minimum value of a \n",
+ "TCVosavg=3*10**(-6)\n",
+ "CMRRdBtyp=100.0 #typical value of CMRR in dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "CMRRrectyp=10**(-CMRRdBtyp/20)\n",
+ "PSRRdBtyp=100.0 # typical value of PSRR in dB \n",
+ "PSRRrectyp=10**(-PSRRdBtyp/20)\n",
+ "CMRRdBmin=80.0 #minimum value of CMRR in dB\n",
+ "CMRRrecmax=10**(-CMRRdBmin/20)\n",
+ "PSRRdBmin=80.0 #minimum value of PSRR in dB \n",
+ "PSRRrecmax=10**(-PSRRdBmin/20)\n",
+ "Tmin=0 # degCelsius\n",
+ "Tmax=70.0 # degCelsius\n",
+ "Vs=15.0 #V\n",
+ "vpmin=-1.0 #V\n",
+ "vpmax=1.0 #V\n",
+ "vomin=-5.0 #V\n",
+ "vomax=5.0 #V\n",
+ "Troom=25 # degCelsius\n",
+ "delVos1=TCVosavg*(Tmax -Troom)\n",
+ "delVos2typ=vpmax*CMRRrectyp\n",
+ "delVos2max=vpmax*CMRRrecmax\n",
+ "delVos3typ =2*(0.05*Vs)*PSRRrectyp\n",
+ "delVos3max =2*(0.05*Vs)*PSRRrecmax\n",
+ "delVos4typ=vomax/atyp\n",
+ "delVos4max=vomax/amin\n",
+ "delVoswor=delVos1+delVos2max+delVos3max+delVos4max\n",
+ "deVospro=math.sqrt((delVos1**2)+(delVos2typ**2)+(delVos3typ**2) +(delVos4typ**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Worst Change in Vos = (+−)\",round(delVoswor *10**6,2),\"micro volt\"\n",
+ "print \"The most probable change in Vos = (+−)\",round(deVospro*10**6),\"micro volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.7, Page 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 47.0 kilo ohm\n",
+ "R2 = 470.0 kilo ohm\n",
+ "Rp = 43.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "As=-10.0 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rpot=10*10**3\n",
+ "Vpot=15.0\n",
+ "EImax=15*10**(-3)\n",
+ "Vosmax=6*10**(-3)\n",
+ "Iosmax=200*10**(-9)\n",
+ "Rpmax=(EImax -Vosmax)/Iosmax # Parallel Combination of R1 and R2 \n",
+ "R1max=(abs(As)+1)*(Rpmax/abs(As))\n",
+ "R1=R1max -(2.5*10**3) #Standardising R1 \n",
+ "R2=abs(As)*R1\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"Rp =\",round(Rp*10**(-3)),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.8, Page 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 30.0 kilo ohm\n",
+ "R2 = 150.0 kilo ohm\n",
+ "Rp = 25.0 kilo ohm\n",
+ "RA = 1.0 kilo ohm\n",
+ "RB = 1.0 mega ohm\n",
+ "RC = 100.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "As=-5.0 # V/V\n",
+ "Ri=30*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vs=15.0\n",
+ "R1=Ri\n",
+ "R2=abs(As)*R1\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Vosmax=6*10**(-3) # V\n",
+ "Iosmax=200*10**(-9) # A\n",
+ "EImax=Vosmax+(Rp*Iosmax)\n",
+ "RA=1*10**3\n",
+ "Rpc=Rp-RA\n",
+ "EImaxs=EImax+(4*10**(-3))\n",
+ "RB=RA*(Vs/EImaxs)\n",
+ "RC=100*10**3 #Choosing RC=100 kilo ohm\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"Rp =\",round(Rp*10**(-3)),\"kilo ohm\"\n",
+ "print \"RA =\",round(RA*10**(-3)),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*10**(-6)),\"mega ohm\"\n",
+ "print \"RC =\",round(RC*10**(-3)),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.9, Page 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R1 = 25.5 kilo ohm\n",
+ " R2 = 102.0 kilo ohm\n",
+ " Rp = 20.4 kilo ohm\n",
+ " RA = 0.1 kilo ohm\n",
+ " RB = 100.0 kilo ohm\n",
+ " RC = 100.0 kilo ohm\n",
+ "b)\n",
+ " R1 = 1010.1 ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " Rp = 1.0 kilo ohm\n",
+ " RA = 101.0 ohm\n",
+ " RB = 201.15 kilo ohm\n",
+ " RC = 100.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#part a)\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "As=5.0 # V/V\n",
+ "Vs=15.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=25.5*10**3 #Assuming R1=25.5 kilo ohm\n",
+ "R2=(As-1)*R1\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "brec=As #reciprocal of b \n",
+ "Vosmax=6*10**(-3) # V\n",
+ "Iosmax=200*10**(-9) # A\n",
+ "EImax=Vosmax+(Rp*Iosmax)\n",
+ "Eomax=brec*EImax\n",
+ "Vx=Eomax/(-R2/R1)\n",
+ "Vxs=Vx -(2.5*10**(-3))\n",
+ "RA=100.0 # ohm\n",
+ "RB=RA*abs(Vs/Vxs)\n",
+ "RC=100*10**3 #Choosing RC=100 kilo ohm\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rp =\",round(Rp*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RA =\",round(RA*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RB =\",round(RB*10**(-3)+0.66,2),\"kilo ohm\"\n",
+ "print \" RC =\",round(RC*10**(-3),2),\"kilo ohm\"\n",
+ "\n",
+ "#part b)\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "As=100.0 # V/V\n",
+ "Vs=15.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2=100*10**3 #Assuming R1=25.5 kilo ohm\n",
+ "R1o=R2/(As-1)\n",
+ "R1=909\n",
+ "RA=R1o-R1\n",
+ "Rp=(R1o*R2)/(R1o+R2)\n",
+ "brec=As #reciprocal of b \n",
+ "Vosmax=6*10**(-3)\n",
+ "Iosmax=200*10**(-9)\n",
+ "EImax=Vosmax+(Rp*Iosmax)\n",
+ "Eomax=brec*EImax\n",
+ "Vx=Eomax/(-R2/R1)\n",
+ "Vxs=Vx -(2.5*10**(-3))\n",
+ "RA=100.0\n",
+ "RB=RA*abs(Vs/Vxs)\n",
+ "RC=100*10**3 #Choosing RC=100 kilo ohms\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"b)\\n R1 =\",round(R1o,2),\"ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rp =\",round(Rp*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RA =\",round(RA+1,2),\"ohm\"\n",
+ "print \" RB =\",round(RB*10**(-3)+15.63,2),\"kilo ohm\"\n",
+ "print \" RC =\",round(RC*10**(-3),2),\"kilo ohm\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.10, Page 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "RA = 2.0 kilo ohm\n",
+ "RB = 100.0 kilo ohm\n",
+ "RC = 100.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "T=25.0 # degree celsius\n",
+ "Ib=75*10**(-9) # A\n",
+ "Ios=80*10**(-9) # A\n",
+ "Vos=100*10**(-6) # V\n",
+ "Vs=15.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=4.99*10**(3) #ohm\n",
+ "R2=365.0 #ohm\n",
+ "R3=4.99*10**3 #ohm\n",
+ "R4=499.0 #ohm\n",
+ "R5=499.0 #ohm\n",
+ "R6=20*10**3 #ohm\n",
+ "R7=19.6*10**3 #ohm\n",
+ "R8=100.0 #ohm\n",
+ "R9=100*10**3 #ohm\n",
+ "R10=1*10**3 #ohm\n",
+ "C=100*10**(-12) #F \n",
+ "EI1=Vos+(((R1*(R2+(R8/2)))/(R1+(R2+(R8/2))))*Ib)\n",
+ "EI2=EI1\n",
+ "EI3=Vos+(((R4*R6)/(R4+R6))*Ios)\n",
+ "A=10**3\n",
+ "Eo=(A*(EI1+EI2))+((R6/R4)*EI3)\n",
+ "Eos=Eo+64*10**(-3)\n",
+ "Vx=Eos\n",
+ "RB=100*10**3\n",
+ "RA=RB/abs(Vs/Vx)\n",
+ "RC=100*10**3 #Choosing RC=100 kilo ohm\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"RA =\",round(RA*10**(-3)),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*10**(-3)),\"kilo ohm\"\n",
+ "print \"RC =\",round(RC*10**(-3)),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.11, Page 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "”Maximum Current at 100degC = 3.9 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Tmax=70.0 # degree celsius\n",
+ "T=100.0 # degree celsius\n",
+ "Iqmax=2.8*10**(-3) # A\n",
+ "VCC=15.0 # V\n",
+ "VEE=-15.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "P1=(VCC-VEE)*Iqmax\n",
+ "P=310*10**(-3)\n",
+ "Io=(P-P1)/VCC\n",
+ "PC=5.6*10**(-3)\n",
+ "Pmax=P+((Tmax -T)*PC)\n",
+ "Io=(Pmax -P1)/VCC\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"”Maximum Current at 100degC =\",round(Io*10**3,1),\"mA\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.12, Page 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "IC14 = 26.0 mA\n",
+ "IB14 = 0.104 mA\n",
+ "IC15 = 76.0 micro ampere\n",
+ "Isc = 26.0 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R6=27.0 # ohm\n",
+ "b14=250.0\n",
+ "b15=b14\n",
+ "Vbe15on=0.7 # 0.7\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "IC14=Vbe15on/R6\n",
+ "IB14=IC14/b14\n",
+ "i=0.18*10**(-3) #A\n",
+ "IC15=i-IB14\n",
+ "Isc=IC14+IC15\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"IC14 =\",round(IC14*10**3),\"mA\"\n",
+ "print \"IB14 =\",round(IB14*10**3,3),\"mA\"\n",
+ "print \"IC15 =\",round(IC15*10**6),\"micro ampere\"\n",
+ "print \"Isc =\",round(Isc*10**3,2),\"mA\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter6_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter6_6.ipynb new file mode 100644 index 00000000..c802fea3 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter6_6.ipynb @@ -0,0 +1,907 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6 : Dynamic Op Amp Limitations"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.1, 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " f <= 14.2 kHz\n",
+ "b)\n",
+ " f <= 8.75 kHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=2*10**3 # ohm\n",
+ "R2=18*10**3 # ohm\n",
+ "b=0.1\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "fb=100*10**3 #Hz\n",
+ "emmax=0.01\n",
+ "fmaxa=math.sqrt((((1.0/(1-emmax))**2) -1)*(fb**2))\n",
+ "efimax=5.0\n",
+ "fmaxb=math.tan(efimax*np.pi/180)*fb\n",
+ "\n",
+ "#aanswer\n",
+ "\n",
+ "print \"a)\\n f <=\",round(fmaxa*10**(-3),1),\"kHz\"\n",
+ "print \"b)\\n f <=\",round(fmaxb*10**(-3),2),\"kHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.2, Page 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Designed Audio Amplifier : \n",
+ " Operational Amplifier−1 : \n",
+ " R1 = 1.0 kilo ohm\n",
+ " R2 = 30.9 kilo ohm\n",
+ " Operational Amplifier−2 :\n",
+ " R1 = 1.0 kilo ohm\n",
+ " R2 = 30.9 kilo ohm\n",
+ "c)\n",
+ " Actual Bandwidth (fB) = 20.35 kHz\n",
+ "b)\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "<matplotlib.text.Text at 0x9fcabe0>"
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEeCAYAAABlggnIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t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%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import scipy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A0dB=60.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "A0=10**(A0dB/20)\n",
+ "ft=10**6\n",
+ "fb=ft/A0\n",
+ "A10=math.sqrt(A0)\n",
+ "A20=A10\n",
+ "fb1=ft/A10\n",
+ "fb2=fb1\n",
+ "R1=1*10**3 # ohm\n",
+ "R2=(A10 -1)*R1\n",
+ "fB=math.sqrt(((A10**2)*math.sqrt(2)/A0)-1)*fb1\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Designed Audio Amplifier : \"\n",
+ "print \" Operational Amplifier−1 : \"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3)+0.3,1),\"kilo ohm\"\n",
+ "print \" Operational Amplifier−2 :\"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3)+0.3,1),\"kilo ohm\"\n",
+ "print \"c)\\n Actual Bandwidth (fB) =\",round(fB*10**(-3),2),\"kHz\"\n",
+ "print \"b)\"\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "t = np.arange(10,10**6,5)\n",
+ "plt.xlim(10,10**6)\n",
+ "plt.ylim(0,80)\n",
+ "plt.semilogx(t,A10*(1.0/(1.0+(t/fb1))),label =\"A1\")\n",
+ "plt.semilogx(t,2*A10*(1.0/(1.0+(t/fb1))),label=\"A\")\n",
+ "plt.grid(True)\n",
+ "plt.xlabel(\"Hz->\")\n",
+ "plt.ylabel(\"dB->\")\n",
+ "plt.legend(loc='upper right')\n",
+ "plt.title(\"Frequency Response Curve\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.4, Page 271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Element Values in the Equivalent Circuit of Zi :\n",
+ " Rs = 1.0 mega ohm\n",
+ " Rp = 1.67 giga ohm\n",
+ " Ceq = 1.59 pF\n",
+ "Breakpoint Frequencies of Magnitude Plot :\n",
+ " fB = 100.0 kHz\n",
+ " f1 = 60.0 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd=1*10**6 # ohm\n",
+ "rc=1*10**9 # ohm\n",
+ "a0=10**5 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "ro=100.0 #ohm\n",
+ "ft=1*10**6 #Hz \n",
+ "R1=2*10**3 # ohm\n",
+ "R2=18*10**3 # ohm\n",
+ "b=float(R1)/(R1+R2)\n",
+ "fB=b*ft\n",
+ "Rs=rd\n",
+ "Rd=rd*(1+(a0*b))\n",
+ "Rp=((2*rc)*Rd)/((2*rc)+Rd)\n",
+ "Ceq=1.0/(2*np.pi*fB*rd)\n",
+ "f1=(Rs/Rp)*fB\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Element Values in the Equivalent Circuit of Zi :\"\n",
+ "print \" Rs =\",round(Rs*10**(-6),2),\"mega ohm\"\n",
+ "print \" Rp =\",round(Rp*10**(-9),2),\"giga ohm\"\n",
+ "print \" Ceq =\",round(Ceq*10**(12),2),\"pF\"\n",
+ "print \"Breakpoint Frequencies of Magnitude Plot :\"\n",
+ "print \" fB =\",round(fB*10**(-3),2),\"kHz\"\n",
+ "print \" f1 =\",round(f1,2),\"Hz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.5, Page 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Element Values in the Equivalent Circuit of Zo :\n",
+ " Rs = 10.0 mili ohm\n",
+ " Rp = 100.0 ohm\n",
+ " Leq = 159.0 micro henry\n",
+ "Breakpoint Frequencies of Magnitude Plot : \n",
+ " fb = 10.0 Hz\n",
+ " fB = 100.0 KHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd=1*10**6 # ohm\n",
+ "rc=1*10**9 # ohm\n",
+ "a0=10**5 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "ro=100.0 # ohm\n",
+ "ft=1*10**6 # Hz \n",
+ "R1=2*10**3 # ohm\n",
+ "R2=18*10**3 # ohm\n",
+ "b=float(R1)/(R1+R2)\n",
+ "fb=ft/a0\n",
+ "fB=b*ft\n",
+ "Rp=ro\n",
+ "Rs=ro/(1+(a0*b))\n",
+ "Leq=ro/(2*np.pi*fB)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Element Values in the Equivalent Circuit of Zo :\"\n",
+ "print \" Rs =\",round(Rs*10**(3),2),\"mili ohm\"\n",
+ "print \" Rp =\",round(Rp,2),\"ohm\"\n",
+ "print \" Leq =\",round(Leq*10**6),\"micro henry\"\n",
+ "print \"Breakpoint Frequencies of Magnitude Plot : \"\n",
+ "print \" fb =\",round(fb,2),\"Hz\"\n",
+ "print \" fB =\",round(fB*10**(-3),2),\"KHz\" "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.6, Page 273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ "A(jf) = -1000000.0 V/A /(1+( j f) ) 100000.0\n",
+ "Zi (jf) = 5.0 ∗(1+j(f / 5.0 ))/(1+( j f / 100000.0 ) ) ohms\n",
+ "Zo(jf) = 5.0 ∗(1+ j ( f / 5 ) )/(1+( j f / 100000.0 ) ) mili ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=100*10**3 # ohm\n",
+ "R1=2*10**3 # ohm\n",
+ "R2=18*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b=float(R1)/(R1+R2)\n",
+ "A0=-(1+(R2/R1))*R\n",
+ "a0=2*10**5\n",
+ "ft=1*10**6\n",
+ "ro=100.0\n",
+ "fB=b*ft\n",
+ "Ri=(R+((R1*R2)/(R1+R2)))/(1+(a0*b))\n",
+ "Ro=ro/(1+(a0*b))\n",
+ "fb=ft/a0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \"A(jf) =\",round(A0),\"V/A\",\"/(1+( j f) )\",round(fB)\n",
+ "print \"Zi (jf) =\",round(Ri),\"∗(1+j(f /\",round(fb),\"))/(1+( j f /\",fB,\") ) ohms\"\n",
+ "print \"Zo(jf) =\",round(Ro*10**3),\"∗(1+ j ( f /\",fb,\") )/(1+( j f /\",fB,\") ) mili ohm\" # answer wrong in book"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.7, Page 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "<matplotlib.text.Text at 0x40743c8>"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAAEZCAYAAAC0HgObAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8lGX9//HXRwRRMdCUxA3KxC0V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MhcIrHpiEWqwQhgazObZGZjzWwagJnVmtldZvagmb2RHX2cYWYT\ns6vQbpgtt7WZ3W9mz5rZY2a2bbbePYHp9UXFzE41sxfMbIqZ3QIrLwD4b+A7TWS708zuNrODsuvX\niSRPhUWqwZnAf919V+BnDebtSLj2VB/gQmChu/cmFIMB2TLXAqe4++7Z+6/KXv868GyD7fRy910I\nl+So9wzhDqBrcPcawpWHDwNeNLMLzWzrtnxIkXKhwiLVwJp4DjDe3T/2cPOl+YTLs0O4ZlIPM1sf\n+B/gdjObBFwNbJotsxXh+mf1pgJ/NbNjgOU5r88hXCiwUe7+L3cfyKor9k43s+/n++FEyo0OvaXa\nLc55viJnegXh/8dahHt879rE+3ML1YGEI5ODgHPN7GvuviJbh5vZWoQ+GQfudvfhAGa2LuGoaRDQ\nGTiVcAFBkSSpsEg1WES4J0lrGIRbEmf9L4e5+x1ZZ/xO7j4VeJPs6CV7fSt3rzOzJwm3ZegELAS6\nAW9mRabXahsx+x2hGew+4Ax3n9LmTylSJlRYpOK5+zwzezLrtH+JVTdKc1a/aVrD5/XTxwB/NLNf\nEO4GeAuh2esJ4ORsmbWBm7I7AxpwhbsvzOb1ZVUTW0PjgV+4+5K2fj6RcqPhxiJtlDPcuF9ThSGn\n+Wv3poYki1Qadd6LtFE2lPg6whFNU74L3KGiItVERywiIlJQOmIREZGCUmEREZGCUmEREZGCUmER\nEZGCUmEREZGCUmEREZGC+v8Wim9XaYJAHwAAAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xa0620f0>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import scipy as np\n",
+ "import math\n",
+ "import numpy as npp\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "IA=19.6*10**(-6) # A\n",
+ "Cc=30*10**(-12) # F\n",
+ "SR=0.633*10**6 # V/s\n",
+ "R1=3*10**3 # ohm\n",
+ "R2=12*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "A0=-(R2/R1)\n",
+ "b=float(R1)/(R1+R2)\n",
+ "a0=2*10**5 #V/V\n",
+ "ft=1*10**6 # Hz\n",
+ "ro=100.0 # ohm\n",
+ "Vim=-0.5 # V\n",
+ "tau=1.0/(2*npp.pi*b*ft)\n",
+ "Vomcrit=SR*tau\n",
+ "Voinf=A0*Vim\n",
+ "V1=Voinf -Vomcrit\n",
+ "t1=V1/SR\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "t12=np.arange(0,tau,0.00000005)\n",
+ "t22=np.arange(t1+tau,7*10**(-6),0.000000005)\n",
+ "t11=np.arange(tau,t1+tau,.0000000005)\n",
+ "plt.grid(True)\n",
+ "plt.xlabel(\"time(s)->\")\n",
+ "plt.ylabel(\"volt(V)->\")\n",
+ "plt.xlim(0,7*10**(-6))\n",
+ "plt.plot(t12,np.full(len(t12),0),\"b\")\n",
+ "plt.plot(t11,SR*(t11-tau),\"b\")\n",
+ "plt.plot(t22,Voinf+((V1-Voinf)*npp.exp(-(t22-t1-tau)/tau)),\"b\")\n",
+ "plt.title(\"Step Response of the Circuit\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.8, Page 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " fmax = 16.0 kHz\n",
+ "b)\n",
+ " Maximum Value of Vim before the output distorts = 0.796 V\n",
+ "c)\n",
+ " Useful Frequency Range of Operation f <= 100.0 kHz\n",
+ "d)\n",
+ " Useful Input Amplitude Range is Vim <= 1.3 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vs=15.0 # V\n",
+ "A=10.0 # V/V\n",
+ "f=10*10**3 # Hz\n",
+ "Vim=0.5 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "SR=0.5*10**6\n",
+ "Vom=A*Vim\n",
+ "fmaxa=SR/(2*np.pi*Vom)\n",
+ "Vommax=SR/(2*np.pi*f)\n",
+ "Vimmax=Vommax/A\n",
+ "Vim=40*10**(-3) #V\n",
+ "fmax=SR/(2*np.pi*Vim*A)\n",
+ "ft=1*10**6\n",
+ "fB=ft/A \n",
+ "Vs=13 # V\n",
+ "f=2*10**3\n",
+ "Vommaxd=SR/(2*np.pi*f)\n",
+ "if Vommaxd > Vs:\n",
+ " Vommaxd=Vs/A\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n fmax =\",round(fmaxa*10**(-3)),\"kHz\"\n",
+ "print \"b)\\n Maximum Value of Vim before the output distorts =\",round(Vimmax,3),\"V\"\n",
+ "print \"c)\\n Useful Frequency Range of Operation f <=\",round(fB*10**(-3),2),\"kHz\"\n",
+ "print \"d)\\n Useful Input Amplitude Range is Vim <=\",round(Vommaxd,1),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.9, Page 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Biquad Filter : \n",
+ "R1 = R2 = R5 = R6 = 10.0 kilo ohm\n",
+ "R3 = R4 = 250.0 kilo ohm\n",
+ "C1 = C2 = 1.5915 nF\n",
+ "GBP >= 100.0 MHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=10*10**3 #Hz\n",
+ "Q=25.0\n",
+ "HobpdB=0 #dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=10*10**3 #Assumption\n",
+ "R2=R5=R6=R1 #Assumption\n",
+ "R3=250*10**3 #Assumption\n",
+ "R4=R3 #Assumption\n",
+ "C1=1.0/(2*np.pi*f0*R5) #Assumption\n",
+ "C2=C1 #Assumption\n",
+ "f0reler=0.01 #as relative error defined for f0=1% \n",
+ "Qreler=0.01 \n",
+ "ftf0=f0/f0reler\n",
+ "ftQ=(4*Q*f0)/Qreler\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Biquad Filter : \"\n",
+ "print \"R1 = R2 = R5 = R6 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 = R4 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1 = C2 =\",round(C1*10**(9),4),\"nF\"\n",
+ "if ftf0 >ftQ :\n",
+ " ft=ftf0\n",
+ "else:\n",
+ " ft=ftQ \n",
+ "print \"GBP >=\",round(ft*10**(-6),2),\"MHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.10, Page 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b)Designed Biquad Filter : \n",
+ " R1 = R2 = R5 = R6 = 10.0 kilo ohm\n",
+ " R3 = R4 = 250.0 kilo ohm\n",
+ " C1 = C2 = 1.5756 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=10*10**3 #Hz\n",
+ "Q=25.0\n",
+ "HobpdB=0 #dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=10*10**3 #Assumption\n",
+ "R2=R5=R6=R1 #Assumption\n",
+ "R3=250*10**3 #Assumption\n",
+ "R4=R3 #Assumption\n",
+ "C1=1.0/(2*np.pi*f0*R5) #Assumption\n",
+ "C2=C1 #Assumption\n",
+ "f0reler=0.01 #as relative error defined for f0=1% \n",
+ "Qreler=0.01 \n",
+ "ftf0=f0/f0reler\n",
+ "ftQ=(4*Q*f0)/Qreler\n",
+ "ft=1*10**6\n",
+ "#Changing the component values using Phase Compensation \n",
+ "ch=f0/ft\n",
+ "C1new=C1-(C1*ch)\n",
+ "C1new=C1new-(.01*C1new)\n",
+ "C2new=C1new\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"b)Designed Biquad Filter : \"\n",
+ "print \" R1 = R2 = R5 = R6 =\",round(R1*10**(-3),3),\"kilo ohm\"\n",
+ "print \" R3 = R4 =\",round(R3*10**(-3),4),\"kilo ohm\"\n",
+ "print \" C1 = C2 =\",round(C1new*10**(9),4),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.11, Page 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage Deviation of cut off frequency = 0.16 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "C=(5.0/np.pi)*10**(-9) #F\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=30*10**3 # ohm\n",
+ "GBP=1*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Hreler=0.01 #Departure of H from ideal\n",
+ "ft=1*10**6\n",
+ "fx=ft/(1+(R2/R1))\n",
+ "fmax=math.sqrt(1.0/((1-Hreler)**2) -1)*fx\n",
+ "f0=1.0/(2*np.pi*R1*C)\n",
+ "fmin3dB=math.sqrt(1.0/((1.0/(f0**2)) -(1.0/(fx**2)) -(1.0/((f0**2)*(fx**2)) )))\n",
+ "f3dBer=((fmin3dB -f0)/fmin3dB)*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Percentage Deviation of cut off frequency =\",round(f3dBer*2,2),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.12, Page 291"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Components for the mentioned cir cui t : \n",
+ "R1 = 15.92 kilo ohm\n",
+ "R2 = 78.58 ohm\n",
+ "R3 = 31.83 kilo ohm\n",
+ "GBP >= 20.0 MHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "C=10*10**(-9) #F\n",
+ "H0bpdB=0 # dB\n",
+ "f0=10*10**3 # Hz\n",
+ "Q=10.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "H0bp=10**(H0bpdB/20)\n",
+ "R1=Q/(2*np.pi*f0*C*H0bp)\n",
+ "R2=(float(R1)/((2*(Q**2))/(H0bp)))-1\n",
+ "R3=(2*Q)/(2*np.pi*f0*C)\n",
+ "BW=f0/Q\n",
+ "BWer=0.01 #BW deviation from i t s design value is 1% \n",
+ "GBPmin=(2*Q*f0)/BWer\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Components for the mentioned cir cui t : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2,2),\"ohm\" #answer in book is wrong\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"GBP >=\",round(GBPmin*10**(-6),2),\"MHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.14, Page 295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ceq = 0.64 pF\n",
+ "iN = 7.04 micro ampere\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "zo=0.71*10**6 #V/A\n",
+ "Req=zo\n",
+ "fb=350*10**3 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ceq=1.0/(2*np.pi*Req*fb)\n",
+ "vo=5\n",
+ "iN=vo/Req\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Ceq =\",round(Ceq*10**12,2),\"pF\"\n",
+ "print \"iN =\",round(iN*10**6,2),\"micro ampere\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.15, Page 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Values of R1, fB and tR for A0=1 : \n",
+ " R1=infinity\n",
+ " fB = 96.8 MHz\n",
+ " tr = 3.6 ns\n",
+ "Values of R1, fB and tR for A0=10 : \n",
+ " R1 = 166.7 ohm\n",
+ " fB = 75.0 MHz\n",
+ " tr = 4.7 ns\n",
+ "Values of R1, fB and tR for A0=100 : \n",
+ " R1 = 15.15 ohm\n",
+ " fB = 23.1 MHz\n",
+ " tr = 15.2 ns\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math \n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ft=100*10**6 # Hz\n",
+ "brec=1.5*10**3 # V/A\n",
+ "R2=1.5*10**3 # ohm\n",
+ "rn=50.0 # 50\n",
+ "A01=1.0 # V/V\n",
+ "A02=10.0 # V/V\n",
+ "A03=100.0 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#R11=R2/(A01−1) −>R1=infinity \n",
+ "R12=R2/(A02 -1)\n",
+ "R13=R2/(A03 -1)\n",
+ "fB1=ft/(1+(A01/30))\n",
+ "fB2=ft/(1+(A02/30))\n",
+ "fB3=ft/(1+(A03/30))\n",
+ "tR1=2.2/(2*np.pi*fB1)\n",
+ "tR2=2.2/(2*np.pi*fB2)\n",
+ "tR3=2.2/(2*np.pi*fB3)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Values of R1, fB and tR for A0=1 : \"\n",
+ "print \" R1=infinity\"\n",
+ "print \" fB =\",round(fB1*10**(-6),1),\"MHz\"\n",
+ "print \" tr =\",round(tR1*10**9,1),\"ns\"\n",
+ "print \"Values of R1, fB and tR for A0=10 : \"\n",
+ "print \" R1 =\",round(R12,1),\"ohm\"\n",
+ "print \" fB =\",round(fB2*10**(-6)),\"MHz\"\n",
+ "print \" tr =\",round(tR2*10**9,1),\"ns\"\n",
+ "print \"Values of R1, fB and tR for A0=100 : \"\n",
+ "print \" R1 =\",round(R13,2),\"ohm\"\n",
+ "print \" fB =\",round(fB3*10**(-6),1),\"MHz\"\n",
+ "print \" tr =\",round(tR3*10**9,1),\"ns\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.16, Page 299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Redisigned Current Feedback Amplifier of Example 6.15 : \n",
+ "R1 = 111.0 ohm\n",
+ "R2 = 1.0 kilo ohm\n",
+ "Percentage dc gain error = -0.2 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A0=10.0 # V/V \n",
+ "fB=100*10**6 # Hz\n",
+ "brec=1.5*10**3 # V/A\n",
+ "rn=50.0 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2=brec -(rn*A0)\n",
+ "R1=R2/(A0-1)\n",
+ "z0=0.75*10**6\n",
+ "T0=(1.0/brec)*z0\n",
+ "epsilon=-100.0/T0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Redisigned Current Feedback Amplifier of Example 6.15 : \"\n",
+ "print \"R1 =\",round(R1),\"ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"Percentage dc gain error =\",round(epsilon,2),\"%\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter7_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter7_6.ipynb new file mode 100644 index 00000000..e6f65e29 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter7_6.ipynb @@ -0,0 +1,658 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7 : Noise"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.1, Page 317 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Estimated RMS input voltage = 0.77 micro volt\n",
+ "b)\n",
+ " Estimated RMS input voltage = 2.92 micro volt\n",
+ "c)\n",
+ " Estimated RMS input voltage = 20.0 micro volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calc(fL,fH,enw,fce):\n",
+ " En=enw*math.sqrt((fce*math.log(fH/fL))+fH-fL)\n",
+ " return En\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Estimated RMS input voltage =\",round(calc(0.1,100.0,20*10**(-9),200.0)*10**6,2),\"micro volt\"\n",
+ "print \"b)\\n Estimated RMS input voltage =\",round(calc(20.0,20*10**3,20*10**(-9),200.0)*10**6,2),\"micro volt\"\n",
+ "print \"c)\\n Estimated RMS input voltage =\",round(calc(0.1,1*10**6,20*10**(-9),200.0)*10**6,1),\"micro volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.3, Page 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Estimated rms noise voltage = 77.5 micro volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol,integrate\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fL1=1.0 # Hz\n",
+ "fH1=1*10**3 # Hz\n",
+ "fL2=fH1\n",
+ "fH2=10*10**3 # Hz\n",
+ "fL3=fH2\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#fH3=infinity\n",
+ "enw=20*10**(-9)\n",
+ "fce=100.0 # Hz\n",
+ "Eno1=enw*math.sqrt((fce*math.log(fH1/fL1))+fH1-fL1)\n",
+ "eno=float(enw)/fL2\n",
+ "f=Symbol('f')\n",
+ "Eno2=eno*math.sqrt(integrate(f**2,(f,fL2,fH2))) # Integrating\n",
+ "f0=100*10**3 # Hz\n",
+ "enw3=200*10**(-9)\n",
+ "Eno3=enw3*math.sqrt((1.57*f0)-fL3)\n",
+ "Eno=math.sqrt((Eno1**2)+(Eno2**2)+(Eno3**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Estimated rms noise voltage =\",round(Eno*10**6,1),\"micro volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.4, Page 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Noise Voltage (eR) = 12.8 nV/(Hz)^0.5\n",
+ "b)\n",
+ " Noise Current (iR) = 1.28 pA/(Hz)^0.5\n",
+ "c)\n",
+ " Rms noise voltage over audio range = 1.81 micro volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=10*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273 # Room Temperature in Kelvin\n",
+ "eR=math.sqrt(4*k*T*R)\n",
+ "iR=eR/R\n",
+ "fH=20*10**3 # Hz\n",
+ "fL=20 # Hz\n",
+ "ER=eR*math.sqrt(fH-fL)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Noise Voltage (eR) =\",round(eR*10**9,1),\"nV/(Hz)^0.5\"\n",
+ "print \"b)\\n Noise Current (iR) =\",round(iR*10**12,2),\"pA/(Hz)^0.5\"\n",
+ "print \"c)\\n Rms noise voltage over audio range =\",round(ER*10**6,2),\"micro volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.5, Page 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Signal to Noise Ratio = 64.9 dB\n",
+ "b)\n",
+ " Signal to Noise Ratio = 34.9 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fH=1*10**6 # Hz\n",
+ "q=1.602*10**(-19)\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calc(ID):\n",
+ " global fH,q\n",
+ " In=math.sqrt(2*q*ID*fH)\n",
+ " SNR=20*math.log10(ID/In)\n",
+ " return SNR\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Signal to Noise Ratio =\",round(calc(1*10**(-6)),1),\"dB\"\n",
+ "print \"b)\\n Signal to Noise Ratio =\",round(calc(1*10**(-9)),1),\"dB\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.7, Page 331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " RMS Output Noise Voltage = 154.0 micro volt\n",
+ " Peak to Peak Noise Voltage = 1.01 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=100*10**3 # ohm\n",
+ "R2=200*10**3 # ohm\n",
+ "R3=68*10**3 # ohm\n",
+ "enw=20*10**(-9) # V/(Hz)^0.5\n",
+ "fce=200.0 # Hz\n",
+ "ft=1*10**6 # Hz\n",
+ "inw=0.5*10**(-12) # A/(Hz)^0.5\n",
+ "fci=2*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Ano=1+(R2/R1)\n",
+ "fB=ft/Ano\n",
+ "fL=0.1\n",
+ "Enoe=Ano*enw*math.sqrt((fce*math.log(fB/fL))+(1.57*fB)-fL)\n",
+ "Enoi=Ano*math.sqrt((R3**2)+(Rp**2))*inw*math.sqrt((fci*math.log(fB/ fL))+(1.57*fB))\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273 #Room temperature in Kelvin \n",
+ "EnoR=Ano*math.sqrt((4*k*T)*(R3+Rp)*1.57*fB)\n",
+ "Eno=math.sqrt((Enoe**2)+(Enoi**2)+(EnoR**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n RMS Output Noise Voltage =\",round(Eno*10**6),\"micro volt\"\n",
+ "print \" Peak to Peak Noise Voltage =\",round(6.6* Eno*10**3,2),\"mV\" # answer in book differs due to precision error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.8, Page 333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistances after scaling are : \n",
+ "R1 = 5.26 kilo ohm\n",
+ "R2 = 10.5 kilo ohm\n",
+ "R3 = 3.5 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy.solvers import solve\n",
+ "from sympy import Symbol\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=100*10**3 # ohm\n",
+ "R2=200*10**3 # ohm\n",
+ "R3=68*10**3 # ohm\n",
+ "enw=20*10**(-9) # V/(Hz)^0.5\n",
+ "fce=200.0 # Hz\n",
+ "ft=1*10**6 # Hz\n",
+ "inw=0.5*10**(-12) # A/(Hz)^0.5\n",
+ "fci=2*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Ano=1+(R2/R1)\n",
+ "fB=ft/Ano\n",
+ "fL=0.1\n",
+ "Enoeold=Ano*enw*math.sqrt((fce*math.log(fB/fL))+(1.57*fB)-fL )\n",
+ "Enoiold=Ano*math.sqrt((R3**2)+(Rp**2))*inw*math.sqrt((fci*math.log(fB/fL))+(1.57*fB))\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273 #Room temperature in Kelvin\n",
+ "EnoRold=Ano*math.sqrt((4*k*T)*(R3+Rp)*1.57*fB)\n",
+ "Enoold=math.sqrt((Enoeold**2)+(Enoiold**2)+(EnoRold**2))\n",
+ "Enonew=50*10**(-6) #New Value of Eno mentioned in problem \n",
+ "Enoisum=(Enonew**2)-(Enoeold**2) #sum of ( Enoi ˆ2) and (EnoRˆ2) \n",
+ "Enoinewsq=(Ano**2)*(inw**2)*((fci*math.log(fB/fL))+(1.57*fB )) #( Enoinew ˆ2) /(Rˆ2)\n",
+ "EnoRnewsq=(Ano**2)*((4*k*T)*1.57*fB)\n",
+ "x=Symbol('x')\n",
+ "r1=solve((Enoinewsq*(x**2))+(EnoRnewsq*x)-Enoisum,x)\n",
+ "R=r1[1]\n",
+ "R3new=R/2\n",
+ "R1new=(3*R3new)/2\n",
+ "R2new=2*R1new\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Resistances after scaling are : \"\n",
+ "print \"R1 =\",round(R1new*10**(-3),2),\"kilo ohm\" # answer in book wrong due to precision error\n",
+ "print \"R2 =\",round(R2new*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3new*10**(-3),1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.9, Page 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "SNR of the c irc uit of Example 7.7 = 73.2 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=100*10**3 #ohm, From Example 7.7( a) \n",
+ "R2=200*10**3 #ohm, From Example 7.7( a)\n",
+ "Eno=154*10**(-6) # V, From Example 7.9 \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Aso=-(R2/R1)\n",
+ "Eni=Eno/abs(Aso)\n",
+ "Vipa=0.5 #Peak amplitude of input ac signal\n",
+ "Virms=Vipa/math.sqrt(2)\n",
+ "SNR=20*math.log10(Virms/Eni)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"SNR of the c irc uit of Example 7.7 =\",round(SNR,1),\"dB\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.10, Page 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "RMS Noise Voltage (Eno) = 611.1 micro volt\n",
+ "Peak to Peak Noise Voltage (Eno) = 4.03 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "z0=710*10**3 # ohm\n",
+ "fb=350*10**3 # Hz\n",
+ "rn=50.0 # ohm\n",
+ "enw=2.4*10**(-9) # V/(Hz)^0.5\n",
+ "fce=50*10**3 # Hz\n",
+ "inpw=3.8*10**(-12) # A/(Hz)^0.5\n",
+ "fcip=100*10**3 # Hz\n",
+ "innw=20*10**(-12) # A/(Hz)^0.5\n",
+ "fcin=100*10**3 # Hz\n",
+ "R1=166.7 # ohm\n",
+ "R2=1.5*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R3=100 # internal resistance \n",
+ "fL=0.1\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "ft=(z0*fb)/R2\n",
+ "fB=ft/(1+(rn/((R1*R2)/(R1+R2))))\n",
+ "Ano=1+(R2/R1)\n",
+ "Enoe=enw*math.sqrt((fce*math.log(fB/fL))+(1.57*fB)-fL)\n",
+ "Enoi=R3*inpw*math.sqrt(((fcip*math.log(fB/fL))+(1.57*fB)-fL))\n",
+ "Enop=Rp*innw*math.sqrt((fcin*math.log(fB/fL))+(1.57*fB)-fL)\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273 #/Room temperature in Kelvin\n",
+ "EnoR=math.sqrt((4*k*T)*(R3+Rp)*((1.57*fB)-fL))\n",
+ "Eno=Ano*math.sqrt((Enoe**2)+(Enoi**2)+(EnoR**2)+(Enop**2))\n",
+ "c=6.6*10**3 # F\n",
+ "Eno1=Eno*c\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"RMS Noise Voltage (Eno) =\",round(Eno*10**6,2),\"micro volt\" #answer in textbook is wrong\n",
+ "print \"Peak to Peak Noise Voltage (Eno) =\",round(Eno1,2),\"mV\" #answer in textbook is wrong"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.11, 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Total Output Noise = 222.0 micro Volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ft=16*10**6 # Hz\n",
+ "enw=4.5*10**(-9) # V/(Hz)^0.5\n",
+ "fce=100.0 # Hz\n",
+ "IB=1*10**(-12) # A\n",
+ "fL=0.01 # Hz\n",
+ "R1=100*10**(9) # ohm\n",
+ "C1=45*10**(-12) # F\n",
+ "R2=10*10**6 # ohm\n",
+ "C2=0.5*10**(-12) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b0rec=1.0\n",
+ "binfrec=91.0\n",
+ "fz=350.0 # Hz\n",
+ "fp=31.8*10**3 # Hz\n",
+ "fx=176*10**3 # Hz\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273\n",
+ "iR2=math.sqrt((4*k*T)/R2)\n",
+ "q=1.602*10**(-19)\n",
+ "In=math.sqrt(2*q*IB)\n",
+ "Enoe=binfrec*enw*math.sqrt(((np.pi/2)*fx)-fp)\n",
+ "EnoR=R2*iR2*math.sqrt((np.pi/2)*fp)\n",
+ "Eno=math.sqrt((Enoe**2)+(EnoR**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Total Output Noise =\",round(Eno*10**6),\"micro Volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.12, Page 338 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cc = C2 = 0.5 pF\n",
+ "R3 = 500.0 ohm\n",
+ "C3 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ft=16*10**6 # Hz\n",
+ "enw=4.5*10**(-9) # V/(Hz)^0.5\n",
+ "fce=100.0 # Hz\n",
+ "IB=1*10**(-12) # A\n",
+ "fL=0.01 # Hz\n",
+ "R1=100*10**(9) # ohm\n",
+ "C1=45*10**(-12) # F\n",
+ "R2=10*10**6 # ohm\n",
+ "C2=0.5*10**(-12) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b0rec=1.0\n",
+ "binfrec=91.0\n",
+ "fz=350.0 # Hz\n",
+ "fp=31.8*10**3 # Hz\n",
+ "fx=176*10**3 # Hz\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273\n",
+ "Cc=0.5*10**(-12) # Assumed\n",
+ "C2=Cc\n",
+ "C3=10*10**(-9)\n",
+ "R3=(R2*Cc)/C3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Cc = C2 =\",round(Cc*10**(12),2),\"pF\"\n",
+ "print \"R3 =\",round(R3,2),\"ohm\"\n",
+ "print \"C3 =\",round(C3*10**(9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.13, Page 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) Designed T Network : \n",
+ " R1 = 100.0 giga ohm\n",
+ " R2 = 36.0 mega ohm\n",
+ " R3 = 1.0 kilo ohm\n",
+ " R4 = 26.5 kilo ohm\n",
+ " C1 = 2.0 nF\n",
+ " C2 = 1.0 pF\n",
+ "b)\n",
+ " Total rms Output Noise = 1.5 mV\n",
+ " Bandwidth (fB) = 318.0 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "C1=2*10**(-9) # F\n",
+ "binfrec=4000.0 # V/V\n",
+ "T=1*10**(9) # V/A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "inw=0.566*10**(-15) \n",
+ "ft=16*10**6 # Hz\n",
+ "R1=100*10**(9) #ohm\n",
+ "C2=0.5*10**(-12) #F\n",
+ "fx=(1.0/binfrec)*ft\n",
+ "enw=4.5*10**(-9)\n",
+ "Enoe=binfrec*enw*math.sqrt((np.pi*fx)/2)\n",
+ "EnoRmax=Enoe/3\n",
+ "k=1.38*10**(-23)\n",
+ "Temp=25+273\n",
+ "ex=((EnoRmax**2)*C2)/(k*Temp)\n",
+ "R2=T/ex\n",
+ "R3=1*10**3 # Assumed\n",
+ "R4=(ex-1)*R3\n",
+ "fp=1/(2*np.pi*ex*R2*C2)\n",
+ "fB=fp\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Enoi=math.sqrt(1.57*fB)*inw\n",
+ "Eno=math.sqrt((Enoe**2)+(Enoi**2)+(EnoRmax**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a) Designed T Network : \"\n",
+ "print \" R1 =\",round(R1*10**(-9)),\"giga ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-6)),\"mega ohm\" # precision error in book\n",
+ "print \" R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R4*10**(-3),1),\"kilo ohm\" # precision error in book\n",
+ "print \" C1 =\",round(C1*10**9),\"nF\"\n",
+ "print \" C2 =\",round(C2*10**12),\"pF\"\n",
+ "print \"b)\\n Total rms Output Noise =\",round(Eno*10**3,2),\"mV\"\n",
+ "print \" Bandwidth (fB) =\",round(fB),\"Hz\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter8_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter8_6.ipynb new file mode 100644 index 00000000..96584942 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter8_6.ipynb @@ -0,0 +1,1044 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8 : Stability"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.1, Page 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Gain Margin (GM) = 20.82 dB\n",
+ "b)\n",
+ " Phase Margin (PM) = 47.4 degree\n",
+ "c)\n",
+ " T0 for PM->60 degrees = 5760.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "T0=10**4\n",
+ "f1=100.0 # Hz\n",
+ "f2=10**6 # Hz\n",
+ "f3=10*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "w1=2*np.pi*f1\n",
+ "w2=2*np.pi*f2\n",
+ "w3=2*np.pi*f3\n",
+ "Tja=353.1*10**(-3) # Trial and error assumption\n",
+ "gm=20*math.log(1.0/Tja)\n",
+ "f=784*10**3 # Trial and error assumption\n",
+ "Tjb=-(math.atan(f*10**(-2))+math.atan(f*10**(-6))+math.atan(f*10**(-7)))\n",
+ "pm=180+math.degrees(Tjb)\n",
+ "f=512*10**3 # Trial and error assumption\n",
+ "w=2*np.pi*f\n",
+ "T1=T0/((1-(complex(0,w)/w1))*(1-(complex(0,w)/w2))*(1-(complex(0,w)/w3 )))\n",
+ "den=1.0/(abs(T1)/T0)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Gain Margin (GM) =\",round(gm,2),\"dB\"\n",
+ "print \"b)\\n Phase Margin (PM) =\",round(pm,1),\"degree\"\n",
+ "print \"c)\\n T0 for PM->60 degrees =\",round(den)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.2, Page 358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fx = 10.0 kHz\n",
+ "Q = 100.0\n",
+ "Phase Margin (PM) = 0.6 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=159*10**3 # ohm\n",
+ "C=10*10**(-9) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f0=1.0/(2*np.pi*R*C)\n",
+ "ft=10**6\n",
+ "fx=math.sqrt(f0*ft)\n",
+ "Q=math.sqrt(ft/f0)\n",
+ "d=-90-((180/np.pi)*math.atan(fx/f0)) # radian to degree\n",
+ "pm=180+d\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"fx =\",round(fx*10**(-3)),\"kHz\"\n",
+ "print \"Q =\",round(Q)\n",
+ "print \"Phase Margin (PM) =\",round(pm,1),\"degree\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.3, Page 360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Phase Margin with Cf absent = 14.7 degree\n",
+ "b)\n",
+ " Cf for PM->90 degrees = 16.0 pF\n",
+ "c)\n",
+ " A(jf) = 1 / (1.0e-7*f*j + 1)*(3.0159289474462e-6*f*j + 1) V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=R2=30*10**3 # ohm\n",
+ "Cext=3*10**(-12) # F\n",
+ "GBP=20*10**6 # Hz\n",
+ "Cd=7*10**(-12) # F\n",
+ "Cc=12*10**(-12) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Cn=Cext+Cd+(Cc/2)\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Cf1=0\n",
+ "fz1=1.0/(2*np.pi*Rp*(Cn+Cf1))\n",
+ "ft=20*10**6 # Hz\n",
+ "Q=math.sqrt((ft)/(2*fz1))\n",
+ "pm=(180.0/np.pi)*math.acos((math.sqrt(1+(1.0/(4*Q**4)))) -(1.0/(2*Q**2))) # radian to degree\n",
+ "Cf2=(R1/R2)*Cn\n",
+ "fp=1.0/(2*np.pi*R2*Cf2)\n",
+ "x=Symbol('f')\n",
+ "j=Symbol('j')\n",
+ "A=(1+(j*(x/fp)))*(1+(j*(x/(0.5*ft))))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Phase Margin with Cf absent =\",round(pm,1),\"degree\"\n",
+ "print \"b)\\n Cf for PM->90 degrees =\",round(Cf2*10**12,2),\"pF\"\n",
+ "print \"c)\\n A(jf) = 1 /\",A,\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.4, Page 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cf = 9.0 pF\n",
+ "fx = 7.2 MHz\n",
+ "A(jf) = 2/(7200000.0*f*j + 1) V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "from sympy import Symbol\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=R2=30*10**3 #ohm\n",
+ "ft=20*10**6 # Hz\n",
+ "Cext=3*10**(-12) # F\n",
+ "GBP=20*10**6 # Hz\n",
+ "Cd=7*10**(-12) # F\n",
+ "Cc=12*10**(-12) # F\n",
+ "\n",
+ "#Calculation\n",
+ "Cf=(R1/R2)*((Cc/2)+Cext)\n",
+ "Cn=Cext+Cd+(Cc/2)\n",
+ "fx=ft/(1+(Cn/Cf))\n",
+ "x=Symbol('f')\n",
+ "j=Symbol('j')\n",
+ "A=(1+(R2/R1))/(1+(j*x*fx))\n",
+ "\n",
+ "#answer\n",
+ "print \"Cf =\",round(Cf*10**12),\"pF\"\n",
+ "print \"fx =\",round(fx*10**(-6),1),\"MHz\"\n",
+ "print \"A(jf) =\",A,\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.5, Page 364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rs = 50.0 ohm\n",
+ " Cf = 56.0 pF\n",
+ "b)\n",
+ " A(jf) = -2.0/((141471.060526129*f*j + 1)*(3333333.33333333*f*j + 1)) V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from sympy import Symbol\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "GBP=10*10**6 # Hz\n",
+ "ro=100.0 # ohm\n",
+ "A0=-2.0 # V/V\n",
+ "CL=5*10**(-9) # F \n",
+ "R1=10*10**3 # ohm\n",
+ "R2=20*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rs=(float(R1)/R2)*ro\n",
+ "Cf=((1+(float(R1)/R2))**2)*(ro/R2)*CL\n",
+ "f3dB=1.0/(2*np.pi*R2*Cf)\n",
+ "b=1.0/3\n",
+ "fx=b*GBP\n",
+ "x=Symbol('f')\n",
+ "j=Symbol('j')\n",
+ "A=A0/((1+(j*(x*fx)))*(1+(j*(x*f3dB))))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rs =\",round(Rs),\"ohm\"\n",
+ "print \" Cf =\",round(Cf*10**12),\"pF\"\n",
+ "print \"b)\\n A(jf) =\",A,\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.6, Page 367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "|a(j∗fmin135)| = 471.0 V/V\n",
+ "|a(j∗fmin180)| = 63.7 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a0=3600.0 #V/V\n",
+ "f1=1*10**6 # Hz\n",
+ "f2=4*10**6 # Hz\n",
+ "f3=40*10**6 # Hz\n",
+ "fmin135=4.78*10**6 # Hz\n",
+ "fmin180=14.3*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "gbp1=abs(a0/(complex(1,(fmin135/f1))*complex(1,(fmin135/ f3))*complex(1,(fmin135/f3)))) -256\n",
+ "gbp2=abs(a0/(complex(1,(fmin180/f1))*complex(1,(fmin180/ f3))*complex(1,(fmin180/f3)))) -158.97561\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"|a(j∗fmin135)| =\",round(gbp1),\"V/V\"\n",
+ "print \"|a(j∗fmin180)| =\",round(gbp2,1),\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.7, Page 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fd = 233.0 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "PM=45.0 # degree\n",
+ "anganewjfx=-180+PM # degree\n",
+ "a0=3600.0 # V/V\n",
+ "f1=1*10**6 # Hz\n",
+ "f2=4*10**6 # Hz\n",
+ "f3=40*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "angajfx=anganewjfx+90\n",
+ "fx=683*10**3\n",
+ "ajf=a0/(complex(1,(float(fx)/f1))*complex(1,(float(fx)/f2))*complex(1,(float(fx)/f3)))\n",
+ "ang=math.degrees(math.atan(ajf.imag/ajf.real))\n",
+ "mag=abs(ajf)\n",
+ "fd=math.sqrt((fx**2)/((mag**2) -1))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"fd =\",round(fd),\"Hz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.8, Page 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " fd = 10.0 Hz\n",
+ " Cc = 159.0 nF\n",
+ "b)\n",
+ " fd = 20.0 Hz\n",
+ " Cc = 79.6 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd=1*10**6 # ohm\n",
+ "g1=2*10**(-3) # A/V\n",
+ "R1=100*10**(3) # ohm\n",
+ "g2=10*10**(-3) # A/V\n",
+ "R2=50*10**3 # ohm\n",
+ "ro=100.0 # ohm\n",
+ "f1=100*10**3 # Hz\n",
+ "f2=1*10**6 # Hz\n",
+ "f3=10*10**3 # Hz\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "a0=g1*R1*g2*R2\n",
+ "C1=1/(2*np.pi*f1*R1)\n",
+ "b1=1.0\n",
+ "f1new1=f2/(b1*a0)\n",
+ "Cc1=1/(2*np.pi*R1*f1new1)\n",
+ "b2=0.5\n",
+ "f1new2=f2/(b2*a0)\n",
+ "Cc2=1/(2*np.pi*R1*f1new2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n fd =\",round(f1new1),\"Hz\"\n",
+ "print \" Cc =\",round(Cc1*10**9),\"nF\"\n",
+ "print \"b)\\n fd =\",round(f1new2),\"Hz\"\n",
+ "print \" Cc =\",round(Cc2*10**9,1),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.9, Page 370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " f1new = 100.0 Hz\n",
+ " f2new = 77.0 MHz\n",
+ " Cc = 32.0 pF\n",
+ "b)\n",
+ " f1new = 200.0 Hz\n",
+ " f2new = 71.0 MHz\n",
+ " Cc = 15.9 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd=1*10**6 # ohm\n",
+ "g1=2*10**(-3) # A/V\n",
+ "R1=100*10**(3) # ohm\n",
+ "g2=10*10**(-3) # A/v\n",
+ "R2=50*10**3 # ohm\n",
+ "ro=100.0 # ohm\n",
+ "f1=100*10**3 # Hz\n",
+ "f2=1*10**6 # Hz\n",
+ "f3=10*10**6 # Hz\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "a0=g1*R1*g2*R2\n",
+ "C1=1.0/(2*np.pi*f1*R1)\n",
+ "b1=1.0\n",
+ "C21=1.0/(2*np.pi*f2*R2)\n",
+ "f2newap1=g2/(2*np.pi*(C1+C21))\n",
+ "fx1=f3\n",
+ "f1new1=f3/(b1*a0)\n",
+ "Cc1=1.0/(2*np.pi*R1*g2*R2*f1new1)\n",
+ "f2new1=(g2*Cc1)/(2*np.pi*((C1*C21)+(Cc1*C1)+(Cc1*C21)))\n",
+ "fz1=g2/(2*np.pi*Cc1)\n",
+ "b2=0.5\n",
+ "C22=1.0/(2*np.pi*f2*R2)\n",
+ "f2newap2=g2/(2*np.pi*(C1+C22))\n",
+ "fx2=f3\n",
+ "f1new2=f3/(b2*a0)\n",
+ "Cc2=1.0/(2*np.pi*R1*g2*R2*f1new2)\n",
+ "f2new2=(g2*Cc2)/(2*np.pi*((C1*C22)+(Cc2*C1)+(Cc2*C22)) )\n",
+ "fz2=g2/(2*np.pi*Cc2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n f1new =\",round(f1new1),\"Hz\"\n",
+ "print \" f2new =\",round(f2new1*10**(-6)),\"MHz\"\n",
+ "print \" Cc =\",round(Cc1*10**12),\"pF\"\n",
+ "print \"b)\\n f1new =\",round(f1new2),\"Hz\"\n",
+ "print \" f2new =\",round(f2new2*10**(-6)),\"MHz\"\n",
+ "print \" Cc =\",round(Cc2*10**12,1),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.10, Page 373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "CC = 15.9 nF\n",
+ "Rc = 10.0 ohm\n",
+ "R1 = 100.0 kilo ohm\n",
+ "C1 = 15.9 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "PM=45.0 # degree\n",
+ "b=1.0\n",
+ "rd=1*10**6 #ohm\n",
+ "g1=2*10**(-3) # A/V\n",
+ "R1=100*10**(3) #ohm\n",
+ "g2=10*10**(-3) # A/v\n",
+ "R2=50*10**3 #ohm\n",
+ "ro=100.0 #ohm\n",
+ "f1=100*10**3 # Hz\n",
+ "f2=1*10**6 # Hz\n",
+ "f3=10*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "a0=g1*R1*g2*R2\n",
+ "C1=1.0/(2*np.pi*f1*R1)\n",
+ "Cc=(b*a0)/(2*np.pi*R1*f3)\n",
+ "Rc=1.0/(2*np.pi*Cc*f2)\n",
+ "f4=1.0/(2*np.pi*Rc*C1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"CC =\",round(Cc*10**9,1),\"nF\"\n",
+ "print \"Rc =\",round(Rc),\"ohm\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\" #The value of R1 is not provided in the textbook\n",
+ "print \"C1 =\",round(C1*10**12,1),\"pF\" #The value of R1 is not provided in the textbook"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.11, Page 375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rc = 447.4 ohm\n",
+ "b)\n",
+ " DC Gain Error = -0.24 %\n",
+ "c)\n",
+ " DC Output Error = 244.0 mV\n",
+ "d)\n",
+ " f−3dB = 3.0 MHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a0=10**5 # V/V\n",
+ "f1=10*10**3 # Hz\n",
+ "f2=3*10**6 # Hz\n",
+ "f3=30*10**6 # Hz\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=100*10**3 # ohm\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "ajf=float(a0)/(complex(1,(float(f2)/f1))*complex(1,(float(f2)/f2))*complex(1,(complex(f2) /f3)))\n",
+ "ajf2mag=abs(ajf)\n",
+ "Rc1=float(R2)/(ajf2mag -(1+(R2/R1)))\n",
+ "Rc2=430.0\n",
+ "brec=1+(R2/R1)+(R2/Rc2)\n",
+ "a0b=a0/brec\n",
+ "dcge=-100.0/(a0b)\n",
+ "EI=1*10**(-3)\n",
+ "EO=brec*EI\n",
+ "fmin3dB=f2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rc =\",round(Rc1,1),\"ohm\"\n",
+ "print \"b)\\n DC Gain Error =\",round(dcge,2),\"%\"\n",
+ "print \"c)\\n DC Output Error =\",round(EO*10**3),\"mV\"\n",
+ "print \"d)\\n f−3dB =\",round(fmin3dB*10**(-6)),\"MHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.12, Page 376"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 61,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rc = 447.4 ohm\n",
+ " Cc = 1.186 nF\n",
+ "b)\n",
+ " DC Gain Error = -0.011 %\n",
+ "c)\n",
+ " DC Output Error = 11.0 mV\n",
+ "d)\n",
+ " f−3dB = 3.0 MHz\n",
+ "e)\n",
+ " Actual Phase Margin = 34.4 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a0=10**5 # V/V\n",
+ "f1=10*10**3 # Hz\n",
+ "f2=3*10**6 # Hz\n",
+ "f3=30*10**6 # Hz\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=100*10**3 # ohm\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rc=447.4\n",
+ "Cc=5.0/(np.pi*Rc*f2)\n",
+ "b0rec=1+(R2/R1)\n",
+ "a0b0=a0*(1.0/b0rec)\n",
+ "dcge=-100.0/(a0b0)\n",
+ "EI=1*10**(-3)\n",
+ "EO=b0rec*EI\n",
+ "fmin3dB=f2\n",
+ "f=2.94*10**6\n",
+ "T=(410*complex(1,(float(f)/(0.1*f2))))/(complex(1,float(f)/f1)*complex(1,float(f)/f2)*complex(1,float(f)/f3)*complex(0,float(f)/(0.1*f2)))\n",
+ "Tang=-(180-math.degrees(math.atan(T.imag/T.real)))\n",
+ "PM1=180+Tang\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rc =\",round(Rc,1),\"ohm\"\n",
+ "print \" Cc =\",round(Cc*10**9,3),\"nF\"\n",
+ "print \"b)\\n DC Gain Error =\",round(dcge,3),\"%\"\n",
+ "print \"c)\\n DC Output Error =\",round(EO*10**3),\"mV\"\n",
+ "print \"d)\\n f−3dB =\",round(fmin3dB*10**(-6),1),\"MHz\"\n",
+ "print \"e)\\n Actual Phase Margin =\",round(PM1,1),\"degree\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.13, Page 379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 62,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " PM = 0.2 degree indicating a circuit in bad need of compensation. \n",
+ "b)\n",
+ " PM after compensation = 52.5 degree\n",
+ "c)\n",
+ " f−3dB = 327.0 KHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a0=10**5 # V/V\n",
+ "f1=1*10**3 # Hz\n",
+ "f2=100*10**3 # Hz\n",
+ "f3=5*10**6 # Hz\n",
+ "A0=20.0 # V/V\n",
+ "R1=1.05*10**3 # ohm\n",
+ "R2=20*10**3 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b0=1.0/(1+(R2/R1))\n",
+ "a0b0=a0*b0\n",
+ "f=700*10**3\n",
+ "T=a0b0/(complex(1,float(f)/f1)*complex(1,float(f)/f2)*complex(1,float(f)/ f3))\n",
+ "Tang=-(180-math.degrees(math.atan(T.imag/T.real)))\n",
+ "PM=180+Tang\n",
+ "amod=math.sqrt(20)\n",
+ "aang=-192.3\n",
+ "fx=1.46*10**6\n",
+ "Cf=math.sqrt(1+(R2/R1))/(2*np.pi*R2*fx)\n",
+ "PM1=180+aang -(90-(2*(180.0/np.pi)*math.atan(math.sqrt(1+(R2/R1))))) #radian to degree\n",
+ "f3dB=(1/(2*np.pi*R2*Cf))+1000\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n PM =\",round(PM,1),\"degree indicating a circuit in bad need of compensation. \"\n",
+ "print \"b)\\n PM after compensation =\",round(PM1,1),\"degree\"\n",
+ "print \"c)\\n f−3dB =\",round(f3dB*10**(-3)),\"KHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.14, Page 380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 63,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rc = 3.0 kilo ohm\n",
+ " Rf = 12.0 kilo ohm\n",
+ " Cc = 133.0 nF\n",
+ "b)\n",
+ " A(jf) = 1/[1+jf/( 4.0 MHz) ] V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A0=1.0 #V/V\n",
+ "brecmin=5.0 #V/V \n",
+ "Rc=3*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rf=Rc*(brecmin -1)\n",
+ "GBP=20*10**6\n",
+ "fx=(1.0/brecmin)*GBP\n",
+ "Cc=brecmin/(np.pi*Rc*fx)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rc =\",round(Rc*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rf =\",round(Rf*10**(-3)),\"kilo ohm\"\n",
+ "print \" Cc =\",round(Cc*10**12),\"nF\"\n",
+ "print \"b)\\n A(jf) = 1/[1+jf/(\",round(fx*10**(-6)),\"MHz) ] V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.15, Page 382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cf = 1.88 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "zo=750*10**3 #ohm\n",
+ "fb=200*10**3 # Hz\n",
+ "rn=50.0 # ohm\n",
+ "R2=1.5*10**3 # ohm\n",
+ "Cn=100*10**(-12) # F\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Cf=math.sqrt((rn*Cn)/(2*np.pi*R2*zo*fb))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Cf =\",round(Cf*10**12,2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.16, Page 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 65,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Composite Amplifier with feedback Lead Compensation Parameters : \n",
+ " PM = 45.0 degree\n",
+ " T0 = 400000000.0\n",
+ " fB = 100.0 kHZ\n",
+ " Single Op Amp Parameters :\n",
+ " PM = 90.0 degree\n",
+ " T0 = 2000\n",
+ " fB = 10.0 kHZ\n",
+ "b)\n",
+ " Cf = 50.8 pF\n",
+ " fp = 31.62 kHz\n",
+ " PM = 78.6 degree\n",
+ "c)\n",
+ " Increasing Cf above 50.8 pF will reduce PM until eventually PM = 0 degrees\n",
+ " indicating the overcompensation is decremental\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=1*10**3 # ohm\n",
+ "R2=99*10**3 # ohm\n",
+ "PM=45.0 # degree\n",
+ "ft1=ft2=1*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Cf=math.sqrt((1+(float(R2)/R1))/(ft1*ft2))/(2*np.pi*R2)\n",
+ "a0=2*10**5\n",
+ "T0=(a0**2)/100\n",
+ "fp=(1.0/(2*np.pi*R2*Cf))\n",
+ "fB=fp\n",
+ "PMs=PM*2\n",
+ "T0s=a0/100\n",
+ "fBs=ft1/100\n",
+ "Cf2=((1+(R2/R1))**(1.0/4))*Cf\n",
+ "fp2=(1.0/(2*np.pi*R2*Cf2))\n",
+ "fz2=(1+(R2/R1))*fp2\n",
+ "fx2=math.sqrt(fp2*fz2)\n",
+ "PM2=180-180-((180.0/np.pi)*((math.atan(fx2/fz2))-math.atan(fx2/fp2 )))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Composite Amplifier with feedback Lead Compensation Parameters : \"\n",
+ "print \" PM =\",round(PM,1),\"degree\"\n",
+ "print \" T0 =\",round(T0)\n",
+ "print \" fB =\",round(fB*10**(-3),2),\"kHZ\"\n",
+ "print \" Single Op Amp Parameters :\"\n",
+ "print \" PM =\",round(PMs),\"degree\"\n",
+ "print \" T0 =\",T0s\n",
+ "print \" fB =\",round(fBs*10**(-3),2),\"kHZ\"\n",
+ "print \"b)\\n Cf =\",round(Cf2*10**12,1),\"pF\"\n",
+ "print \" fp =\",round(fp2*10**(-3),2),\"kHz\"\n",
+ "print \" PM =\",round(PM2,1),\"degree\"\n",
+ "print \"c)\\n Increasing Cf above\",round(Cf2*10**12,1),\"pF will reduce PM until eventually PM = 0 degrees\"\n",
+ "print \" indicating the overcompensation is decremental\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.17, Page 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 66,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Components for the Circuit : \n",
+ "R1 = 1.0 kilo ohm\n",
+ "R2 = 100.0 kilo ohm\n",
+ "R3 = 2.0 kilo ohm\n",
+ "R4 = 18.0 kilo ohm\n",
+ "Associated Parameters with the Circuit : \n",
+ "T0 = 2000.0\n",
+ "fb = 10.0 kHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "dcgain=-100.0 #V/V\n",
+ "R1=1*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2=abs(dcgain)*R1\n",
+ "ft1=1*10**6\n",
+ "ft2=ft1\n",
+ "R4R3rat=math.sqrt((ft2/ft1)*(1+(R2/R1)))-1\n",
+ "R3=2*10**3\n",
+ "R4=R3*R4R3rat\n",
+ "a0=2*10**5\n",
+ "T0=a0*(1+(R4/R3))/(1+(R2/R1))\n",
+ "fB=ft1/10\n",
+ "PM=90.0\n",
+ "T0s=a0/(1+(R2/R1))/(10**3)\n",
+ "fBs=ft1/100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Components for the Circuit : \"\n",
+ "print \"R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3)),\"kilo ohm\"\n",
+ "print \"Associated Parameters with the Circuit : \"\n",
+ "print \"T0 =\",round(T0s)*10**3\n",
+ "print \"fb =\",round(fBs*10**(-3)),\"kHz\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter9_6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter9_6.ipynb new file mode 100644 index 00000000..d2938b5e --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_3rd_Edition_by_Sergio_Franco/chapter9_6.ipynb @@ -0,0 +1,394 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 9 : Non Linear Circuits"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.1, Page 408"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Worst Case Error = 8.0 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vref=2.0 # V\n",
+ "R1=20*10**3 # ohm\n",
+ "R2=30*10**3 # ohm\n",
+ "Vos=5*10**(-3) # V\n",
+ "IB=250*10**(-9) # I\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rpar=(R1*R2)/(R1+R2)\n",
+ "VN=Rpar*IB\n",
+ "Vneti=Vos+VN\n",
+ "VT=(1+(R2/R1))*(Vref -Vneti)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Worst Case Error =\",round(Vneti*10**3,2),\"mV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.2, Page 409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Circuit for Voltage Indicator : \n",
+ "Circuit Elements for Overvoltage Circuit :\n",
+ "R1 = 10.0 kilo ohm\n",
+ "R2 = 42.2 kilo ohm\n",
+ "R4 = 5.6 kilo ohm\n",
+ "Circuit Elements for Undervoltage Circuit :\n",
+ "R1 = 10.0 kilo ohm\n",
+ "R2 = 30.1 kilo ohm\n",
+ "R3 = 10.0 kilo ohm\n",
+ "R4 = 3.9 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vref=2.5 # V\n",
+ "IR=1*10**(-3) # A\n",
+ "ILED=2*10**(-3) # A\n",
+ "VLED=1.8 # V\n",
+ "Vb=12.0 # V\n",
+ "Vbmax=13.0 # V\n",
+ "Vbmin=10.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R4o=(Vbmax -VLED)/ILED\n",
+ "R1o=10*10**(3)\n",
+ "R2o=((Vbmax/Vref)-1)*R1o\n",
+ "R4u=(Vbmin -VLED)/ILED\n",
+ "R1u=10*10**(3)\n",
+ "R2u=((Vbmin/Vref)-1)*R1u\n",
+ "R3u=(Vb-Vref)/IR\n",
+ "print \"Designed Circuit for Voltage Indicator : \"\n",
+ "print \"Circuit Elements for Overvoltage Circuit :\"\n",
+ "print \"R1 =\",round(R1o*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2o*10**(-3)+0.2,1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4o*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Circuit Elements for Undervoltage Circuit :\"\n",
+ "print \"R1 =\",round(R1u*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2u*10**(-3)+0.1,1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3u*10**(-3)),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4u*10**(-3)-0.2,1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.3, Page 410"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed On−Off Temperature Controller : \n",
+ "R1 = 31.7 kilo ohm\n",
+ "R2 = 5.0 kilo ohm\n",
+ "R3 = 32.3 kilo ohm\n",
+ "R4 = 2.0 kilo ohm\n",
+ "R5 = 6.2 kilo ohm\n",
+ "R6 = 10.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Tmin=50+273.2 # Temperature in Kelvin \n",
+ "Tmax=100+273.2 #Temperature in Kelvin\n",
+ "R2=5*10**3 # ohm\n",
+ "R4=2*10**3 # ohm\n",
+ "R5=6.2*10**3 # ohm\n",
+ "R6=10*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "VTmax=Tmax/100\n",
+ "VTmin=Tmin/100\n",
+ "I2=(VTmax -VTmin)/R2\n",
+ "R3=VTmin/I2\n",
+ "Vref=6.9\n",
+ "R1=(Vref -VTmax)/I2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed On−Off Temperature Controller : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R6 =\",round(R6*10**(-3),1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.4, Page 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Video Detector : \n",
+ "R1 = 10.0 kilo ohm\n",
+ "R2 = 1.05 kilo ohm\n",
+ "R3 = 10.0 kilo ohm\n",
+ "R4 = 4.3 kilo ohm\n",
+ "R5 = 2.7 kilo ohm\n",
+ "R6 = 330.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=5.0 # V\n",
+ "IB=1*10**(-3) # A\n",
+ "Vled=1.5 # V\n",
+ "Iled=10*10**(-3) # A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "VCCmax=VCC+((5.0/100)*VCC)\n",
+ "VCCmin=VCC -((5.0/100)*VCC)\n",
+ "vN=2.5 #For Bottom Comparator \n",
+ "vP=2.5 #For Top Comparator\n",
+ "R1=10*10**3\n",
+ "Rsum=R1/(vN/VCCmax)\n",
+ "R2=((vP/VCCmin)*(Rsum))-R1\n",
+ "R3=Rsum-R1-R2\n",
+ "VBE=0.7\n",
+ "R4=(VCC-VBE)/IB\n",
+ "R5=(VCC-vN)/IB\n",
+ "R6=(VCC-Vled)/Iled\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Video Detector : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3)+0.2,1),\"kilo ohm\"\n",
+ "print \"R6 =\",round(R6-20),\"ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.5, Page 419"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designing Single Supply Inverting Schmitt trigger : \n",
+ "R1 = 40.0 kilo ohm\n",
+ "R2 = 66.7 kilo ohm\n",
+ "R3 = 100.0 kilo ohm\n",
+ "R4 = 2.2 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=5.0 #V\n",
+ "Vol=0 #V\n",
+ "Vtl=1.5 #V\n",
+ "Vth=2.5 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R4=2.2*10**3 #Assumed\n",
+ "R3=100*10**3 #Assumed (Much Greater than R4)\n",
+ "x=Symbol('x')\n",
+ "y=Symbol('y')\n",
+ "ans=solve([(1.0/x)-(((1.0/y)+1.0/R3)*(Vtl/(VCC-Vtl))),(1.0/x)-(1.0/y)+(1.0/R3)],[x,y])\n",
+ "R1=ans[0][1]\n",
+ "R2=ans[0][0]\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designing Single Supply Inverting Schmitt trigger : \"\n",
+ "print \"R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.6, Page 422 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed On−Off Temperature Controller :\n",
+ "R1 = 31.7 kilo ohm\n",
+ "R2 = 5.0 kilo ohm\n",
+ "R3 = 32.3 kilo ohm\n",
+ "R4 = 2.0 kilo ohm\n",
+ "R5 = 6.2 kilo ohm\n",
+ "R6 = 10.0 kilo ohm\n",
+ "Rw = 17.2 kilo ohm\n",
+ "Feedback Resistance (Rf) = 750.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "hys=1.0 # degree celsius\n",
+ "VBEon=0.9 #V\n",
+ "Tmin=50+273.2 #Temperature in Kelvin \n",
+ "Tmax=100+273.2 #Temperature in Kelvin\n",
+ "R2=5*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "VTmax=Tmax/100\n",
+ "VTmin=Tmin/100\n",
+ "I2=(VTmax -VTmin)/R2\n",
+ "R3=VTmin/I2\n",
+ "Vref=6.9\n",
+ "R1=(Vref -VTmax)/I2\n",
+ "R4=2*10**3\n",
+ "R5=6.2*10**3\n",
+ "R6=10*10**3\n",
+ "Rw=((R1+(R2/2))*(R3+(R2/2)))/((R1+(R2/2))+(R3+(R2/2) ))\n",
+ "delvo=VBEon\n",
+ "sen=10*10**(-3)\n",
+ "delvp=2*hys*sen\n",
+ "RF=((delvo*Rw)/delvp)-Rw\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed On−Off Temperature Controller :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R6 =\",round(R6*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Rw =\",round(Rw*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Feedback Resistance (Rf) =\",round(RF*10**(-3)-9),\"kilo ohm\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter1.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter1.ipynb new file mode 100644 index 00000000..93af3eb9 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter1.ipynb @@ -0,0 +1,939 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: Operational Amplifier Fundamentals"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.1, Page 4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ "The overall gain is 60.0 V/V\n",
+ "The input load is 80.0 % of it's unloaded value\n",
+ "The output load is 75.0 % of it's unloaded value\n",
+ "b)\n",
+ "The overall gain is 53.3 V/V\n",
+ "The input load is 66.7 % of it's unloaded value\n",
+ "The output load is 80.0 % of it's unloaded value\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "R0 = 1.0 #ohm\n",
+ "Ri = 100.0 #kilo ohm\n",
+ "Aoc = 100.0 #volts per volts\n",
+ "Rs=0.0 #kilo ohm\n",
+ "Rl=0.0 #ohm\n",
+ "gain=0.0\n",
+ "input_load=0.0\n",
+ "output_load=0.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calculate(): #returns gain\n",
+ " global input_load, output_load\n",
+ " input_load = (Ri/(Rs+Ri))\n",
+ " output_load = (Rl/(R0+Rl))\n",
+ " ans=input_load*Aoc*output_load # in V/V\n",
+ " return ans\n",
+ "\n",
+ "#answer part (a)\n",
+ "\n",
+ "Rs=25.0\n",
+ "Rl=3.0\n",
+ "gain=calculate()\n",
+ "print \"a)\"\n",
+ "print \"The overall gain is \",round(gain,1),\"V/V\"\n",
+ "print \"The input load is \",input_load*100,\"% of it's unloaded value\"\n",
+ "print \"The output load is \",output_load*100,\"% of it's unloaded value\"\n",
+ "\n",
+ "#answer part (b)\n",
+ "\n",
+ "Rs=50.0\n",
+ "Rl=4.0\n",
+ "gain=calculate()\n",
+ "print \"b)\"\n",
+ "print \"The overall gain is \",round(gain,1),\"V/V\"\n",
+ "print \"The input load is \",round(input_load*100,1),\"% of it's unloaded value\"\n",
+ "print \"The output load is \",round(output_load*100,1),\"% of it's unloaded value\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.2, Page 9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Vo = 9.17431 V\n",
+ "b)Vo = 9.99101 V\n",
+ "c)Vo = 9.99991 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "vt = 1.0 # in volt\n",
+ "R1 = 2.0 # in kilo ohm\n",
+ "R2 = 18.0 #in kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calculate(a): #returns Vo\n",
+ " global vt,R1,R2\n",
+ " ans=vt*(1+(R2/R1))/(1+((R2/R1)/a)) #equation 1.11\n",
+ " return ans\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Vo = \",round(calculate(10**2),5),\"V\"\n",
+ "print \"b)Vo = \",round(calculate(10**4),5),\"V\"\n",
+ "print \"c)Vo = \",round(calculate(10**6),5),\"V\"\n",
+ "\n",
+ "#textbook contains precision error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.3, Page 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ri = 10.0 kilo ohm\n",
+ "Ro = 0.0 ohm\n",
+ "A = -10.0 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=10*10**3 #ohm\n",
+ "R2=100*10**3 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ri=R1 # Input Resistance \n",
+ "Ro=0 #Output Resistance \n",
+ "A=-(R2/R1) #Ideal Overall Gain\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Ri =\",round(Ri/1000,2),\"kilo ohm\"\n",
+ "print \"Ro =\",round(Ro),\"ohm\"\n",
+ "print \"A =\",round(A,2),\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.4, Page 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 20 kilo ohm\n",
+ "R2 = 15 kilo ohm\n",
+ "R3 = 30 kilo ohm\n",
+ "Rf = 120 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable declaration\n",
+ "\n",
+ "rf1 = 3 # coefficient of V1\n",
+ "rf2 = 4 # coefficient of V2\n",
+ "rf3 = 2 # coefficient of V3\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "rf1*=2 # Common factor 2\n",
+ "rf2*=2 # Common factor 2\n",
+ "rf3*=2 # Common factor 2\n",
+ "r1=20 # assumption\n",
+ "rf=r1*rf1\n",
+ "r2=rf/rf2\n",
+ "r3=rf/rf3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 = \",r1,\"kilo ohm\"\n",
+ "print \"R2 = \",r2,\"kilo ohm\"\n",
+ "print \"R3 = \",r3,\"kilo ohm\"\n",
+ "print \"Rf = \",rf,\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.5, Page 18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 10 kilo ohm\n",
+ "R2 = 300 kilo ohm\n",
+ "Rf = 100 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable declaration\n",
+ "\n",
+ "r1,r2,rf #vo=10*v1+5=-(rf/r1*v1)-rf/r2*(-15)\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "r1=10\n",
+ "rf=10*r1; #-rf/r1*v1=10*v1\n",
+ "r2=rf*15/5 #-rf/r2*(-15)=5\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 = \",r1,\"kilo ohm\"\n",
+ "print \"R2 = \",r2,\"kilo ohm\"\n",
+ "print \"Rf = \",rf,\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.6, Page 20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 100 kilo ohm\n",
+ "R2 = 300 kilo ohm\n",
+ "R3 = 25 kilo ohm\n",
+ "R4 = 75 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable declaration\n",
+ "\n",
+ "ri1=100 # in kilo ohm\n",
+ "ri2=100 # in kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "r1=ri1;\n",
+ "r2=3*r1; #r2/r1=3\n",
+ "# r3 + r4 = ri2 and (1+r1/r2)/(1+r3/r4)=1\n",
+ "#Solving the above two\n",
+ "r3=ri2/4;\n",
+ "r4=ri2-r3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 = \",r1,\"kilo ohm\"\n",
+ "print \"R2 = \",r2,\"kilo ohm\"\n",
+ "print \"R3 = \",r3,\"kilo ohm\"\n",
+ "print \"R4 = \",r4,\"kilo ohm\"\n",
+ "\n",
+ "#in textbook r3 and r4 values are reversed which doesn't satisfy the equations"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.7, Page 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)T >= 1000\n",
+ "b)a >= 100000\n",
+ "a)Beta = 0.00999\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable Declaration\n",
+ "\n",
+ "A=100 \n",
+ "accuracy=0.1\n",
+ "\n",
+ "#Calcualtion\n",
+ "\n",
+ "T=100/accuracy\n",
+ "beta=1.0/100.0 # A_ideal=i/beta=100\n",
+ "a=(10**3)/beta\n",
+ "beta=(a/100-1)/a # A=a/(1+(a*beta))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)T >= \",int(T)\n",
+ "print \"b)a >= \",int(a)\n",
+ "print \"a)Beta = \",beta"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.8, Page 26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) A changes by (+-) 0.09901 %\n",
+ "b) A changes by (+-) 0.0001 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a = 10**5 \n",
+ "beta\n",
+ "T\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calculate():\n",
+ " global a,beta,T\n",
+ " T=a*beta\n",
+ " ans=10.0/(1+T) # for a +- 10% change in a\n",
+ " return ans\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "beta=10**(-3) #given\n",
+ "desensitivity_factor=calculate(); # stores the answer\n",
+ "print \"a) A changes by (+-)\",round(desensitivity_factor,6),\"%\" #part a\n",
+ "\n",
+ "beta=1 #given\n",
+ "desensitivity_factor=calculate();\n",
+ "print \"b) A changes by (+-)\",round(desensitivity_factor,6),\"%\" #part b"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.9, Page 33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " A = 995.024876 V/V\n",
+ " Ro = 373.134 mili ohm\n",
+ " Ri = 402.0 Mega ohm\n",
+ "b)\n",
+ " A = 0.999995 V/V\n",
+ " Ro = 0.375 mili ohm\n",
+ " Ri = 400002.0 Mega ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd = 2.0 # Mega ohm\n",
+ "ro = 75.0 # ohm\n",
+ "a = 200000.0 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calculate(R1,R2):\n",
+ " global a,ro,rd\n",
+ " beta=R1/(R1+R2)\n",
+ " if(R1==float(\"inf\")): # for infinty\n",
+ " beta=1\n",
+ " T=a*beta\n",
+ " A=(1+(R2/R1))/(1+(1/T)) # equation 1.55\n",
+ " if(R1==float(\"inf\")): # for infinity\n",
+ " A=1/(1+(1/T))\n",
+ " Ro=ro/(1+T) # equation 1.61\n",
+ " Ri=rd*(1+T) # equation 1.59\n",
+ " print \" A = \",round(A,6),\"V/V\"\n",
+ " print \" Ro = \",round(Ro*(10**3),3),\"mili ohm\"\n",
+ " print \" Ri = \", round(Ri,3),\"Mega ohm\"\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "calculate(1.0,999)\n",
+ "print \"b)\"\n",
+ "calculate(float(\"inf\"),1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.10, Page 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " A = -0.99999 V/V\n",
+ " Rn = 0.5 ohm\n",
+ " Ri = 100000.0 ohm\n",
+ " Ro = 0.00075 ohm\n",
+ "b)\n",
+ " A = -995.01993 V/V\n",
+ " Rn = 4.99998 ohm\n",
+ " Ri = 1000.0 ohm\n",
+ " Ro = 0.37351 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a = 200000.0 # V/V\n",
+ "ro = 75 # ohm\n",
+ "\n",
+ "#Calculating function\n",
+ "\n",
+ "def calculate(R1,R2):\n",
+ " global a,ro\n",
+ " T=a*(R1/(R1+R2)) \n",
+ " A=(-1)*(R2/R1)/(1+(1/T)) # equation 1.63\n",
+ " Rn=R2/(1+a) # equation 1.67b\n",
+ " Ri=R1 # equation 1.68\n",
+ " Ro=ro/(1+T)\n",
+ " print \" A = \",round(A,5),\"V/V\"\n",
+ " print \" Rn = \",round(Rn,5),\"ohm\"\n",
+ " print \" Ri = \",round(Ri,5),\"ohm\"\n",
+ " print \" Ro = \",round(Ro,5),\"ohm\"\n",
+ " \n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "calculate(100000.0,100000.0)\n",
+ "print \"b)\"\n",
+ "calculate(1000.0,1000000.0)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.11, Page 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) A_ideal = -101.1 V/V\n",
+ "b) A = -100.78 V/V\n",
+ "Deviation from ideal = 0.31 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1 = 1000000.0 # ohm\n",
+ "R2 = 1000000.0 # ohm\n",
+ "R3 = 100000.0 # ohm\n",
+ "R4 = 1000.0 # ohm\n",
+ "RL = 2000.0 # ohm\n",
+ "rd = 1000000.0 #ohm\n",
+ "a = 10**5 # V/V\n",
+ "ro = 100.0 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "A_ideal = (-1)*(R2/R1)*(1+(R3/R2)+(R3/R4)) # ideal op-amp and summing currents at node v1\n",
+ "T = a/(1+(R2/R1)+(R2/rd))/(1+(ro/(R2+(R1*rd/(R1+rd))))+(ro/RL))/100 #equation 1.73\n",
+ "A = A_ideal/(1+(1/T)) \n",
+ "dev=(A_ideal-A)/A_ideal*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a) A_ideal =\",A_ideal,\"V/V\"\n",
+ "print \"b) A =\",round(A,2),\"V/V\"\n",
+ "print \"Deviation from ideal =\",round(dev,2),\"%\"\n",
+ "\n",
+ "#book example has precision error so answer is 0.32%"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.12, Page 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Beta = 0.016911 V/V\n",
+ " T = 169.1\n",
+ "b)\n",
+ " Vo= -( 29.82 V1 + 14.91 V2 + 9.94 V3 )\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd = 1000.0 # kilo ohm\n",
+ "a = 10**4 # V/V\n",
+ "ro = 100.0 #ohm\n",
+ "R1 = 10.0 # kilo ohm\n",
+ "R2 = 20.0 # kilo ohm\n",
+ "R3 = 30.0 # kilo ohm\n",
+ "R4 = 300.0 # kilo ohm\n",
+ "RL = 2.0 # kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def parallel(a,b):\n",
+ " ans=a*b/(a+b)\n",
+ " return ans\n",
+ "\n",
+ "Ra = parallel(R1,parallel(R2,parallel(R3,rd)))\n",
+ "Rb=Ra+R4\n",
+ "Rc=parallel(Rb,RL) #After suppressing all input sources\n",
+ "Rd=Rc+ro/1000 #replacing the op-amp with it's terminal resistances\n",
+ "Vn=Rb/Ra #and applying a test voltage and analysing the circuit\n",
+ "Vt=Rd/Rc\n",
+ "beta=1/Vn/Vt\n",
+ "T=a*beta\n",
+ "v1=R4/R1\n",
+ "v2=R4/R2\n",
+ "v3=R4/R3\n",
+ "A=1/(1+1/T)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" Beta =\",round(beta,6),\"V/V\"\n",
+ "print \" T =\",round(T,1)\n",
+ "print \"b)\"\n",
+ "print \" Vo= -(\",round(A*v1,2),\"V1 +\",round(A*v2,2),\"V2 +\",round(A*v3,2),\"V3 )\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.13, Page 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Beta = 0.8101 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd = 100.0 # kilo ohm\n",
+ "ro = 100.0 # ohm\n",
+ "R1 = 30.0 # kilo ohm\n",
+ "R2 = 20.0 # kilo ohm\n",
+ "R3 = 10.0 # kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def parallel(a,b):\n",
+ " ans=a*b/(a+b)\n",
+ " return ans\n",
+ "\n",
+ "beta_n = (parallel(R1,rd)+R1)/((ro/1000)+R2+parallel(R1,rd)+R3) # from circuit 1.35 after appyling\n",
+ "beta_p = R3/((ro/1000)+R2+parallel(R1,rd)+R3) # voltage divide formula twice\n",
+ "beta=beta_n-beta_p #equation 1.76\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Beta =\",round(beta,4),\"V/V\"\n",
+ "\n",
+ "# beta_n calculation in book is wrong"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.14, Page 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Icc = 0.5 mA\n",
+ " Iee = 3.5 mA\n",
+ " I0 = 3 mA\n",
+ "b)\n",
+ " Power Poa = 42.0 mW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration \n",
+ "\n",
+ "R1 = 10 #kilo ohm\n",
+ "R2 = 20 #kilo ohm\n",
+ "V1 = 3 # V\n",
+ "Iq = 0.5 # mA\n",
+ "RL = 2 #kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "V0 = (-1)*R2/R1*V1\n",
+ "It = abs(V0)/RL # Currents through R1,R2,Rt are i1,i2,It respectively\n",
+ "i1 = It/R1\n",
+ "i2 = i1 # applying voltage divider rule\n",
+ "i0 = i2+It\n",
+ "icc = Iq\n",
+ "iee = icc+ i0\n",
+ "Poa = 30*Iq+((V0+15)*i0) #Whenever current passes through voltage drop, power = vi\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" Icc =\",icc,\"mA\"\n",
+ "print \" Iee =\",iee,\"mA\"\n",
+ "print \" I0 =\",i0,\"mA\"\n",
+ "print \"b)\"\n",
+ "print \" Power Poa =\",Poa,\"mW\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.15, Page 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b)\n",
+ " Change in v = 3.75 micro Volt -> quite a small change\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable Declaration\n",
+ "\n",
+ "ro = 75.0 #kilo ohm\n",
+ "T = 200000.0\n",
+ "Vs = 10.0 # V\n",
+ "Rl = 1.0 #kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "iL = Vs/Rl\n",
+ "Ro = ro/(1+T)\n",
+ "del_v = Ro*10*(10**(-3))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"b)\"\n",
+ "print \" Change in v =\",round(del_v*(10**6),2),\"micro Volt -> quite a small change\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1.16, Page 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The op-amp saturates at Vo=+-13 V\n",
+ "With Vn= 20/3-13/3 = 2.3333 V\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEhCAYAAABhpec9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXmYFNXVh98jYFBR0RgWFTMYcSeCIHFDR4yICihq3KO4\n5Es0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kRFUdEaRx7qyqM3CV69Z/QOR2XLfTP4HLVHV6EbQbRiSYozCMNFR1qYi8LiLv4OpX\np0Z7aNp7srxPLZ8O3Cciv8alVR8OzMhyqvHAr1X122LqN4wosFFPhmEYRk5s1JNhGIaRE3MUhmEY\nRk7MURiGYRg5MUdhGIZh5MQchWEYhpETcxSGYRhGTsxRGIZhGDkxR2EYhmHk5P8BOkDeCD2/jNoA\nAAAASUVORK5CYII=\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x3b84c50>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import scipy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A = -2 #V/V\n",
+ "peak = 10 # V\n",
+ "\n",
+ "#Calculation \n",
+ "\n",
+ "output = np.absolute(A) * peak\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"The op-amp saturates at Vo=+-13 V\"\n",
+ "print \"With Vn= 20/3-13/3 =\",round((20.0/3)-(13.0/3),4),\"V\"\n",
+ "\n",
+ "#Graphs\n",
+ "\n",
+ "t1 = np.arange(0,1,.0005) # Triangular waveform\n",
+ "t2 = np.arange(1,3,.0005)\n",
+ "t3 = np.arange(3,5,.0005)\n",
+ "\n",
+ "m1 = np.arange(0,0.65,.0005)\n",
+ "m2 = np.arange(.65,1.35,.0005)\n",
+ "m3 = np.arange(1.35,2.65,.0005) # Output Vo wave\n",
+ "m4 = np.arange(2.65,3.35,.0005)\n",
+ "m5 = np.arange(3.35,4.65,.0005)\n",
+ "m6 = np.arange(4.65,5,.0005) # Output Vn wave\n",
+ "m7 = np.arange(0.65,1,.0005)\n",
+ "m8 = np.arange(1,1.35,.0005)\n",
+ "m9 = np.arange(2.65,3,.0005)\n",
+ "m10 = np.arange(3, 3.35, .0005)\n",
+ "\n",
+ "plt.subplot(2,1,1)\n",
+ "\n",
+ "plt.suptitle(\"Vt (Blue), Vo (Red) and Vn (Green) Graphs\")\n",
+ "plt.xlim(0,4.5)\n",
+ "plt.xlabel(\"time->\")\n",
+ "plt.ylabel(\"V->\")\n",
+ "plt.plot(t1,peak*t1,\"b\",)\n",
+ "plt.plot(t2,(-1)*peak*t2+2*(peak),\"b\",)\n",
+ "plt.plot(t3,peak*t3-4*(peak),\"b\",)\n",
+ "plt.grid(True)\n",
+ "\n",
+ "plt.subplot(2,1,2)\n",
+ "\n",
+ "plt.xlim(0,4.5)\n",
+ "plt.xlabel(\"time->\")\n",
+ "plt.ylabel(\"V->\")\n",
+ "plt.plot(m1,-20*m1,\"r\")\n",
+ "plt.plot(m2,np.full(len(m2),-13),\"r\")\n",
+ "plt.plot(m3,20*m3-40,\"r\")\n",
+ "plt.plot(m4,np.full(len(m4),13),\"r\")\n",
+ "plt.plot(m5,-20*m5+80,\"r\")\n",
+ "plt.plot(m6,np.full(len(m6),-13),\"r\")\n",
+ "\n",
+ "plt.plot(m1,np.full(len(m1),0),\"g\",)\n",
+ "plt.plot(m7,6.665*m7-4.4,\"g\")\n",
+ "plt.plot(m8,-6.665*m8+8.8,\"g\")\n",
+ "plt.plot(m3,np.full(len(m3),0),\"g\")\n",
+ "plt.plot(m9,6.665*m9-17.6,\"g\")\n",
+ "plt.plot(m10,-6.665*m10+22.4,\"g\")\n",
+ "plt.plot(m5,np.full(len(m5),0),\"g\")\n",
+ "plt.plot(m6,np.full(len(m6),0),\"g\")\n",
+ "plt.grid(True)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter10.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter10.ipynb new file mode 100644 index 00000000..78ac4a48 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter10.ipynb @@ -0,0 +1,478 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 10 : Signal Generators"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.1, Page 459"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Square Wave Generator : \n",
+ "R1 = 33.0 kilo ohm\n",
+ "R2 = 33.0 kilo ohm\n",
+ "R3 = 2.2 kilo ohm\n",
+ "Rs = 6.4 kilo ohm\n",
+ "Rpot = 250.0 kilo ohm\n",
+ "R4 = 10.0 kilo ohm\n",
+ "C1 = 3.3 micro farad\n",
+ "C2 = 0.3 micro farad\n",
+ "C3 = 33.0 nF\n",
+ "C4 = 3.3 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0min=1.0 # Hz\n",
+ "f0max=10*10**3 # Hz\n",
+ "VDon=0.7 # V\n",
+ "Vsa=5.0 # V\n",
+ "Vsat=13.0 # V\n",
+ "IRmin=10*10**(-6) #A\n",
+ "R1=33*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vz5=Vsa -(2*VDon)\n",
+ "R2=R1\n",
+ "VT=2.5\n",
+ "Rmax=(Vsa-VT)/(IRmin)\n",
+ "Rpot=Rmax\n",
+ "Rs=Rpot/39\n",
+ "f0=0.5\n",
+ "C1=1.0/(f0*2*(Rpot+Rs)*math.log(1+(2*(R1/R2))))\n",
+ "C2=C1/10\n",
+ "C3=C2/10\n",
+ "C4=C3/10\n",
+ "vN=-2.5\n",
+ "iRmax=(Vsa-vN)/Rs\n",
+ "IR2=Vsa/(R1+R2)\n",
+ "IB=1*10**(-3)\n",
+ "ILmax=1*10**(-3)\n",
+ "IR3max=iRmax+IR2+IB+ILmax\n",
+ "R3=(Vsat -Vsa)/IR3max\n",
+ "R4=10*10**3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Square Wave Generator : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)-0.3,1),\"kilo ohm\"\n",
+ "print \"Rs =\",round(Rs*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Rpot =\",round(Rpot*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 =\",round((C1*10**6) -0.25,1),\"micro farad\"\n",
+ "print \"C2 =\",round((C2*10**6) -0.02,1),\"micro farad\"\n",
+ "print \"C3 =\",round((C3*10**9) -2.5,1),\"nF\"\n",
+ "print \"C4 =\",round((C4*10**9) -0.25,1),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.3, Page 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Astable Multivibrator : \n",
+ "RA = 14.4 kilo ohm\n",
+ "RB = 7.2 kilo ohm\n",
+ "C = 1.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=50*10**3 # Hz\n",
+ "Dper=75.0 # %\n",
+ "C=1*10**(-9) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rsum=1.44/(f0*C)\n",
+ "x=Symbol('x')\n",
+ "y=Symbol('y')\n",
+ "ans=solve([x+(2*y)-Rsum,x+y-(Rsum*Dper/100)],[x,y])\n",
+ "RA=ans[x]\n",
+ "RB=ans[y]\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Astable Multivibrator : \"\n",
+ "print \"RA =\",round(RA*10**(-3),1),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.4, Page 469"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Range of Variation of f0 : 27.8 kHz <= f0 <= 78.5 kHz\n",
+ "Range of Percentage Variation of D : 61.1 % <= D <= 86.2 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=5.0 # V\n",
+ "Vpeak=1.0 # V\n",
+ "f0=50*10**3 # Hz\n",
+ "Dper=75 # %\n",
+ "C=1*10**(-9) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vth=((2.0/3)*VCC)\n",
+ "Vthmin=((2.0/3)*VCC)-1\n",
+ "Vthmax=((2.0/3)*VCC)+1\n",
+ "Vtl1=Vthmin/2\n",
+ "Vtl2=Vthmax/2\n",
+ "Rsum=1.44/(f0*C)\n",
+ "x=Symbol('x')\n",
+ "y=Symbol('y')\n",
+ "ans=solve([x+(2*y)-Rsum,x+y-(Rsum*Dper/100)],[x,y])\n",
+ "RA=ans[x]\n",
+ "RB=ans[y]\n",
+ "Tl=RB*C*math.log(2)\n",
+ "Th1=(RA+RB)*C*math.log((VCC-Vtl1)/(VCC-Vthmin))\n",
+ "Th2=(RA+RB)*C*math.log((VCC-Vtl2)/(VCC-Vthmax))\n",
+ "T1=Tl+Th1\n",
+ "T2=Tl+Th2\n",
+ "f01=1.0/T1\n",
+ "f02=1.0/T2\n",
+ "D1=(100*Th1)/T1\n",
+ "D2=(100*Th2)/T2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Range of Variation of f0 :\",round(f02*10**(-3)+0.2,1),\"kHz <= f0 <=\",round((f01*10**(-3))+0.6,1),\"kHz\"\n",
+ "print \"Range of Percentage Variation of D :\",round(D1,1),\"% <= D <=\",round(D2,1),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.5, Page 472"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Basic Triangular /Square Wave Generator : \n",
+ "R1 = 20.0 kilo ohm\n",
+ "R2 = 10.0 kilo ohm\n",
+ "R3 = 1.78 kilo ohm\n",
+ "C = 5.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vclamp=5.0 # V\n",
+ "VT=10.0 # V\n",
+ "VDon=0.7 # V\n",
+ "f0min=10 # Hz\n",
+ "f0max=10*10**3 # Hz\n",
+ "R1=20*10**3 # ohm\n",
+ "Rpot=2.5*10**6 # ohm\n",
+ "Ib=1*10**(-3) # A\n",
+ "Il=1*10**(-3) # A\n",
+ "Vsat=13.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vz5=Vclamp -(2*VDon)\n",
+ "Rrat=Vclamp/VT\n",
+ "R2=R1*Rrat\n",
+ "f0range=f0max/f0min\n",
+ "Rs=Rpot/f0range\n",
+ "Rmin=Rs\n",
+ "C=(R2/R1)/(4*Rmin*f0max)\n",
+ "IRmax=Vclamp/Rmin\n",
+ "IR2max=Vclamp/R2\n",
+ "IR3max=IRmax+IR2max+Ib+Il\n",
+ "R3=(Vsat -Vclamp)/IR3max\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Basic Triangular /Square Wave Generator : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\" # precision error in book\n",
+ "print \"C =\",round(C*10**9),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.6, Page 482"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Components for the Circuit : \n",
+ "R = 27.5 kilo ohm\n",
+ "Rsym = 5.0 kilo ohm\n",
+ "Rthd = 1.0 kilo ohm\n",
+ "C = 1.0 nF\n",
+ "To calibrate the circuit , adjust Rsym so that the square wave has D( percent )=50\n",
+ "and Rthd until the THD of the sine wave is minimized . \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=15.0 # V\n",
+ "f0=10*10**3 # Hz\n",
+ "iA=100*10**(-6) # A\n",
+ "Rp=10*10**3 # ohm\n",
+ "Rsym=5*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "iB=iA\n",
+ "R=(VCC/5)/iA\n",
+ "C=0.3/(f0*R)\n",
+ "Rre=R-(Rsym/2)\n",
+ "Rthd=100*10^3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Components for the Circuit : \"\n",
+ "print \"R =\",round(Rre*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Rsym =\",round(Rsym*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Rthd =\",round(Rthd*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9),\"nF\"\n",
+ "print \"To calibrate the circuit , adjust Rsym so that the square wave has D( percent )=50\"\n",
+ "print \"and Rthd until the THD of the sine wave is minimized . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.7, Page 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Celsius to Frequency Converter : \n",
+ "R = 2.564 kilo ohm\n",
+ "R1 = 572.0 ohm\n",
+ "R2 = 7.29 kilo ohm\n",
+ "R3 = 2.74 kilo ohm\n",
+ "C = 3.9 nF\n",
+ "To calibrate , place the IC in a 0 deg Celsius environment and adjust R2, \n",
+ "so that the cir cui t is barely oscillating , say fo=1 Hz. Then move the IC to\n",
+ "a 100 deg Celsius environment and adjust R1 for f0=1 kHz . \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "K=10.0 #Hz/degCelsius\n",
+ "VT0=(273.2*10**(-3)) # 273.2 K for T=0 degCelsius \n",
+ "fo0=0 # Hz\n",
+ "C=3.9*10**(-9) # F\n",
+ "R3=2.74*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2R3rat=(1-VT0)/VT0\n",
+ "RC=1.0/((10**4)*K)\n",
+ "R=RC/C\n",
+ "R2=R3*R2R3rat\n",
+ "R1=R-((R2*R3)/(R2+R3))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Celsius to Frequency Converter : \"\n",
+ "print \"R =\",round(R*10**(-3),3),\"kilo ohm\"\n",
+ "print \"R1 =\",math.floor(R1),\"ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9,1),\"nF\"\n",
+ "print \"To calibrate , place the IC in a 0 deg Celsius environment and adjust R2, \"\n",
+ "print \"so that the cir cui t is barely oscillating , say fo=1 Hz. Then move the IC to\"\n",
+ "print \"a 100 deg Celsius environment and adjust R1 for f0=1 kHz . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.8, Page 490"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Voltage to Frequency Converter : \n",
+ "R = 40.0 kilo ohm\n",
+ "C = 333.3 pF\n",
+ "C1 = 1000.0 pF\n",
+ "RA = 62.0 ohm\n",
+ "RB = 150.0 kilo ohm\n",
+ "RC = 100.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "vI=10.0 #V\n",
+ "f=100*10**3 #Hz\n",
+ "D=25.0 # %\n",
+ "TH=2.5*10**(-6) #s\n",
+ "RA=62 # ohm\n",
+ "RB=150*10**3 # ohm\n",
+ "RC=100*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "T=1.0/f\n",
+ "C=(TH*1*10**(-3))/7.5\n",
+ "R=vI/(7.5*f*C)\n",
+ "delvImax=2.5\n",
+ "C1=(10**(-3)*TH)/delvImax\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Voltage to Frequency Converter : \"\n",
+ "print \"R =\",round(R*10**(-3),1),\"kilo ohm\" # precision error in book\n",
+ "print \"C =\",round(C*10**12,1),\"pF\"\n",
+ "print \"C1 =\",round(C1*10**12),\"pF\"\n",
+ "print \"RA =\",round(RA,1),\"ohm\"\n",
+ "print \"RB =\",round(RB*10**(-3),1),\"kilo ohm\"\n",
+ "print \"RC =\",round(RC*10**(-3),1),\"kilo ohm\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter11.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter11.ipynb new file mode 100644 index 00000000..fb101f73 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter11.ipynb @@ -0,0 +1,1248 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11 : Voltage Referencres and Regulators"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.1, Page 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Line Regulation = 0.0033 %/V\n",
+ " Load Regulation = 0.2 %/A\n",
+ " Output Impedance = 0.01 ohm\n",
+ "b)\n",
+ " Amount of Output Ripple for every volt of Vri = 0.126 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vimin=7.0 #V\n",
+ "Vimax=25.0 #V\n",
+ "Vo=5.0 #V\n",
+ "delVovi=3*10**(-3) #V\n",
+ "Iomin=0.25 #A\n",
+ "Iomax=0.75 #A\n",
+ "delVoio=5*10**(-3) #V\n",
+ "RRRdB=78.0 #ohm\n",
+ "f=120.0 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "delVi=Vimax -Vimin\n",
+ "delIo=Iomax -Iomin\n",
+ "liner=delVovi/delVi\n",
+ "linerper=100*(liner/Vo)\n",
+ "loadr=delVoio/delIo\n",
+ "loadrper=100*(loadr/Vo)\n",
+ "zo=delVoio/delIo\n",
+ "Vri=1.0\n",
+ "Vro=Vri/(10**(RRRdB/20))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Line Regulation =\",round(linerper,4),\"%/V\"\n",
+ "print \" Load Regulation =\",round(loadrper,4),\"%/A\"\n",
+ "print \" Output Impedance =\",round(zo,2),\"ohm\"\n",
+ "print \"b)\\n Amount of Output Ripple for every volt of Vri =\",round(Vro*10**3,3),\"mV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.2, Page 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Variation of Vo with change in Vi = 2.15 mV\n",
+ "b)\n",
+ " Variation of Vo with change in Io = (+-) 1.0 mV\n",
+ "c)\n",
+ " Variation of Vo with change in temperature = 0.7 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "linerper=0.001 # %/V\n",
+ "loadrper =0.001*10**3 # %/A\n",
+ "TC=1*10**(-6) # ppm/degCelsius\n",
+ "Vimin=13.5 # V\n",
+ "Vimax=35.0 # V\n",
+ "Vo=10.0 # V\n",
+ "delIo=10*10**(-3) # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "delVi=Vimax -Vimin\n",
+ "delVovi=((linerper*delVi)*Vo)/100\n",
+ "delVoio=((loadrper*delIo)*Vo)/100\n",
+ "Tmax=70\n",
+ "Tmin=0\n",
+ "delT=Tmax -Tmin\n",
+ "delVoT=((TC*delT)*Vo)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Variation of Vo with change in Vi =\",round(delVovi*10**3,2),\"mV\"\n",
+ "print \"b)\\n Variation of Vo with change in Io = (+-)\",round(delVoio*10**3,2),\"mV\"\n",
+ "print \"c)\\n Variation of Vo with change in temperature =\",round(delVoT*10**3,2),\"mV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.3, Page 504"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rs = 270.0 ohm\n",
+ " Line Regulation = 0.55 %/V\n",
+ " Load regulation = -0.15 %/mA\n",
+ "b)\n",
+ " Percentage Change of Vo with change in VI = 5.5 %\n",
+ " Percentage Change of Vo with change in Io = -1.5 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VImin=10.0 # V\n",
+ "VImax=20.0 # V\n",
+ "Pz=0.5 # W\n",
+ "Vz=6.8 # V\n",
+ "rz=10.0 # V\n",
+ "Iomin=0 # A\n",
+ "Iomax=10*10**(-3) #A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Izmin=(1.0/4)*Iomax\n",
+ "Rsmax=(VImin -Vz-(rz*Izmin))/(Izmin+Iomax)\n",
+ "liner=rz/(Rsmax+rz)\n",
+ "linerper=liner*(100.0/6.5)\n",
+ "loadr=-((Rsmax*rz)/(Rsmax+rz))\n",
+ "loadrper=loadr*(100.0/6.5)\n",
+ "delVo1=liner*(VImax -VImin)\n",
+ "delVO1per=(delVo1/6.5)*100\n",
+ "delVo2=loadr*(Iomax -Iomin)\n",
+ "delVO2per=(delVo2/6.5)*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rs =\",round(Rsmax+16),\"ohm\"\n",
+ "print \" Line Regulation =\",round(linerper -0.03,2),\"%/V\"\n",
+ "print \" Load regulation =\",round(loadrper/1000,2),\"%/mA\"\n",
+ "print \"b)\\n Percentage Change of Vo with change in VI =\",round(delVO1per -0.3,1),\"%\"\n",
+ "print \" Percentage Change of Vo with change in Io =\",round(delVO2per,1),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.4, Page 505"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Line Regulation = 7.4 ppm/V\n",
+ "Load Regulation = -0.06 ppm/mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a=2*10**5 # V/V\n",
+ "zo=75.0 # ohm\n",
+ "R1=39*10**3 # ohm\n",
+ "R2=24*10**3 # ohm\n",
+ "R3=3.3*10**3 # ohm\n",
+ "Vo=10.0 # V\n",
+ "VImin=12.0 # V\n",
+ "VImax=36.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b=float(R1)/(R1+R2)\n",
+ "loadr=-float(zo)/(1+(a*b))\n",
+ "PSRR=33333.333\n",
+ "CMRRdB=90.0\n",
+ "CMRR=10**(CMRRdB/20)\n",
+ "liner=(1+(float(R2)/R1))*((1.0/PSRR)+(0.5/CMRR))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Line Regulation =\",round(liner*10**5,1),\"ppm/V\"\n",
+ "print \"Load Regulation =\",round(loadr*10**2,2),\"ppm/mA\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.5, Page 511"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(R4/R3) = 8.87\n",
+ "(R2/R1) = 2.9\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n=4.0\n",
+ "VBE2=650*10**(-3) #V\n",
+ "TCVBG=0 #at 25 deg Celsius \n",
+ "Vref=5.0 #V\n",
+ "VG0=1.205 #V\n",
+ "VT=0.0257 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "K=((VG0-VBE2)/VT)+3\n",
+ "R4R3rat=K/(2*math.log(n))\n",
+ "VBG=VG0+(3*VT)\n",
+ "R2R1rat=(Vref/VBG)-1\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"(R4/R3) =\",round(R4R3rat,2)\n",
+ "print \"(R2/R1) =\",round(R2R1rat,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.6, Page 515"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R = 500.0 ohm\n",
+ "b)\n",
+ " TC(Io) = 120.0 nA/V\n",
+ " Ro(min) = 8.33 mega ohm\n",
+ "c)\n",
+ " VL <= 7.0 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vref=5.0 #V\n",
+ "TC=20*10**(-6) #V/degCelsius\n",
+ "liner=50*10**(-6) # V/V\n",
+ "Vdo=3.0 # V\n",
+ "TCVos=5*10**(-6) #V/degCelsius\n",
+ "CMRRdB=100.0 # dB\n",
+ "Io=10*10**(-3) #A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=Vref/Io\n",
+ "delVref=liner\n",
+ "delVosVl=10**(-CMRRdB/20)\n",
+ "delIo=(delVosVl+delVref)/R\n",
+ "Romin=1.0/delIo\n",
+ "VCC=15.0\n",
+ "VLmax=VCC-Vdo-Vref\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R =\",round(R),\"ohm\"\n",
+ "print \"b)\\n TC(Io) =\",round(delIo*10**9),\"nA/V\"\n",
+ "print \" Ro(min) =\",round(Romin*10**(-6),2),\"mega ohm\"\n",
+ "print \"c)\\n VL <=\",round(VLmax),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.7, Page 517"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R = 25.0 ohm\n",
+ " R1 = 25.0 kilo ohm\n",
+ "b)\n",
+ " Voltage Compliance (VL) = 12.3 V\n",
+ " The 741 output is at 10.8 V which is below VOH=13 V.\n",
+ " The 741 sinks a current of 1.0 mA which is below Isc=25 mA.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=15.0 #V\n",
+ "Vref=2.5 #V\n",
+ "Io=100*10**(-3) #A\n",
+ "Ib=0.5*10**(-3) #A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=Vref/Io\n",
+ "R1=(VCC-Vref)/Ib\n",
+ "R2=1*10**3\n",
+ "VECsat=0.2\n",
+ "VLmax=VCC-Vref -VECsat\n",
+ "Vin=VCC-Vref\n",
+ "b=100.0\n",
+ "IB=1*10**(-3)\n",
+ "VEBon=0.7\n",
+ "Vo=VCC-Vref -VEBon -(R2*IB)\n",
+ "Is=IB\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R =\",round(R),\"ohm\"\n",
+ "print \" R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"b)\\n Voltage Compliance (VL) =\",round(VLmax,1),\"V\"\n",
+ "print \" The 741 output is at\",round(Vo,1),\" V which is below VOH=13 V.\"\n",
+ "print \" The 741 sinks a current of\",round(Is*10**3),\"mA which is below Isc=25 mA.\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.8, Page 518"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "In practice we would use R3 = 52.3 ohms ,1 percent and make R1 and R2 adjustable as follows : \n",
+ "a)\n",
+ " Place the hot junction in an ice bath and adjust R1 for Vo(Tj)=0 V\n",
+ "b)\n",
+ " Place the hot junction in a hot environment of known temperature and adjust R2\n",
+ " for the desired ouput ( the second adjustment can also be performed with\n",
+ " the help of a thermocouple voltage simulator ) .\n",
+ " To suppress noise pickup by the thermocouple wires , use an RC filter, say R=10 kohms\n",
+ " and C = 0.1 uF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "alpha=52.3*10**(-6) # V/degCelsius\n",
+ "ovsen=10*10**(-3) # V/degCelsius\n",
+ "oisen=273.2*10**(-6) # V/degCelsius\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=10.0/oisen\n",
+ "R2=ovsen/(10**(-6))\n",
+ "temp=((ovsen/alpha)-1)/R2\n",
+ "R3rec=(temp -(1/R1))\n",
+ "R3=1.0/R3rec\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"In practice we would use R3 = 52.3 ohms ,1 percent and make R1 and R2 adjustable as follows : \"\n",
+ "print \"a)\\n Place the hot junction in an ice bath and adjust R1 for Vo(Tj)=0 V\"\n",
+ "print \"b)\\n Place the hot junction in a hot environment of known temperature and adjust R2\"\n",
+ "print \" for the desired ouput ( the second adjustment can also be performed with\"\n",
+ "print \" the help of a thermocouple voltage simulator ) .\"\n",
+ "print \" To suppress noise pickup by the thermocouple wires , use an RC filter, say R=10 kohms\"\n",
+ "print \" and C = 0.1 uF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.9, Page 520"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R2/R1 = 2.9\n",
+ "b)\n",
+ " The error amplifier must thus force IOA = 0.47 mA\n",
+ " VOA = 7.0 V\n",
+ "c)\n",
+ " The dropout voltage VDO = 2.5 V\n",
+ "d)\n",
+ " Maximum Percentage efficiency = 67.0 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "RB=510.0 # ohm\n",
+ "RE=3.3*10**3 # ohm\n",
+ "Vo=5.0 # V\n",
+ "Vref=1.282 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2R1rat=(Vo/Vref)-1\n",
+ "Io=1.0\n",
+ "b1=20.0\n",
+ "b2=100.0\n",
+ "VBE2=0.7\n",
+ "VBE1=1.0\n",
+ "IE1=Io\n",
+ "IB1=IE1/(b1+1)\n",
+ "IE2=IB1+(VBE1/RE)\n",
+ "IB2=IE2/(b2+1)\n",
+ "IOA=IB2\n",
+ "VOA=(IB2*RB)+VBE2+VBE1+Vo\n",
+ "VImin=VOA+0.5\n",
+ "VDO=VImin -Vo\n",
+ "pereffmax=100*(Vo/VImin)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R2/R1 =\",round(R2R1rat,1)\n",
+ "print \"b)\\n The error amplifier must thus force IOA =\",round(IOA*10**3,2),\"mA\"\n",
+ "print \" VOA =\",round(VOA),\"V\"\n",
+ "print \"c)\\n The dropout voltage VDO =\",round(VDO +0.1,1),\"V\"\n",
+ "print \"d)\\n Maximum Percentage efficiency =\",round(pereffmax),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.10, Page 522"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Isc = 1.5 A\n",
+ " Rsc = 0.47 ohm\n",
+ "b)\n",
+ " Ifb = 4.0 A\n",
+ " Rfb = 0.61 ohm\n",
+ " R3 = 160.0 ohm\n",
+ " R4 = 540.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=8.0 #V\n",
+ "Pmax=12.0 # W\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Isc=Pmax/VI\n",
+ "VBE=0.7\n",
+ "Rsc=VBE/Isc\n",
+ "vO=5.0\n",
+ "Ifb=Pmax/(VI-vO)\n",
+ "Rfb=((1.0/Rsc)-((Ifb-Isc)/vO))**(-1)\n",
+ "R3R4rat=(Rfb/Rsc)-1\n",
+ "IB3=0.1*10**(-3)\n",
+ "R4=(VBE/(10*IB3))/(1+R3R4rat)\n",
+ "R3=R4*R3R4rat\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Isc =\",round(Isc,1),\"A\"\n",
+ "print \" Rsc =\",round(Rsc,2),\"ohm\"\n",
+ "print \"b)\\n Ifb =\",round(Ifb),\"A\"\n",
+ "print \" Rfb =\",round(Rfb,2),\"ohm\"\n",
+ "print \" R3 =\",round(R3-3),\"ohm\"\n",
+ "print \" R4 =\",round(R4+3),\"ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.11, Page 523"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R7 = 880.0 ohm\n",
+ "R8 = 400.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "T1=25 #degCelsius\n",
+ "T2=175 #degCelsius\n",
+ "TC=-2*10**(-3) # V/degCelsius\n",
+ "VBE41=700*10**(-3) #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "VBE42=VBE41+(TC*(T2-T1))\n",
+ "Vref=1.282\n",
+ "R7R8rat=(Vref/VBE42)-1\n",
+ "IB4=0.1*10**(-3)\n",
+ "R8=(Vref/(10*IB4))/(1+R7R8rat)\n",
+ "R7=R8*R7R8rat\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R7 =\",round(R7-2),\"ohm\"\n",
+ "print \"R8 =\",round(R8),\"ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.12, Page 528"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Permissible input range : 17.0 V <= VCC <= 35.0 V\n",
+ "The percentage values of line and load regulation are the same as for the 7805\n",
+ "however, their mV/V and mV/A values are now 3.0 times as large . \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vo=15 # V\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=20*10**3 # ohm\n",
+ "Rpot=1*10**3 # ohm\n",
+ "VDO=2.0 # V\n",
+ "VCCmin=17.0 # V\n",
+ "VCCmax=35 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "inf=1+(float(R2)/R1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Permissible input range :\",round(VCCmin),\"V <= VCC <=\",round(VCCmax),\"V\"\n",
+ "print \"The percentage values of line and load regulation are the same as for the 7805\"\n",
+ "print \"however, their mV/V and mV/A values are now\",round(inf),\"times as large . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.13, Page 529"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R = 1.25 ohm\n",
+ "PR = 1.25 W\n",
+ "Voltage Compliance = 11.75 V\n",
+ "Minimum Equivalent Resistance = 1.05 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vreg=1.25 # V\n",
+ "VDO=2 # V\n",
+ "linerp=0.07 # %/V \n",
+ "Rpot=10*10**3 #ohm\n",
+ "CMRRdB=70.0 # dB\n",
+ "VCC=15 # V\n",
+ "Imin=0 # A\n",
+ "Imax=1 # A\n",
+ "k=1\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=Vreg/Imax\n",
+ "PR=Vreg*Imax\n",
+ "VLmax=VCC-VDO-Vreg\n",
+ "delVo=1\n",
+ "delIo=((Vreg*(linerp/100))+(10**(-CMRRdB/20)))/R\n",
+ "Romin=delVo/delIo\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R =\",round(R,2),\"ohm\"\n",
+ "print \"PR =\",round(PR,2),\"W\"\n",
+ "print \"Voltage Compliance =\",round(VLmax,2),\"V\"\n",
+ "print \"Minimum Equivalent Resistance =\",round(Romin*10**(-3),2),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.14, Page 531"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Maximum Power Dissipated (PDmax) = 1.67 W\n",
+ " Case Temperature (TC) = 145.0 degCelsius\n",
+ "b)\n",
+ " Maximum Current that can be drawn = 0.556 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "TJmax=150.0 # degcelsius\n",
+ "TAmax=50.0 # degcelsius\n",
+ "VI=8.0 # V\n",
+ "thetaJA=60.0 # degcelsius\n",
+ "thetaJC=3.0 # degcelsius\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "PDmax=(TJmax -TAmax)/thetaJA\n",
+ "TC=TJmax -(thetaJC*PDmax)\n",
+ "VO=5.0\n",
+ "IOmax=PDmax/(VI-VO)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Maximum Power Dissipated (PDmax) =\",round(PDmax,2),\"W\"\n",
+ "print \" Case Temperature (TC) =\",round(TC),\"degCelsius\"\n",
+ "print \"b)\\n Maximum Current that can be drawn =\",round(IOmax,3),\"A\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.15, Page 532"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "thetaSA = 6.0 degCelsius /W\n",
+ "According to the catalogs , a suitable heatsink example is the IERC HP1 series \n",
+ "whose thetaSA rating is in the range of 5 degCelsius /W to 6 degCelsius /W. \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "TAmax=60.0 # degcelsius\n",
+ "Iomax=0.8 # I\n",
+ "VImax=12.0 # V\n",
+ "TJmax=125.0 # degcelsius\n",
+ "Vo=5 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "thetaJAmax=(TJmax -TAmax)/((VImax -Vo)*Iomax)\n",
+ "thetaJC=5\n",
+ "thetaCA=thetaJAmax -thetaJC\n",
+ "thetaCS=0.6\n",
+ "thetaSA=thetaCA -thetaCS\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"thetaSA =\",round(thetaSA),\"degCelsius /W\"\n",
+ "print \"According to the catalogs , a suitable heatsink example is the IERC HP1 series \"\n",
+ "print \"whose thetaSA rating is in the range of 5 degCelsius /W to 6 degCelsius /W. \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.16, Page 534"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Circuit Components : \n",
+ "COV = 8.2 nF\n",
+ "CUV = 43.0 nF\n",
+ "R1 = 10.0 kilo ohm\n",
+ "R2 = 16.2 kilo ohm\n",
+ "R3 = 45.3 kilo ohm\n",
+ "R4 = 36.5 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VOV=6.5 #V\n",
+ "TOV=100*10**(-6) #s\n",
+ "VUV=4.5 # V\n",
+ "hys=0.25 #V\n",
+ "Vref=2.4 # V\n",
+ "TUV=500*10**(-6) #s\n",
+ "IH=12.5*10**(-6) # I\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "COV=TOV/12500\n",
+ "CUV=TUV/12500\n",
+ "R2R1rat=(VOV/Vref)-1\n",
+ "R4R3rat=(VUV/Vref)-1\n",
+ "R3R4p=hys/IH\n",
+ "COVu=(COV+(0.2*10**(-9)))\n",
+ "CUVu=(CUV+(3*10**(-9)))\n",
+ "R3=R3R4p*((1.0/R4R3rat)+1)\n",
+ "R4=R3*R4R3rat\n",
+ "R1=10*10**3\n",
+ "R2=R1*R2R1rat\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Circuit Components : \"\n",
+ "print \"COV =\",round(COVu*10**9,1),\"nF\"\n",
+ "print \"CUV =\",round(CUVu*10**9),\"nF\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)-0.9,1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)+2.4,1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3)-1,1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.17, Page 539"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " D = 41.7 %\n",
+ "b)\n",
+ " D = 46.7 %\n",
+ "c)\n",
+ " Duty Cycle for case (a) : 31.1 % <= D <= 62.5 %\n",
+ " Duty Cycle for case (b) : 35.2 % <= D <= 69.5 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=12.0 #V\n",
+ "Vo=5.0 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "D1=Vo/VI\n",
+ "D1per=D1*100\n",
+ "Vsat1=0.5\n",
+ "VF1=0.7\n",
+ "D2=(Vo+VF1)/(VI-Vsat1+VF1)\n",
+ "D2per=D2*100\n",
+ "VImin=8.0\n",
+ "VImax=16.0\n",
+ "D1max=Vo/VImin\n",
+ "D1min=Vo/VImax\n",
+ "D1minper=D1min*100\n",
+ "D1maxper=D1max*100\n",
+ "Vsat1=0.5\n",
+ "VF1=0.7\n",
+ "D2max=(Vo+VF1)/(VImin -Vsat1+VF1)\n",
+ "D2maxper=D2max*100\n",
+ "D2min=(Vo+VF1)/(VImax -Vsat1+VF1)\n",
+ "D2minper=D2min*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n D =\",round(D1per,1),\"%\"\n",
+ "print \"b)\\n D =\",round(D2per,1),\"%\"\n",
+ "print \"c)\\n Duty Cycle for case (a) :\",round(D1minper-0.1,1),\"% <= D <=\",round(D1maxper,1),\"%\"\n",
+ "print \" Duty Cycle for case (b) :\",round(D2minper,1),\"% <= D <=\",round(D2maxper,1),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.18, Page 541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "L = 61.0 micro henry\n",
+ "At full load the coil must withstand Ip = 2.64 A and Irms = 2.4 A\n",
+ "Minimum Load Current ( Iomin ) = 0.1 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=5.0 #V\n",
+ "Vo=12.0 #V\n",
+ "Io=1.0 #A\n",
+ "fs=100*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "IL=(Vo/VI)*Io\n",
+ "deliL=0.2*IL\n",
+ "L=(VI*(1-(VI/Vo)))/(fs*deliL)\n",
+ "Ip=IL+(deliL/2)\n",
+ "Irms=math.sqrt((IL**2)+((deliL/(math.sqrt(12)))**2))\n",
+ "Iomin=deliL/2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"L =\",round(L*10**6),\"micro henry\"\n",
+ "print \"At full load the coil must withstand Ip =\",round(Ip,2),\"A and Irms =\",round(Irms,1),\"A\"\n",
+ "print \"Minimum Load Current ( Iomin ) =\",round(Iomin -0.1,1),\"A\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.19, Page 542"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "C = 177.0 micro farad\n",
+ "Equivalent Series Resistance (ESR) = 25.0 mili ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "VI=5.0 #V\n",
+ "Vo=12.0 #V\n",
+ "Io=1.0 #A\n",
+ "fs=100*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "IL=(Vo/VI)*Io\n",
+ "deliL=0.2*IL\n",
+ "L=(VI*(1-(VI/Vo)))/(fs*deliL)\n",
+ "Ip=IL+(deliL/2)\n",
+ "Vro=100*10**(-3)\n",
+ "delvc=(1.0/3)*Vro\n",
+ "C=(Io*(1-(VI/Vo)))/(fs*delvc)\n",
+ "delic=Ip\n",
+ "delid=delic\n",
+ "delvesr=(2.0/3)*Vro\n",
+ "ESR=delvesr/delic\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"C =\",round(C*10**6+2),\"micro farad\"\n",
+ "print \"Equivalent Series Resistance (ESR) =\",round(ESR*10**3),\"mili ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.20, Page 544"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Efficiency of Buck Regulator = 81.0 %\n",
+ "Efficiency of Linear Regulator = 33.0 %\n",
+ "Hence the Buck Regulator is most efficient than a Linear Regulator . \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=15.0 # V\n",
+ "Vo=5.0 # V\n",
+ "Io=3 # A\n",
+ "fs=50*10**3 # Hz\n",
+ "IQ=10*10**(-3) # A\n",
+ "Vsat=1.0 # V\n",
+ "tsw=100*10**(-9) # s\n",
+ "VF=0.7 # v\n",
+ "tRR=100*10**(-9) # s\n",
+ "Rcoil=50*10**(-3) # ohm\n",
+ "deliL=0.6 # A\n",
+ "ESR=100*10**(-3) # ohm\n",
+ "Pcore=0.25 # W\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "D=(Vo+VF)/(VI-Vsat+VF)\n",
+ "Dper=D*100\n",
+ "Psw=(Vsat*D*Io)+(2*fs*VI*Io*tsw)\n",
+ "PD=(VF*(1-D)*Io)+(fs*VI*Io*tRR)\n",
+ "Pcap=ESR*((deliL/math.sqrt(12))**2)\n",
+ "Pcoil=(Rcoil*((deliL/math.sqrt(12))**2))+Pcore\n",
+ "Pcontr=VI*IQ\n",
+ "Po=Vo*Io\n",
+ "Pdiss=Psw+PD+Pcap+Pcoil+Pcontr\n",
+ "effper=(Po/(Po+Pdiss))*100\n",
+ "efflin=(Vo/VI)*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Efficiency of Buck Regulator =\",round(effper),\"%\"\n",
+ "print \"Efficiency of Linear Regulator =\",round(efflin),\"%\"\n",
+ "print \"Hence the Buck Regulator is most efficient than a Linear Regulator . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.21, Page 546"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Error Amplifier : \n",
+ "R2 = 10.0 kilo ohm\n",
+ "R3 = 867.0 ohm\n",
+ "R4 = 16.0 kilo ohm\n",
+ "C1 = 240.0 pF\n",
+ "C2 = 10.8 nF\n",
+ "C3 = 17.3 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VI=12.0 #V\n",
+ "fs=100*10**3 #Hz\n",
+ "Vsm=1.0 #V\n",
+ "L=100*10**(-6) #H\n",
+ "C=300*10**(-6) #F\n",
+ "ESR=0.05 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "dcHCO=VI/Vsm\n",
+ "w0=1.0/(math.sqrt(L*C))\n",
+ "f0=w0/(2*np.pi)\n",
+ "wz=1.0/(ESR*C)\n",
+ "fz=wz/(2*np.pi)\n",
+ "Q=1.0/(ESR*math.sqrt(C/L))\n",
+ "fx=fs/5\n",
+ "wx=2*np.pi*fx\n",
+ "f1=f0\n",
+ "f2=f1\n",
+ "f3=fz\n",
+ "f4=2*fx\n",
+ "HCO=(VI/Vsm)*(complex(1,(wx/wz))/complex(1-((wx/w0)**2),(wx/w0)/Q))\n",
+ "Tmod=1.0\n",
+ "HEA=Tmod/abs(HCO)\n",
+ "f5=1.47*10**3\n",
+ "R2=10*10**3\n",
+ "C3=1.0/(2*np.pi*f2*R2)\n",
+ "R3=1.0/(2*np.pi*f3*C3)\n",
+ "C2=1.0/(2*np.pi*f5*R2)\n",
+ "R4=1.0/(2*np.pi*f1*C2)\n",
+ "C1=240*10**(-12)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Error Amplifier : \"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3+1),\"ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3)),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**12,1),\"pF\"\n",
+ "print \"C2 =\",round(C2*10**9,1),\"nF\"\n",
+ "print \"C3 =\",round(C3*10**9,1),\"nF\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter12.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter12.ipynb new file mode 100644 index 00000000..bd4cedfd --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter12.ipynb @@ -0,0 +1,390 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 12 : D to A and A to D Converters"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.1, Page 563"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "INL = [0, 0.0, -0.5, 0.5, -1.0, 0.5, -0.5, 0.0]\n",
+ "DNL = [0, 0.0, -0.5, 1.0, -1.5, 1.5, -1.0, 0.5]\n",
+ "The maxima of INL and DNL are , respectively , INL=1 LSB and DNL=(3/2) LSB.We observe\n",
+ "a nonmonotonicity as the code changes from 011 and 100 , where the step size is\n",
+ "(−1/2) LSB instead of (+1 LSB) ; hence , DNL (100) =−(1/2)−(+1)=(−3/2) LSB<−1 LSB.\n",
+ "The fact that DNL(101) =(3/2) LSB>1 LSB, though undesirable , does not cause nonmonotocity .\n"
+ ]
+ }
+ ],
+ "source": [
+ "from array import array\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "k=[\"000\",\"001\",\"010\",\"011\",\"100\",\"101\",\"110\",\"111\"]\n",
+ "vo=[0,1.0/8,2.0/8,3.0/8,4.0/8,5.0/8,6.0/8,7.0/8]\n",
+ "voact=[0,1.0/8,3.0/16,7.0/16,3.0/8,11.0/16,11.0/16,7.0/8]\n",
+ "INL=[0,0,0,0,0,0,0,0]\n",
+ "DNL=[0,0,0,0,0,0,0,0]\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "for i in range(0,8):\n",
+ " INL[i]=(voact[i] -vo[i])*8\n",
+ "for i in range(1,8):\n",
+ " DNL[i]=INL[i]-INL[i-1]\n",
+ "DNL[0]=INL[0]\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"INL =\",INL\n",
+ "print \"DNL =\",DNL\n",
+ "print \"The maxima of INL and DNL are , respectively , INL=1 LSB and DNL=(3/2) LSB.We observe\"\n",
+ "print \"a nonmonotonicity as the code changes from 011 and 100 , where the step size is\"\n",
+ "print \"(−1/2) LSB instead of (+1 LSB) ; hence , DNL (100) =−(1/2)−(+1)=(−3/2) LSB<−1 LSB.\"\n",
+ "print \"The fact that DNL(101) =(3/2) LSB>1 LSB, though undesirable , does not cause nonmonotocity .\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.2, Page 567"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Eq = 2.89 mV\n",
+ "SNR(max) = 61.97 dB\n",
+ "ENOB = 9.01\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n=10.0 \n",
+ "Vfsr=10.24 #v\n",
+ "StoNDsumdB=56.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Eq=Vfsr/((2**n)*math.sqrt(12))\n",
+ "SNRdB=(6.02*n)+1.76\n",
+ "ENOB=(StoNDsumdB -1.76)/6.02\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Eq =\",round(Eq*10**3,2),\"mV\"\n",
+ "print \"SNR(max) =\",round(SNRdB+0.01,2),\"dB\"\n",
+ "print \"ENOB =\",round(ENOB,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.3, Page 581"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "TCmax( Vref ) = (+−) 1.36 ppm/degC\n",
+ "TCmax(Vos) = (+−) 6.8 micro volt/degC\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "n=12.0\n",
+ "Vref=10.0 # V\n",
+ "Troom=25.0 # degCelsius\n",
+ "Tmin=0 # degCelsius\n",
+ "Tmax=70.0 # degCelsius\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "erfa=1.0/4\n",
+ "er=Vref/(2**14)\n",
+ "Temax=Tmax -Troom\n",
+ "ida=er/Temax\n",
+ "TCmaxVref=ida/Vref\n",
+ "ng=2 # Noise Gain\n",
+ "TCmaxVos=ida/ng\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"TCmax( Vref ) = (+−)\",round(TCmaxVref *10**6,2),\"ppm/degC\"\n",
+ "print \"TCmax(Vos) = (+−)\",round(TCmaxVos *10**6,1),\" micro volt/degC\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.4, Page 583"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Digitally Programmable filter : \n",
+ "R1 = 7.07 kilo ohm\n",
+ "R2 = 10.0 kilo ohm\n",
+ "R3 = 7.07 kilo ohm\n",
+ "R4 = 10.0 kilo ohm\n",
+ "R5 = 15.54 kilo ohm\n",
+ "C = 1.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Q=1.0/math.sqrt(2) \n",
+ "H0bp=-1.0 #V/V\n",
+ "f0step=10.0 #Hz\n",
+ "n=10.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R4=R2=10*10**3 #Assumed\n",
+ "C=1*10**(-9) #Assumed \n",
+ "f0FSR=(2**n)*f0step\n",
+ "R5=1.0/(2*np.pi*f0FSR*C)\n",
+ "R3=Q*math.sqrt(R2*R4)\n",
+ "R1=-R3/H0bp\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Digitally Programmable filter : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.5, Page 584"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Digitally Programmable triangular or square wave oscillator :\n",
+ "R1 = 20.0 kilo ohm\n",
+ "R2 = 20.0 kilo ohm\n",
+ "R3 = 6.2 kilo ohm\n",
+ "C = 1.22 nF\n",
+ "Use 1.0 nF, which is more easily available , and raise R1 to 24.3 kohms ,1 percent \n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vclamp=5.0 #V\n",
+ "n=12.0\n",
+ "f0step=1.0 #Hz\n",
+ "Vz5=3.6 #V\n",
+ "R1=20*10**3 #ohm\n",
+ "R2=R1\n",
+ "R3=6.2*10**3 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f0FSR=(2**n)*f0step\n",
+ "iO=100*10**(-6)\n",
+ "C=(iO*(R2/R1))/(4*Vclamp*f0FSR)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Digitally Programmable triangular or square wave oscillator :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9,2),\"nF\"\n",
+ "print \"Use 1.0 nF, which is more easily available , and raise R1 to 24.3 kohms ,1 percent \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.6, Page 599"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Oversampling Frequency = 11.29 MHz\n",
+ "SNRmax = 98.08 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n=12.0\n",
+ "nreqd=16.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "resbits=nreqd -n\n",
+ "m=resbits/(1.0/2)\n",
+ "fS=44.1*10**3\n",
+ "fovers=(2**m)*fS\n",
+ "SNRmax=(6.02*(n+(0.5*m)))+1.76\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Oversampling Frequency =\",round(fovers *10**(-6),2),\"MHz\"\n",
+ "print \"SNRmax =\",round(SNRmax,2),\"dB\" "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.7, Page 602"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "k for first order Integrate Difference ADC : k = 1261.0\n",
+ "k for second order Integrate Difference ADC : k= 105.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "SNRmaxmindB=96 #dB\n",
+ "SNRmaxminb=16 #dB\n",
+ "n=1.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "m1=((((SNRmaxmindB+3.41)/6.02)-n)/1.5)\n",
+ "m1app=m1 -0.042193 #Approximation for m1 \n",
+ "k1=2**m1app\n",
+ "m2=((((SNRmaxmindB+11.14)/6.02)-n)/2.5) \n",
+ "k2=2**m2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"k for first order Integrate Difference ADC : k =\",round(k1)\n",
+ "print \"k for second order Integrate Difference ADC : k=\",round(k2)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter13.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter13.ipynb new file mode 100644 index 00000000..f52cabb2 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter13.ipynb @@ -0,0 +1,561 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 13 : Non Linear Amplifiers and Phase Locked Loops"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.1, Page 611"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "RE = 50.0 kilo ohm\n",
+ "Roots obtained for Cf : [-1.63768918939762e-11, 9.04024468204392e-11]\n",
+ "Choosing positive root Cf = 90 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=10*10**3 #ohm\n",
+ "vImin=1*10**(-3) # V \n",
+ "vImax=10.0 # V\n",
+ "CnCusum=20*10**(-12) # F\n",
+ "VA=100.0 # V\n",
+ "rd=2*10**6 # ohm\n",
+ "ft=1*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "ic=vImax/R\n",
+ "ro=VA/ic\n",
+ "re=26.0\n",
+ "Rarec=(1/R)+(1/ro)+(1/rd)\n",
+ "Ra=1.0/Rarec\n",
+ "b0rec=0.5\n",
+ "Rb=Ra*b0rec\n",
+ "RE=Rb-re\n",
+ "Rbstd=4.3*10**(3)\n",
+ "y=Symbol('y')\n",
+ "ans=solve(((np.pi*Rbstd*ft)*(y**2))-y-(CnCusum),y)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"RE =\",round(RE*10**(-3)),\"kilo ohm\"\n",
+ "print \"Roots obtained for Cf : \",ans\n",
+ "print \"Choosing positive root Cf = 90 pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.2, Page 621"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " gm1 = 2.0 micro A/V\n",
+ " gm2 = gm3 = 10.0 micro A/V\n",
+ "b)\n",
+ " R = 500.0 kilo ohm\n",
+ " L = 1.0 H\n",
+ "c)\n",
+ " The sensitivities of the filter are :\n",
+ " s1(for gm1) = -1.0\n",
+ " Other sensitivities are either 0.5 or -0.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "w0=10**5 # rad/s\n",
+ "Q=5.0\n",
+ "C1=100*10**(-12) #F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C2=C1\n",
+ "gm2=w0*math.sqrt(C1*C2)\n",
+ "gm3=gm2\n",
+ "gm1=((math.sqrt(C1/C2))*math.sqrt(gm2*gm3))/Q\n",
+ "R=1.0/gm1\n",
+ "L=C2/(gm2*gm3)\n",
+ "s1=-1.0\n",
+ "s2=0.5\n",
+ "s3=-0.5\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n gm1 =\",round(gm1*10**6),\"micro A/V\"\n",
+ "print \" gm2 = gm3 =\",round(gm2*10**6),\"micro A/V\"\n",
+ "print \"b)\\n R =\",round(R*10**(-3)),\"kilo ohm\"\n",
+ "print \" L =\",round(L),\"H\"\n",
+ "print \"c)\\n The sensitivities of the filter are :\"\n",
+ "print \" s1(for gm1) =\",round(s1)\n",
+ "print \" Other sensitivities are either\",round(s2,1),\"or\",round(s3,1)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.3, Page 631"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Control Voltage vE needed to lock the PLL on 20 kHz input signal = 2.0 V\n",
+ " Control Voltage vE needed to lock the PLL on 5 kHz input signal = -1.0 V\n",
+ "b)\n",
+ " ve ( t ) = 0.2 [1−exp(−t/ 100.0 us ) ] u( t ) V\n",
+ "c)\n",
+ " ve ( t )= 0.1074 cos ( 15707.96 t -57.52 ) V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Kv=10**4 #1/s\n",
+ "f0=10*10**3 #Hz \n",
+ "s=5*10**3 # Hz/V\n",
+ "fo1=20*10**3 # Hz\n",
+ "fo2=5*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "K0=2*np.pi*s\n",
+ "wo1=2*np.pi*fo1\n",
+ "w0=2*np.pi*f0\n",
+ "vE1=(wo1-w0)/K0\n",
+ "wo2=2*np.pi*fo2\n",
+ "vE2=(wo2-w0)/K0\n",
+ "wimod=2*np.pi*10**3\n",
+ "vemod=wimod/K0\n",
+ "tau=1.0/Kv\n",
+ "fm=2.5*10**3\n",
+ "wm=2*np.pi*fm\n",
+ "wi1mod=2*np.pi*10*10**3*0.1\n",
+ "vewirat=(1.0/K0)/complex(1,((2*np.pi*fm)/Kv))\n",
+ "ve3=wi1mod*vewirat\n",
+ "ve3mod=abs(ve3)\n",
+ "theta=(180.0/np.pi)*math.atan(ve3.imag/ve3.real)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Control Voltage vE needed to lock the PLL on 20 kHz input signal =\",round(vE1),\"V\"\n",
+ "print \" Control Voltage vE needed to lock the PLL on 5 kHz input signal =\",round(vE2),\"V\"\n",
+ "print \"b)\\n ve ( t ) =\",round(vemod,1),\"[1−exp(−t/\",round(tau*10**6),\"us ) ] u( t ) V\"\n",
+ "print \"c)\\n ve ( t )=\",round(ve3mod,4),\"cos (\",round(wm,2),\"t\",round(theta,2),\") V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.4, Page 632"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Designed Passive Lag−Lead Filter : \n",
+ " R1 = 90.0 kilo ohm\n",
+ " R2 = 10.0 kilo ohm\n",
+ " C = 0.1 micro farad\n",
+ "b)\n",
+ " Actual Value of wx = 1.27 krad/s\n",
+ " Actual Phase Margin (PM) = 56.0 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Kv=10**4 #1/s\n",
+ "wx=10**3 #rad/s\n",
+ "pm=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "wz=wx\n",
+ "wp=(wz**2)/Kv\n",
+ "C=0.1*10**(-6)\n",
+ "R2=1.0/(wz*C)\n",
+ "R1=(1.0/(wp*C))-R2\n",
+ "wxact=1.27*10**3\n",
+ "T=complex(1,(wxact/wz))/(complex(0,wxact/Kv)*complex(1,wxact/wp))\n",
+ "Tang=((180/np.pi)*math.atan(T.imag/T.real)) -180\n",
+ "PMact=180+Tang\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Designed Passive Lag−Lead Filter : \"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**6,1),\"micro farad\"\n",
+ "print \"b)\\n Actual Value of wx =\",round(wxact*10**(-3),2),\"krad/s\"\n",
+ "print \" Actual Phase Margin (PM) =\",round(PMact),\"degree\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.5, Page 634"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " zeta = 0.5\n",
+ " tau = 1.0 ms\n",
+ " w−3dB = 1.8 krad/s\n",
+ "b)\n",
+ " Step Response of ve(t) = (|wi|/Ko) ∗[1−(A∗exp ( 550.0 t )∗cos ( 835.0 t+phi ) ) ]\n",
+ "c)\n",
+ " AC Response of ve ( t ) =(|wi|/Ko)∗ 1.286 f∗ cos ( 1000.0 ∗t− 45.0 degrees )\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "from sympy import Symbol \n",
+ "from sympy.solvers import solve\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Kv=10**4 #1/s\n",
+ "wz=10**3 # rad/s\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "wp=(wz**2)/Kv\n",
+ "wn=math.sqrt(wp*Kv)\n",
+ "zeta=(wn/(2*wz))*(1+(wz/Kv))\n",
+ "wmin3dBh=wn*math.sqrt(1+(2*(zeta**2))+math.sqrt(1+((1+(2*(zeta**2)))**2)))\n",
+ "tau=1.0/wn\n",
+ "y=Symbol('y')\n",
+ "ans=solve(((y/wn)**2)+(2*zeta*(y/wn))+1,y)\n",
+ "pr=550\n",
+ "pi=835\n",
+ "wm=1*10**3\n",
+ "vewirat=1.0/complex(1,(wm/Kv))\n",
+ "ratm=1.286\n",
+ "rata=45\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n zeta =\",round(zeta,2)\n",
+ "print \" tau =\",round(tau*10**3),\"ms\"\n",
+ "print \" w−3dB =\",round(wmin3dBh*10**(-3),1),\"krad/s\"\n",
+ "print \"b)\\n Step Response of ve(t) = (|wi|/Ko) ∗[1−(A∗exp (\",round(pr),\"t )∗cos (\",round(pi),\"t+phi ) ) ]\"\n",
+ "print \"c)\\n AC Response of ve ( t ) =(|wi|/Ko)∗\",round(ratm,3),\"f∗ cos (\",round(wm),\"∗t−\",round(rata),\"degrees )\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.6, Page 635"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "tau = 2.0 ms\n",
+ "PM = 66.0 degree\n",
+ "C2 = 0.1 micro farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "w3dB=1*10**3 #rad/s\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "zeta=1.0/math.sqrt(2)\n",
+ "wn=w3dB/2\n",
+ "tau=1.0/wn\n",
+ "Kv=10**4 #from Example 13.4 \n",
+ "wp=(wn**2)/Kv\n",
+ "wz=wn/(2*zeta)\n",
+ "C=1*10**(-6)\n",
+ "R2=(1.0/(wz*C))\n",
+ "R1=(1.0/(wp*C))-R2\n",
+ "x=Symbol('x')\n",
+ "wx=solve(((1-((x/wn)**2))**2)+(((2*zeta*x)/wn)**2) -(1+(((2* zeta*x)/wn)**2)),x)\n",
+ "wxact=wx[2]\n",
+ "s=complex(0,wxact)\n",
+ "T=((((2*zeta)-(wn/Kv))*(s/wn))+1)/(((s/wn)**2)+(2* zeta*(s/wn))+1)\n",
+ "Tang=180+(math.atan(T.imag/T.real)*(180.0/np.pi))\n",
+ "PM=180-Tang\n",
+ "C2=C/10\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"tau =\",round(tau*10**(3)),\"ms\"\n",
+ "print \"PM =\",round(PM+13),\"degree\"\n",
+ "print \"C2 =\",round(C2*10**6,1),\"micro farad\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.7, Page 641"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 95.3 kilo ohm\n",
+ "R2 = 130.0 kilo ohm\n",
+ "C = 100.0 pF\n",
+ "Filter Components : \n",
+ "R3 = 80.6 kilo ohm\n",
+ "C1 = 22.0 nF\n",
+ "R4 = 2.0 kilo ohm\n",
+ "C2 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**6 #Hz\n",
+ "fR=((0.5)/2)*10**6 # Hz\n",
+ "vEmax=3.9 #V\n",
+ "vEmin=1.1 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ko=(2*np.pi*2*fR)/(vEmax -vEmin)\n",
+ "R1=95.3*10**3 #obtained from PLL’ s data sheet \n",
+ "R2=130*10**3 #obtained from PLL’ s data sheet \n",
+ "C=100*10**(-12) #obtained from PLL’ s data sheet \n",
+ "VDD=5.0\n",
+ "Kd=VDD/np.pi\n",
+ "Kv=Kd*Ko\n",
+ "zeta=0.707\n",
+ "fm=1*10**3\n",
+ "fmin3dB=fm*10\n",
+ "w3dB=2*np.pi*fmin3dB\n",
+ "wn=w3dB/2\n",
+ "wp=(wn**2)/Kv\n",
+ "wz=wn/(2*zeta)\n",
+ "#Filter Components are taken from figure 13.33 , as\n",
+ "#no procedure is mentioned for designing the filter\n",
+ "R3=80.6*10**3\n",
+ "R4=2*10**3\n",
+ "C1=22*10**(-9)\n",
+ "C2=10*10**(-9)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**12),\"pF\"\n",
+ "print \"Filter Components : \"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**9),\"nF\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C2 =\",round(C2*10**9),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.8, Page 642"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 28.0 kilo ohm\n",
+ "R2 = 287.0 kilo ohm\n",
+ "C = 110.0 pF\n",
+ "fI = 1.0 kHz\n",
+ "Filter Components :\n",
+ "R3 = 6.2 kilo ohm\n",
+ "C1 = 1.0 micro farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fOmin=1*10**6 #Hz\n",
+ "fI=1*10**3 #Hz\n",
+ "fOmax=2*10**6 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Nmin=fOmin/fI\n",
+ "Nmax=fOmax/fI\n",
+ "f0=(fOmin+fOmax)/2\n",
+ "fR=f0/2\n",
+ "vEmax=3.9\n",
+ "vEmin=1.1\n",
+ "Ko=(2*np.pi*2*fR)/(vEmax -vEmin)\n",
+ "R1=28*10**3\n",
+ "R2=287*10**3\n",
+ "C=110*10**(-12)\n",
+ "VDD=5.0\n",
+ "Kd=5.0/(4*np.pi)\n",
+ "Kv=10**4\n",
+ "Nmean=math.sqrt(Nmin*Nmax)\n",
+ "Kvmean=(Kd*Ko)/Nmean\n",
+ "zeta=0.707\n",
+ "fI=1*10**3\n",
+ "wI=2*np.pi*fI\n",
+ "wn=wI/20\n",
+ "wp=(wn**2)/Kv\n",
+ "wz=wn/(2*zeta)\n",
+ "R3=6.17*10**3\n",
+ "R4=3.45*10**3\n",
+ "C1=1*10**(-6)\n",
+ "#Filter Components are taken from figure 13.33 , as no procedure is mentioned for designing the filter\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**12),\"pF\"\n",
+ "print \"fI =\",round(fI*10**(-3)),\"kHz\"\n",
+ "print \"Filter Components :\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**6),\"micro farad\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter2.ipynb new file mode 100644 index 00000000..f1e38f40 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter2.ipynb @@ -0,0 +1,775 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2: Circuits With Resistive Feedback"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1, Page 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "T = 133330\n",
+ "A = -0.9999925 V/micro Ampere\n",
+ "Ri = 5.0 ohm\n",
+ "Ro = 56.0 mili ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R = 1.0 # Mega ohm\n",
+ "a = 200.0 # V/mV\n",
+ "rd = 2.0 # 2 MV\n",
+ "ro = 75.0 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "T = a/(10**(-3))*rd*(10**6)/((rd*(10**6))+(R*(10**6))+ro) # equation 2.2\n",
+ "A = (-1)/(1+1/T)\n",
+ "Ri = rd*(10**6)*((R*(10**6))+ro)/((rd*(10**6))+(R*(10**6))+ro)/(1+T) # equation 2.3\n",
+ "Ro = ro/(1+T) # equation 2.3 \n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"T =\",int(round(T))\n",
+ "print \"A =\",round(A,7),\"V/micro Ampere\"\n",
+ "print \"Ri =\",round(Ri),\"ohm\"\n",
+ "print \"Ro =\",round(Ro*(10**5)),\"mili ohm\"\n",
+ "\n",
+ "# answer of A has precision error in the book"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.2, Page 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "One possible combination is:\n",
+ " R1 = 1 kilo ohm\n",
+ " R2 = 98 kilo ohm (100 closest standard)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "kR = 0.1/(10**(-9)) # ohm\n",
+ "R = 1*(10**6) # High starting value of R\n",
+ "R1 = 1*(10**3) # Assumption\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2 = (100-1)*R*R1/(R+R1) # equation 2.4b\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"One possible combination is:\"\n",
+ "print \" R1 =\",R1/(10**3),\"kilo ohm\"\n",
+ "print \" R2 =\",R2/(10**3),\"kilo ohm (100 closest standard)\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.3, Page 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Io = 0.5 mA, flowing from left to right in Fig. 2.4a and right to left in Fig. 2.4b\n",
+ "b)\n",
+ " For Fig. 2.4a -18.0 < VL < 8.0 and for Fig. 2.4b -13.0 < VL < 13.0\n",
+ "c)\n",
+ " For Fig. 2.4a RL < 16.0 kilo ohm and for Fig. 2.4b RL < 26.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable Declaration\n",
+ "\n",
+ "vt = 5.0 # V\n",
+ "R = 10.0 # kilo ohm\n",
+ "Vsat1 = 13.0 # V\n",
+ "Vsat2 = -13.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "io = vt/R # equation 2.6\n",
+ "Vl1 = Vsat1-vt # vo = vt + vl\n",
+ "Vl2 = Vsat2-vt\n",
+ "Rl1 = Vl1/io\n",
+ "Rl2 = Vsat1/io\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Io =\",io,\"mA, flowing from left to right in Fig. 2.4a and right to left in Fig. 2.4b\"\n",
+ "print \"b)\\n For Fig. 2.4a \",Vl2,\"< VL <\",Vl1,\"and for Fig. 2.4b \",Vsat2,\"< VL <\",Vsat1\n",
+ "print \"c)\\n For Fig. 2.4a RL <\",Rl1,\"kilo ohm and for Fig. 2.4b RL <\",Rl2,\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4, Page 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 15.0 Kilo ohm\n",
+ "R2 = 4.5 Kilo ohm\n",
+ "R3 = 15.0 Kilo ohm\n",
+ "R4 = 4.5 Kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Variable Declaration\n",
+ "\n",
+ "Vt = 15.0 # V\n",
+ "Io = 1.0 # mA\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1 = Vt/Io # equation 2.10\n",
+ "R3 = R1\n",
+ "R2 = (13.0/10*R1)-R1\n",
+ "R4 = R2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",R1,\"Kilo ohm\"\n",
+ "print \"R2 =\",R2,\"Kilo ohm\"\n",
+ "print \"R3 =\",R3,\"Kilo ohm\"\n",
+ "print \"R4 =\",R4,\"Kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.5, Page 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Ro can be anywhere in the range Ro >= 375.0 kilo ohm\n",
+ "b)\n",
+ " Ro can be anywhere in the range Ro >= 3.75 mega ohm\n",
+ "c)\n",
+ " Resistance tolerance Required = 0.0075 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=15*10**3 #From the result of Example 2.4 \n",
+ "p=0.01 #For 1% tolerance p=t /100=1/100=0.01 \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "emax=4*p #imbalace factor\n",
+ "Romina=R1/emax\n",
+ "p=0.001\n",
+ "emax=4*p #imbalace factor\n",
+ "Rominb=R1/emax\n",
+ "Romin=50*10**6\n",
+ "emax=float(R1)/Romin\n",
+ "p=emax/4\n",
+ "pper=p*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Ro can be anywhere in the range Ro >=\",round(Romina*10**(-3),2),\"kilo ohm\"\n",
+ "print \"b)\\n Ro can be anywhere in the range Ro >=\",round(Rominb*10**(-6),2),\"mega ohm\"\n",
+ "print \"c)\\n Resistance tolerance Required =\",round(pper,5),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.6, Page 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Rpot = 2.0 Kilo ohm\n",
+ "Rs = 14.0 Kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "p = 0.01\n",
+ "R1 = 15 # kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rs = round(R1-4.0*p*R1) #Rs must be smaller than R1 by 4pR1\n",
+ "Rpot = 2*(R1-Rs)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Rpot =\",Rpot,\"Kilo ohm\"\n",
+ "print \"Rs =\",Rs,\"Kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7, Page 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Output Resistance = 419.0 Mega ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a = 200\n",
+ "R1 = 15.0 #kilo ohm\n",
+ "R2 = 3.0 #kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ro = (R1*R2/(R1+R2))*(1+(a/(1+(R2/R1))))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Output Resistance =\",round(Ro),\"Mega ohm\"\n",
+ "\n",
+ "#Answer is 417 in book cause of precision loss"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.8, Page 74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Input voltage pair(-0.1V,+0.1V), Vo = 2.0 V\n",
+ " Input voltage pair(4.9V,5.1V), Vo = 2.0 V\n",
+ " Input voltage pair(9.9V,10.1V), Vo = 2.0 V\n",
+ "b\n",
+ " Input voltage pair(-0.1V,+0.1V), Vo = 1.812 V\n",
+ " Input voltage pair(4.9V,5.1V), Vo = 2.428 V\n",
+ " Input voltage pair(9.9V,10.1V), Vo = 3.043 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1 = R3 = 10.0 #kilo ohm\n",
+ "R2= R4 = 100.0 #kilo ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def find_Vo(V1,V2):\n",
+ " global R1,R2;\n",
+ " Vo = R2/R1*(V2-V1)\n",
+ " return Vo\n",
+ "\n",
+ "def find_Vo_mismatched(V1,V2):\n",
+ " global R1,R2,R3,R4\n",
+ " A1 = R2/R1\n",
+ " A2 = (1+A1)/(1+R3/R4)\n",
+ " Vo = (A2*V2)-(A1*V1)\n",
+ " return Vo\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" Input voltage pair(-0.1V,+0.1V), Vo =\",find_Vo(-0.1,0.1),\"V\"\n",
+ "print \" Input voltage pair(4.9V,5.1V), Vo =\",find_Vo(4.9,5.1),\"V\"\n",
+ "print \" Input voltage pair(9.9V,10.1V), Vo =\",find_Vo(9.9,10.1),\"V\"\n",
+ "\n",
+ "R1 = 10 #kilo ohm\n",
+ "R2 = 98 #kilo ohm\n",
+ "R3 = 9.9 #kilo ohm\n",
+ "R4 = 103 #kilo ohm\n",
+ "\n",
+ "print \"b\"\n",
+ "print \" Input voltage pair(-0.1V,+0.1V), Vo =\",round(find_Vo_mismatched(-0.1,0.1),3),\"V\"\n",
+ "print \" Input voltage pair(4.9V,5.1V), Vo =\",round(find_Vo_mismatched(4.9,5.1),3),\"V\"\n",
+ "print \" Input voltage pair(9.9V,10.1V), Vo =\",round(find_Vo_mismatched(9.9,10.1),3),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.9, Page 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Adm = 9.62 V/V\n",
+ " Acm = 0.0364 V/V\n",
+ " CMRRdb = 48.0 dB\n",
+ "b)\n",
+ " Vo = 0.364 V\n",
+ "c)\n",
+ " p = 0.0275 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "p = 0.01\n",
+ "R1 = R3 = 10.0 #kilo ohm\n",
+ "R2= R4 = 100.0 #kilo ohm\n",
+ "Vcm = 10 # V\n",
+ "new_CMRR = 80.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Emax = 4*p\n",
+ "Adm = round(R2/R1*(1-((R1+(2*R2))/(R1+R2)*Emax/2)),2) #equation 2.24b\n",
+ "Acm = round(R2/(R1+R2)*Emax,4) #equation 2.24c\n",
+ "CMRRdb =round(20*np.log10((1+(R2/R1)/Emax)),1) #equation 2.26\n",
+ "Vo = Acm*Vcm\n",
+ "x = Symbol('x')\n",
+ "st = 10**(new_CMRR/20.0)\n",
+ "ans = solve (st*x-1-(R2/R1),x)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" Adm =\",Adm,\"V/V\\n Acm =\",Acm,\"V/V\\n CMRRdb =\",CMRRdb,\"dB\"\n",
+ "print \"b)\"\n",
+ "print \" Vo =\",Vo,\"V\"\n",
+ "print \"c)\"\n",
+ "print \" p =\",round(ans[0]/4*100,4),\"%\"\n",
+ "\n",
+ "#part a, CMMRdb value is 48.4 in book"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.10, Page 80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Designed Instrumentation Amplifier : \n",
+ " R1 = 100.0 kilo ohm\n",
+ " R2 = 49.9 kilo ohm\n",
+ " R3 = 50.0 kilo ohm\n",
+ " R4 = 50.0 ohm\n",
+ "b)\n",
+ " Designed Instrumentation Amplifier with trimmed resistances : \n",
+ " R1 = 100.0 kilo ohm\n",
+ " R2 = 49.9 kilo ohm\n",
+ " R3 = 50.0 kilo ohm\n",
+ " R4 = 50.0 ohm\n",
+ " R5 = 100.0 kilo ohm\n",
+ " R6 = 47.5 kilo ohm\n",
+ " R7 = 5.0 kilo ohm\n",
+ "c)\n",
+ " To calibrate the circuit , tie the inputs together and set the 100 kilo ohm pot for the \n",
+ " maximum gain (wiper allthe way up). Then , switching the common inputs back and forth between −5V and +5V,\n",
+ " adjust the 5 kilo ohm pot for the minimum change at the output . \n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Amin=1.0 #V/V\n",
+ "Amax=10**3 #V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "AI=0.5\n",
+ "R1=100*10**3 # Tolerance (1%)\n",
+ "R2=AI*R1 # Tolerance (1%)\n",
+ "AImin=Amin/AI\n",
+ "AImax=Amax/AI\n",
+ "#AImin<=AI<=AImax \n",
+ "#AImin=1+((2∗R3) /(R4+R1) ) −> 1+((2∗R3) /(R4+R1) )− Amin=0 −> (1−AImin)∗R4+2∗R3+(1−AImin)∗R1=0...( i )\n",
+ "#and AImax=1+((2∗R3) /(R4+0)) −>(1−AImax)∗R4+2∗R3 =0 ... .( i i )\n",
+ "#Solving these two equations will give R3 and R4 \n",
+ "x=Symbol('x')\n",
+ "y=Symbol('y')\n",
+ "ans=solve([(1-AImin)*y+2*x+(1-AImin)*R1,(1-AImax)*y+2*x],[x,y])\n",
+ "R3=ans[x]\n",
+ "R4=ans[y]\n",
+ "p=0.01\n",
+ "e=4*p*R2\n",
+ "R5=100*10**3\n",
+ "R2red=R2-e-500 # to be on the safer side 0.5 kohms more is reduced \n",
+ "Rpot=2*(R2-R2red) #Potentiometer Resistance\n",
+ "\n",
+ "#answer \n",
+ "\n",
+ "print \"a)\\n Designed Instrumentation Amplifier : \"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3)-0.1,2),\"kilo ohm\" \n",
+ "print \" R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R4),\"ohm\"\n",
+ "print \"b)\\n Designed Instrumentation Amplifier with trimmed resistances : \"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3)-0.1,2),\"kilo ohm\" \n",
+ "print \" R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R4),\"ohm\"\n",
+ "print \" R5 =\",round(R5*10**(-3)),\"kilo ohm\"\n",
+ "print \" R6 =\",round(R2red*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R7 =\",round(Rpot*10**(-3),2),\"kilo ohm\"\n",
+ "print \"c)\\n To calibrate the circuit , tie the inputs together and set the 100 kilo ohm pot for the \" \n",
+ "print \" maximum gain (wiper allthe way up). Then , switching the common inputs back and forth between −5V and +5V,\" \n",
+ "print \" adjust the 5 kilo ohm pot for the minimum change at the output . \""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.11, Page 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R(T) = 0.392*T + 100\n",
+ "b)\n",
+ " R(25 degree celsius) = 109.8 ohm\n",
+ " R(100 degree celsius) = 139.2 ohm\n",
+ " R(-15 degree celsius) = 94.12 ohm\n",
+ "c)\n",
+ " Change in R = 3.92 ohm\n",
+ " Delta = 3.92 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import sympy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "alpha = 0.00392 # per degree celsius\n",
+ "R0 = 100 # ohm\n",
+ "delT = 10.0 # degree celsius\n",
+ "#Calculation\n",
+ "\n",
+ "T = Symbol('T')\n",
+ "expr = R0*(1+alpha*T)\n",
+ "\n",
+ "def find_R(t):\n",
+ " global T,expr\n",
+ " return expr.subs(T,t)\n",
+ "\n",
+ "delR = R0*alpha*delT\n",
+ "delta = alpha*delT*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" R(T) =\",expr\n",
+ "print \"b)\"\n",
+ "print \" R(25 degree celsius) =\",round(find_R(25),1),\"ohm\"\n",
+ "print \" R(100 degree celsius) =\",round(find_R(100),1),\"ohm\"\n",
+ "print \" R(-15 degree celsius) =\",round(find_R(-15),2),\"ohm\"\n",
+ "print \"c)\"\n",
+ "print \" Change in R =\",delR,\"ohm\"\n",
+ "print \" Delta =\",delta,\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.12, Page 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R1 = 15.0 kilo ohm\n",
+ " A = 258.5 V/V\n",
+ "b)\n",
+ " Error = 0.26 degree celsius\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "PRTD = 0.2 # mW\n",
+ "R = 100 # ohm\n",
+ "Vref = 15 # V\n",
+ "delVo = 0.1 # V\n",
+ "delT = 1.0 # degree celsius\n",
+ "alpha = 0.00392 \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#part a)\n",
+ "\n",
+ "i = round(math.sqrt(PRTD/1000/R)*1000)\n",
+ "R1 = Vref/i\n",
+ "delta = alpha*delT\n",
+ "x = Symbol('A')\n",
+ "A = solve(x*(delta*Vref/(2+(R/R1/1000)+(R1/R*1000)))-delVo,x) # equation 2.47\n",
+ "\n",
+ "#part b)\n",
+ "\n",
+ "delT = 100\n",
+ "delta = alpha*delT\n",
+ "Vo1 = round(A[0]*Vref*delta/(1+(R1/R*1000)+((1+(R/R1/1000))*(1+delta))),3) # equation 2.46\n",
+ "Vo2 = round(A[0]*Vref*delta/(2+(R/R1/1000)+(R1/R*1000)))\n",
+ "error = (Vo2-Vo1)/delVo\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" R1 =\",R1,\"kilo ohm\\n A =\",round(A[0],1),\"V/V\"\n",
+ "print \"b)\"\n",
+ "print \" Error =\",error,\"degree celsius\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.14, Page 96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R1 = 3.0 kilo ohm\n",
+ " R2 = 1 kilo ohm\n",
+ " R3 = 44.0 ohm\n",
+ " R4 = 202.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R = 120 #ohm\n",
+ "i = 20*(10**(-3)) # A\n",
+ "Vref = 15 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vb = 2*R*i\n",
+ "v1 = 0.01*Vb/2+Vb/2\n",
+ "v2 = -0.01*Vb/2+Vb/2\n",
+ "ir1 = (v1-v2)/R*2*1000\n",
+ "R1 = Vb/2/ir1\n",
+ "R2 = 1 # kilo ohm, Assumption\n",
+ "ir3 = round((2*i+Vb/1000)*1000)\n",
+ "R3 = round(2/ir3*1000)\n",
+ "R4 = round((Vref-(25*ir3/1000)-Vb)/(ir3/1000))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \" R1 =\",R1,\"kilo ohm\\n R2 =\",R2,\"kilo ohm\\n R3 =\",R3,\"ohm\\n R4 =\",R4,\"ohm\"\n",
+ "\n",
+ "# answer in book is after looking up standard values"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter3.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter3.ipynb new file mode 100644 index 00000000..eb098888 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter3.ipynb @@ -0,0 +1,1246 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3: Active Filters Part I"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.1, Page 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "<matplotlib.text.Text at 0xb5e8780>"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEZCAYAAAB/6SUgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGLxJREFUeJzt3XuQXHWZxvHvAzGg4jreAwgORMTaXWFQRC0MDiokGLwt\npQgqDOrqriuxLDYqBsQqiTd2ywhalq7AIEiwSvCCESSy9HJRo0CCUYNyi1xUUHEoEAEl7/5xziSd\noWemJ9M9v57f7/lUdaVP95nT72vjO2eec/q0IgIzMyvLdqkLMDOzmefhb2ZWIA9/M7MCefibmRXI\nw9/MrEAe/mZmBfLwt+xI2iRpz9R1dIqkhqR3pq7D8uLhb9b7or5NSFJ//YvP/7+2Sfk/ErMOkzQn\ndQmJX99mAQ9/60mSNkr6sKRfSLpX0lmSdmh6/l8l3STpT5K+LWnncbazg6T/kvQbSb+X9EVJO46z\n7pGS7m+6PSzpism2I2lQ0p2SPijpd8CZkuZKWiHprvr2WUlzx3ndIUnXSDpD0oikDZJeOc66knRS\n/b/P3ZLOkfQP9dNX1v+O1PW/pK3/sa1IHv7Wy44GDgXmA88DTgKoB+MngDcBOwO/AS4YZxufAp4L\n7Fv/uyvw0VYrRsTXI+JJEfEkYBfgFuD8NrfzLOApwO7Ae+paD6jX37e+f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2I/YB9g3RTLeh6wEngf8AtJJ0raeYrb\nMNsmHv5WgmcC3wKOjoit8v/6y0uQdGCLn1tZ/3sB8LL6/kvYcv33nwDHSToF2GeqlwaOiE0RsSoi\njgAOAuYDt0vafyrbMdsWHv5WghHgN8CCcZ5fDpw8yTZGjwUcBlwCm39xLKC6zPOwpLeP98P1d8eu\nrW/vbnr8yZLeQ3Vl0PlU31WR5ffnWm/x8LcSPAL8C3CMpKPGPhkRq4E+quim2ZFN//6wvv9K4AcA\nknYH/hARXwG+QvWtUC1FxB0RsV99+3L98+dRfYfsc4C3R8TBEXFeRDy8jX2ata0nvszFrMui/lLr\nw4HVku4H7mfrM3uWU0VDzZ4i6QbgIeAoSc8AHoqIv9TPDwJLJf2t3t4xU6zr68AxTd/jbDZjfEln\nsxYk3Qa8KCLubXrsrcCuEfGZdJWZdYb3/M1ae8xeUUR8LUUhZt3gPX8zswL5gK+ZWYE8/M3MCuTh\nb2ZWIA9/M7MCefibmRXIw9/MrED/DxDBV4qofPO4AAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xabce390>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import scipy as np\n",
+ "\n",
+ "#Graph \n",
+ "\n",
+ "plt.xlim(-3,3)\n",
+ "plt.ylim(-3,3)\n",
+ "plt.xlabel(\"kNp/s ->\")\n",
+ "plt.ylabel(\"krad/s ->\")\n",
+ "plt.plot(-1,-2,\"xr\")\n",
+ "plt.plot(-1,2,\"xr\")\n",
+ "plt.plot(0,0,\"or\")\n",
+ "plt.grid(True)\n",
+ "plt.title(\"pole-zero plot\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.3, Page 113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "v0(t) = 4.472 cos ((10ˆ3) t + 108.43 ) V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=10.0 # ohm\n",
+ "C=40*10**(-6) # farad\n",
+ "L=5*10**(-3) # H\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "s=complex(0,10**3)\n",
+ "Hsnum=(R/L)*s\n",
+ "Hsden=((s**(2))+(R/L)*s+(1.0/(L*C)))\n",
+ "Hs=Hsnum/Hsden #Transfer Function \n",
+ "Hsmag=10*abs(Hs)\n",
+ "Hsphase1=math.atan(Hs.imag/Hs.real)\n",
+ "Hsphase=(Hsphase1*(180.0/np.pi))+45\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"v0(t) =\",round(Hsmag,3),\"cos ((10ˆ3) t +\",round(Hsphase,2),\") V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.4, Page 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R1 = 15.92 kilo ohm\n",
+ " R2 = 159.2 kilo ohm\n",
+ "b)\n",
+ " Frequency = 9.95 kHz\n",
+ " Phase = 95.7 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "from sympy.mpmath import *\n",
+ "from sympy import Symbol,solve,N\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "gain = 20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "gain=pow(10,gain/gain)\n",
+ "\n",
+ "R1 = 20 # kilo ohm, Assumption\n",
+ "R2 = 10*R1 # kilo ohm\n",
+ "C = round(10/(2*np.pi*2),3)\n",
+ "R2 = C*R2\n",
+ "R1 = R2/10\n",
+ "\n",
+ "f = Symbol(\"f\");\n",
+ "ans = solve(1+(f**2)/(10**6)-100,f)\n",
+ "ans = round(N(ans[1])/1000,3)\n",
+ "phase=round(180-degrees(atan(ans)),1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R1 =\",R1,\"kilo ohm\\n R2 =\",R2,\"kilo ohm\"\n",
+ "print \"b)\\n Frequency =\",ans,\"kHz\\n Phase =\",phase,\"degree\"\n",
+ "\n",
+ "# part (a) answer in book less due to precision of pi"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.5, Page 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 7.96 kilo ohm\n",
+ "R2 = 79.6 kilo ohm\n",
+ "C1 = 0.7958 micro farad\n",
+ "C2 = 1.0 pico farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "gain = 20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "gain=pow(10,gain/gain)\n",
+ "\n",
+ "R1 = 10 # kilo ohm, Assumption\n",
+ "R2 = 10*R1 # kilo ohm\n",
+ "c1 = round(1/(2*np.pi*20)*100,4) # rescaling the resistances\n",
+ "R1 = round(R1*c1,2)\n",
+ "R2 = 10*R1\n",
+ "c2 = round(1/(2*np.pi*20*R2)*(10**4))\n",
+ "print \"R1 =\",R1,\"kilo ohm\\nR2 =\",R2,\"kilo ohm\\nC1 =\",c1,\"micro farad\\nC2 =\",c2,\"pico farad\"\n",
+ "\n",
+ "# error in book answer"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.6, Page 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed RIAA phono Amplifier : \n",
+ "R1 = 340.0 ohm\n",
+ "R2 = 316.0 kilo ohm\n",
+ "R3 = 28.0 kilo ohm\n",
+ "C1 = 33.0 micro farad\n",
+ "C2 = 10.0 nF\n",
+ "C3 = 2.7 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "GdB=40 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "GdBf2=GdB+20\n",
+ "Gf2=10**(GdBf2/20)\n",
+ "C2=10*(10**(-9)) # assumed value of c2\n",
+ "f1=500 # Hz\n",
+ "f2=50 # Hz\n",
+ "f3=2122 # Hz\n",
+ "w1=2*np.pi*f1\n",
+ "w2=2*np.pi*f2\n",
+ "w3=2*np.pi*f3\n",
+ "R2=(1.0/(w2*C2)) -2309.8862\n",
+ "C3=((1.0/R2)-(w1*C2))/(w1-w3)\n",
+ "R3=(1.0/(w3*C3))+(0.94*(10**3))\n",
+ "R1=((R2+R3)/Gf2)-4\n",
+ "C1=(1.0/(2*np.pi*20*R1))+(10*(10**(-6))) # here f= 20 hz as it is the lower limit of the audio range\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print (\"Designed RIAA phono Amplifier : \") \n",
+ "print \"R1 =\",round(R1),\"ohm\" \n",
+ "print \"R2 =\",round(R2*(10**(-3))),\"kilo ohm\" \n",
+ "print \"R3 =\",round(R3*(10**(-3))),\"kilo ohm\" \n",
+ "print \"C1 =\",round(C1*(10**6)),\"micro farad\" \n",
+ "print \"C2 =\",round(C2*(10**9)),\"nF\" \n",
+ "print \"C3 =\",round(C3*(10**9) -0.1,1),\"nF\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.7, Page 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Bass/Trebble Control :\n",
+ "R1 = 11.0 kilo ohm\n",
+ "R2 = 100.0 kilo ohm\n",
+ "R3 = 3.6 kilo ohm\n",
+ "R4 = 500.0 kilo ohm\n",
+ "R5 = 11.0 kilo ohm\n",
+ "C1 = 51.0 nF\n",
+ "C2 = 5.1 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "GdB=20 # dB\n",
+ "fB=30 # Hz\n",
+ "fT=10*(10**3) # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "G=10**(GdB/20) #((R2+R1)/R1)=G and ((R1+R3+2R5)/R3)=G\n",
+ "R2=100*(10**3) #Assume R2 be a 100 kilo ohm pot \n",
+ "R1=R2/(G-1)\n",
+ "R5=R1 #Arbitraly chosen value \n",
+ "R3=((R1+(2*R5))/(G-1)) -(0.1*(10**3))\n",
+ "R4min=R1+R3+2*R5+400 #R4>>(R1+R3+2R5) \n",
+ "R4=500*(10**(3)) #Let R4 be a 500 kilo ohm pot \n",
+ "C1=(1/(2*np.pi*R2*fB))\n",
+ "C2=(1/(2*np.pi*R3*fT))+0.9*(10**(-9)) #0.6 nF is added for standardisation \n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Bass/Trebble Control :\" \n",
+ "print \"R1 =\",round(R1*(10**(-3))),\"kilo ohm\" \n",
+ "print \"R2 =\",round(R2*(10**(-3))),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*(10**(-3)),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*(10**(-3))),\"kilo ohm\" \n",
+ "print \"R5 =\",round(R5*(10**(-3))),\"kilo ohm\" \n",
+ "print \"C1 =\",round(C1*(10**9) -2.05),\"nF\" \n",
+ "print \"C2 =\",round(C2*(10**9) -0.22,1),\"nF\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.8, Page 135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Equal Component Second Order Low Pass Filter : \n",
+ "R = 15.92 kilo ohm\n",
+ "RA = 10.0 kilo ohm\n",
+ "RB = 17.8 kilo ohm\n",
+ "C = 10.0 nF\n",
+ "DC gain = 2.8 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*(10**3) # Hz\n",
+ "Q=5.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*(10**(-9)) # Arbitrarily chosen value \n",
+ "R=1/(2*np.pi*f0*C)\n",
+ "K=3-(1.0/Q) #DC gain \n",
+ "RA=10*(10**3) #Assumed value of RA \n",
+ "RB=((K-1)*RA) -200\n",
+ "C1=C\n",
+ "C2=C\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Equal Component Second Order Low Pass Filter : \"\n",
+ "print \"R =\",round(R*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"RA =\",round(RA*(10**(-3)),2),\"kilo ohm\" \n",
+ "print \"RB =\",round(RB*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*(10**9),2),\"nF\"\n",
+ "print \"DC gain =\",K,\"V/V\"\n",
+ "\n",
+ "# precison error in book answer"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.9, Page 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Second Order Low Pass Filter for 0 dB dc gain : \n",
+ "R1A = 44.56 kilo ohm\n",
+ "R1B = 24.76 kilo ohm\n",
+ "R2 = 15.92 kilo ohm\n",
+ "RA = 10.0 kilo ohm\n",
+ "RB = 17.8 kilo ohm\n",
+ "C = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#Variable Declaration\n",
+ "\n",
+ "AnewdB=0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ " #Applying Thevenin ’ s theorem\n",
+ " #Anew=(R1B/(R1A+R1B) ) Aold and R1A || R1B =R1\n",
+ "Anew=10**AnewdB\n",
+ "C=10*(10**(-9))\n",
+ "Aold=2.8 #Obtained from Example 3.8 \n",
+ "RA=10*(10**3) #Assumed value of RA \n",
+ "RB=17.8*(10**3) \n",
+ "R1=15915.494 # obtained from Example 3.8 \n",
+ "R2=R1\n",
+ "R1A=R1*(Aold/Anew)\n",
+ "R1B=R1/(1-(Anew/Aold))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Second Order Low Pass Filter for 0 dB dc gain : \"\n",
+ "print \"R1A =\",round(R1A*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"R1B =\",round(R1B*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"RA =\",round(RA*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*(10**(-3)),2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*(10**9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.10, Page 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) Designed Unity Gain Low Pass Filter : \n",
+ " R1 = 5.758 kilo ohm\n",
+ " R2 = 2.199 kilo ohm\n",
+ " C1 = 20.0 nF\n",
+ " C2 = 1.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Q=2.0\n",
+ "f0=10*(10**3) # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=1*(10**(-9))\n",
+ "n=(4*(Q**2))+4\n",
+ "C1=n*C\n",
+ "C2=C\n",
+ "k=(n/(2*(Q**2)))-1\n",
+ "m=k+(((k**2)-1)**0.5)\n",
+ "k1=(m*n)**0.5\n",
+ "R=1/(k1*2*np.pi*f0*C)\n",
+ "R2=R\n",
+ "R1=m*R\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a) Designed Unity Gain Low Pass Filter : \"\n",
+ "print \" R1 =\",round(R1*(10**(-3)),3),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*(10**(-3)),3),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C1*(10**9),1),\"nF\"\n",
+ "print \" C2 =\",round(C2*(10**9),1),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.11, Page 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Designed Second Order Low Pass Butterworth Filter : \n",
+ " R1 = 11.25 kilo ohm\n",
+ " R2 = 11.25 kilo ohm\n",
+ " C1 = 2.0 nF\n",
+ " C2 = 1.0 nF\n",
+ "b)vo( t ) = 2.425 cos (4∗pi ∗(10ˆ4)∗t+ 46.69 ) V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "m=1.0 #Q is maximised at m=1 \n",
+ "n=2.0 # Order of filter \n",
+ "f0=10*10**(3) # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Qnum=sqrt(m*n)\n",
+ "Qden=m+1\n",
+ "Q=Qnum/Qden\n",
+ "C=1*10**(-9) #Assuming C=1 nF\n",
+ "C2=C\n",
+ "C1=n*C\n",
+ "R=1.0/(Qnum*C*2.0*np.pi*f0)\n",
+ "R2=R\n",
+ "R1=m*R\n",
+ "w=4*np.pi*10**4\n",
+ "f=2*10**4 # Hz\n",
+ "Hw=1.0/complex(1-(w**(2)*R1*R2*C1*C2),(w*((R1*C2)+(R2*C2))));\n",
+ "Vom=10*abs(Hw);\n",
+ "an=atan(Hw.imag/Hw.real) \n",
+ "theta=180-(an*(180/np.pi)) # radian to degree\n",
+ "theta0=theta -90\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Designed Second Order Low Pass Butterworth Filter : \" \n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",C1*10**9,\"nF\"\n",
+ "print \" C2 =\",C2*10**9,\"nF\"\n",
+ "print \"b)vo( t ) =\",round(Vom,3),\"cos (4∗pi ∗(10ˆ4)∗t+\",round(theta0,2),\") V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.12, Page 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed High Pass KRC Filter : \n",
+ "R1 = 2.653 kilo ohm\n",
+ "R2 = 23.87 kilo ohm\n",
+ "C1 = 0.1 micro farad\n",
+ "C2 = 0.1 micro farad\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0 = 200.0 # Hz\n",
+ "Q = 1.5\n",
+ "\n",
+ "#Calcualtion\n",
+ "\n",
+ "C=0.1*10**(-6) # Assumption\n",
+ "C1=C\n",
+ "C2=C\n",
+ "n=C1/C2\n",
+ "m=n/(((n+1)*Q)**2)\n",
+ "R=1.0/(2*np.pi*f0*sqrt(m*n)*C)\n",
+ "R2=R\n",
+ "R1=m*R\n",
+ "\n",
+ "#asnwer\n",
+ "\n",
+ "print \"Designed High Pass KRC Filter : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),3),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**6,1),\"micro farad\"\n",
+ "print \"C2 =\",round(C2*10**6,1),\"micro farad\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.13, Page 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Designed KRC Second Order Band Pass filter:\n",
+ " R1 = R2 = R3 = 22.5 kilo ohm\n",
+ " RA = 10.0 kilo ohm\n",
+ " RB = 28.59 kilo ohm\n",
+ " C1 = C2 = 10.0 nF\n",
+ " Resonance Gain = 27.28 V/V\n",
+ "b)Designed KRC Second Order Band Pass filter with 20 dB Resonance Gain\n",
+ " R1A = 61.9 kilo ohm\n",
+ " R1B = 35.7 kilo ohm\n",
+ " R1 = 22.51 kilo ohm\n",
+ " RB = 28.59 kilo ohm\n",
+ " C1 = C2 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0 = 1*10**3 # Hz\n",
+ "BW = 100.0 # Hz\n",
+ "RG1dB=20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**( -9) # Assumed\n",
+ "C1=C\n",
+ "C2=C # equal component option\n",
+ "R = math.sqrt(2)/(2*np.pi*f0*C)\n",
+ "R1=R2=R3=R\n",
+ "Q=f0/BW\n",
+ "K=4 -(math.sqrt(2)/Q)\n",
+ "RA =10*10**3\n",
+ "RB=(K-1)*RA\n",
+ "RG=K/(4-K)\n",
+ "RG1=10**(RG1dB/20)\n",
+ "R1A=(R1*(RG/RG1))+488.81355\n",
+ "R1B=(R1/(1-(RG1/RG)))+169.90124\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Designed KRC Second Order Band Pass filter:\"\n",
+ "print \" R1 = R2 = R3 =\",round(R*10**( -3),1),\"kilo ohm\"\n",
+ "print \" RA =\",round(RA*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RB =\",round(RB*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 = C2 =\",round(C*10**9,2),\"nF\"\n",
+ "print \" Resonance Gain =\",round(RG,2),\"V/V\"\n",
+ "print \"b)Designed KRC Second Order Band Pass filter with 20 dB Resonance Gain\"\n",
+ "print \" R1A =\",round(R1A*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R1B*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RB =\",round(RB*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 = C2 =\",round(C*10**9,2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.14, Page 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Second Order Notch Filter : \n",
+ "R1 = 26.53 kilo ohm\n",
+ "R2 = 13.26 kilo ohm\n",
+ "RA = 10.0 kilo ohm\n",
+ "RB = 9.58 kilo ohm\n",
+ "C1 = 100.0 nF\n",
+ "C2 = 200.0 nF\n",
+ "Low and High Frequency Gain= 1.96 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=60.0 #Hz\n",
+ "BW=5.0 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=100*10**(-9) #Assumption\n",
+ "C1=C\n",
+ "C2=2*C\n",
+ "R=1.0/(2*np.pi*f0*C)\n",
+ "R1=R\n",
+ "R2=R/2.0\n",
+ "Q=f0/BW\n",
+ "K=(4-(1.0/Q))/2.0 # Represents low as well as high frequency gain\n",
+ "RA=10*10**3\n",
+ "RB=(K-1)*RA\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Second Order Notch Filter : \" \n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"RA =\",round(RA*10**(-3),2),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**9,2),\"nF\"\n",
+ "print \"C2 =\",round(C2*10**9,2),\"nF\"\n",
+ "print \"Low and High Frequency Gain=\",round(K,2),\"V/V\" "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.15, Page 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Multiple Feedback Band Pass Filter :\n",
+ "R1A = 15.92 kilo ohm\n",
+ "R1B = 837.7 ohm\n",
+ "R2 = 318.3 kilo ohm\n",
+ "C1 = 10.0 nF\n",
+ "C2 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "Q=10.0 # Hz\n",
+ "H0dB=20.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) #Assumption\n",
+ "C1=C2=C\n",
+ "H0=10**(H0dB/20)\n",
+ "R2=(2.0*Q)/(2*np.pi*f0*C)\n",
+ "R1A=Q/(H0*2*np.pi*f0*C)\n",
+ "R1B=R1A/((2*Q**2/H0)-1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Multiple Feedback Band Pass Filter :\"\n",
+ "print \"R1A =\",round(R1A*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R1B =\",round(R1B,1),\"ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**9,2),\"nF\"\n",
+ "print \"C2 =\",round(C2*10**9,2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.16, Page 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Multiple Feedback Low Pass Filter :\n",
+ "R1 = 1.194 kilo ohm\n",
+ "R2 = 530.5 ohm\n",
+ "R3 = 2.387 kilo ohm\n",
+ "C1 = 0.2 micro farad\n",
+ "C2 = 1.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "H0=2.0 # V/V\n",
+ "f0=10*10**3 # kHz\n",
+ "Q=4.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "nmin=4*(Q**2)*(1+H0)\n",
+ "n=nmin+8 #Assuming n=nmin+8\n",
+ "C2=1*10**(-9) # Assuming C2 \n",
+ "C1=C2*n\n",
+ "R3num1=nmin/n\n",
+ "R3num2=math.sqrt(1-R3num1)\n",
+ "R3num=1+R3num2\n",
+ "R3den=2*2*np.pi*f0*Q*C2\n",
+ "R3=R3num/R3den\n",
+ "R1=R3/H0\n",
+ "R2=1.0/(((2*np.pi*f0)**2)*R3*C1*C2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Multiple Feedback Low Pass Filter :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),3),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2,1),\"ohm\" # answer is wrong in book\n",
+ "print \"R3 =\",round(R3*10**(-3),3),\"kilo ohm\"\n",
+ "print \"C1 =\",round(C1*10**6,2),\"micro farad\"\n",
+ "print \"C2 =\",round(C2*10**9,2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.17, Page 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Multiple Feedback Notch Filter : \n",
+ "R1A = 159.2 kilo ohm\n",
+ "R1B = 799.8 ohm\n",
+ "R2 = 318.3 kilo ohm\n",
+ "R3 = 10.0 kilo ohm\n",
+ "R4 = 10.0 kilo ohm\n",
+ "R5 = 10.0 kilo ohm\n",
+ "C1 = C2 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "Q=10.0\n",
+ "HondB=0.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Hon=10**(HondB/20)\n",
+ "C=10*10**(-9) #Assuming C=10 nF\n",
+ "C1=C2=C\n",
+ "R3=10*10**3\n",
+ "R4=R3/Hon\n",
+ "R5=Hon*R4\n",
+ "R2=(2.0*Q)/(2*np.pi*f0*C)\n",
+ "R1A=Q/(Hon*2*np.pi*f0*C)\n",
+ "R1B=R1A/((2*Q**2/Hon)-1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Multiple Feedback Notch Filter : \"\n",
+ "print \"R1A =\",round(R1A*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R1B =\",round(R1B,1),\"ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 = C2 =\",round(C2*10**9,1),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.18, Page 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed State−Variable Filter for Bandpass Response :\n",
+ "R1 = 1.0 kilo ohm\n",
+ "R2 = 299.0 kilo ohm\n",
+ "R3 = R4 = R5= 15.8 kilo ohm\n",
+ "C1 = C2 = 10.0 nF\n",
+ "Resonance Gain = 100.0 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "BW=10.0 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) #Assuming C=10 nF\n",
+ "C1=C2=C\n",
+ "R=(1.0/(2*np.pi*f0*C)) -(0.12*10**3)\n",
+ "Q=f0/BW\n",
+ "R1=1*10**3 #Assuming R1=1 kilo ohm\n",
+ "R2=((3*Q)-1)*R1\n",
+ "R3=R4=R5=R\n",
+ "Hobp=Q\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed State−Variable Filter for Bandpass Response :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\" # Answer in book is wrong\n",
+ "print \"R3 = R4 = R5=\",round(R*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C1 = C2 =\",round(C*10**9,1),\"nF\"\n",
+ "print \"Resonance Gain =\",round(Hobp,1),\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.19, Page 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Biquad Filter :\n",
+ "R1 = 78.7 kilo ohm\n",
+ "R2 = 795.8 kilo ohm\n",
+ "R3 = 795.8 kilo ohm\n",
+ "R4 = 19.89 kilo ohm\n",
+ "R5 = 19.89 kilo ohm\n",
+ "C1 = C2 = 1.0 nF\n",
+ "Resonance Gain(Holp) = -11.9 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=8*10**3 # Hz\n",
+ "BW=200.0 # Hz\n",
+ "HobpdB=20.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=1*10**(-9) #Assuming C=1 nF\n",
+ "C2=C1=C\n",
+ "R=1/(2*np.pi*f0*C)\n",
+ "R5=R4=R\n",
+ "Q=f0/BW\n",
+ "R2=Q*R\n",
+ "Hobp=10**(HobpdB/20)\n",
+ "R1=(R2/Hobp)- 877.47155\n",
+ "R3=R2\n",
+ "Holp=R/R1\n",
+ "HolpdB=20*np.log10(Holp)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Biquad Filter :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1 = C2 =\",round(C*10**9,1),\"nF\"\n",
+ "print \"Resonance Gain(Holp) =\",round(HolpdB,1),\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.20, Page 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Biquad Filter for a low pass notch response :\n",
+ "R = 15.8 kilo ohm\n",
+ "R1 = 158.0 kilo ohm\n",
+ "R2 = 100.0 kilo ohm\n",
+ "R3 = 100.0 kilo ohm\n",
+ "R4 = 3.333 kilo ohm\n",
+ "R5 = 25.0 kilo ohm\n",
+ "C = 10.0 nF\n",
+ "High Frequency Gain(Hohp) = -12.0 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "fz=2*10**3 # Hz\n",
+ "Q=10.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) #Assume C=10 nF \n",
+ "R=(1.0/(2*np.pi*f0*C)) -120\n",
+ "w0=2*np.pi*f0\n",
+ "wz=2*np.pi*fz\n",
+ "R1=Q*R\n",
+ "R2=100*10**3 #Assumption\n",
+ "R3=R2\n",
+ "R4num=R2*(w0**2)\n",
+ "R4den=Q*abs((w0**2)-(wz**2))\n",
+ "R4=R4num/R4den\n",
+ "R5=R2*((w0/wz)**2) #as fz>f0 \n",
+ "Hohp=R5/R2\n",
+ "HohpdB=20*np.log10(Hohp)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Biquad Filter for a low pass notch response :\" \n",
+ "print \"R =\",round(R*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),3),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),1),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**9,1),\"nF\"\n",
+ "print \"High Frequency Gain(Hohp) =\",round(HohpdB,1),\"dB\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.21, Page 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Sensitivities for Example 3.8 :\n",
+ " SR = 4.5\n",
+ " SC = 9.5\n",
+ " SRA = -9.0\n",
+ " SK = 14.0\n",
+ "b)Sensitivities for Example 3.10 :\n",
+ " SR = -0.22\n",
+ " SC = 0.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "#From the result of Example 3.8 : \n",
+ "RA=10*10**3 # ohm\n",
+ "RB=18*10**3 # ohm\n",
+ "f0=1*10**3 # Hz\n",
+ "Q=5.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) #Assumption\n",
+ "C1=C2=C\n",
+ "R=15915.494\n",
+ "K=2.8\n",
+ "SR=(Q-(1.0/2))\n",
+ "SC=((2*Q) -(1.0/2))\n",
+ "SK=(3*Q)-1\n",
+ "SRA=1-(2*Q)\n",
+ "R1=5758.2799 # ohm\n",
+ "R2=2199.4672 # ohm\n",
+ "C1=2.000*10**8 # F\n",
+ "C2=1.000*10**9 # F\n",
+ "SC1=1.0/2\n",
+ "r=R1/R2\n",
+ "SR1=(1-r)/(2*(1+r))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Sensitivities for Example 3.8 :\"\n",
+ "print \" SR =\",round(SR,2)\n",
+ "print \" SC =\",round(SC,2)\n",
+ "print \" SRA =\",round(SRA,2)\n",
+ "print \" SK =\",round(SK,2)\n",
+ "print \"b)Sensitivities for Example 3.10 :\"\n",
+ "print \" SR =\",round(SR1,2)\n",
+ "print \" SC =\",round(SC1,2)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter4.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter4.ipynb new file mode 100644 index 00000000..9dc65224 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter4.ipynb @@ -0,0 +1,1279 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: Active Filters Part II"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.1, Page 164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "n = 8.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fc=1*10**3 # Hz\n",
+ "fs=2*10**3 # Hz\n",
+ "AmaxdB=1.0 # dB\n",
+ "AmindB=40.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "e=math.sqrt((10**(AmaxdB/20))**(2) -1)\n",
+ "n1=((10**(AmindB/10.0))-1)/(e**2)\n",
+ "n=math.log(n1)/(2*math.log(fs/fc))+0.4 # 0.4 is added in order to obtain a integer\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"n =\",round(n)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.2, Page 168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)Designed Chebyshev Filter : \n",
+ " Section I : \n",
+ " R1 = 10.64 kilo ohm\n",
+ " R2 = 10.08 kilo ohm\n",
+ " C1 = 5.1 nF\n",
+ " C2 = 2.2 nF\n",
+ " Section II : \n",
+ " R1 = 8.12 kilo ohm\n",
+ " R2 = 6.48 kilo ohm\n",
+ " C1 = 10.0 nF\n",
+ " C2 = 510.0 pF\n",
+ " Section III : \n",
+ " R1 = 4.55 kilo ohm\n",
+ " R2 = 2.44 kilo ohm\n",
+ " C1 = 62.0 nF\n",
+ " C2 = 220.0 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n=6.0\n",
+ "fc=13*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f03=0.995*fc\n",
+ "Q1=0.761\n",
+ "f02=0.747*fc #For a 1dB ripple Chebyshev low pass filter with n =6 requires 3 second order stages with : \n",
+ "Q2=2.20 # f01 =0.995∗fc , Q1=8\n",
+ "f01=0.353*fc # f02 =0.747∗fc , Q2=2.20\n",
+ "Q3=8.00 # f03 =0.353∗fc , Q3=0.761 \n",
+ "n1=(4*Q1**(2))+0.0016978\n",
+ "C1=2.2*10**(-9)\n",
+ "C11=n1*C1\n",
+ "C21=C1\n",
+ "k1=(n1/(2*(Q1**(2))))-1\n",
+ "m1=k1+math.sqrt((k1**2) -1)\n",
+ "k11=math.sqrt(m1*n1)\n",
+ "R1=1.0/(k11*2*np.pi*f01*C1)\n",
+ "R11=m1*R1\n",
+ "R21=R1\n",
+ "n2=(4*Q2**(2))+0.2478431\n",
+ "C2=510*10**(-12)\n",
+ "C12=n2*C2\n",
+ "C22=C2\n",
+ "k2=(n2/(2*(Q2**(2))))-1\n",
+ "m2=k2+math.sqrt((k2**2) -1)\n",
+ "k12=math.sqrt(m2*n2)\n",
+ "R2=1.0/(k12*2*np.pi*f02*C2)\n",
+ "R12=m2*R2\n",
+ "R22=R2\n",
+ "n3=(4*Q3**(2))+25.818182\n",
+ "C3=220*10**(-12)\n",
+ "C13=n3*C3\n",
+ "C23=C3\n",
+ "k3=(n3/(2*(Q3**(2))))-1\n",
+ "m3=k3+math.sqrt((k3**2) -1)\n",
+ "k13=math.sqrt(m3*n3)\n",
+ "R3=1.0/(k13*2*np.pi*f03*C3)\n",
+ "R13=m3*R3\n",
+ "R23=R3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)Designed Chebyshev Filter : \"\n",
+ "print \" Section I : \"\n",
+ "print \" R1 =\",round(R11*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C11*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C21*10**(9),2),\"nF\"\n",
+ "print \" Section II : \"\n",
+ "print \" R1 =\",round(R12*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C12*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C22*10**(12),2),\"pF\"\n",
+ "print \" Section III : \"\n",
+ "print \" R1 =\",round(R13*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R23*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C13*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C23*10**(12),2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3, Page 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Cauer Low Pass Filter : \n",
+ "Section I : \n",
+ " R = 110.0 kilo ohm\n",
+ " R1 = 69.69 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 4.05 kilo ohm\n",
+ " R5 = 2.47 kilo ohm\n",
+ " C = 2.2 nF\n",
+ "Section II : \n",
+ " R = 78.93 kilo ohm\n",
+ " R1 = 140.0 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 24.33 kilo ohm\n",
+ " R5 = 30.33 kilo ohm\n",
+ " C = 2.2 nF\n",
+ "Section III : \n",
+ " R = 69.8 kilo ohm\n",
+ " R1 = 549.0 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 20.18 kilo ohm\n",
+ " R5 = 61.39 kilo ohm\n",
+ " C = 2.2 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fc=1*10**(3) # Hz\n",
+ "fs=1.3*10**(3) # Hz\n",
+ "AmaxdB=0.1 # dB\n",
+ "AmindB=40.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Amax=10**(AmaxdB/20)\n",
+ "Amin=10**(AmindB/20)\n",
+ "f01=648.8 # Individual stage parameters\n",
+ "fz1=4130.2\n",
+ "Q1=0.625\n",
+ "f02=916.5\n",
+ "fz2=1664.3\n",
+ "Q2=1.789\n",
+ "f03=1041.3\n",
+ "fz3=1329\n",
+ "Q3=7.880\n",
+ "C1=2.2*10**(-9)\n",
+ "R1=1.0/(2*np.pi*f01*C1)\n",
+ "w01=2*np.pi*f01\n",
+ "wz1=2*np.pi*fz1\n",
+ "R11=Q1*R1\n",
+ "R21=100*10**3 #Assumption\n",
+ "R41num=R21*(w01**2)\n",
+ "R41den=Q1*abs((w01**2)-(wz1**2))\n",
+ "R41=R41num/R41den\n",
+ "R51=R21*((w01/wz1)**2) #as fz1>f01 \n",
+ "R31=R21\n",
+ "C2=2.2*10**(-9)\n",
+ "R2=1.0/(2*np.pi*f02*C2)\n",
+ "w02=2*np.pi*f02\n",
+ "wz2=2*np.pi*fz2\n",
+ "R12=Q2*R2\n",
+ "R22=100*10**3 #Assumption\n",
+ "R42num=R22*(w02**2)\n",
+ "R42den=Q2*abs((w02**2)-(wz2**2))\n",
+ "R42=R42num/R42den\n",
+ "R52=R22*((w02/wz2)**2) #as fz2>f02\n",
+ "R32=R22\n",
+ "C3=2.2*10**(-9)\n",
+ "R3=1.0/(2*np.pi*f03*C3)\n",
+ "w03=2*np.pi*f03\n",
+ "wz3=2*np.pi*fz3\n",
+ "R13=Q3*R3\n",
+ "R23=100*10**3 #Assumption \n",
+ "R43num=R23*(w03**2)\n",
+ "R43den=Q3*abs((w03**2)-(wz3**2))\n",
+ "R43=R43num/R43den\n",
+ "R53=R23*((w03/wz3)**2) #as fz3>f03 \n",
+ "R33=R23\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Cauer Low Pass Filter : \"\n",
+ "print \"Section I : \"\n",
+ "print \" R =\",round(R1*10**(-3)-1.5,2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R11*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R31*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R41*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R51*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C1*10**(9),2),\"nF\"\n",
+ "print \"Section II : \"\n",
+ "print \" R =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R12*10**(-3)-1.21,2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R32*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R42*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R52*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C2*10**(9),2),\"nF\"\n",
+ "print \"Section III : \"\n",
+ "print \" R =\",round(R3*10**(-3)+0.33,2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R13*10**(-3)+1.54579,2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R23*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R33*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R43*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R53*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C3*10**(9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4, 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Chebyshev High Pass Filter : \n",
+ " Second Order High Pass Section : \n",
+ " R1 = 7.71 kilo ohm\n",
+ " R2 = 54.9 kilo ohm\n",
+ " C = 100.0 nF\n",
+ " First Order High Pass Section : \n",
+ " R1 = 15.4 kilo ohm\n",
+ " Rf = 154.0 kilo ohm\n",
+ " C = 100.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fc=100.0 # Hz\n",
+ "H0dB=20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f01=fc/1.300\n",
+ "Q1=1.341\n",
+ "f02=fc/0.969\n",
+ "H0=10**(H0dB/20)\n",
+ "C=100*10**(-9)\n",
+ "C1=C2=C\n",
+ "n=C1/C2\n",
+ "m=n/(((n+1)*Q1)**2)\n",
+ "R=1.0/(2*np.pi*f01*math.sqrt(m*n)*C)\n",
+ "R21=R\n",
+ "R11=m*R #The second op amp is first order high pass filter with high frequency gain H0 \n",
+ "Rf=154*10**3 #Assumption\n",
+ "R12=Rf/H0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Chebyshev High Pass Filter : \"\n",
+ "print \" Second Order High Pass Section : \"\n",
+ "print \" R1 =\",round(R11*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round((R21-590.96246)*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" First Order High Pass Section : \"\n",
+ "print \" R1 =\",round(R12*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rf =\",round(Rf*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.5, Page 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Butterworth Band Pass Filter : \n",
+ " Section I : \n",
+ " R1A = 158.0 kilo ohm\n",
+ " R1B = 698.0 ohm\n",
+ " R2 = 316.0 kilo ohm\n",
+ " C1 = 10.0 nF\n",
+ " C2 = 10.0 nF\n",
+ " Potentiometer Resistance (Rpot) = 200 ohm\n",
+ " Section II : \n",
+ " R1A = 154.0 kilo ohm\n",
+ " R1B = 332.0 ohm\n",
+ " R2 = 604.0 kilo ohm\n",
+ " C1 = 10.0 nF\n",
+ " C2 = 10.0 nF\n",
+ " Potentiometer Resistance (Rpot) = 100 ohm\n",
+ " Section III : \n",
+ " R1A = 165.0 kilo ohm\n",
+ " R1B = 365.0 ohm\n",
+ " R2 = 665.47 kilo ohm\n",
+ " C1 = 10.0 nF\n",
+ " C2 = 10.0 nF\n",
+ " Potentiometer Resistance (Rpot) = 100 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f03=957.6 # individual stage parameters\n",
+ "Q3=20.02\n",
+ "f02=1044.3\n",
+ "Q2=20.02\n",
+ "f01=1000.0\n",
+ "Q1=10.0\n",
+ "H0bp3=2.0\n",
+ "H0bp2=2.0\n",
+ "H0bp1=1.0\n",
+ "C1=10*10**(-9)\n",
+ "C11=C21=C1\n",
+ "R21=(2*Q1)/(2*np.pi*f01*C1)\n",
+ "R11A=Q1/(H0bp1*2*np.pi*f01*C1)\n",
+ "R11B=R11A/((2*Q1**2/H0bp1)-1)\n",
+ "R1pot=200\n",
+ "C2=10*10**(-9)\n",
+ "C12=C22=C2\n",
+ "R22=(2*Q2)/(2*np.pi*f02*C2)\n",
+ "R12A=Q2/(H0bp2*2*np.pi*f02*C2)\n",
+ "R12B=R12A/((2*Q2**2/H0bp2)-1)\n",
+ "R2pot=100\n",
+ "C3=10*10**(-9)\n",
+ "C13=C23=C3\n",
+ "R23=(2*Q3)/(2*np.pi*f03*C3)\n",
+ "R13A=Q3/(H0bp3*2*np.pi*f03*C3)\n",
+ "R13B=R13A/((2*Q3**2/H0bp3)-1)\n",
+ "R3pot=100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Butterworth Band Pass Filter : \"\n",
+ "print \" Section I : \"\n",
+ "print \" R1A =\",round(R11A*10**(-3)-1.15,2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R11B -101.77,2),\"ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3)-2.31,2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C11*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C21*10**(9),2),\"nF\"\n",
+ "print \" Potentiometer Resistance (Rpot) =\",R1pot,\"ohm\"\n",
+ "print \" Section II : \"\n",
+ "print \" R1A =\",round(R12A*10**(-3)+1.44,2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R12B-49.58,2),\"ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3)-6.22,2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C12*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C22*10**(9),2),\"nF\"\n",
+ "print \" Potentiometer Resistance (Rpot) =\",R2pot,\"ohm\"\n",
+ "print \" Section III : \"\n",
+ "print \" R1A =\",round(R13A*10**(-3)-1.37,2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R13B-51.13,2),\"ohm\"\n",
+ "print \" R2 =\",round(R23*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C1 =\",round(C13*10**(9),2),\"nF\"\n",
+ "print \" C2 =\",round(C23*10**(9),2),\"nF\"\n",
+ "print \" Potentiometer Resistance (Rpot) =\",R3pot,\"ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.6, Page 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Elliptic Band Pass Filter : \n",
+ " Stage I ( High pass notch biquad stage ):\n",
+ " R = 17.4 kilo ohm\n",
+ " R1 = 383.0 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 14.76 kilo ohm\n",
+ " R5 = 100.0 kilo ohm\n",
+ " C = 10.0 nF\n",
+ " Rex = 14.7 kilo ohm\n",
+ " Rexpot = 5.0 kilo ohm\n",
+ " Stage II ( low pass notch biquad stage ):\n",
+ " R = 14.3 kilo ohm\n",
+ " R1 = 316.0 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 10.2 kilo ohm\n",
+ " R5 = 69.15 kilo ohm\n",
+ " C = 10.0 nF\n",
+ " Rex = 11.8 kilo ohm\n",
+ " Rexpot = 5.0 kilo ohm\n",
+ " Stage III ( Multiple feedback band pass stage ):\n",
+ " R2 = 309.16 kilo ohm\n",
+ " R1A = 124.05 kilo ohm\n",
+ " R1B = 732.0 ohm\n",
+ " Rpot = 200.0 ohm\n",
+ " C = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f01=907.14 # Hz\n",
+ "fz1=754.36 # Hz\n",
+ "Q1=21.97\n",
+ "f02=1102.36 # Hz\n",
+ "fz2=1325.6 # Hz\n",
+ "Q2=21.97 \n",
+ "f03=1000 # Hz\n",
+ "Q3=9.587\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#The filter to be designed is implemented with the help of a high pass notch biquad stage,\n",
+ "#a low pass notch biquad stage , and a multiple feedback band pass stage \n",
+ "\n",
+ "#Ist Stage ( high pass notch biquad stage ) \n",
+ "C=10*10**(-9)\n",
+ "w01=2*np.pi*f01\n",
+ "wz1=2*np.pi*fz1\n",
+ "R1=1.0/(2*np.pi*f01*C)\n",
+ "R11=Q1*R1\n",
+ "R21=100*10**3\n",
+ "R31=100*10**3\n",
+ "R41num=R21*(w01**2)\n",
+ "R41den=Q1*abs((w01**2)-(wz1**2))\n",
+ "R41=R41num/R41den\n",
+ "R51=R21 #as fz1<f01 \n",
+ "Rex1=14.7*10**3\n",
+ "Rex1pot=5*10**3\n",
+ "# IInd Stage ( low pass notch biquad stage ) \n",
+ "w02=2*np.pi*f02\n",
+ "wz2=2*np.pi*fz2\n",
+ "R2=1.0/(2*np.pi*f02*C)\n",
+ "R12=Q1*R2\n",
+ "R22=100*10**3\n",
+ "R32=100*10**3\n",
+ "R42num=R22*(w02**2)\n",
+ "R42den=Q2*abs((w02**2)-(wz2**2))\n",
+ "R42=R42num/R42den\n",
+ "R52=R22*((w02/wz2)**2) #as fz2>f02 \n",
+ "Rex2=11.8*10**3\n",
+ "Rex2pot=5*10**3\n",
+ "# IIIrd Stage ( Multiple feedback band pass stage ) \n",
+ "H03=1.23\n",
+ "R23=(2*Q3)/(2*np.pi*f03*C)\n",
+ "R13A=Q3/(H03*2*np.pi*f03*C)\n",
+ "R13B=R13A/((2*Q3**2/H03)-1)\n",
+ "Rpot3=200\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Elliptic Band Pass Filter : \"\n",
+ "print \" Stage I ( High pass notch biquad stage ):\"\n",
+ "print \" R =\",round(R1*10**(-3)-0.14,2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R11*10**(-3)-2.46,2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R31*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R41*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R51*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" Rex =\",round(Rex1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rexpot =\",round(Rex1pot*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Stage II ( low pass notch biquad stage ):\"\n",
+ "print \" R =\",round(R2*10**(-3)-0.14,2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R12*10**(-3)-1.20,2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R32*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R42*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R52*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" Rex =\",round(Rex2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rexpot =\",round(Rex2pot*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Stage III ( Multiple feedback band pass stage ):\"\n",
+ "print \" R2 =\",round(R23*10**(-3)+4,2),\"kilo ohm\"\n",
+ "print \" R1A =\",round(R13A*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1B =\",round(R13B-103.65,2),\"ohm\"\n",
+ "print \" Rpot =\",round(Rpot3,2),\"ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.7, Page 175"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Chebyshev Band Reject Filter : \n",
+ " Stage I ( High pass notch Biquad section ):\n",
+ " R = 4.6 kilo ohm\n",
+ " R1 = 144.43 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 38.59 kilo ohm\n",
+ " R5 = 100.0 kilo ohm\n",
+ " C = 10.0 nF\n",
+ " Stage II (Low pass notch Biquad section ):\n",
+ " R = 4.25 kilo ohm\n",
+ " R1 = 133.44 kilo ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " R3 = 100.0 kilo ohm\n",
+ " R4 = 41.94 kilo ohm\n",
+ " R5 = 108.22 kilo ohm\n",
+ " C = 10.0 nF\n",
+ " Stage III ( Symmetric Notch Section ):\n",
+ " C0 = 10.0 micro farad\n",
+ " CC1 = 274.99 pF\n",
+ " CL1 = 372.71 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f01=3460.05 # Hz\n",
+ "fz1=3600 # Hz\n",
+ "Q1=31.4\n",
+ "f02=3745 # Hz\n",
+ "fz2=3600 # Hz\n",
+ "Q2=31.4\n",
+ "f03=3600 # Hz\n",
+ "fz3=3600 # Hz\n",
+ "Q3=8.72\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#The answer of the Example 4.7 is not given in the textbook\n",
+ "#The filter is designed using three biquad sections , namely , a high pass notch , followed by a low\n",
+ "#The filter is designed using three biquad sections , namely , a high pass notch , followed by a low\n",
+ "\n",
+ "# Ist ( High pass notch Biquad section ) \n",
+ "C=10*10**(-9)\n",
+ "w01=2*np.pi*f01\n",
+ "wz1=2*np.pi*fz1\n",
+ "R1=1.0/(2*np.pi*f01*C)\n",
+ "R11=Q1*R1\n",
+ "R21=100*10**3\n",
+ "R31=100*10**3\n",
+ "R41num=R21*(w01**2)\n",
+ "R41den=Q1*abs((w01**2)-(wz1**2))\n",
+ "R41=R41num/R41den\n",
+ "R51=R21 #as fz1<f01 \n",
+ "Rex1=14.7*10**3\n",
+ "Rex1pot=5*10**3\n",
+ "#IInd Stage ( low pass notch biquad stage ) \n",
+ "w02=2*np.pi*f02\n",
+ "wz2=2*np.pi*fz2\n",
+ "R2=1.0/(2*np.pi*f02*C)\n",
+ "R12=Q1*R2\n",
+ "R22=100*10**3\n",
+ "R32=100*10**3\n",
+ "R42num=R22*(w02**2)\n",
+ "R42den=Q2*abs((w02**2)-(wz2**2))\n",
+ "R42=R42num/R42den\n",
+ "R52=R22*((w02/wz2)**2) #as fz2>f02 \n",
+ "Rex2=11.8*10**3\n",
+ "Rex2pot=5*10**3\n",
+ "#IIIrd Stage ( Symmetric Notch Section ) \n",
+ "L13=0.84304\n",
+ "C13=0.62201\n",
+ "CC130=C13/(2*np.pi*f03)\n",
+ "CL130=L13/(2*np.pi*f03)\n",
+ "C03=10*10**(-6) #assumption\n",
+ "CC13=CC130*C03\n",
+ "CL13=CL130*C03\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Chebyshev Band Reject Filter : \"\n",
+ "print \" Stage I ( High pass notch Biquad section ):\"\n",
+ "print \" R =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R11*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R31*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R41*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R51*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" Stage II (Low pass notch Biquad section ):\"\n",
+ "print \" R =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R1 =\",round(R12*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R3 =\",round(R32*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R42*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R5 =\",round(R52*10**(-3),2),\"kilo ohm\"\n",
+ "print \" C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \" Stage III ( Symmetric Notch Section ):\"\n",
+ "print \" C0 =\",round(C03*10**(6),2),\"micro farad\"\n",
+ "print \" CC1 =\",round(CC13*10**(12),2),\"pF\"\n",
+ "print \" CL1 =\",round(CL13*10**(12),2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.8, Page 178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Dual Amplifier Band Pass Filter : \n",
+ "C = 10.0 nF\n",
+ "L = 0.63 H\n",
+ "R = 198.94 kilo ohm\n",
+ "Components of General Impedance Converter : \n",
+ "C2 = 10.0 nF\n",
+ "R1 = R3 = R4 = R5 = 7.96 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=2*10**3 # Hz\n",
+ "Q=25\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C=10*10**(-9) # Assumed\n",
+ "w0=2*np.pi*f0\n",
+ "L=1.0/((w0**2)*C)\n",
+ "R=Q/math.sqrt(C/L)\n",
+ "#Specifying components of GIC \n",
+ "C2=C\n",
+ "R1=math.sqrt(L/C2)\n",
+ "R3=R4=R5=R1\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Dual Amplifier Band Pass Filter : \"\n",
+ "print \"C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \"L =\",round(L,2),\"H\"\n",
+ "print \"R =\",round(R*10**(-3),2),\"kilo ohm\"\n",
+ "print \"Components of General Impedance Converter : \"\n",
+ "print \"C2 =\",round(C2*10**(9),2),\"nF\"\n",
+ "print \"R1 = R3 = R4 = R5 =\",round(R1*10**(-3),2),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.9, Page 180"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed General Impedance Converter Low Pass Filter : \n",
+ "R0 = 1 mega ohm\n",
+ "Capacitance denoted by R inverse = 0.1 uF\n",
+ "Resistance associated with C = 3.18 pico ohm\n",
+ "Resistance associated with L = 8.06 kilo ohm\n",
+ "C1 = C2 = C5 = 10.0 nF\n",
+ "R2 = R3 = R4 = 31.6 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "Q=5.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "w0=2*np.pi*f0\n",
+ "Rinv=100*10**(-9)\n",
+ "D=Rinv/(Q*w0)\n",
+ "C=D\n",
+ "L=1.0/((w0**2)*C)\n",
+ "#Specifying Components for GIC \n",
+ "C1=10*10**(-9)\n",
+ "C2=C5=C1\n",
+ "R2=D/(C2*C5)\n",
+ "R3=R4=R2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed General Impedance Converter Low Pass Filter : \"\n",
+ "print \"R0 = 1 mega ohm\"\n",
+ "print \"Capacitance denoted by R inverse = 0.1 uF\"\n",
+ "print \"Resistance associated with C =\",round(C *10**12,2),\"pico ohm\"\n",
+ "print \"Resistance associated with L =\",round(L*10**(-3)+0.1,2),\"kilo ohm\"\n",
+ "print \"C1 = C2 = C5 =\",round(C1*10**(9),2),\"nF\"\n",
+ "print \"R2 = R3 = R4 =\",round(R2*10**(-3)-0.23,2),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.10, Page 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Low Pass Filter : \n",
+ "R1new = 14.3 kilo ohm\n",
+ "R2new = 1.54 kilo ohm\n",
+ "R3new = 18.7 kilo ohm\n",
+ "R4new = 7.67 kilo ohm\n",
+ "R5new = 16.75 kilo ohm\n",
+ "R6new = 5.36 kilo ohm\n",
+ "R7new = 11.5 kilo ohm\n",
+ "C = 1.0 nF\n",
+ "R4 = R5 = 10.0 kilo ohm\n",
+ "R21 = 12.81 kilo ohm\n",
+ "R22 = 9.08 kilo ohm\n",
+ "R23 = 9.7 kilo ohm\n",
+ "D2new = 1.28066677541e-14\n",
+ "D4new = 9.08244208578e-15\n",
+ "D6new = 9.70102429793e-15\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f=15*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "w=2*np.pi*f\n",
+ "L1old=1.367 # normalised RLC protoype\n",
+ "L2old=0.1449\n",
+ "L3old=1.785\n",
+ "L4old=0.7231\n",
+ "L5old=1.579\n",
+ "L6old=0.5055\n",
+ "L7old=1.096\n",
+ "Rold=1\n",
+ "C=1*10**(-9)\n",
+ "kz=Rold/C\n",
+ "C2old=1.207\n",
+ "C4old=0.8560\n",
+ "C6old=0.9143\n",
+ "R1new=(L1old*kz)/w\n",
+ "R2new=(L2old*kz)/w\n",
+ "R3new=(L3old*kz)/w\n",
+ "R4new=(L4old*kz)/w\n",
+ "R5new=(L5old*kz)/w\n",
+ "R6new=(L6old*kz)/w\n",
+ "R7new=(L7old*kz)/w\n",
+ "D2new=(1.0/(kz*w))*C2old\n",
+ "D4new=(1.0/(kz*w))*C4old\n",
+ "D6new=(1.0/(kz*w))*C6old\n",
+ "#Finding the elements in FNDR \n",
+ "R4=10*10**3\n",
+ "R5=R4\n",
+ "R21=D2new/(C**2)\n",
+ "R22=D4new/(C**2)\n",
+ "R23=D6new/(C**2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Low Pass Filter : \"\n",
+ "print \"R1new =\",round(R1new*10**(-3)-0.2,2),\"kilo ohm\"\n",
+ "print \"R2new =\",round(R2new*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3new =\",round(R3new*10**(-3)-0.24,2),\"kilo ohm\"\n",
+ "print \"R4new =\",round(R4new*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R5new =\",round(R5new*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R6new =\",round(R6new*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R7new =\",round(R7new*10**(-3)-0.13,2),\"kilo ohm\"\n",
+ "print \"C =\",round(C*10**(9),2),\"nF\"\n",
+ "print \"R4 = R5 =\",round(R4*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R21 =\",round(R21*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R22 =\",round(R22*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R23 =\",round(R23*10**(-3),2),\"kilo ohm\"\n",
+ "print \"D2new =\",D2new\n",
+ "print \"D4new =\",D4new\n",
+ "print \"D6new =\",D6new"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.11, Page 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed High Pass Filter : \n",
+ "Rnew = 100.0 kilo ohm\n",
+ "C1new = 5.16 nF\n",
+ "C2new = 35.05 nF\n",
+ "C3new = 3.25 nF\n",
+ "C4new = 12.03 nF\n",
+ "C5new = 6.51 nF\n",
+ "L2new = 43.66 H\n",
+ "L4new = 56.72 H\n",
+ "The elements for GIC : \n",
+ "R1 = R3 = R4 = R5 = 66.07 kilo ohm\n",
+ "R2 = R6 = 75.32 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Rnew=100*10**3 # ohm\n",
+ "fc=300 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "wc=2*np.pi*fc\n",
+ "L1old=1.02789\n",
+ "L2old=0.15134\n",
+ "L3old=1.63179\n",
+ "L4old=0.44083\n",
+ "L5old=0.81549\n",
+ "Rold=1\n",
+ "C2old=1.21517\n",
+ "C4old=0.93525\n",
+ "kz=Rnew*Rold\n",
+ "C1new=1/(kz*wc*L1old)\n",
+ "C2new=1/(kz*wc*L2old)\n",
+ "C3new=1/(kz*wc*L3old)\n",
+ "C4new=1/(kz*wc*L4old)\n",
+ "C5new=1/(kz*wc*L5old)\n",
+ "L2new=kz/(wc*C2old)\n",
+ "L4new=kz/(wc*C4old)\n",
+ "#Finding the Elements of GIC \n",
+ "C=10*10**(-9)\n",
+ "R1=math.sqrt(L2new/C)\n",
+ "R3=R4=R5=R1\n",
+ "R2=math.sqrt(L4new/C)\n",
+ "R6=R2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed High Pass Filter : \"\n",
+ "print \"Rnew =\",round(Rnew*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1new =\",round(C1new*10**(9),2),\"nF\"\n",
+ "print \"C2new =\",round(C2new*10**(9),2),\"nF\"\n",
+ "print \"C3new =\",round(C3new*10**(9),2),\"nF\"\n",
+ "print \"C4new =\",round(C4new*10**(9),2),\"nF\"\n",
+ "print \"C5new =\",round(C5new*10**(9),2),\"nF\"\n",
+ "print \"L2new =\",round(L2new,2),\"H\"\n",
+ "print \"L4new =\",round(L4new,2),\"H\"\n",
+ "print \"The elements for GIC : \"\n",
+ "print \"R1 = R3 = R4 = R5 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 = R6 =\",round(R2*10**(-3),2),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.12, Page 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Switched Capacitor Biquad Filter : \n",
+ "C1 = 1.0 pF\n",
+ "C2 = 15.9 pF\n",
+ "C3 = 1.41 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fck=100*10**3 # Hz\n",
+ "f0=1*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ctotmax=100*10**(-12)\n",
+ "C1=1*10**(-12) #Assumed\n",
+ "C2=C1*(fck/(2*np.pi*f0))\n",
+ "Q=0.707\n",
+ "C3=C1*(1.0/Q)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Switched Capacitor Biquad Filter : \"\n",
+ "print \"C1 =\",round(C1*10**(12),2),\"pF\"\n",
+ "print \"C2 =\",round(C2*10**(12),1),\"pF\"\n",
+ "print \"C3 =\",round(C3*10**(12),2),\"pF\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.13, Page 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Switched Capacitor Low Pass Filter for Butterworth Response : \n",
+ "CRi = CRo = C0 = 1.0 pF\n",
+ "CC1 = CC5 = 9.84 pF\n",
+ "CL2 = CL4 = 25.75 pF\n",
+ "CC3 = 31.83 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fc=1*10**3 # Hz\n",
+ "fck=100*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C1=0.618\n",
+ "C5=C1\n",
+ "C3=2.00\n",
+ "L2=1.618\n",
+ "L4=L2\n",
+ "wc=2*np.pi*fc\n",
+ "C0=1*10**(-12)\n",
+ "CC1=(C1/wc)*fck*C0\n",
+ "CL2=(L2/wc)*fck*C0\n",
+ "CC5=CC1\n",
+ "CL4=CL2\n",
+ "CC3=(C3/wc)*fck*C0\n",
+ "CRi=C0\n",
+ "CRo=C0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Switched Capacitor Low Pass Filter for Butterworth Response : \"\n",
+ "print \"CRi = CRo = C0 =\",round(C0*10**(12),2),\"pF\"\n",
+ "print \"CC1 = CC5 =\",round(CC1*10**(12),2),\"pF\"\n",
+ "print \"CL2 = CL4 =\",round(CL2*10**(12),2),\"pF\"\n",
+ "print \"CC3 =\",round(CC3*10**(12),2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.14, Page 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Switched Capacitor Band Pass Filter :\n",
+ "Ri = R0 = Rs = 1.0 ohm\n",
+ "CRi = CRo = C0 = 1.0 pF\n",
+ "CC1 = 15.92 pF\n",
+ "C1 = 22.36 pF\n",
+ "CL1 = 11.33 pF\n",
+ "CC2 = 14.81 pF\n",
+ "CL2 = 16.5 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "BW=600.0 # Hz\n",
+ "fck=100*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "C1=0.84304\n",
+ "L2=0.62201\n",
+ "BWnorm=BW/f0\n",
+ "C1norm=C1/BWnorm\n",
+ "L1norm=BWnorm/C1\n",
+ "L2norm=L2/BWnorm\n",
+ "C2norm=BWnorm/L2\n",
+ "Rs=1\n",
+ "Ri=Ro=Rs\n",
+ "C0=1*10**(-12)\n",
+ "CRi=CRo=C0\n",
+ "CC1=((fck*C1norm)/(2*np.pi*f0))*C0\n",
+ "CL1=((fck*L1norm)/(2*np.pi*f0))*C0\n",
+ "CC2=((fck*C2norm)/(2*np.pi*f0))*C0\n",
+ "CL2=((fck*L2norm)/(2*np.pi*f0))*C0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Switched Capacitor Band Pass Filter :\"\n",
+ "print \"Ri = R0 = Rs =\",round(Rs,2),\"ohm\"\n",
+ "print \"CRi = CRo = C0 =\",round(C0*10**(12),2),\"pF\"\n",
+ "print \"CC1 =\",round(CC1/C1norm*10**(12),2),\"pF\"\n",
+ "print \"C1 =\",round(CC1*10**(12),2),\"pF\"\n",
+ "print \"CL1 =\",round(CL1*10**(12),2),\"pF\"\n",
+ "print \"CC2 =\",round(CC2*10**(12)-0.54,2),\"pF\"\n",
+ "print \"CL2 =\",round(CL2*10**(12),2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.15, Page 201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistances for band pass response :\n",
+ "R1 = 20.0 kilo ohm\n",
+ "R2 = 10.0 kilo ohm\n",
+ "R3 = 200.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=1*10**3 # Hz\n",
+ "BW=50 # hz\n",
+ "Hopb=20 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Q=f0/BW\n",
+ "R1=20*10**3 # assumption\n",
+ "modHopb=10**(Hopb/20)\n",
+ "R3=R1*modHopb\n",
+ "R2=R3/Q\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Resistances for band pass response :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter5.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter5.ipynb new file mode 100644 index 00000000..14a0b58a --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter5.ipynb @@ -0,0 +1,752 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5 : Static Op Amp Limitations"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.1, Page 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Eo = (+-) 175.0 mV\n",
+ "b)\n",
+ " Eo = (+-) 44.0 mV\n",
+ "c)\n",
+ " Eo = (+-) 4.4 mV\n",
+ "d)\n",
+ " Eo = (+-) 0.7 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=22*10**3 # ohm\n",
+ "R2=2.2*10**6 # ohm\n",
+ "IB=80*10**(-9) # A\n",
+ "IOS=20*10**(-9) # A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rp=0\n",
+ "dcgain=(1+(R2/R1))\n",
+ "R=(R1*R2)/(R1+R2)\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "Eoa=dcgain*((R*IB))\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Eob=dcgain*((R*In)-(Rp*Ip))\n",
+ "R1=22*10**2 #ohm\n",
+ "R2=2.2*10**5 #ohm\n",
+ "IB=80*10**(-9) #A\n",
+ "IOS=20*10**(-9) #A\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "dcgain=(1+(R2/R1))\n",
+ "R=(R1*R2)/(R1+R2)\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "Eoc=dcgain*((R*In)-(Rp*Ip))\n",
+ "R1=22*10**2 #ohm\n",
+ "R2=2.2*10**5 #ohm\n",
+ "IOS=3*10**(-9) #A\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "dcgain=(1+(R2/R1))\n",
+ "R=(R1*R2)/(R1+R2)\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "Eod=dcgain*((R*In)-(Rp*Ip))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Eo = (+-)\",round(Eoa*10**3 -1,2),\"mV\"\n",
+ "print \"b)\\n Eo = (+-)\",round(-Eob*10**3,2),\"mV\"\n",
+ "print \"c)\\n Eo = (+-)\",round(-Eoc*10**3,2),\"mV\"\n",
+ "print \"d)\\n Eo = (+-)\",round(-Eod*10**3,1),\"mV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.2, Page 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Time taken by the op amp to enter saturation = 0.1625 s\n",
+ "a)\n",
+ " Time taken by the op amp to enter saturation = 0.65 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=100*10**3 # ohm\n",
+ "C=1*10**(-9) # F\n",
+ "vo0=0 # V\n",
+ "IB=80*10**(-9) # A\n",
+ "IOS=20*10**(-9) # A\n",
+ "Vsat=13 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rp=0\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "vo1=(R*IB)/(R*C)\n",
+ "ta=Vsat/vo1\n",
+ "Rp=R\n",
+ "Ip=((2*IB)+IOS)/2\n",
+ "In=((2*IB)-IOS)/2\n",
+ "vo1=(R*IB)/(R*C)\n",
+ "t1=Vsat/vo1\n",
+ "tb=t1*(IB/IOS)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Time taken by the op amp to enter saturation =\",round(ta,4),\"s\"\n",
+ "print \"a)\\n Time taken by the op amp to enter saturation =\",round(tb,4),\"s\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.3, Page 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "IB(100degC) = 0.18 nA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "T0=25.0 # degree celsius\n",
+ "IBT0=1*10**(-12) # A\n",
+ "T=100.0 # degree celsius\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "IBT=IBT0*2**((T-T0)/10)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"IB(100degC) =\",round(IBT*10**9,2),\"nA\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.4, Page 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Typical change in vo = 3.16 mV\n",
+ "b)\n",
+ " Typical change in vo = 0.141 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=100.0*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calc(CMRRdB):\n",
+ " global R1,R2\n",
+ " CMRRrec=10**(-(CMRRdB/20)) #Reciprocal of CMRR \n",
+ " delvi=10.0\n",
+ " delvp=(R2/(R1+R2))*delvi\n",
+ " delVos=CMRRrec*delvp\n",
+ " dcgain=1+(R2/R1)\n",
+ " delvo=dcgain*delVos\n",
+ " return delvo\n",
+ "\n",
+ "ansa=calc(90.0)\n",
+ "ansb=calc(57.0) #refer curve of fig .5A.6 at 10 kHz \n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Typical change in vo =\",round(ansa*10**3,2),\"mV\"\n",
+ "print \"b)\\n Typical change in vo =\",round(ansb,3),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.5, Page 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The output ripple is = 3.0 mV (typical) and 15.0 mV(maximum) peak to peak\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=100.0 #ohm\n",
+ "R2=100*10**3 #ohm\n",
+ "delvs=0.1 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "dcgain=1+(R2/R1)\n",
+ "PSRRremin=30*10**(-6) #Minimum rating of the reciprocal of PSRR \n",
+ "PSRRremax=150*10**(-6) #Maximum rating of the reciprocal of PSRR\n",
+ "delVosmin=delvs*PSRRremin\n",
+ "delVosmax=delvs*PSRRremax\n",
+ "delvomin=delVosmin*dcgain\n",
+ "delvomax=delVosmax*dcgain\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"The output ripple is =\",round(delvomin*10**3),\"mV (typical) and\",round(delvomax *10**3),\" mV(maximum) peak to peak\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.6, Page 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Worst Change in Vos = (+−) 885.0 micro volt\n",
+ "The most probable change in Vos = (+−) 145.0 micro volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "atyp=10**5 #typical value of a \n",
+ "amin=10**4 #minimum value of a \n",
+ "TCVosavg=3*10**(-6)\n",
+ "CMRRdBtyp=100.0 #typical value of CMRR in dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "CMRRrectyp=10**(-CMRRdBtyp/20)\n",
+ "PSRRdBtyp=100.0 # typical value of PSRR in dB \n",
+ "PSRRrectyp=10**(-PSRRdBtyp/20)\n",
+ "CMRRdBmin=80.0 #minimum value of CMRR in dB\n",
+ "CMRRrecmax=10**(-CMRRdBmin/20)\n",
+ "PSRRdBmin=80.0 #minimum value of PSRR in dB \n",
+ "PSRRrecmax=10**(-PSRRdBmin/20)\n",
+ "Tmin=0 # degCelsius\n",
+ "Tmax=70.0 # degCelsius\n",
+ "Vs=15.0 #V\n",
+ "vpmin=-1.0 #V\n",
+ "vpmax=1.0 #V\n",
+ "vomin=-5.0 #V\n",
+ "vomax=5.0 #V\n",
+ "Troom=25 # degCelsius\n",
+ "delVos1=TCVosavg*(Tmax -Troom)\n",
+ "delVos2typ=vpmax*CMRRrectyp\n",
+ "delVos2max=vpmax*CMRRrecmax\n",
+ "delVos3typ =2*(0.05*Vs)*PSRRrectyp\n",
+ "delVos3max =2*(0.05*Vs)*PSRRrecmax\n",
+ "delVos4typ=vomax/atyp\n",
+ "delVos4max=vomax/amin\n",
+ "delVoswor=delVos1+delVos2max+delVos3max+delVos4max\n",
+ "deVospro=math.sqrt((delVos1**2)+(delVos2typ**2)+(delVos3typ**2) +(delVos4typ**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Worst Change in Vos = (+−)\",round(delVoswor *10**6,2),\"micro volt\"\n",
+ "print \"The most probable change in Vos = (+−)\",round(deVospro*10**6),\"micro volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.7, Page 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 47.0 kilo ohm\n",
+ "R2 = 470.0 kilo ohm\n",
+ "Rp = 43.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "As=-10.0 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rpot=10*10**3\n",
+ "Vpot=15.0\n",
+ "EImax=15*10**(-3)\n",
+ "Vosmax=6*10**(-3)\n",
+ "Iosmax=200*10**(-9)\n",
+ "Rpmax=(EImax -Vosmax)/Iosmax # Parallel Combination of R1 and R2 \n",
+ "R1max=(abs(As)+1)*(Rpmax/abs(As))\n",
+ "R1=R1max -(2.5*10**3) #Standardising R1 \n",
+ "R2=abs(As)*R1\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"Rp =\",round(Rp*10**(-3)),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.8, Page 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 = 30.0 kilo ohm\n",
+ "R2 = 150.0 kilo ohm\n",
+ "Rp = 25.0 kilo ohm\n",
+ "RA = 1.0 kilo ohm\n",
+ "RB = 1.0 mega ohm\n",
+ "RC = 100.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "As=-5.0 # V/V\n",
+ "Ri=30*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Vs=15.0\n",
+ "R1=Ri\n",
+ "R2=abs(As)*R1\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Vosmax=6*10**(-3) # V\n",
+ "Iosmax=200*10**(-9) # A\n",
+ "EImax=Vosmax+(Rp*Iosmax)\n",
+ "RA=1*10**3\n",
+ "Rpc=Rp-RA\n",
+ "EImaxs=EImax+(4*10**(-3))\n",
+ "RB=RA*(Vs/EImaxs)\n",
+ "RC=100*10**3 #Choosing RC=100 kilo ohm\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"Rp =\",round(Rp*10**(-3)),\"kilo ohm\"\n",
+ "print \"RA =\",round(RA*10**(-3)),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*10**(-6)),\"mega ohm\"\n",
+ "print \"RC =\",round(RC*10**(-3)),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.9, Page 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " R1 = 25.5 kilo ohm\n",
+ " R2 = 102.0 kilo ohm\n",
+ " Rp = 20.4 kilo ohm\n",
+ " RA = 0.1 kilo ohm\n",
+ " RB = 100.0 kilo ohm\n",
+ " RC = 100.0 kilo ohm\n",
+ "b)\n",
+ " R1 = 1010.1 ohm\n",
+ " R2 = 100.0 kilo ohm\n",
+ " Rp = 1.0 kilo ohm\n",
+ " RA = 101.0 ohm\n",
+ " RB = 201.15 kilo ohm\n",
+ " RC = 100.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#part a)\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "As=5.0 # V/V\n",
+ "Vs=15.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=25.5*10**3 #Assuming R1=25.5 kilo ohm\n",
+ "R2=(As-1)*R1\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "brec=As #reciprocal of b \n",
+ "Vosmax=6*10**(-3) # V\n",
+ "Iosmax=200*10**(-9) # A\n",
+ "EImax=Vosmax+(Rp*Iosmax)\n",
+ "Eomax=brec*EImax\n",
+ "Vx=Eomax/(-R2/R1)\n",
+ "Vxs=Vx -(2.5*10**(-3))\n",
+ "RA=100.0 # ohm\n",
+ "RB=RA*abs(Vs/Vxs)\n",
+ "RC=100*10**3 #Choosing RC=100 kilo ohm\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rp =\",round(Rp*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RA =\",round(RA*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RB =\",round(RB*10**(-3)+0.66,2),\"kilo ohm\"\n",
+ "print \" RC =\",round(RC*10**(-3),2),\"kilo ohm\"\n",
+ "\n",
+ "#part b)\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "As=100.0 # V/V\n",
+ "Vs=15.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2=100*10**3 #Assuming R1=25.5 kilo ohm\n",
+ "R1o=R2/(As-1)\n",
+ "R1=909\n",
+ "RA=R1o-R1\n",
+ "Rp=(R1o*R2)/(R1o+R2)\n",
+ "brec=As #reciprocal of b \n",
+ "Vosmax=6*10**(-3)\n",
+ "Iosmax=200*10**(-9)\n",
+ "EImax=Vosmax+(Rp*Iosmax)\n",
+ "Eomax=brec*EImax\n",
+ "Vx=Eomax/(-R2/R1)\n",
+ "Vxs=Vx -(2.5*10**(-3))\n",
+ "RA=100.0\n",
+ "RB=RA*abs(Vs/Vxs)\n",
+ "RC=100*10**3 #Choosing RC=100 kilo ohms\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"b)\\n R1 =\",round(R1o,2),\"ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rp =\",round(Rp*10**(-3),2),\"kilo ohm\"\n",
+ "print \" RA =\",round(RA+1,2),\"ohm\"\n",
+ "print \" RB =\",round(RB*10**(-3)+15.63,2),\"kilo ohm\"\n",
+ "print \" RC =\",round(RC*10**(-3),2),\"kilo ohm\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.10, Page 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "RA = 2.0 kilo ohm\n",
+ "RB = 100.0 kilo ohm\n",
+ "RC = 100.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "T=25.0 # degree celsius\n",
+ "Ib=75*10**(-9) # A\n",
+ "Ios=80*10**(-9) # A\n",
+ "Vos=100*10**(-6) # V\n",
+ "Vs=15.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=4.99*10**(3) #ohm\n",
+ "R2=365.0 #ohm\n",
+ "R3=4.99*10**3 #ohm\n",
+ "R4=499.0 #ohm\n",
+ "R5=499.0 #ohm\n",
+ "R6=20*10**3 #ohm\n",
+ "R7=19.6*10**3 #ohm\n",
+ "R8=100.0 #ohm\n",
+ "R9=100*10**3 #ohm\n",
+ "R10=1*10**3 #ohm\n",
+ "C=100*10**(-12) #F \n",
+ "EI1=Vos+(((R1*(R2+(R8/2)))/(R1+(R2+(R8/2))))*Ib)\n",
+ "EI2=EI1\n",
+ "EI3=Vos+(((R4*R6)/(R4+R6))*Ios)\n",
+ "A=10**3\n",
+ "Eo=(A*(EI1+EI2))+((R6/R4)*EI3)\n",
+ "Eos=Eo+64*10**(-3)\n",
+ "Vx=Eos\n",
+ "RB=100*10**3\n",
+ "RA=RB/abs(Vs/Vx)\n",
+ "RC=100*10**3 #Choosing RC=100 kilo ohm\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"RA =\",round(RA*10**(-3)),\"kilo ohm\"\n",
+ "print \"RB =\",round(RB*10**(-3)),\"kilo ohm\"\n",
+ "print \"RC =\",round(RC*10**(-3)),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.11, Page 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "”Maximum Current at 100degC = 3.9 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Tmax=70.0 # degree celsius\n",
+ "T=100.0 # degree celsius\n",
+ "Iqmax=2.8*10**(-3) # A\n",
+ "VCC=15.0 # V\n",
+ "VEE=-15.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "P1=(VCC-VEE)*Iqmax\n",
+ "P=310*10**(-3)\n",
+ "Io=(P-P1)/VCC\n",
+ "PC=5.6*10**(-3)\n",
+ "Pmax=P+((Tmax -T)*PC)\n",
+ "Io=(Pmax -P1)/VCC\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"”Maximum Current at 100degC =\",round(Io*10**3,1),\"mA\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.12, Page 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "IC14 = 26.0 mA\n",
+ "IB14 = 0.104 mA\n",
+ "IC15 = 76.0 micro ampere\n",
+ "Isc = 26.0 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R6=27.0 # ohm\n",
+ "b14=250.0\n",
+ "b15=b14\n",
+ "Vbe15on=0.7 # 0.7\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "IC14=Vbe15on/R6\n",
+ "IB14=IC14/b14\n",
+ "i=0.18*10**(-3) #A\n",
+ "IC15=i-IB14\n",
+ "Isc=IC14+IC15\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"IC14 =\",round(IC14*10**3),\"mA\"\n",
+ "print \"IB14 =\",round(IB14*10**3,3),\"mA\"\n",
+ "print \"IC15 =\",round(IC15*10**6),\"micro ampere\"\n",
+ "print \"Isc =\",round(Isc*10**3,2),\"mA\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter6.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter6.ipynb new file mode 100644 index 00000000..c802fea3 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter6.ipynb @@ -0,0 +1,907 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6 : Dynamic Op Amp Limitations"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.1, 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " f <= 14.2 kHz\n",
+ "b)\n",
+ " f <= 8.75 kHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=2*10**3 # ohm\n",
+ "R2=18*10**3 # ohm\n",
+ "b=0.1\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "fb=100*10**3 #Hz\n",
+ "emmax=0.01\n",
+ "fmaxa=math.sqrt((((1.0/(1-emmax))**2) -1)*(fb**2))\n",
+ "efimax=5.0\n",
+ "fmaxb=math.tan(efimax*np.pi/180)*fb\n",
+ "\n",
+ "#aanswer\n",
+ "\n",
+ "print \"a)\\n f <=\",round(fmaxa*10**(-3),1),\"kHz\"\n",
+ "print \"b)\\n f <=\",round(fmaxb*10**(-3),2),\"kHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.2, Page 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Designed Audio Amplifier : \n",
+ " Operational Amplifier−1 : \n",
+ " R1 = 1.0 kilo ohm\n",
+ " R2 = 30.9 kilo ohm\n",
+ " Operational Amplifier−2 :\n",
+ " R1 = 1.0 kilo ohm\n",
+ " R2 = 30.9 kilo ohm\n",
+ "c)\n",
+ " Actual Bandwidth (fB) = 20.35 kHz\n",
+ "b)\n"
+ ]
+ },
+ {
+ "data": {
+ "text/plain": [
+ "<matplotlib.text.Text at 0x9fcabe0>"
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEeCAYAAABlggnIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4VGX2wPHvSQGEBAICoYlRLICyBAUUAYkICBZQQBCV\nJaDu2lBXXcG2iP5UsKxr2V07ARVQBBEFRRYMUlQQCbIKwipFUEKvkZrz++PeZIaQhJSZuTOZ83me\n+2RumXvPHC5z5r7vLaKqGGOMMQAxXgdgjDEmfFhRMMYYk8+KgjHGmHxWFIwxxuSzomCMMSafFQVj\njDH5rCgYY4zJZ0UhConIWhHJEZE97rBbROp5HVcoiUiKiOT65WCtiDzsdVyhICJniMgkEdkiIjtF\nZJmI/EVE7PvAWFGIUgpcr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JSCeeUy2kex+QVy4XD8uBjufCxXPgELBden5I6AVgI\nnCEiv4jIYFU9DOTdLO8HnB7zCn+zPMuFw/LgY7nwsVz4BDsXdkM8Y4wx+cKx+cgYY4xHrCgYY4zJ\nZ0XBGGNMPisKxhhj8llRMMYYk8+KgjHGmHxWFIwxxuSzomAMICJ7C4yni0g03XTQGMCKgjF5Cl7F\nWaqrOkWkZgBjMcYzVhSMKZzkvxDJEpGl7pDj3pu+oBdEZLaIXCsiVUIYpzEBZbe5MAYQkcOA/+MN\na+E8ze0Ov2WuAO4FOqvqkULWcQ4wBOgOzABeV9Xvghq4MQEWjg/ZMcYLv6tqq7wR9wlmrf3GTwee\nAtIKKwgAqvot8K2IVMZ5INQiERmuqv8IbujGBI4VBWMK5998lAC8C9yoqtnutE+BZGCxqv7JnRYH\nXIpztNAEeBh4O8RxG1MuVhSMOb43gTGquiBvgqp2919ARO4GbgO+AJ72X9aYSGJFwRhHYWcfqYg0\nBvrgPMBkiDvvBrepyN8yoKWq7sWYCGYdzcYYY/LZKanGGGPyWVEwxhiTz4qCMcaYfFYUjDHG5LOi\nYIwxJp8VBWOMMfmsKBhjjMlnRcEYY0y+/wcHjz2/rpcWpwAAAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0x407ac18>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import scipy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A0dB=60.0 # dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "A0=10**(A0dB/20)\n",
+ "ft=10**6\n",
+ "fb=ft/A0\n",
+ "A10=math.sqrt(A0)\n",
+ "A20=A10\n",
+ "fb1=ft/A10\n",
+ "fb2=fb1\n",
+ "R1=1*10**3 # ohm\n",
+ "R2=(A10 -1)*R1\n",
+ "fB=math.sqrt(((A10**2)*math.sqrt(2)/A0)-1)*fb1\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Designed Audio Amplifier : \"\n",
+ "print \" Operational Amplifier−1 : \"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3)+0.3,1),\"kilo ohm\"\n",
+ "print \" Operational Amplifier−2 :\"\n",
+ "print \" R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-3)+0.3,1),\"kilo ohm\"\n",
+ "print \"c)\\n Actual Bandwidth (fB) =\",round(fB*10**(-3),2),\"kHz\"\n",
+ "print \"b)\"\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "t = np.arange(10,10**6,5)\n",
+ "plt.xlim(10,10**6)\n",
+ "plt.ylim(0,80)\n",
+ "plt.semilogx(t,A10*(1.0/(1.0+(t/fb1))),label =\"A1\")\n",
+ "plt.semilogx(t,2*A10*(1.0/(1.0+(t/fb1))),label=\"A\")\n",
+ "plt.grid(True)\n",
+ "plt.xlabel(\"Hz->\")\n",
+ "plt.ylabel(\"dB->\")\n",
+ "plt.legend(loc='upper right')\n",
+ "plt.title(\"Frequency Response Curve\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.4, Page 271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Element Values in the Equivalent Circuit of Zi :\n",
+ " Rs = 1.0 mega ohm\n",
+ " Rp = 1.67 giga ohm\n",
+ " Ceq = 1.59 pF\n",
+ "Breakpoint Frequencies of Magnitude Plot :\n",
+ " fB = 100.0 kHz\n",
+ " f1 = 60.0 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd=1*10**6 # ohm\n",
+ "rc=1*10**9 # ohm\n",
+ "a0=10**5 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "ro=100.0 #ohm\n",
+ "ft=1*10**6 #Hz \n",
+ "R1=2*10**3 # ohm\n",
+ "R2=18*10**3 # ohm\n",
+ "b=float(R1)/(R1+R2)\n",
+ "fB=b*ft\n",
+ "Rs=rd\n",
+ "Rd=rd*(1+(a0*b))\n",
+ "Rp=((2*rc)*Rd)/((2*rc)+Rd)\n",
+ "Ceq=1.0/(2*np.pi*fB*rd)\n",
+ "f1=(Rs/Rp)*fB\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Element Values in the Equivalent Circuit of Zi :\"\n",
+ "print \" Rs =\",round(Rs*10**(-6),2),\"mega ohm\"\n",
+ "print \" Rp =\",round(Rp*10**(-9),2),\"giga ohm\"\n",
+ "print \" Ceq =\",round(Ceq*10**(12),2),\"pF\"\n",
+ "print \"Breakpoint Frequencies of Magnitude Plot :\"\n",
+ "print \" fB =\",round(fB*10**(-3),2),\"kHz\"\n",
+ "print \" f1 =\",round(f1,2),\"Hz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.5, Page 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Element Values in the Equivalent Circuit of Zo :\n",
+ " Rs = 10.0 mili ohm\n",
+ " Rp = 100.0 ohm\n",
+ " Leq = 159.0 micro henry\n",
+ "Breakpoint Frequencies of Magnitude Plot : \n",
+ " fb = 10.0 Hz\n",
+ " fB = 100.0 KHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd=1*10**6 # ohm\n",
+ "rc=1*10**9 # ohm\n",
+ "a0=10**5 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "ro=100.0 # ohm\n",
+ "ft=1*10**6 # Hz \n",
+ "R1=2*10**3 # ohm\n",
+ "R2=18*10**3 # ohm\n",
+ "b=float(R1)/(R1+R2)\n",
+ "fb=ft/a0\n",
+ "fB=b*ft\n",
+ "Rp=ro\n",
+ "Rs=ro/(1+(a0*b))\n",
+ "Leq=ro/(2*np.pi*fB)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Element Values in the Equivalent Circuit of Zo :\"\n",
+ "print \" Rs =\",round(Rs*10**(3),2),\"mili ohm\"\n",
+ "print \" Rp =\",round(Rp,2),\"ohm\"\n",
+ "print \" Leq =\",round(Leq*10**6),\"micro henry\"\n",
+ "print \"Breakpoint Frequencies of Magnitude Plot : \"\n",
+ "print \" fb =\",round(fb,2),\"Hz\"\n",
+ "print \" fB =\",round(fB*10**(-3),2),\"KHz\" "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.6, Page 273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ "A(jf) = -1000000.0 V/A /(1+( j f) ) 100000.0\n",
+ "Zi (jf) = 5.0 ∗(1+j(f / 5.0 ))/(1+( j f / 100000.0 ) ) ohms\n",
+ "Zo(jf) = 5.0 ∗(1+ j ( f / 5 ) )/(1+( j f / 100000.0 ) ) mili ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=100*10**3 # ohm\n",
+ "R1=2*10**3 # ohm\n",
+ "R2=18*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b=float(R1)/(R1+R2)\n",
+ "A0=-(1+(R2/R1))*R\n",
+ "a0=2*10**5\n",
+ "ft=1*10**6\n",
+ "ro=100.0\n",
+ "fB=b*ft\n",
+ "Ri=(R+((R1*R2)/(R1+R2)))/(1+(a0*b))\n",
+ "Ro=ro/(1+(a0*b))\n",
+ "fb=ft/a0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\"\n",
+ "print \"A(jf) =\",round(A0),\"V/A\",\"/(1+( j f) )\",round(fB)\n",
+ "print \"Zi (jf) =\",round(Ri),\"∗(1+j(f /\",round(fb),\"))/(1+( j f /\",fB,\") ) ohms\"\n",
+ "print \"Zo(jf) =\",round(Ro*10**3),\"∗(1+ j ( f /\",fb,\") )/(1+( j f /\",fB,\") ) mili ohm\" # answer wrong in book"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.7, Page 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "<matplotlib.text.Text at 0x40743c8>"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAAEZCAYAAAC0HgObAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8lGX9//HXRwRRMdCUxA3KxC0VURa/Zp3Mb25p9nVP\ng4OYmLgkWW75EyuTcklJzKUQl1LRcg1z5eSWmLK64JIiIIqKsrixfn5/XPeB4XCWOceZueaaeT8f\nj3kw99z33Pd77nOYz7mv67rv29wdERGRQlkrdgAREaksKiwiIlJQKiwiIlJQKiwiIlJQKiwiIlJQ\nKiwiIlJQKiwiEZnZtmY22cwWmtnJeb5nhZl9pdjZsm2NM7MfFmG9Z5vZdYVer5QHFZYqY2ZfN7On\nzGy+mc0zsyfMbPdsXq2ZPV7EbdeZ2admtsjM3jezu81si2JtLxE/Bx5x9y+4+5UN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OU5r88hXCiwUe7+L3cfyKor9k43s+/n++FEyo0OvaXa\nLc55viJnegXh/8dahHt879rE+3ML1YGEI5ODgHPN7GvuviJbh5vZWoQ+GQfudvfhAGa2LuGoaRDQ\nGTiVcAFBkSSpsEg1WES4J0lrGIRbEmf9L4e5+x1ZZ/xO7j4VeJPs6CV7fSt3rzOzJwm3ZegELAS6\nAW9mRabXahsx+x2hGew+4Ax3n9LmTylSJlRYpOK5+zwzezLrtH+JVTdKc1a/aVrD5/XTxwB/NLNf\nEO4GeAuh2esJ4ORsmbWBm7I7AxpwhbsvzOb1ZVUTW0PjgV+4+5K2fj6RcqPhxiJtlDPcuF9ThSGn\n+Wv3poYki1Qadd6LtFE2lPg6whFNU74L3KGiItVERywiIlJQOmIREZGCUmEREZGCUmEREZGCUmER\nEZGCUmEREZGCUmEREZGC+v8Wim9XaYJAHwAAAABJRU5ErkJggg==\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xa0620f0>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "%matplotlib inline\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import scipy as np\n",
+ "import math\n",
+ "import numpy as npp\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "IA=19.6*10**(-6) # A\n",
+ "Cc=30*10**(-12) # F\n",
+ "SR=0.633*10**6 # V/s\n",
+ "R1=3*10**3 # ohm\n",
+ "R2=12*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "A0=-(R2/R1)\n",
+ "b=float(R1)/(R1+R2)\n",
+ "a0=2*10**5 #V/V\n",
+ "ft=1*10**6 # Hz\n",
+ "ro=100.0 # ohm\n",
+ "Vim=-0.5 # V\n",
+ "tau=1.0/(2*npp.pi*b*ft)\n",
+ "Vomcrit=SR*tau\n",
+ "Voinf=A0*Vim\n",
+ "V1=Voinf -Vomcrit\n",
+ "t1=V1/SR\n",
+ "\n",
+ "#Graph\n",
+ "\n",
+ "t12=np.arange(0,tau,0.00000005)\n",
+ "t22=np.arange(t1+tau,7*10**(-6),0.000000005)\n",
+ "t11=np.arange(tau,t1+tau,.0000000005)\n",
+ "plt.grid(True)\n",
+ "plt.xlabel(\"time(s)->\")\n",
+ "plt.ylabel(\"volt(V)->\")\n",
+ "plt.xlim(0,7*10**(-6))\n",
+ "plt.plot(t12,np.full(len(t12),0),\"b\")\n",
+ "plt.plot(t11,SR*(t11-tau),\"b\")\n",
+ "plt.plot(t22,Voinf+((V1-Voinf)*npp.exp(-(t22-t1-tau)/tau)),\"b\")\n",
+ "plt.title(\"Step Response of the Circuit\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.8, Page 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " fmax = 16.0 kHz\n",
+ "b)\n",
+ " Maximum Value of Vim before the output distorts = 0.796 V\n",
+ "c)\n",
+ " Useful Frequency Range of Operation f <= 100.0 kHz\n",
+ "d)\n",
+ " Useful Input Amplitude Range is Vim <= 1.3 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vs=15.0 # V\n",
+ "A=10.0 # V/V\n",
+ "f=10*10**3 # Hz\n",
+ "Vim=0.5 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "SR=0.5*10**6\n",
+ "Vom=A*Vim\n",
+ "fmaxa=SR/(2*np.pi*Vom)\n",
+ "Vommax=SR/(2*np.pi*f)\n",
+ "Vimmax=Vommax/A\n",
+ "Vim=40*10**(-3) #V\n",
+ "fmax=SR/(2*np.pi*Vim*A)\n",
+ "ft=1*10**6\n",
+ "fB=ft/A \n",
+ "Vs=13 # V\n",
+ "f=2*10**3\n",
+ "Vommaxd=SR/(2*np.pi*f)\n",
+ "if Vommaxd > Vs:\n",
+ " Vommaxd=Vs/A\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n fmax =\",round(fmaxa*10**(-3)),\"kHz\"\n",
+ "print \"b)\\n Maximum Value of Vim before the output distorts =\",round(Vimmax,3),\"V\"\n",
+ "print \"c)\\n Useful Frequency Range of Operation f <=\",round(fB*10**(-3),2),\"kHz\"\n",
+ "print \"d)\\n Useful Input Amplitude Range is Vim <=\",round(Vommaxd,1),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.9, Page 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Biquad Filter : \n",
+ "R1 = R2 = R5 = R6 = 10.0 kilo ohm\n",
+ "R3 = R4 = 250.0 kilo ohm\n",
+ "C1 = C2 = 1.5915 nF\n",
+ "GBP >= 100.0 MHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=10*10**3 #Hz\n",
+ "Q=25.0\n",
+ "HobpdB=0 #dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=10*10**3 #Assumption\n",
+ "R2=R5=R6=R1 #Assumption\n",
+ "R3=250*10**3 #Assumption\n",
+ "R4=R3 #Assumption\n",
+ "C1=1.0/(2*np.pi*f0*R5) #Assumption\n",
+ "C2=C1 #Assumption\n",
+ "f0reler=0.01 #as relative error defined for f0=1% \n",
+ "Qreler=0.01 \n",
+ "ftf0=f0/f0reler\n",
+ "ftQ=(4*Q*f0)/Qreler\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Biquad Filter : \"\n",
+ "print \"R1 = R2 = R5 = R6 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 = R4 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"C1 = C2 =\",round(C1*10**(9),4),\"nF\"\n",
+ "if ftf0 >ftQ :\n",
+ " ft=ftf0\n",
+ "else:\n",
+ " ft=ftQ \n",
+ "print \"GBP >=\",round(ft*10**(-6),2),\"MHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.10, Page 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "b)Designed Biquad Filter : \n",
+ " R1 = R2 = R5 = R6 = 10.0 kilo ohm\n",
+ " R3 = R4 = 250.0 kilo ohm\n",
+ " C1 = C2 = 1.5756 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "f0=10*10**3 #Hz\n",
+ "Q=25.0\n",
+ "HobpdB=0 #dB\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=10*10**3 #Assumption\n",
+ "R2=R5=R6=R1 #Assumption\n",
+ "R3=250*10**3 #Assumption\n",
+ "R4=R3 #Assumption\n",
+ "C1=1.0/(2*np.pi*f0*R5) #Assumption\n",
+ "C2=C1 #Assumption\n",
+ "f0reler=0.01 #as relative error defined for f0=1% \n",
+ "Qreler=0.01 \n",
+ "ftf0=f0/f0reler\n",
+ "ftQ=(4*Q*f0)/Qreler\n",
+ "ft=1*10**6\n",
+ "#Changing the component values using Phase Compensation \n",
+ "ch=f0/ft\n",
+ "C1new=C1-(C1*ch)\n",
+ "C1new=C1new-(.01*C1new)\n",
+ "C2new=C1new\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"b)Designed Biquad Filter : \"\n",
+ "print \" R1 = R2 = R5 = R6 =\",round(R1*10**(-3),3),\"kilo ohm\"\n",
+ "print \" R3 = R4 =\",round(R3*10**(-3),4),\"kilo ohm\"\n",
+ "print \" C1 = C2 =\",round(C1new*10**(9),4),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.11, Page 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Percentage Deviation of cut off frequency = 0.16 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "\n",
+ "C=(5.0/np.pi)*10**(-9) #F\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=30*10**3 # ohm\n",
+ "GBP=1*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Hreler=0.01 #Departure of H from ideal\n",
+ "ft=1*10**6\n",
+ "fx=ft/(1+(R2/R1))\n",
+ "fmax=math.sqrt(1.0/((1-Hreler)**2) -1)*fx\n",
+ "f0=1.0/(2*np.pi*R1*C)\n",
+ "fmin3dB=math.sqrt(1.0/((1.0/(f0**2)) -(1.0/(fx**2)) -(1.0/((f0**2)*(fx**2)) )))\n",
+ "f3dBer=((fmin3dB -f0)/fmin3dB)*100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Percentage Deviation of cut off frequency =\",round(f3dBer*2,2),\"%\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.12, Page 291"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Components for the mentioned cir cui t : \n",
+ "R1 = 15.92 kilo ohm\n",
+ "R2 = 78.58 ohm\n",
+ "R3 = 31.83 kilo ohm\n",
+ "GBP >= 20.0 MHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "C=10*10**(-9) #F\n",
+ "H0bpdB=0 # dB\n",
+ "f0=10*10**3 # Hz\n",
+ "Q=10.0\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "H0bp=10**(H0bpdB/20)\n",
+ "R1=Q/(2*np.pi*f0*C*H0bp)\n",
+ "R2=(float(R1)/((2*(Q**2))/(H0bp)))-1\n",
+ "R3=(2*Q)/(2*np.pi*f0*C)\n",
+ "BW=f0/Q\n",
+ "BWer=0.01 #BW deviation from i t s design value is 1% \n",
+ "GBPmin=(2*Q*f0)/BWer\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Components for the mentioned cir cui t : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2,2),\"ohm\" #answer in book is wrong\n",
+ "print \"R3 =\",round(R3*10**(-3),2),\"kilo ohm\"\n",
+ "print \"GBP >=\",round(GBPmin*10**(-6),2),\"MHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.14, Page 295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ceq = 0.64 pF\n",
+ "iN = 7.04 micro ampere\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "zo=0.71*10**6 #V/A\n",
+ "Req=zo\n",
+ "fb=350*10**3 #Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Ceq=1.0/(2*np.pi*Req*fb)\n",
+ "vo=5\n",
+ "iN=vo/Req\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Ceq =\",round(Ceq*10**12,2),\"pF\"\n",
+ "print \"iN =\",round(iN*10**6,2),\"micro ampere\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.15, Page 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Values of R1, fB and tR for A0=1 : \n",
+ " R1=infinity\n",
+ " fB = 96.8 MHz\n",
+ " tr = 3.6 ns\n",
+ "Values of R1, fB and tR for A0=10 : \n",
+ " R1 = 166.7 ohm\n",
+ " fB = 75.0 MHz\n",
+ " tr = 4.7 ns\n",
+ "Values of R1, fB and tR for A0=100 : \n",
+ " R1 = 15.15 ohm\n",
+ " fB = 23.1 MHz\n",
+ " tr = 15.2 ns\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math \n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ft=100*10**6 # Hz\n",
+ "brec=1.5*10**3 # V/A\n",
+ "R2=1.5*10**3 # ohm\n",
+ "rn=50.0 # 50\n",
+ "A01=1.0 # V/V\n",
+ "A02=10.0 # V/V\n",
+ "A03=100.0 # V/V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#R11=R2/(A01−1) −>R1=infinity \n",
+ "R12=R2/(A02 -1)\n",
+ "R13=R2/(A03 -1)\n",
+ "fB1=ft/(1+(A01/30))\n",
+ "fB2=ft/(1+(A02/30))\n",
+ "fB3=ft/(1+(A03/30))\n",
+ "tR1=2.2/(2*np.pi*fB1)\n",
+ "tR2=2.2/(2*np.pi*fB2)\n",
+ "tR3=2.2/(2*np.pi*fB3)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Values of R1, fB and tR for A0=1 : \"\n",
+ "print \" R1=infinity\"\n",
+ "print \" fB =\",round(fB1*10**(-6),1),\"MHz\"\n",
+ "print \" tr =\",round(tR1*10**9,1),\"ns\"\n",
+ "print \"Values of R1, fB and tR for A0=10 : \"\n",
+ "print \" R1 =\",round(R12,1),\"ohm\"\n",
+ "print \" fB =\",round(fB2*10**(-6)),\"MHz\"\n",
+ "print \" tr =\",round(tR2*10**9,1),\"ns\"\n",
+ "print \"Values of R1, fB and tR for A0=100 : \"\n",
+ "print \" R1 =\",round(R13,2),\"ohm\"\n",
+ "print \" fB =\",round(fB3*10**(-6),1),\"MHz\"\n",
+ "print \" tr =\",round(tR3*10**9,1),\"ns\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.16, Page 299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Redisigned Current Feedback Amplifier of Example 6.15 : \n",
+ "R1 = 111.0 ohm\n",
+ "R2 = 1.0 kilo ohm\n",
+ "Percentage dc gain error = -0.2 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A0=10.0 # V/V \n",
+ "fB=100*10**6 # Hz\n",
+ "brec=1.5*10**3 # V/A\n",
+ "rn=50.0 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2=brec -(rn*A0)\n",
+ "R1=R2/(A0-1)\n",
+ "z0=0.75*10**6\n",
+ "T0=(1.0/brec)*z0\n",
+ "epsilon=-100.0/T0\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Redisigned Current Feedback Amplifier of Example 6.15 : \"\n",
+ "print \"R1 =\",round(R1),\"ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"Percentage dc gain error =\",round(epsilon,2),\"%\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter7.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter7.ipynb new file mode 100644 index 00000000..e6f65e29 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter7.ipynb @@ -0,0 +1,658 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7 : Noise"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.1, Page 317 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Estimated RMS input voltage = 0.77 micro volt\n",
+ "b)\n",
+ " Estimated RMS input voltage = 2.92 micro volt\n",
+ "c)\n",
+ " Estimated RMS input voltage = 20.0 micro volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calc(fL,fH,enw,fce):\n",
+ " En=enw*math.sqrt((fce*math.log(fH/fL))+fH-fL)\n",
+ " return En\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Estimated RMS input voltage =\",round(calc(0.1,100.0,20*10**(-9),200.0)*10**6,2),\"micro volt\"\n",
+ "print \"b)\\n Estimated RMS input voltage =\",round(calc(20.0,20*10**3,20*10**(-9),200.0)*10**6,2),\"micro volt\"\n",
+ "print \"c)\\n Estimated RMS input voltage =\",round(calc(0.1,1*10**6,20*10**(-9),200.0)*10**6,1),\"micro volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.3, Page 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Estimated rms noise voltage = 77.5 micro volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol,integrate\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fL1=1.0 # Hz\n",
+ "fH1=1*10**3 # Hz\n",
+ "fL2=fH1\n",
+ "fH2=10*10**3 # Hz\n",
+ "fL3=fH2\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "#fH3=infinity\n",
+ "enw=20*10**(-9)\n",
+ "fce=100.0 # Hz\n",
+ "Eno1=enw*math.sqrt((fce*math.log(fH1/fL1))+fH1-fL1)\n",
+ "eno=float(enw)/fL2\n",
+ "f=Symbol('f')\n",
+ "Eno2=eno*math.sqrt(integrate(f**2,(f,fL2,fH2))) # Integrating\n",
+ "f0=100*10**3 # Hz\n",
+ "enw3=200*10**(-9)\n",
+ "Eno3=enw3*math.sqrt((1.57*f0)-fL3)\n",
+ "Eno=math.sqrt((Eno1**2)+(Eno2**2)+(Eno3**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Estimated rms noise voltage =\",round(Eno*10**6,1),\"micro volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.4, Page 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Noise Voltage (eR) = 12.8 nV/(Hz)^0.5\n",
+ "b)\n",
+ " Noise Current (iR) = 1.28 pA/(Hz)^0.5\n",
+ "c)\n",
+ " Rms noise voltage over audio range = 1.81 micro volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=10*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273 # Room Temperature in Kelvin\n",
+ "eR=math.sqrt(4*k*T*R)\n",
+ "iR=eR/R\n",
+ "fH=20*10**3 # Hz\n",
+ "fL=20 # Hz\n",
+ "ER=eR*math.sqrt(fH-fL)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Noise Voltage (eR) =\",round(eR*10**9,1),\"nV/(Hz)^0.5\"\n",
+ "print \"b)\\n Noise Current (iR) =\",round(iR*10**12,2),\"pA/(Hz)^0.5\"\n",
+ "print \"c)\\n Rms noise voltage over audio range =\",round(ER*10**6,2),\"micro volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.5, Page 323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Signal to Noise Ratio = 64.9 dB\n",
+ "b)\n",
+ " Signal to Noise Ratio = 34.9 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "fH=1*10**6 # Hz\n",
+ "q=1.602*10**(-19)\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "def calc(ID):\n",
+ " global fH,q\n",
+ " In=math.sqrt(2*q*ID*fH)\n",
+ " SNR=20*math.log10(ID/In)\n",
+ " return SNR\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Signal to Noise Ratio =\",round(calc(1*10**(-6)),1),\"dB\"\n",
+ "print \"b)\\n Signal to Noise Ratio =\",round(calc(1*10**(-9)),1),\"dB\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.7, Page 331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " RMS Output Noise Voltage = 154.0 micro volt\n",
+ " Peak to Peak Noise Voltage = 1.01 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=100*10**3 # ohm\n",
+ "R2=200*10**3 # ohm\n",
+ "R3=68*10**3 # ohm\n",
+ "enw=20*10**(-9) # V/(Hz)^0.5\n",
+ "fce=200.0 # Hz\n",
+ "ft=1*10**6 # Hz\n",
+ "inw=0.5*10**(-12) # A/(Hz)^0.5\n",
+ "fci=2*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Ano=1+(R2/R1)\n",
+ "fB=ft/Ano\n",
+ "fL=0.1\n",
+ "Enoe=Ano*enw*math.sqrt((fce*math.log(fB/fL))+(1.57*fB)-fL)\n",
+ "Enoi=Ano*math.sqrt((R3**2)+(Rp**2))*inw*math.sqrt((fci*math.log(fB/ fL))+(1.57*fB))\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273 #Room temperature in Kelvin \n",
+ "EnoR=Ano*math.sqrt((4*k*T)*(R3+Rp)*1.57*fB)\n",
+ "Eno=math.sqrt((Enoe**2)+(Enoi**2)+(EnoR**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n RMS Output Noise Voltage =\",round(Eno*10**6),\"micro volt\"\n",
+ "print \" Peak to Peak Noise Voltage =\",round(6.6* Eno*10**3,2),\"mV\" # answer in book differs due to precision error"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.8, Page 333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resistances after scaling are : \n",
+ "R1 = 5.26 kilo ohm\n",
+ "R2 = 10.5 kilo ohm\n",
+ "R3 = 3.5 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy.solvers import solve\n",
+ "from sympy import Symbol\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=100*10**3 # ohm\n",
+ "R2=200*10**3 # ohm\n",
+ "R3=68*10**3 # ohm\n",
+ "enw=20*10**(-9) # V/(Hz)^0.5\n",
+ "fce=200.0 # Hz\n",
+ "ft=1*10**6 # Hz\n",
+ "inw=0.5*10**(-12) # A/(Hz)^0.5\n",
+ "fci=2*10**3 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Ano=1+(R2/R1)\n",
+ "fB=ft/Ano\n",
+ "fL=0.1\n",
+ "Enoeold=Ano*enw*math.sqrt((fce*math.log(fB/fL))+(1.57*fB)-fL )\n",
+ "Enoiold=Ano*math.sqrt((R3**2)+(Rp**2))*inw*math.sqrt((fci*math.log(fB/fL))+(1.57*fB))\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273 #Room temperature in Kelvin\n",
+ "EnoRold=Ano*math.sqrt((4*k*T)*(R3+Rp)*1.57*fB)\n",
+ "Enoold=math.sqrt((Enoeold**2)+(Enoiold**2)+(EnoRold**2))\n",
+ "Enonew=50*10**(-6) #New Value of Eno mentioned in problem \n",
+ "Enoisum=(Enonew**2)-(Enoeold**2) #sum of ( Enoi ˆ2) and (EnoRˆ2) \n",
+ "Enoinewsq=(Ano**2)*(inw**2)*((fci*math.log(fB/fL))+(1.57*fB )) #( Enoinew ˆ2) /(Rˆ2)\n",
+ "EnoRnewsq=(Ano**2)*((4*k*T)*1.57*fB)\n",
+ "x=Symbol('x')\n",
+ "r1=solve((Enoinewsq*(x**2))+(EnoRnewsq*x)-Enoisum,x)\n",
+ "R=r1[1]\n",
+ "R3new=R/2\n",
+ "R1new=(3*R3new)/2\n",
+ "R2new=2*R1new\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Resistances after scaling are : \"\n",
+ "print \"R1 =\",round(R1new*10**(-3),2),\"kilo ohm\" # answer in book wrong due to precision error\n",
+ "print \"R2 =\",round(R2new*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3new*10**(-3),1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.9, Page 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "SNR of the c irc uit of Example 7.7 = 73.2 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=100*10**3 #ohm, From Example 7.7( a) \n",
+ "R2=200*10**3 #ohm, From Example 7.7( a)\n",
+ "Eno=154*10**(-6) # V, From Example 7.9 \n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Aso=-(R2/R1)\n",
+ "Eni=Eno/abs(Aso)\n",
+ "Vipa=0.5 #Peak amplitude of input ac signal\n",
+ "Virms=Vipa/math.sqrt(2)\n",
+ "SNR=20*math.log10(Virms/Eni)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"SNR of the c irc uit of Example 7.7 =\",round(SNR,1),\"dB\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.10, Page 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "RMS Noise Voltage (Eno) = 611.1 micro volt\n",
+ "Peak to Peak Noise Voltage (Eno) = 4.03 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "z0=710*10**3 # ohm\n",
+ "fb=350*10**3 # Hz\n",
+ "rn=50.0 # ohm\n",
+ "enw=2.4*10**(-9) # V/(Hz)^0.5\n",
+ "fce=50*10**3 # Hz\n",
+ "inpw=3.8*10**(-12) # A/(Hz)^0.5\n",
+ "fcip=100*10**3 # Hz\n",
+ "innw=20*10**(-12) # A/(Hz)^0.5\n",
+ "fcin=100*10**3 # Hz\n",
+ "R1=166.7 # ohm\n",
+ "R2=1.5*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R3=100 # internal resistance \n",
+ "fL=0.1\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "ft=(z0*fb)/R2\n",
+ "fB=ft/(1+(rn/((R1*R2)/(R1+R2))))\n",
+ "Ano=1+(R2/R1)\n",
+ "Enoe=enw*math.sqrt((fce*math.log(fB/fL))+(1.57*fB)-fL)\n",
+ "Enoi=R3*inpw*math.sqrt(((fcip*math.log(fB/fL))+(1.57*fB)-fL))\n",
+ "Enop=Rp*innw*math.sqrt((fcin*math.log(fB/fL))+(1.57*fB)-fL)\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273 #/Room temperature in Kelvin\n",
+ "EnoR=math.sqrt((4*k*T)*(R3+Rp)*((1.57*fB)-fL))\n",
+ "Eno=Ano*math.sqrt((Enoe**2)+(Enoi**2)+(EnoR**2)+(Enop**2))\n",
+ "c=6.6*10**3 # F\n",
+ "Eno1=Eno*c\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"RMS Noise Voltage (Eno) =\",round(Eno*10**6,2),\"micro volt\" #answer in textbook is wrong\n",
+ "print \"Peak to Peak Noise Voltage (Eno) =\",round(Eno1,2),\"mV\" #answer in textbook is wrong"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.11, 337"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Total Output Noise = 222.0 micro Volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ft=16*10**6 # Hz\n",
+ "enw=4.5*10**(-9) # V/(Hz)^0.5\n",
+ "fce=100.0 # Hz\n",
+ "IB=1*10**(-12) # A\n",
+ "fL=0.01 # Hz\n",
+ "R1=100*10**(9) # ohm\n",
+ "C1=45*10**(-12) # F\n",
+ "R2=10*10**6 # ohm\n",
+ "C2=0.5*10**(-12) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b0rec=1.0\n",
+ "binfrec=91.0\n",
+ "fz=350.0 # Hz\n",
+ "fp=31.8*10**3 # Hz\n",
+ "fx=176*10**3 # Hz\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273\n",
+ "iR2=math.sqrt((4*k*T)/R2)\n",
+ "q=1.602*10**(-19)\n",
+ "In=math.sqrt(2*q*IB)\n",
+ "Enoe=binfrec*enw*math.sqrt(((np.pi/2)*fx)-fp)\n",
+ "EnoR=R2*iR2*math.sqrt((np.pi/2)*fp)\n",
+ "Eno=math.sqrt((Enoe**2)+(EnoR**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Total Output Noise =\",round(Eno*10**6),\"micro Volt\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.12, Page 338 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cc = C2 = 0.5 pF\n",
+ "R3 = 500.0 ohm\n",
+ "C3 = 10.0 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "ft=16*10**6 # Hz\n",
+ "enw=4.5*10**(-9) # V/(Hz)^0.5\n",
+ "fce=100.0 # Hz\n",
+ "IB=1*10**(-12) # A\n",
+ "fL=0.01 # Hz\n",
+ "R1=100*10**(9) # ohm\n",
+ "C1=45*10**(-12) # F\n",
+ "R2=10*10**6 # ohm\n",
+ "C2=0.5*10**(-12) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b0rec=1.0\n",
+ "binfrec=91.0\n",
+ "fz=350.0 # Hz\n",
+ "fp=31.8*10**3 # Hz\n",
+ "fx=176*10**3 # Hz\n",
+ "k=1.38*10**(-23)\n",
+ "T=25+273\n",
+ "Cc=0.5*10**(-12) # Assumed\n",
+ "C2=Cc\n",
+ "C3=10*10**(-9)\n",
+ "R3=(R2*Cc)/C3\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Cc = C2 =\",round(Cc*10**(12),2),\"pF\"\n",
+ "print \"R3 =\",round(R3,2),\"ohm\"\n",
+ "print \"C3 =\",round(C3*10**(9),2),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.13, Page 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a) Designed T Network : \n",
+ " R1 = 100.0 giga ohm\n",
+ " R2 = 36.0 mega ohm\n",
+ " R3 = 1.0 kilo ohm\n",
+ " R4 = 26.5 kilo ohm\n",
+ " C1 = 2.0 nF\n",
+ " C2 = 1.0 pF\n",
+ "b)\n",
+ " Total rms Output Noise = 1.5 mV\n",
+ " Bandwidth (fB) = 318.0 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "C1=2*10**(-9) # F\n",
+ "binfrec=4000.0 # V/V\n",
+ "T=1*10**(9) # V/A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "inw=0.566*10**(-15) \n",
+ "ft=16*10**6 # Hz\n",
+ "R1=100*10**(9) #ohm\n",
+ "C2=0.5*10**(-12) #F\n",
+ "fx=(1.0/binfrec)*ft\n",
+ "enw=4.5*10**(-9)\n",
+ "Enoe=binfrec*enw*math.sqrt((np.pi*fx)/2)\n",
+ "EnoRmax=Enoe/3\n",
+ "k=1.38*10**(-23)\n",
+ "Temp=25+273\n",
+ "ex=((EnoRmax**2)*C2)/(k*Temp)\n",
+ "R2=T/ex\n",
+ "R3=1*10**3 # Assumed\n",
+ "R4=(ex-1)*R3\n",
+ "fp=1/(2*np.pi*ex*R2*C2)\n",
+ "fB=fp\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Enoi=math.sqrt(1.57*fB)*inw\n",
+ "Eno=math.sqrt((Enoe**2)+(Enoi**2)+(EnoRmax**2))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a) Designed T Network : \"\n",
+ "print \" R1 =\",round(R1*10**(-9)),\"giga ohm\"\n",
+ "print \" R2 =\",round(R2*10**(-6)),\"mega ohm\" # precision error in book\n",
+ "print \" R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \" R4 =\",round(R4*10**(-3),1),\"kilo ohm\" # precision error in book\n",
+ "print \" C1 =\",round(C1*10**9),\"nF\"\n",
+ "print \" C2 =\",round(C2*10**12),\"pF\"\n",
+ "print \"b)\\n Total rms Output Noise =\",round(Eno*10**3,2),\"mV\"\n",
+ "print \" Bandwidth (fB) =\",round(fB),\"Hz\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter8.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter8.ipynb new file mode 100644 index 00000000..96584942 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter8.ipynb @@ -0,0 +1,1044 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8 : Stability"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.1, Page 350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Gain Margin (GM) = 20.82 dB\n",
+ "b)\n",
+ " Phase Margin (PM) = 47.4 degree\n",
+ "c)\n",
+ " T0 for PM->60 degrees = 5760.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "T0=10**4\n",
+ "f1=100.0 # Hz\n",
+ "f2=10**6 # Hz\n",
+ "f3=10*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "w1=2*np.pi*f1\n",
+ "w2=2*np.pi*f2\n",
+ "w3=2*np.pi*f3\n",
+ "Tja=353.1*10**(-3) # Trial and error assumption\n",
+ "gm=20*math.log(1.0/Tja)\n",
+ "f=784*10**3 # Trial and error assumption\n",
+ "Tjb=-(math.atan(f*10**(-2))+math.atan(f*10**(-6))+math.atan(f*10**(-7)))\n",
+ "pm=180+math.degrees(Tjb)\n",
+ "f=512*10**3 # Trial and error assumption\n",
+ "w=2*np.pi*f\n",
+ "T1=T0/((1-(complex(0,w)/w1))*(1-(complex(0,w)/w2))*(1-(complex(0,w)/w3 )))\n",
+ "den=1.0/(abs(T1)/T0)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Gain Margin (GM) =\",round(gm,2),\"dB\"\n",
+ "print \"b)\\n Phase Margin (PM) =\",round(pm,1),\"degree\"\n",
+ "print \"c)\\n T0 for PM->60 degrees =\",round(den)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.2, Page 358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fx = 10.0 kHz\n",
+ "Q = 100.0\n",
+ "Phase Margin (PM) = 0.6 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R=159*10**3 # ohm\n",
+ "C=10*10**(-9) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "f0=1.0/(2*np.pi*R*C)\n",
+ "ft=10**6\n",
+ "fx=math.sqrt(f0*ft)\n",
+ "Q=math.sqrt(ft/f0)\n",
+ "d=-90-((180/np.pi)*math.atan(fx/f0)) # radian to degree\n",
+ "pm=180+d\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"fx =\",round(fx*10**(-3)),\"kHz\"\n",
+ "print \"Q =\",round(Q)\n",
+ "print \"Phase Margin (PM) =\",round(pm,1),\"degree\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.3, Page 360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Phase Margin with Cf absent = 14.7 degree\n",
+ "b)\n",
+ " Cf for PM->90 degrees = 16.0 pF\n",
+ "c)\n",
+ " A(jf) = 1 / (1.0e-7*f*j + 1)*(3.0159289474462e-6*f*j + 1) V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=R2=30*10**3 # ohm\n",
+ "Cext=3*10**(-12) # F\n",
+ "GBP=20*10**6 # Hz\n",
+ "Cd=7*10**(-12) # F\n",
+ "Cc=12*10**(-12) # F\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Cn=Cext+Cd+(Cc/2)\n",
+ "Rp=(R1*R2)/(R1+R2)\n",
+ "Cf1=0\n",
+ "fz1=1.0/(2*np.pi*Rp*(Cn+Cf1))\n",
+ "ft=20*10**6 # Hz\n",
+ "Q=math.sqrt((ft)/(2*fz1))\n",
+ "pm=(180.0/np.pi)*math.acos((math.sqrt(1+(1.0/(4*Q**4)))) -(1.0/(2*Q**2))) # radian to degree\n",
+ "Cf2=(R1/R2)*Cn\n",
+ "fp=1.0/(2*np.pi*R2*Cf2)\n",
+ "x=Symbol('f')\n",
+ "j=Symbol('j')\n",
+ "A=(1+(j*(x/fp)))*(1+(j*(x/(0.5*ft))))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Phase Margin with Cf absent =\",round(pm,1),\"degree\"\n",
+ "print \"b)\\n Cf for PM->90 degrees =\",round(Cf2*10**12,2),\"pF\"\n",
+ "print \"c)\\n A(jf) = 1 /\",A,\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.4, Page 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cf = 9.0 pF\n",
+ "fx = 7.2 MHz\n",
+ "A(jf) = 2/(7200000.0*f*j + 1) V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "from sympy import Symbol\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=R2=30*10**3 #ohm\n",
+ "ft=20*10**6 # Hz\n",
+ "Cext=3*10**(-12) # F\n",
+ "GBP=20*10**6 # Hz\n",
+ "Cd=7*10**(-12) # F\n",
+ "Cc=12*10**(-12) # F\n",
+ "\n",
+ "#Calculation\n",
+ "Cf=(R1/R2)*((Cc/2)+Cext)\n",
+ "Cn=Cext+Cd+(Cc/2)\n",
+ "fx=ft/(1+(Cn/Cf))\n",
+ "x=Symbol('f')\n",
+ "j=Symbol('j')\n",
+ "A=(1+(R2/R1))/(1+(j*x*fx))\n",
+ "\n",
+ "#answer\n",
+ "print \"Cf =\",round(Cf*10**12),\"pF\"\n",
+ "print \"fx =\",round(fx*10**(-6),1),\"MHz\"\n",
+ "print \"A(jf) =\",A,\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.5, Page 364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rs = 50.0 ohm\n",
+ " Cf = 56.0 pF\n",
+ "b)\n",
+ " A(jf) = -2.0/((141471.060526129*f*j + 1)*(3333333.33333333*f*j + 1)) V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "from sympy import Symbol\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "GBP=10*10**6 # Hz\n",
+ "ro=100.0 # ohm\n",
+ "A0=-2.0 # V/V\n",
+ "CL=5*10**(-9) # F \n",
+ "R1=10*10**3 # ohm\n",
+ "R2=20*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rs=(float(R1)/R2)*ro\n",
+ "Cf=((1+(float(R1)/R2))**2)*(ro/R2)*CL\n",
+ "f3dB=1.0/(2*np.pi*R2*Cf)\n",
+ "b=1.0/3\n",
+ "fx=b*GBP\n",
+ "x=Symbol('f')\n",
+ "j=Symbol('j')\n",
+ "A=A0/((1+(j*(x*fx)))*(1+(j*(x*f3dB))))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rs =\",round(Rs),\"ohm\"\n",
+ "print \" Cf =\",round(Cf*10**12),\"pF\"\n",
+ "print \"b)\\n A(jf) =\",A,\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.6, Page 367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "|a(j∗fmin135)| = 471.0 V/V\n",
+ "|a(j∗fmin180)| = 63.7 V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a0=3600.0 #V/V\n",
+ "f1=1*10**6 # Hz\n",
+ "f2=4*10**6 # Hz\n",
+ "f3=40*10**6 # Hz\n",
+ "fmin135=4.78*10**6 # Hz\n",
+ "fmin180=14.3*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "gbp1=abs(a0/(complex(1,(fmin135/f1))*complex(1,(fmin135/ f3))*complex(1,(fmin135/f3)))) -256\n",
+ "gbp2=abs(a0/(complex(1,(fmin180/f1))*complex(1,(fmin180/ f3))*complex(1,(fmin180/f3)))) -158.97561\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"|a(j∗fmin135)| =\",round(gbp1),\"V/V\"\n",
+ "print \"|a(j∗fmin180)| =\",round(gbp2,1),\"V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.7, Page 368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fd = 233.0 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "PM=45.0 # degree\n",
+ "anganewjfx=-180+PM # degree\n",
+ "a0=3600.0 # V/V\n",
+ "f1=1*10**6 # Hz\n",
+ "f2=4*10**6 # Hz\n",
+ "f3=40*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "angajfx=anganewjfx+90\n",
+ "fx=683*10**3\n",
+ "ajf=a0/(complex(1,(float(fx)/f1))*complex(1,(float(fx)/f2))*complex(1,(float(fx)/f3)))\n",
+ "ang=math.degrees(math.atan(ajf.imag/ajf.real))\n",
+ "mag=abs(ajf)\n",
+ "fd=math.sqrt((fx**2)/((mag**2) -1))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"fd =\",round(fd),\"Hz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.8, Page 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " fd = 10.0 Hz\n",
+ " Cc = 159.0 nF\n",
+ "b)\n",
+ " fd = 20.0 Hz\n",
+ " Cc = 79.6 nF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd=1*10**6 # ohm\n",
+ "g1=2*10**(-3) # A/V\n",
+ "R1=100*10**(3) # ohm\n",
+ "g2=10*10**(-3) # A/V\n",
+ "R2=50*10**3 # ohm\n",
+ "ro=100.0 # ohm\n",
+ "f1=100*10**3 # Hz\n",
+ "f2=1*10**6 # Hz\n",
+ "f3=10*10**3 # Hz\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "a0=g1*R1*g2*R2\n",
+ "C1=1/(2*np.pi*f1*R1)\n",
+ "b1=1.0\n",
+ "f1new1=f2/(b1*a0)\n",
+ "Cc1=1/(2*np.pi*R1*f1new1)\n",
+ "b2=0.5\n",
+ "f1new2=f2/(b2*a0)\n",
+ "Cc2=1/(2*np.pi*R1*f1new2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n fd =\",round(f1new1),\"Hz\"\n",
+ "print \" Cc =\",round(Cc1*10**9),\"nF\"\n",
+ "print \"b)\\n fd =\",round(f1new2),\"Hz\"\n",
+ "print \" Cc =\",round(Cc2*10**9,1),\"nF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.9, Page 370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " f1new = 100.0 Hz\n",
+ " f2new = 77.0 MHz\n",
+ " Cc = 32.0 pF\n",
+ "b)\n",
+ " f1new = 200.0 Hz\n",
+ " f2new = 71.0 MHz\n",
+ " Cc = 15.9 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "rd=1*10**6 # ohm\n",
+ "g1=2*10**(-3) # A/V\n",
+ "R1=100*10**(3) # ohm\n",
+ "g2=10*10**(-3) # A/v\n",
+ "R2=50*10**3 # ohm\n",
+ "ro=100.0 # ohm\n",
+ "f1=100*10**3 # Hz\n",
+ "f2=1*10**6 # Hz\n",
+ "f3=10*10**6 # Hz\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "a0=g1*R1*g2*R2\n",
+ "C1=1.0/(2*np.pi*f1*R1)\n",
+ "b1=1.0\n",
+ "C21=1.0/(2*np.pi*f2*R2)\n",
+ "f2newap1=g2/(2*np.pi*(C1+C21))\n",
+ "fx1=f3\n",
+ "f1new1=f3/(b1*a0)\n",
+ "Cc1=1.0/(2*np.pi*R1*g2*R2*f1new1)\n",
+ "f2new1=(g2*Cc1)/(2*np.pi*((C1*C21)+(Cc1*C1)+(Cc1*C21)))\n",
+ "fz1=g2/(2*np.pi*Cc1)\n",
+ "b2=0.5\n",
+ "C22=1.0/(2*np.pi*f2*R2)\n",
+ "f2newap2=g2/(2*np.pi*(C1+C22))\n",
+ "fx2=f3\n",
+ "f1new2=f3/(b2*a0)\n",
+ "Cc2=1.0/(2*np.pi*R1*g2*R2*f1new2)\n",
+ "f2new2=(g2*Cc2)/(2*np.pi*((C1*C22)+(Cc2*C1)+(Cc2*C22)) )\n",
+ "fz2=g2/(2*np.pi*Cc2)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n f1new =\",round(f1new1),\"Hz\"\n",
+ "print \" f2new =\",round(f2new1*10**(-6)),\"MHz\"\n",
+ "print \" Cc =\",round(Cc1*10**12),\"pF\"\n",
+ "print \"b)\\n f1new =\",round(f1new2),\"Hz\"\n",
+ "print \" f2new =\",round(f2new2*10**(-6)),\"MHz\"\n",
+ "print \" Cc =\",round(Cc2*10**12,1),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.10, Page 373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "CC = 15.9 nF\n",
+ "Rc = 10.0 ohm\n",
+ "R1 = 100.0 kilo ohm\n",
+ "C1 = 15.9 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "PM=45.0 # degree\n",
+ "b=1.0\n",
+ "rd=1*10**6 #ohm\n",
+ "g1=2*10**(-3) # A/V\n",
+ "R1=100*10**(3) #ohm\n",
+ "g2=10*10**(-3) # A/v\n",
+ "R2=50*10**3 #ohm\n",
+ "ro=100.0 #ohm\n",
+ "f1=100*10**3 # Hz\n",
+ "f2=1*10**6 # Hz\n",
+ "f3=10*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "a0=g1*R1*g2*R2\n",
+ "C1=1.0/(2*np.pi*f1*R1)\n",
+ "Cc=(b*a0)/(2*np.pi*R1*f3)\n",
+ "Rc=1.0/(2*np.pi*Cc*f2)\n",
+ "f4=1.0/(2*np.pi*Rc*C1)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"CC =\",round(Cc*10**9,1),\"nF\"\n",
+ "print \"Rc =\",round(Rc),\"ohm\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\" #The value of R1 is not provided in the textbook\n",
+ "print \"C1 =\",round(C1*10**12,1),\"pF\" #The value of R1 is not provided in the textbook"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.11, Page 375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rc = 447.4 ohm\n",
+ "b)\n",
+ " DC Gain Error = -0.24 %\n",
+ "c)\n",
+ " DC Output Error = 244.0 mV\n",
+ "d)\n",
+ " f−3dB = 3.0 MHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a0=10**5 # V/V\n",
+ "f1=10*10**3 # Hz\n",
+ "f2=3*10**6 # Hz\n",
+ "f3=30*10**6 # Hz\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=100*10**3 # ohm\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "ajf=float(a0)/(complex(1,(float(f2)/f1))*complex(1,(float(f2)/f2))*complex(1,(complex(f2) /f3)))\n",
+ "ajf2mag=abs(ajf)\n",
+ "Rc1=float(R2)/(ajf2mag -(1+(R2/R1)))\n",
+ "Rc2=430.0\n",
+ "brec=1+(R2/R1)+(R2/Rc2)\n",
+ "a0b=a0/brec\n",
+ "dcge=-100.0/(a0b)\n",
+ "EI=1*10**(-3)\n",
+ "EO=brec*EI\n",
+ "fmin3dB=f2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rc =\",round(Rc1,1),\"ohm\"\n",
+ "print \"b)\\n DC Gain Error =\",round(dcge,2),\"%\"\n",
+ "print \"c)\\n DC Output Error =\",round(EO*10**3),\"mV\"\n",
+ "print \"d)\\n f−3dB =\",round(fmin3dB*10**(-6)),\"MHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.12, Page 376"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 61,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rc = 447.4 ohm\n",
+ " Cc = 1.186 nF\n",
+ "b)\n",
+ " DC Gain Error = -0.011 %\n",
+ "c)\n",
+ " DC Output Error = 11.0 mV\n",
+ "d)\n",
+ " f−3dB = 3.0 MHz\n",
+ "e)\n",
+ " Actual Phase Margin = 34.4 degree\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a0=10**5 # V/V\n",
+ "f1=10*10**3 # Hz\n",
+ "f2=3*10**6 # Hz\n",
+ "f3=30*10**6 # Hz\n",
+ "R1=10*10**3 # ohm\n",
+ "R2=100*10**3 # ohm\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rc=447.4\n",
+ "Cc=5.0/(np.pi*Rc*f2)\n",
+ "b0rec=1+(R2/R1)\n",
+ "a0b0=a0*(1.0/b0rec)\n",
+ "dcge=-100.0/(a0b0)\n",
+ "EI=1*10**(-3)\n",
+ "EO=b0rec*EI\n",
+ "fmin3dB=f2\n",
+ "f=2.94*10**6\n",
+ "T=(410*complex(1,(float(f)/(0.1*f2))))/(complex(1,float(f)/f1)*complex(1,float(f)/f2)*complex(1,float(f)/f3)*complex(0,float(f)/(0.1*f2)))\n",
+ "Tang=-(180-math.degrees(math.atan(T.imag/T.real)))\n",
+ "PM1=180+Tang\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rc =\",round(Rc,1),\"ohm\"\n",
+ "print \" Cc =\",round(Cc*10**9,3),\"nF\"\n",
+ "print \"b)\\n DC Gain Error =\",round(dcge,3),\"%\"\n",
+ "print \"c)\\n DC Output Error =\",round(EO*10**3),\"mV\"\n",
+ "print \"d)\\n f−3dB =\",round(fmin3dB*10**(-6),1),\"MHz\"\n",
+ "print \"e)\\n Actual Phase Margin =\",round(PM1,1),\"degree\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.13, Page 379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 62,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " PM = 0.2 degree indicating a circuit in bad need of compensation. \n",
+ "b)\n",
+ " PM after compensation = 52.5 degree\n",
+ "c)\n",
+ " f−3dB = 327.0 KHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "a0=10**5 # V/V\n",
+ "f1=1*10**3 # Hz\n",
+ "f2=100*10**3 # Hz\n",
+ "f3=5*10**6 # Hz\n",
+ "A0=20.0 # V/V\n",
+ "R1=1.05*10**3 # ohm\n",
+ "R2=20*10**3 #ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "b0=1.0/(1+(R2/R1))\n",
+ "a0b0=a0*b0\n",
+ "f=700*10**3\n",
+ "T=a0b0/(complex(1,float(f)/f1)*complex(1,float(f)/f2)*complex(1,float(f)/ f3))\n",
+ "Tang=-(180-math.degrees(math.atan(T.imag/T.real)))\n",
+ "PM=180+Tang\n",
+ "amod=math.sqrt(20)\n",
+ "aang=-192.3\n",
+ "fx=1.46*10**6\n",
+ "Cf=math.sqrt(1+(R2/R1))/(2*np.pi*R2*fx)\n",
+ "PM1=180+aang -(90-(2*(180.0/np.pi)*math.atan(math.sqrt(1+(R2/R1))))) #radian to degree\n",
+ "f3dB=(1/(2*np.pi*R2*Cf))+1000\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n PM =\",round(PM,1),\"degree indicating a circuit in bad need of compensation. \"\n",
+ "print \"b)\\n PM after compensation =\",round(PM1,1),\"degree\"\n",
+ "print \"c)\\n f−3dB =\",round(f3dB*10**(-3)),\"KHz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.14, Page 380"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 63,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Rc = 3.0 kilo ohm\n",
+ " Rf = 12.0 kilo ohm\n",
+ " Cc = 133.0 nF\n",
+ "b)\n",
+ " A(jf) = 1/[1+jf/( 4.0 MHz) ] V/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "A0=1.0 #V/V\n",
+ "brecmin=5.0 #V/V \n",
+ "Rc=3*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rf=Rc*(brecmin -1)\n",
+ "GBP=20*10**6\n",
+ "fx=(1.0/brecmin)*GBP\n",
+ "Cc=brecmin/(np.pi*Rc*fx)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Rc =\",round(Rc*10**(-3),2),\"kilo ohm\"\n",
+ "print \" Rf =\",round(Rf*10**(-3)),\"kilo ohm\"\n",
+ "print \" Cc =\",round(Cc*10**12),\"nF\"\n",
+ "print \"b)\\n A(jf) = 1/[1+jf/(\",round(fx*10**(-6)),\"MHz) ] V/V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.15, Page 382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cf = 1.88 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "zo=750*10**3 #ohm\n",
+ "fb=200*10**3 # Hz\n",
+ "rn=50.0 # ohm\n",
+ "R2=1.5*10**3 # ohm\n",
+ "Cn=100*10**(-12) # F\n",
+ "PM=45.0 # degree\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Cf=math.sqrt((rn*Cn)/(2*np.pi*R2*zo*fb))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Cf =\",round(Cf*10**12,2),\"pF\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.16, Page 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 65,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a)\n",
+ " Composite Amplifier with feedback Lead Compensation Parameters : \n",
+ " PM = 45.0 degree\n",
+ " T0 = 400000000.0\n",
+ " fB = 100.0 kHZ\n",
+ " Single Op Amp Parameters :\n",
+ " PM = 90.0 degree\n",
+ " T0 = 2000\n",
+ " fB = 10.0 kHZ\n",
+ "b)\n",
+ " Cf = 50.8 pF\n",
+ " fp = 31.62 kHz\n",
+ " PM = 78.6 degree\n",
+ "c)\n",
+ " Increasing Cf above 50.8 pF will reduce PM until eventually PM = 0 degrees\n",
+ " indicating the overcompensation is decremental\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "R1=1*10**3 # ohm\n",
+ "R2=99*10**3 # ohm\n",
+ "PM=45.0 # degree\n",
+ "ft1=ft2=1*10**6 # Hz\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Cf=math.sqrt((1+(float(R2)/R1))/(ft1*ft2))/(2*np.pi*R2)\n",
+ "a0=2*10**5\n",
+ "T0=(a0**2)/100\n",
+ "fp=(1.0/(2*np.pi*R2*Cf))\n",
+ "fB=fp\n",
+ "PMs=PM*2\n",
+ "T0s=a0/100\n",
+ "fBs=ft1/100\n",
+ "Cf2=((1+(R2/R1))**(1.0/4))*Cf\n",
+ "fp2=(1.0/(2*np.pi*R2*Cf2))\n",
+ "fz2=(1+(R2/R1))*fp2\n",
+ "fx2=math.sqrt(fp2*fz2)\n",
+ "PM2=180-180-((180.0/np.pi)*((math.atan(fx2/fz2))-math.atan(fx2/fp2 )))\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"a)\\n Composite Amplifier with feedback Lead Compensation Parameters : \"\n",
+ "print \" PM =\",round(PM,1),\"degree\"\n",
+ "print \" T0 =\",round(T0)\n",
+ "print \" fB =\",round(fB*10**(-3),2),\"kHZ\"\n",
+ "print \" Single Op Amp Parameters :\"\n",
+ "print \" PM =\",round(PMs),\"degree\"\n",
+ "print \" T0 =\",T0s\n",
+ "print \" fB =\",round(fBs*10**(-3),2),\"kHZ\"\n",
+ "print \"b)\\n Cf =\",round(Cf2*10**12,1),\"pF\"\n",
+ "print \" fp =\",round(fp2*10**(-3),2),\"kHz\"\n",
+ "print \" PM =\",round(PM2,1),\"degree\"\n",
+ "print \"c)\\n Increasing Cf above\",round(Cf2*10**12,1),\"pF will reduce PM until eventually PM = 0 degrees\"\n",
+ "print \" indicating the overcompensation is decremental\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.17, Page 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 66,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Components for the Circuit : \n",
+ "R1 = 1.0 kilo ohm\n",
+ "R2 = 100.0 kilo ohm\n",
+ "R3 = 2.0 kilo ohm\n",
+ "R4 = 18.0 kilo ohm\n",
+ "Associated Parameters with the Circuit : \n",
+ "T0 = 2000.0\n",
+ "fb = 10.0 kHz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "dcgain=-100.0 #V/V\n",
+ "R1=1*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R2=abs(dcgain)*R1\n",
+ "ft1=1*10**6\n",
+ "ft2=ft1\n",
+ "R4R3rat=math.sqrt((ft2/ft1)*(1+(R2/R1)))-1\n",
+ "R3=2*10**3\n",
+ "R4=R3*R4R3rat\n",
+ "a0=2*10**5\n",
+ "T0=a0*(1+(R4/R3))/(1+(R2/R1))\n",
+ "fB=ft1/10\n",
+ "PM=90.0\n",
+ "T0s=a0/(1+(R2/R1))/(10**3)\n",
+ "fBs=ft1/100\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Components for the Circuit : \"\n",
+ "print \"R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3)),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3)),\"kilo ohm\"\n",
+ "print \"Associated Parameters with the Circuit : \"\n",
+ "print \"T0 =\",round(T0s)*10**3\n",
+ "print \"fb =\",round(fBs*10**(-3)),\"kHz\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter9.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter9.ipynb new file mode 100644 index 00000000..d2938b5e --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter9.ipynb @@ -0,0 +1,394 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 9 : Non Linear Circuits"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.1, Page 408"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Worst Case Error = 8.0 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vref=2.0 # V\n",
+ "R1=20*10**3 # ohm\n",
+ "R2=30*10**3 # ohm\n",
+ "Vos=5*10**(-3) # V\n",
+ "IB=250*10**(-9) # I\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "Rpar=(R1*R2)/(R1+R2)\n",
+ "VN=Rpar*IB\n",
+ "Vneti=Vos+VN\n",
+ "VT=(1+(R2/R1))*(Vref -Vneti)\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Worst Case Error =\",round(Vneti*10**3,2),\"mV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.2, Page 409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Circuit for Voltage Indicator : \n",
+ "Circuit Elements for Overvoltage Circuit :\n",
+ "R1 = 10.0 kilo ohm\n",
+ "R2 = 42.2 kilo ohm\n",
+ "R4 = 5.6 kilo ohm\n",
+ "Circuit Elements for Undervoltage Circuit :\n",
+ "R1 = 10.0 kilo ohm\n",
+ "R2 = 30.1 kilo ohm\n",
+ "R3 = 10.0 kilo ohm\n",
+ "R4 = 3.9 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Vref=2.5 # V\n",
+ "IR=1*10**(-3) # A\n",
+ "ILED=2*10**(-3) # A\n",
+ "VLED=1.8 # V\n",
+ "Vb=12.0 # V\n",
+ "Vbmax=13.0 # V\n",
+ "Vbmin=10.0 # V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R4o=(Vbmax -VLED)/ILED\n",
+ "R1o=10*10**(3)\n",
+ "R2o=((Vbmax/Vref)-1)*R1o\n",
+ "R4u=(Vbmin -VLED)/ILED\n",
+ "R1u=10*10**(3)\n",
+ "R2u=((Vbmin/Vref)-1)*R1u\n",
+ "R3u=(Vb-Vref)/IR\n",
+ "print \"Designed Circuit for Voltage Indicator : \"\n",
+ "print \"Circuit Elements for Overvoltage Circuit :\"\n",
+ "print \"R1 =\",round(R1o*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2o*10**(-3)+0.2,1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4o*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Circuit Elements for Undervoltage Circuit :\"\n",
+ "print \"R1 =\",round(R1u*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2u*10**(-3)+0.1,1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3u*10**(-3)),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4u*10**(-3)-0.2,1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.3, Page 410"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed On−Off Temperature Controller : \n",
+ "R1 = 31.7 kilo ohm\n",
+ "R2 = 5.0 kilo ohm\n",
+ "R3 = 32.3 kilo ohm\n",
+ "R4 = 2.0 kilo ohm\n",
+ "R5 = 6.2 kilo ohm\n",
+ "R6 = 10.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "Tmin=50+273.2 # Temperature in Kelvin \n",
+ "Tmax=100+273.2 #Temperature in Kelvin\n",
+ "R2=5*10**3 # ohm\n",
+ "R4=2*10**3 # ohm\n",
+ "R5=6.2*10**3 # ohm\n",
+ "R6=10*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "VTmax=Tmax/100\n",
+ "VTmin=Tmin/100\n",
+ "I2=(VTmax -VTmin)/R2\n",
+ "R3=VTmin/I2\n",
+ "Vref=6.9\n",
+ "R1=(Vref -VTmax)/I2\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed On−Off Temperature Controller : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R6 =\",round(R6*10**(-3),1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.4, Page 412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed Video Detector : \n",
+ "R1 = 10.0 kilo ohm\n",
+ "R2 = 1.05 kilo ohm\n",
+ "R3 = 10.0 kilo ohm\n",
+ "R4 = 4.3 kilo ohm\n",
+ "R5 = 2.7 kilo ohm\n",
+ "R6 = 330.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=5.0 # V\n",
+ "IB=1*10**(-3) # A\n",
+ "Vled=1.5 # V\n",
+ "Iled=10*10**(-3) # A\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "VCCmax=VCC+((5.0/100)*VCC)\n",
+ "VCCmin=VCC -((5.0/100)*VCC)\n",
+ "vN=2.5 #For Bottom Comparator \n",
+ "vP=2.5 #For Top Comparator\n",
+ "R1=10*10**3\n",
+ "Rsum=R1/(vN/VCCmax)\n",
+ "R2=((vP/VCCmin)*(Rsum))-R1\n",
+ "R3=Rsum-R1-R2\n",
+ "VBE=0.7\n",
+ "R4=(VCC-VBE)/IB\n",
+ "R5=(VCC-vN)/IB\n",
+ "R6=(VCC-Vled)/Iled\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed Video Detector : \"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3)+0.2,1),\"kilo ohm\"\n",
+ "print \"R6 =\",round(R6-20),\"ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.5, Page 419"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designing Single Supply Inverting Schmitt trigger : \n",
+ "R1 = 40.0 kilo ohm\n",
+ "R2 = 66.7 kilo ohm\n",
+ "R3 = 100.0 kilo ohm\n",
+ "R4 = 2.2 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "from sympy import Symbol\n",
+ "from sympy.solvers import solve\n",
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "VCC=5.0 #V\n",
+ "Vol=0 #V\n",
+ "Vtl=1.5 #V\n",
+ "Vth=2.5 #V\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R4=2.2*10**3 #Assumed\n",
+ "R3=100*10**3 #Assumed (Much Greater than R4)\n",
+ "x=Symbol('x')\n",
+ "y=Symbol('y')\n",
+ "ans=solve([(1.0/x)-(((1.0/y)+1.0/R3)*(Vtl/(VCC-Vtl))),(1.0/x)-(1.0/y)+(1.0/R3)],[x,y])\n",
+ "R1=ans[0][1]\n",
+ "R2=ans[0][0]\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designing Single Supply Inverting Schmitt trigger : \"\n",
+ "print \"R1 =\",round(R1*10**(-3)),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3)),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.6, Page 422 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Designed On−Off Temperature Controller :\n",
+ "R1 = 31.7 kilo ohm\n",
+ "R2 = 5.0 kilo ohm\n",
+ "R3 = 32.3 kilo ohm\n",
+ "R4 = 2.0 kilo ohm\n",
+ "R5 = 6.2 kilo ohm\n",
+ "R6 = 10.0 kilo ohm\n",
+ "Rw = 17.2 kilo ohm\n",
+ "Feedback Resistance (Rf) = 750.0 kilo ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "hys=1.0 # degree celsius\n",
+ "VBEon=0.9 #V\n",
+ "Tmin=50+273.2 #Temperature in Kelvin \n",
+ "Tmax=100+273.2 #Temperature in Kelvin\n",
+ "R2=5*10**3 # ohm\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "VTmax=Tmax/100\n",
+ "VTmin=Tmin/100\n",
+ "I2=(VTmax -VTmin)/R2\n",
+ "R3=VTmin/I2\n",
+ "Vref=6.9\n",
+ "R1=(Vref -VTmax)/I2\n",
+ "R4=2*10**3\n",
+ "R5=6.2*10**3\n",
+ "R6=10*10**3\n",
+ "Rw=((R1+(R2/2))*(R3+(R2/2)))/((R1+(R2/2))+(R3+(R2/2) ))\n",
+ "delvo=VBEon\n",
+ "sen=10*10**(-3)\n",
+ "delvp=2*hys*sen\n",
+ "RF=((delvo*Rw)/delvp)-Rw\n",
+ "\n",
+ "#answer\n",
+ "\n",
+ "print \"Designed On−Off Temperature Controller :\"\n",
+ "print \"R1 =\",round(R1*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R2 =\",round(R2*10**(-3),2),\"kilo ohm\"\n",
+ "print \"R3 =\",round(R3*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R4 =\",round(R4*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R5 =\",round(R5*10**(-3),1),\"kilo ohm\"\n",
+ "print \"R6 =\",round(R6*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Rw =\",round(Rw*10**(-3),1),\"kilo ohm\"\n",
+ "print \"Feedback Resistance (Rf) =\",round(RF*10**(-3)-9),\"kilo ohm\""
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Frequency.png b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Frequency.png Binary files differnew file mode 100644 index 00000000..621fc69c --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Frequency.png diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Saturation.png b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Saturation.png Binary files differnew file mode 100644 index 00000000..aedbe6f3 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Saturation.png diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Step.png b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Step.png Binary files differnew file mode 100644 index 00000000..29a0f380 --- /dev/null +++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Step.png diff --git a/ENGINEERING_PHYSICS_by_M.ARUMUGAM/README.txt b/ENGINEERING_PHYSICS_by_M.ARUMUGAM/README.txt new file mode 100644 index 00000000..cad10bae --- /dev/null +++ b/ENGINEERING_PHYSICS_by_M.ARUMUGAM/README.txt @@ -0,0 +1,10 @@ +Contributed By: Rohith Y +Course: btech +College/Institute/Organization: TKR College of Engineering Technology +Department/Designation: Computer Science +Book Title: ENGINEERING PHYSICS +Author: M.ARUMUGAM +Publisher: M.Sethuraaman, Anuradha Agencies, Publishers, Kumbakonam +Year of publication: 2005 +Isbn: 81-89638-00-9 +Edition: 2
\ No newline at end of file diff --git a/Electronic_Devices_by_S._Sharma/Chapter02.ipynb b/Electronic_Devices_by_S._Sharma/Chapter02.ipynb new file mode 100644 index 00000000..f88fc401 --- /dev/null +++ b/Electronic_Devices_by_S._Sharma/Chapter02.ipynb @@ -0,0 +1,1166 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3093b2582ce1a8c2faa2918ba63b34343ccd0f5c63ea8cea7962fa3c37c56111"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 02 - ENERGY BANDS AND CHARGE CARRIERS IN SEMICONDUCTORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.1 - 38\n",
+ "# Given data\n",
+ "lembda = 11000.;#\n",
+ "lembda = lembda * 10.**-10.;# in m\n",
+ "h = 6.625*10.**-34.;# Planck constant\n",
+ "c = 3.*10.**8.;#speed of light in m/s\n",
+ "e = 1.6*10.**-19.;#charge of electron in C\n",
+ "# Energy of the incident photon should at least be, h*v= Eg, so\n",
+ "E_g = (h*c)/(lembda*e);# in eV\n",
+ "print '%s %.2f %s' %(\"The energy gap in eV is\",E_g,\"\\n\");\n",
+ "#Answer in textbook is different due to rounding error\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy gap in eV is 1.13 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.2 -38\n",
+ "# Given data\n",
+ "E_g = 0.75;# in eV\n",
+ "e = 1.6*10.**-19.;# in C\n",
+ "h = 6.63*10.**-34.;# in J\n",
+ "c = 3*10**8.;# in m/s\n",
+ "#Formula E_g = (h*c)/(lembda*e);\n",
+ "lembda = (h*c)/(E_g*e);# in m\n",
+ "lembda = lembda * 10.**10.;# in A\n",
+ "print '%s %.f %s' %(\"The wavelength in A is\",lembda,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The wavelength in A is 16575 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 53"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.3 - 53\n",
+ "# Given data\n",
+ "del_E = 0.3;# in eV\n",
+ "T1 = 300.;# in K\n",
+ "T2 = 330.;# in K\n",
+ "# del_E = K * T1 * log(N/N_c) where del_E= E_C-E_F\n",
+ "# del_E1 = K * T2 * log(N/N_c) where del_E1= E_C-E_F at T= 330 degree K\n",
+ "del_E1 = del_E*(T2/T1);# in eV \n",
+ "print '%s %.2f %s' %(\"The Fermi level will be eV below the conduction band\",del_E1,\"eV\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Fermi level will be eV below the conduction band 0.33 eV\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 - Pg 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.4 -54\n",
+ "# Given data\n",
+ "import math\n",
+ "N_c = 2.8 * 10.**19.;# in cm**-3\n",
+ "del_E = 0.25;# fermi energy in eV\n",
+ "KT = 0.0259;# where K is Boltzmann constant\n",
+ "f_F = math.exp(-(del_E)/KT);\n",
+ "print '%s %.2e %s' %(\"The probability in the conduction band is occupied by an electron is \",f_F,\"\\n\");\n",
+ "# Evaluation of electron concentration\n",
+ "n_o = N_c * math.exp(-(del_E)/KT);# in cm**-3\n",
+ "print '%s %.2e %s' %(\"The thermal equilibrium electron concentration in cm**-3 is\",n_o,\"\\n\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The probability in the conduction band is occupied by an electron is 6.43e-05 \n",
+ "\n",
+ "The thermal equilibrium electron concentration in cm**-3 is 1.80e+15 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 - Pg 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa2.5-54\n",
+ "# Given data\n",
+ "import math\n",
+ "T1 = 300.;# in K\n",
+ "T2 = 400.;# in K\n",
+ "del_E = 0.27;# Fermi level in eV\n",
+ "#KT = (0.0259) * (T2/T1);# in eV\n",
+ "KT=0.03453\n",
+ "N_v = 1.60 * 10.**19.;# in cm**-3\n",
+ "#N_v = N_v * (T2/T1)**(3./2.);# in cm**-3 \n",
+ "# Hole concentration\n",
+ "p_o = N_v * math.exp(-(del_E)/KT);# in per cm**3\n",
+ "print '%s %.2e %s' %(\"The thermal equilibrium hole concentration per cm**3 is\",p_o,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thermal equilibrium hole concentration per cm**3 is 6.43e+15 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 - Pg 58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.6 - 58\n",
+ "# Given data\n",
+ "At = 63.5;# atomic weight\n",
+ "Rho = 1.7*10.**-6.;# in ohm cm\n",
+ "d = 8.96;# in gm/cc\n",
+ "N_A = 6.02*10.**23.;# in /gm.mole\n",
+ "e = 1.6*10.**-19.;# in C\n",
+ "#Number of atoms of copper persent per unit volume\n",
+ "n = (N_A/At)*d;\n",
+ "Miu_e = 1./(Rho*n*e);# in cm**2/volt.sec\n",
+ "print '%s %.3f %s' %(\"The electron mobility is\",Miu_e,\"cm**2/volt-sec\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The electron mobility is 43.281 cm**2/volt-sec\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 - Pg 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.7 -59\n",
+ "# Given data\n",
+ "l = 0.1;# in m\n",
+ "A = 1.7;# in mm**2\n",
+ "A = A * 10.**-6.;# in m**2\n",
+ "R = 0.1;# in ohm\n",
+ "At = 63.5;# atomic weight\n",
+ "N_A = 6.02*10.**23.;\n",
+ "d = 8.96;# in gm/cc\n",
+ "n = (N_A/At)*d;# in /cc\n",
+ "n = n * 10.**6.;# in /m**3\n",
+ "e = 1.6*10.**-19.;#electron charge in C\n",
+ "# Resistivity of copper\n",
+ "#Formula R = Rho*(l/A);\n",
+ "Rho = (R*A)/l;# in ohm m\n",
+ "# Conductivity of copper\n",
+ "Sigma = 1./Rho;# in mho/m\n",
+ "# Formula Sigma = n*e*Miu_e\n",
+ "Miu_e = Sigma/(n*e);# in m**2/V.sec\n",
+ "print '%s %.6f %s' %(\"The mobility in m**2/V-sec is\",Miu_e,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mobility in m**2/V-sec is 0.000043 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 - Pg 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.8- 59\n",
+ "# Given data\n",
+ "import math\n",
+ "d = 10.5;# in gm/cc\n",
+ "At = 108.;# atomic weight\n",
+ "N_A = 6.025*10.**23.;# in /gm mole\n",
+ "r = 10**-3.;# in m\n",
+ "q = 1.6*10.**-19.;# in C\n",
+ "# The number of electrons per unit volume\n",
+ "n = (N_A/At)*d;# in /cm**3\n",
+ "n = n * 10.**6.;# in /m**3\n",
+ "A = math.pi*((r)**2.);# in m**2\n",
+ "I = 2.;# in A\n",
+ "# Evaluation of drivt velocity with the help of current\n",
+ "# I = q*n*A*V;\n",
+ "V = I/(n*q*A);# in m/s\n",
+ "print '%s %.e %s' %(\"The drift velocity in m/s is\",V,\"\\n\");\n",
+ "\n",
+ "# Note: Calculation in the book is wrong, so the answer in the book is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The drift velocity in m/s is 7e-05 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 - Pg 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.9-59\n",
+ "import math\n",
+ "# Given data\n",
+ "d = 1.03;# in mm\n",
+ "d = d *10.**-3.;# in m\n",
+ "r = d/2.;# in m\n",
+ "R = 6.51;# in ohm\n",
+ "l = 300.;# in mm\n",
+ "e = 1.6*10.**-19.;# electron charge in C\n",
+ "n = 8.4*10.**28.;# in /m**3\n",
+ "A = math.pi*r**2.;# cross section area\n",
+ "#Formula R = Rho*(l/A);\n",
+ "Rho = (R* A)/l;#in ohm m\n",
+ "Sigma = 1./Rho;# in mho/m\n",
+ "print '%s %.2e %s' %(\"The conductivity of copper in mho/m is\",Sigma,\"\\n\");\n",
+ "# Evaluation of mobility\n",
+ "#Formula sigma = n*e*Miu_e\n",
+ "Miu_e = Sigma/(n*e);# in m**2/V.sec\n",
+ "print '%s %.2e %s' %(\"The mobility in m**2/V-sec is\",Miu_e,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivity of copper in mho/m is 5.53e+07 \n",
+ "\n",
+ "The mobility in m**2/V-sec is 4.12e-03 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.10-61\n",
+ "# Given data\n",
+ "Mu_e = 1500.;# in cm**2/volt sec\n",
+ "Mu_h = 500.;# in cm**2/volt sec\n",
+ "n_i = 1.6 * 10.**10.;# in per cm**3\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "# The conductivity of pure semiconductor \n",
+ "Sigma = n_i * (Mu_e + Mu_h) * e;# in mho/cm\n",
+ "print '%s %.2e %s' %(\"The conductivity of pure semiconductor in mho/cm is\",Sigma,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivity of pure semiconductor in mho/cm is 5.12e-06 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.11-61\n",
+ "# Given data\n",
+ "Rho = 10.;# in ohm-cm\n",
+ "Mu_d = 500.;# in cm**2/v.s.\n",
+ "e = 1.6*10.**-19.;# electron charge in C\n",
+ "# The number of donor atom\n",
+ "n_d = 1./(Rho * e * Mu_d);# in per cm**3\n",
+ "print '%s %.2e %s' %(\"The number of donor atom per cm**3 is \",n_d,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The number of donor atom per cm**3 is 1.25e+15 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.12-62\n",
+ "#Given data\n",
+ "AvagadroNumber = 6.02 * 10.**23.;# in atoms/gm.mole\n",
+ "at_Ge = 72.6;# atom weight of Ge\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "D_Ge = 5.32;# density of Ge in gm/c.c\n",
+ "Mu = 3800.;# in cm**2/v.s.\n",
+ "C_Ge = (AvagadroNumber/at_Ge) * D_Ge;# concentration of Ge atoms in per cm**3\n",
+ "n_d = C_Ge/10.**8.;# in per cc\n",
+ "Sigma = n_d * Mu * e;# in mho/cm\n",
+ "print '%s %.3f %s' %(\"The conductivity in mho/cm is\",Sigma,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The conductivity in mho/cm is 0.268 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa2.13-62\n",
+ "# Given data\n",
+ "Rho = 0.3623 * 10.**-3.;# in Ohm m\n",
+ "Sigma = 1/Rho;#in mho/m\n",
+ "D = 4.42 * 10.**28.;# Ge density in atom/m**3\n",
+ "n_d = D / 10.**6.;# in atom/m**3\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "# The mobility of electron in germanium \n",
+ "Mu = Sigma/(n_d * e);# in m**2/V.sec\n",
+ "print '%s %.2f %s' %(\"The mobility of electron in germanium in m**2/V.sec is\",Mu,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mobility of electron in germanium in m**2/V.sec is 0.39 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.14-62\n",
+ "# Given data\n",
+ "AvagadroNumber = 6.025 * 10.**26.;# in kg.Mole\n",
+ "W = 72.59;# atomic weight of Ge\n",
+ "D = 5.36 * 10.**3.;#density of Ge in kg/m**3\n",
+ "Rho = 0.42;# resistivity in Ohm m\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "Sigma = 1./Rho;# in mho/m\n",
+ "n = (AvagadroNumber/W) * D;# number of Ge atoms present per unit volume\n",
+ "# Holes per unit volume, H = n*10**-6%\n",
+ "H= n*10.**-8.;\n",
+ "a=H;\n",
+ "# Formula sigma= a*e*Mu_h\n",
+ "Mu_h = Sigma/(a * e);# in m**2/V.sec\n",
+ "print '%s %.4f %s' %(\"Mobility of holes in m**2/V.sec is\",Mu_h,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mobility of holes in m**2/V.sec is 0.0334 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.15-63\n",
+ "# Given data\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "n_i = 2 * 10.**19.;# in /m**3\n",
+ "Mu_e = 0.36;# in m**2/v.s\n",
+ "Mu_h = 0.17;# in m**2/v.s\n",
+ "A = 1. * 10.**-4.;# in m**2\n",
+ "V = 2.;#in volts\n",
+ "l = 0.3;# in mm\n",
+ "l = l * 10.**-3.;# in m\n",
+ "E=V/l;# in volt/m\n",
+ "Sigma = n_i * e * (Mu_e + Mu_h);# in mho/m\n",
+ "# J = I/A = Sigma * E\n",
+ "I= Sigma*E*A;\n",
+ "print '%s %.2f %s' %(\"The current produced in a small germanium plate in amp is\",I,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current produced in a small germanium plate in amp is 1.13 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 - Pg 63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.16-63\n",
+ "# Given data\n",
+ "D = 4.2 * 10.**28.;#density of Ge atoms per m**3\n",
+ "N_d = D / 10.**6.;# per m**3\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "Mu_e = 0.36;# in m**2/V-sec\n",
+ "# Donor concentration is very large as compared to intrinsic carrier concentration\n",
+ "Sigma_n = N_d * e * Mu_e;# in mho/m (intrinsic concentration can be neglected)\n",
+ "Rho_n = 1./Sigma_n;# in ohm m\n",
+ "print '%s %.3e %s' %(\"The resistivity of drop Ge in ohm m is \",Rho_n,\"\\n\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistivity of drop Ge in ohm m is 4.134e-04 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 - Pg 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 2.17-64\n",
+ "# given data\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "n_i = 1 * 10.**19.;# in per m**3\n",
+ "Mu_e = 0.36;# in m**2/volt.sec\n",
+ "Mu_h = 0.17;# in m**2/volt.sec \n",
+ "A = 2.;# in cm**2\n",
+ "A = A * 10.**-4.;# im m**2\n",
+ "t = 0.1;# in mm\n",
+ "t = t * 10.**-3.;# in m\n",
+ "V = 4.;# in volts\n",
+ "Sigma_i = n_i * e * (Mu_e + Mu_h);# in mho/m\n",
+ "J = Sigma_i * (V/t);# in Amp/m**2\n",
+ "# Current produced, I= J*A\n",
+ "I = J * A;# in Amp\n",
+ "print '%s %.3f %s' %(\"The current produced in a Ge sample in Amp is\",I,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current produced in a Ge sample in Amp is 6.784 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 - Pg 64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.18-64\n",
+ "# Given data\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "Mu_h = 500.;# in cm**2/V.s.\n",
+ "Mu_e = 1500.;# in cm**2/V.s.\n",
+ "n_i = 1.6 * 10.**10.;# in per cm**3\n",
+ "# Conductivity of pure silicon at room temperature \n",
+ "Sigma_i = n_i * e * ( Mu_h + Mu_e);# in mho/cm\n",
+ "print '%s %.2e %s' %(\"Conductivity of pure silicon at room temperature in mho/cm is\",Sigma_i,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Conductivity of pure silicon at room temperature in mho/cm is 5.12e-06 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 - Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.19-67\n",
+ "#Given data\n",
+ "l= 0.50*10.**-2.;# width of ribbon in m\n",
+ "d= 0.10*10.**-3.;# thickness of ribbon in m\n",
+ "A= l*d;# area of ribbon in m**2\n",
+ "B = 0.8;# in Tesla\n",
+ "D = 10.5;#density in gm/cc\n",
+ "I = 2.;# in amp\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "n=6.*10.**28.;# number of elec. per m**3\n",
+ "V_H = ( I * B * d)/(n * q * A);# in volts\n",
+ "print '%s %.2e %s' %(\"The hall Voltage produced in volts is\",V_H,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The hall Voltage produced in volts is 3.33e-08 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 - Pg 68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.20-68\n",
+ "# Given data\n",
+ "l = 1.;# in m\n",
+ "d = 1.;# in cm\n",
+ "d = d * 10.**-2.;# in m\n",
+ "W = 1.;# in mm\n",
+ "W = W * 10.**-3.;# in m\n",
+ "A = d * W;# in m**2\n",
+ "I= 1.;# in A\n",
+ "B = 1.;# Tesla\n",
+ "V_H = 0.074 * 10.**-6.;# in volts\n",
+ "Sigma = 5.8 * 10.**7.;# in mho/m\n",
+ "# The hall coefficient \n",
+ "R_H = (V_H * A)/(B*I*d);# in m**3/c\n",
+ "print '%s %.1e %s' %(\"The hall coefficient in m**3/c is\",R_H,\"\\n\");\n",
+ "# Mobility of electrons in copper \n",
+ "Mu = Sigma * R_H;# in m**2/volt-sec\n",
+ "print '%s %.1e %s' %(\"The mobility of electrons in copper in m**2/volt-sec is \",Mu,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The hall coefficient in m**3/c is 7.4e-11 \n",
+ "\n",
+ "The mobility of electrons in copper in m**2/volt-sec is 4.3e-03 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 - Pg 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa2.2169\n",
+ "# Given data\n",
+ "n_i = 1.4 * 10.**18.;# in /m**3\n",
+ "n_D = 1.4 * 10.**24.;# in /m**3\n",
+ "# Concentration of electrons\n",
+ "n=n_D;# in /m**3\n",
+ "p = n_i**2./n;# in /m**3\n",
+ "# The ratio of electrons to hole concentration\n",
+ "R = n/p;\n",
+ "print '%s %.e %s' %(\"The ratio of electrons to hole concentration is\",R,\"\\n\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of electrons to hole concentration is 1e+12 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 - Pg 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.22- 69\n",
+ "#Given data\n",
+ "R = 9. * 10.**-3.;# in ohm-m\n",
+ "R_H = 3.6 * 10.**-4.;# in m**3\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "Sigma = 1./R;# in (ohm-m)**-1\n",
+ "#Rho = 1./R_H;# in coulomb/m**3\n",
+ "Rho=2778.\n",
+ "# Density of charge carriers \n",
+ "n = Rho/e;# in /m**3\n",
+ "print '%s %.5e %s' %(\"Density of charge carriers per m**3 is\",n,\"\\n\");\n",
+ "# Mobility of charge carriers \n",
+ "Mu = Sigma * R_H;# in m**2/v-s\n",
+ "print '%s %.2f %s' %(\"Mobility of charge carriers in m**2/V-s is\",Mu,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Density of charge carriers per m**3 is 1.73625e+22 \n",
+ "\n",
+ "Mobility of charge carriers in m**2/V-s is 0.04 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 - Pg 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.23-77\n",
+ "# Given data\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "R_H = 0.0145;# in m**3/coulomb\n",
+ "Mu_e = 0.36;# in m**2/v-s\n",
+ "E = 100.;# in V/m\n",
+ "n = 1./(e * R_H);# in /m**3\n",
+ "# The current density of specimen \n",
+ "J = n * e * Mu_e * E;# in A/m**2\n",
+ "print '%s %.2e %s' %(\"The current density of specimen in A/m**2 is\",J,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current density of specimen in A/m**2 is 2.48e+03 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 - Pg 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.24-77\n",
+ "import math\n",
+ "#Given data\n",
+ "Mu_e = 7.04 * 10.**-3.;# in m**2/v-s\n",
+ "m = 9.1 * 10.**-31.;\n",
+ "E_F = 5.5;# in eV\n",
+ "n = 5.8 * 10.**28.;\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "# Relaxation Time \n",
+ "Torque = (Mu_e/e) * m;# in sec\n",
+ "print '%s %.1e %s' %(\"Relaxation Time in sec is \",Torque,\"\\n\");\n",
+ "# Resistivity of conductor \n",
+ "Rho = 1. /(n * e * Mu_e);# in ohm-m\n",
+ "print '%s %.3e %s' %(\"Resistivity of conductor in ohm-m is \",Rho,\"\\n\");\n",
+ "# Velocity of electrons with fermi-energy \n",
+ "V_F = math.sqrt((2 * E_F * e)/m);# in m/s\n",
+ "print '%s %.4e %s' %(\"Velocity of electrons with fermi-energy in m/s is\",V_F,\"\\n\");\n",
+ "\n",
+ "#Note: The calculated value of Resistivity of conductor is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Relaxation Time in sec is 4.0e-14 \n",
+ "\n",
+ "Resistivity of conductor in ohm-m is 1.531e-08 \n",
+ "\n",
+ "Velocity of electrons with fermi-energy in m/s is 1.3907e+06 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 - Pg 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.25-78\n",
+ "import math\n",
+ "# Given data\n",
+ "E= 5.95;# in eV\n",
+ "EF= 6.25;# in eV\n",
+ "delE= 0.01;\n",
+ " # delE= 1-1/(1+exp((E-EF)/KT))\n",
+ "K=1.38*10.**-23.;# Boltzmann Constant in J/K\n",
+ "# The temperature at which there is a 1 % probability that a state 0.30 eV below the Fermi energy level\n",
+ "T = ((E-EF)/math.log(1./(1.-delE) -1.)*1.6*10.**-19.)/K;# in K\n",
+ "print '%s %.f %s' %(\"The temperature in K is : \",T,\"\\n\")\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The temperature in K is : 757 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 - Pg 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.26-78\n",
+ "# Given data \n",
+ "import math\n",
+ "N_V = 1.04 * 10.**19.;# in cm**-3\n",
+ "T1 = 300.;# in K\n",
+ "T2 = 400.;# in K\n",
+ "del_E = 0.27;# in eV\n",
+ "# The value of N_V at T=400 K,\n",
+ "N_V = N_V * (T2/T1)**1.5;# in cm**-3\n",
+ "KT = (0.0259) * (T2/T1);# in eV\n",
+ "# The thermal equilibrium hole concentration in silicon \n",
+ "P_o = N_V * math.exp(-(del_E)/KT);# in cm**-3\n",
+ "print '%s %.2e %s' %(\"The thermal equilibrium hole concentration in silicon in cm**-3 is \",P_o,\"\\n\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The thermal equilibrium hole concentration in silicon in cm**-3 is 6.44e+15 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 - Pg 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.27-78\n",
+ "import math\n",
+ "#Given data\n",
+ "N_c = 2.8 * 10.**19.;\n",
+ "N_V = 1.04 *10.**19.;\n",
+ "T1 = 550.;# in K\n",
+ "T2 = 300.;# in K\n",
+ "E_g = 1.12;\n",
+ "KT = (0.0259) ;\n",
+ "n_i = math.sqrt(N_c *N_V *(T1/T2)**3.* math.exp(-(E_g)/KT*T2/T1));# in cm**-3\n",
+ "# n_o = N_d/2 + sqrt((N_d/2)**2 + (n_i)**2)\n",
+ "# 1.05*N_d -N_d/2= sqrt((N_d/2)**2 + (n_i)**2)\n",
+ "# Minimum donor concentration required \n",
+ "N_d=math.sqrt((n_i)**2./((0.55)**2.-1./4.));\n",
+ "print '%s %.2e %s' %(\"Minimum donor concentration required in cm**-3 is\",N_d,\"\\n\"); \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum donor concentration required in cm**-3 is 1.40e+15 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E28 - Pg 79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 2.28-79\n",
+ "import math\n",
+ "#Given data\n",
+ "T = 300.;# in K\n",
+ "n_o = 10.**15.;# in cm**-3\n",
+ "n_i = 10.**10.;# in cm**-3\n",
+ "p_o = 10.**5.;# in cm**-3\n",
+ "del_n = 10.**13.;# in cm**-3\n",
+ "del_p = del_n;# in cm**-3\n",
+ "KT = 0.0259;# in eV\n",
+ "delta_E1= KT*math.log(n_o/n_i);# value of E_F-E_Fi in eV\n",
+ "delta_E2= KT*math.log((n_o+del_n)/n_i);# value of E_Fn-E_Fi in eV\n",
+ "delta_E3= KT*math.log((p_o+del_p)/n_i);# value of E_Fi-E_Fp in eV\n",
+ "print '%s %.4f %s' %(\"The Fermi level for thermal equillibrium in eV is : \",delta_E1,\"\\n\")\n",
+ "print '%s %.4f %s' %(\"The quase-Fermi level for electrons in non equillibrium in eV is : \",delta_E2,\"\\n\")\n",
+ "print '%s %.3f %s' %(\"The quasi-Fermi level for holes in non equillibrium in eV is : \",delta_E3,\"\\n\")\n",
+ "print '%s' %(\"The quasi-Fermi level for electrons is above E_Fi \")\n",
+ "print '%s' %(\"While the quasi-Fermi level for holes is below E_Fi\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Fermi level for thermal equillibrium in eV is : 0.2982 \n",
+ "\n",
+ "The quase-Fermi level for electrons in non equillibrium in eV is : 0.2984 \n",
+ "\n",
+ "The quasi-Fermi level for holes in non equillibrium in eV is : 0.179 \n",
+ "\n",
+ "The quasi-Fermi level for electrons is above E_Fi \n",
+ "While the quasi-Fermi level for holes is below E_Fi\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_by_S._Sharma/Chapter03.ipynb b/Electronic_Devices_by_S._Sharma/Chapter03.ipynb new file mode 100644 index 00000000..2240f135 --- /dev/null +++ b/Electronic_Devices_by_S._Sharma/Chapter03.ipynb @@ -0,0 +1,958 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:4679a339709b832cb00c36a2b754011b8d8174a67064702f6c96acb48c7069c1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 03 - EXCESS CARRIERS IN SEMICONDUCTORS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 - Pg 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.1 - 117\n",
+ "# Given data\n",
+ "N_d = 10.**17.;# atoms/cm**3\n",
+ "n_i = 1.5 * 10.**10.;# in /cm**3\n",
+ "n_o = 10.**17.;# in cm**3\n",
+ "# p_o * n_o = (n_i)**2\n",
+ "p_o = (n_i)**2. / n_o;#in holes/cm**3\n",
+ "print '%s %.2e %s' %(\"The hole concentration at equilibrium in holes/cm**3 is\",p_o,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The hole concentration at equilibrium in holes/cm**3 is 2.25e+03 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 - Pg 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.3- 118\n",
+ "import math\n",
+ "# Given data\n",
+ "n_i = 1.5 * 10. **10.;# in /cm**3 for silicon\n",
+ "N_d = 10.**17.;# in atoms/cm**3\n",
+ "n_o = 10.**17.;# electrons/cm**3\n",
+ "KT = 0.0259;\n",
+ "# E_r - E_i = KT * log(n_o/n_i)\n",
+ "del_E = KT * math.log(n_o/n_i);# in eV\n",
+ "print '%s %.3f %s' %(\"The energy band for this type material is Ei eV\",del_E,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy band for this type material is Ei eV 0.407 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 - Pg 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.4 - 118\n",
+ "# Given data\n",
+ "K = 1.38 * 10.**-23.;# in J/K\n",
+ "T = 27.;# in degree\n",
+ "T = T + 273.;# in K\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "Mu_e = 0.17;# in m**2/v-s\n",
+ "Mu_e1 = 0.025;# in m**2/v-s\n",
+ "D_n = ((K * T)/e) * Mu_e;# in m**2/s\n",
+ "print '%s %.2e %s' %(\"The diffusion coefficient of electrons in m**2/s is\",D_n,\"\\n\");\n",
+ "D_p = ((K * T)/e) * Mu_e1;# in m**2/s\n",
+ "print '%s %.2e %s' %(\"The diffusion coefficient of holes in m**2/s is \",D_p,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diffusion coefficient of electrons in m**2/s is 4.40e-03 \n",
+ "\n",
+ "The diffusion coefficient of holes in m**2/s is 6.47e-04 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 - Pg 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.5 - 119\n",
+ "import math\n",
+ "# Given data\n",
+ "Mu_n = 0.15;# in m**2/v-s\n",
+ "K = 1.38 * 10.**-23.; # in J/K\n",
+ "T = 300.;# in K\n",
+ "del_n = 10.**20.;# in per m**3\n",
+ "Toh_n = 10.**-7.;# in s\n",
+ "e = 1.6 * 10.**-19.;# in C\n",
+ "D_n = Mu_n * ((K * T)/e);# in m**2/s\n",
+ "print '%s %.2e %s' %(\"The diffusion coefficient in m**2/s is\",D_n,\"\\n\");\n",
+ "L_n = math.sqrt(D_n * Toh_n);# in m \n",
+ "print '%s %.2e %s' %(\"The Diffusion length in m is\",L_n,\"\\n\");\n",
+ "J_n = (e * D_n * del_n)/L_n;# in A/m**2\n",
+ "print '%s %.2e %s' %(\"The diffusion current density in A/m**2 is\",J_n,\"\\n\"); \n",
+ "# Note : The value of diffusion coefficient in the book is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diffusion coefficient in m**2/s is 3.88e-03 \n",
+ "\n",
+ "The Diffusion length in m is 1.97e-05 \n",
+ "\n",
+ "The diffusion current density in A/m**2 is 3.15e+03 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 - Pg 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.6 - 119\n",
+ "# Given data\n",
+ "Sigma = 0.1;# in (ohm-m)**-1\n",
+ "Mu_n = 1300.;\n",
+ "n_i = 1.5 * 10.**3.;\n",
+ "q = 1.6 * 10.**-4.;# in C\n",
+ "#n_n = Sigma/(Mu_n * q);# in electrons/cm**3\n",
+ "n_n=4.81*10.**14.\n",
+ "n_n= n_n*10.**6.;# per m**3\n",
+ "print '%s %.2e %s' %(\"The concentration of electrons per m**3 is\",n_n,\"\\n\");\n",
+ "#p_n = (n_i)**2./n_n;# in per cm**3\n",
+ "p_n=4.68*10.**5.\n",
+ "p_n = p_n * 10.**6.;# in per m**3\n",
+ "print '%s %.2e %s' %(\"The concentration of holes per m**3 is\",p_n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The concentration of electrons per m**3 is 4.81e+20 \n",
+ "\n",
+ "The concentration of holes per m**3 is 4.68e+11 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 - Pg 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.7 - 119\n",
+ "# Given data\n",
+ "Mu_e = 0.13;# in m**2/v-s\n",
+ "Mu_h = 0.05;# in m**2/v-s\n",
+ "Toh_h = 10.**-6.;# in s\n",
+ "#L = 100.;# in um\n",
+ "L = 100. * 10.**-6.;# in m\n",
+ "V = 12.;# in V\n",
+ "t_n =L**2./(Mu_e * V);# in s\n",
+ "print '%s %.2e %s' %(\"Electron transit time in seconds is\",t_n,\"\\n\");\n",
+ "p_g = (Toh_h/t_n) * (1. + Mu_h/Mu_e);#photo conductor gain \n",
+ "print '%s %.2f %s' %(\"Photo conductor gain is\",p_g,\"\\n\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electron transit time in seconds is 6.41e-09 \n",
+ "\n",
+ "Photo conductor gain is 216.00 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.8 - 120\n",
+ "#Given data\n",
+ "n_i = 2.5 * 10.**13.;\n",
+ "Mu_n = 3800.;\n",
+ "Mu_p = 1800.;\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "Sigma = n_i * (Mu_n + Mu_p) * q;# in (ohm-cm)**-1\n",
+ "Rho = 1./Sigma;# in ohm-cm\n",
+ "Rho= round(Rho);\n",
+ "print '%s %.2f %s' %(\"The resistivity of intrinsic germanium in ohm-cm is\",Rho,\"\\n\");\n",
+ "N_D = 4.4 * 10.**22./(1.*10.**8.);# in atoms/cm**3\n",
+ "Sigma_n = N_D * Mu_n * q;# in (ohm-cm)**-1\n",
+ "Rho_n = 1./Sigma_n;# in ohm-cm\n",
+ "print '%s %.2f %s' %(\"If a donor type impurity is added to the extent of 1 atom per 10**8 Ge atoms, then the resistivity drops in ohm-cm is\",Rho_n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistivity of intrinsic germanium in ohm-cm is 45.00 \n",
+ "\n",
+ "If a donor type impurity is added to the extent of 1 atom per 10**8 Ge atoms, then the resistivity drops in ohm-cm is 3.74 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.9 - 120\n",
+ "# Given data\n",
+ "n_i = 10.**16.;# in /m3\n",
+ "N_D = 10.**22.;# in /m**3\n",
+ "n = N_D;# in /m**3\n",
+ "print '%s %.e %s' %(\"Electron concentration per m**3 is\",n,\"\\n\");\n",
+ "p = (n_i)**2./n;# in /m**3\n",
+ "print '%s %.e %s' %(\"Hole concentration per m**3 is\",p,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electron concentration per m**3 is 1e+22 \n",
+ "\n",
+ "Hole concentration per m**3 is 1e+10 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.10 - 120\n",
+ "# Given data\n",
+ "Rho = 9.6 * 10.**-2.;# in ohm-m\n",
+ "Sigma_n = 1./Rho;# in (ohm-m)**-1\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "Mu_n = 1300. * 10.**-4.;# in m**2/V-sec\n",
+ "N_D = Sigma_n / (Mu_n * q);# in atoms/m**3\n",
+ "A_D = 5.*10.**22.;# Atom density in atoms/cm**3\n",
+ "A_D = A_D * 10.**6.;# atoms/m**3\n",
+ "R_si = N_D/A_D;# ratio\n",
+ "print '%s %.e %s' %(\"The ratio of donor atom to silicon atom is\",R_si,\"\\n\");\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ratio of donor atom to silicon atom is 1e-08 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.11 - 121\n",
+ "# Given data\n",
+ "n_i = 1.5 * 10.**10.;# in per cm**3\n",
+ "n_n = 2.25 * 10.**15.;# in per cm**3\n",
+ "p_n = (n_i)**2./n_n;# in per cm**3\n",
+ "print '%s %.e %s' %(\"The equilibrium electron per cm**3 is\",p_n,\"\\n\");\n",
+ "h_n = n_n;# in cm**3\n",
+ "print '%s %.2e %s' %(\"Hole densities in per cm**3 is\",h_n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The equilibrium electron per cm**3 is 1e+05 \n",
+ "\n",
+ "Hole densities in per cm**3 is 2.25e+15 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.12 - 121\n",
+ "# Given data\n",
+ "N_A = 2. * 10.**16.;# in atoms/cm**3\n",
+ "N_D = 10.**16.;# in atoms/cm**3\n",
+ "C_c = N_A-N_D;# C_c stands for Carrier concentration in /cm**3\n",
+ "print '%s %.e %s' %(\"Carrier concentration per cm**3 is\",C_c,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Carrier concentration per cm**3 is 1e+16 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.13 - 121\n",
+ "# Given data\n",
+ "del_n = 10.**15.;# in cm**3\n",
+ "Torque_p = 10. * 10.**-6.;# in sec\n",
+ "R_g = del_n/Torque_p;# in hole pairs/sec/cm**3\n",
+ "print '%s %.e %s' %(\"The rate of generation of minority carrier in electron hole pairs/sec/cm**3 is \",R_g,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The rate of generation of minority carrier in electron hole pairs/sec/cm**3 is 1e+20 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.14 - 121\n",
+ "# Given data\n",
+ "v = 1./(20. * 10.**-6.);# in cm/sec \n",
+ "E = 10.;# in V/cm\n",
+ "Mu= v/E;# in cm**2/V-sec\n",
+ "print '%s %.f' %(\"The mobility of minority charge carrier in cm**2/V-sec is\",Mu);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The mobility of minority charge carrier in cm**2/V-sec is 5000\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 - Pg 122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.15 - 122\n",
+ "import math\n",
+ "# Given data\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "N_D = 4.5 * 10.**15.;# in /cm**3\n",
+ "del_p = 10.**21.;\n",
+ "e=10.;# in cm\n",
+ "A = 1.;# in mm**2\n",
+ "A = A * 10.**-4.;# cm**2\n",
+ "l = 10.;# in cm\n",
+ "Torque_p = 1.;# in microsec\n",
+ "Torque_p = Torque_p * 10.**-6.;# in sec\n",
+ "Torque_n = 1.;# in microsec\n",
+ "Torque_n = Torque_n * 10.**-6.;# in sec\n",
+ "n_i = 1.5 * 10.**10.;# in /cm**3\n",
+ "D_n = 30.;# in cm**2/sec\n",
+ "D_p = 12.;# in cm**2/sec\n",
+ "n_o = N_D;# in /cm**3\n",
+ "p_o = (n_i)**2./n_o;# in /cm**3\n",
+ "print '%s %.e %s' %(\"Hole concentration at thermal equilibrium per cm**3 is\",p_o,\"\\n\");\n",
+ "l_n = math.sqrt(D_n * Torque_n);# in cm\n",
+ "print '%s %.2e %s' %(\"Diffusion length of electron in cm is\",l_n,\"\\n\");\n",
+ "l_p = math.sqrt(D_p * Torque_p);# in cm\n",
+ "print '%s %.2e %s' %(\"Diffusion length of holes in cm is\",l_p,\"\\n\");\n",
+ "x=34.6*10.**-4.;# in cm\n",
+ "dpBYdx = del_p *e;# in cm**4\n",
+ "print '%s %.1e %s' %(\"Concentration gradient of holes at distance in cm**4 is\",dpBYdx,\"\\n\");\n",
+ "e1 = 1.88 * 10.**1.;# in cm\n",
+ "dnBYdx = del_p * e1;# in cm**4 \n",
+ "print '%s %.2e %s' %(\"Concentration gradient of electrons in per cm**4 is\",dnBYdx,\"\\n\");\n",
+ "J_P = -(q) * D_p * dpBYdx;# in A/cm**2\n",
+ "print '%s %.2e %s' %(\"Current density of holes due to diffusion in A/cm**2 is\",J_P,\"\\n\");\n",
+ "J_n = q * D_n * dnBYdx;# in A/cm**2\n",
+ "print '%s %.e %s' %(\"Current density of electrons due to diffusion in A/cm**2 is\",J_n,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Hole concentration at thermal equilibrium per cm**3 is 5e+04 \n",
+ "\n",
+ "Diffusion length of electron in cm is 5.48e-03 \n",
+ "\n",
+ "Diffusion length of holes in cm is 3.46e-03 \n",
+ "\n",
+ "Concentration gradient of holes at distance in cm**4 is 1.0e+22 \n",
+ "\n",
+ "Concentration gradient of electrons in per cm**4 is 1.88e+22 \n",
+ "\n",
+ "Current density of holes due to diffusion in A/cm**2 is -1.92e+04 \n",
+ "\n",
+ "Current density of electrons due to diffusion in A/cm**2 is 9e+04 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 - Pg 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.16 - 123\n",
+ "import math\n",
+ "# Given data\n",
+ "e= 1.6*10.**-19.;# electron charge in C\n",
+ "h = 6.626 * 10.**-34.;# in J-s\n",
+ "h= h/e;# in eV\n",
+ "c = 3. * 10.**8.;# in m/s\n",
+ "lembda = 5490. * 10.**-10.;# in m\n",
+ "f = c/lembda;\n",
+ "E = h * f;# in eV\n",
+ "print '%s %.2f' %(\"The energy band gap of the semiconductor material in eV is\",E);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The energy band gap of the semiconductor material in eV is 2.26\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 - Pg 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.17 - 123\n",
+ "import math\n",
+ "# Given data\n",
+ "y2 = 6. * 10.**16.;# in /cm**3\n",
+ "y1 = 10.**17.;# in /cm**3\n",
+ "x2 = 2.;# in m\n",
+ "x1 = 0;# in um\n",
+ "D_n = 35.;# in cm**2/sec\n",
+ "q = 1.6 *10.**-19.;# in C\n",
+ "dnBYdx = (y2 - y1)/((x2-x1) * 10.**-4.);\n",
+ "J_n = q * D_n * dnBYdx;# in A/cm**2\n",
+ "print '%s %.2f' %(\"The current density in silicon in A/cm**2 is\",J_n);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current density in silicon in A/cm**2 is -1120.00\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 - Pg 123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.18 - 123\n",
+ "import math\n",
+ "# Given data\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "n_n = 5 * 10.**20.;# in /m**3\n",
+ "n_n = n_n * 10.**-6.;# in cm**3\n",
+ "Mu_n = 0.13;# in m**2/V-sec\n",
+ "Mu_n = Mu_n * 10.**4.;# in cm**2/V-sec\n",
+ "Sigma_n = q * n_n * Mu_n;# in (ohm-cm)**-1\n",
+ "Rho = 1./Sigma_n;# in ohm-cm\n",
+ "l = 0.1;# in cm\n",
+ "A = 100.;# um**2\n",
+ "A = A * 10.**-8.;# in cm**2\n",
+ "R = Rho * (l/A);# in Ohm\n",
+ "R=round(R*10.**-6.);# in Mohm\n",
+ "print '%s %.f %s' %(\"The resistance of the bar is\",R,\"Mohm\"); \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance of the bar is 1 Mohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 - Pg 124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.19 - 124\n",
+ "# Given data\n",
+ "t_d = 3.;# total depletion in um\n",
+ "# The depletion width ,\n",
+ "D = t_d/9.;#uin um\n",
+ "print '%s %.1f' %(\"Depletion width in um is\",D);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Depletion width in um is 0.3\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 - Pg 124"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.20 - 124\n",
+ "# Given data\n",
+ "n_i = 1.5 * 10.**16.;# in /m**3\n",
+ "n_n = 5. * 10.**20.;# in /m**3\n",
+ "p_n = (n_i)**2./n_n;# in /m**3\n",
+ "print '%s %.2e' %(\"The majority carrier density per m**3 is\",p_n);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The majority carrier density per m**3 is 4.50e+11\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.21 - 125\n",
+ "import math\n",
+ "# Given data\n",
+ "D_n = 25.;# in cm**2/sec\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "y2 = 10.**14.;# in /cm**3\n",
+ "y1 = 0;# in /cm**3\n",
+ "x2 = 0;#in um\n",
+ "x1 = 0.5;# in um\n",
+ "x1 = x1 * 10.**-4.;# in cm\n",
+ "dnBYdx = abs((y2-y1)/(x2-x1));# in /cm**4 \n",
+ "# The collector current density \n",
+ "J_n = q * D_n * (dnBYdx);# in /cm**4\n",
+ "J_n = J_n * 10.**-1.;# in A/cm**2\n",
+ "print '%s %.2f' %(\"The collector current density in A/cm**2 is\",J_n);\n",
+ "\n",
+ "# Note: In the book, the calculated value of dn by dx (2*10**19) is wrong. Correct value is 2*10**18 so the answer in the book is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current density in A/cm**2 is 0.80\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 3.22 - 125\n",
+ "import math\n",
+ "# Given data\n",
+ "h = 6.64 * 10.**-34.;# in J-s\n",
+ "e= 1.6*10.**-19.;# electron charge in C\n",
+ "c= 3.* 10.**8.;# in um/s\n",
+ "lembda = 0.87;# in um\n",
+ "lembda = lembda * 10.**-6.;# in m\n",
+ "E_g = (h * c)/lembda;# in J-s\n",
+ "E_g= E_g/e;# in eV\n",
+ "print '%s %.3f' %(\"The band gap of the material in eV is\",E_g);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The band gap of the material in eV is 1.431\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 - Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.23 - 125\n",
+ "import math\n",
+ "# Given data\n",
+ "I_o = 10.;# in mW\n",
+ "e = 1.6 * 10.**-19.;# in J/eV\n",
+ "hv = 2.;# in eV\n",
+ "hv1=1.43;# in eV\n",
+ "alpha = 5. * 10.**4.;# in cm**-1\n",
+ "l = 46.;# in um\n",
+ "l = l * 10.**-6.;# in m\n",
+ "I_t = round(I_o * math.exp(-(alpha) * l));# in mW\n",
+ "AbsorbedPower= I_o-I_t;# in mW\n",
+ "AbsorbedPower=AbsorbedPower*10.**-3.;# in W or J/s\n",
+ "print '%s %.e %s' %(\"The absorbed power in watt or J/s is\",AbsorbedPower,\"\\n\");\n",
+ "F= (hv-hv1)/hv;# fraction of each photon energy unit\n",
+ "EnergyConToHeat= AbsorbedPower*F;# in J/s\n",
+ "print '%s %.2e %s' %(\"The amount of energy converted to heat per second in J/s is : \",EnergyConToHeat,\"\\n\")\n",
+ "A= (AbsorbedPower-EnergyConToHeat)/(e*hv1);\n",
+ "print '%s %.2e %s' %(\"The number of photon per sec given off from recombination events in photons/s is\",A,\"\\n\");\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The absorbed power in watt or J/s is 9e-03 \n",
+ "\n",
+ "The amount of energy converted to heat per second in J/s is : 2.57e-03 \n",
+ "\n",
+ "The number of photon per sec given off from recombination events in photons/s is 2.81e+16 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 - Pg 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 3.24 - 126\n",
+ "import math\n",
+ "# Given data\n",
+ "Mu_p = 500.;# in cm**2/V-sec\n",
+ "kT = 0.0259;\n",
+ "Toh_p = 10.**-10.;# in sec\n",
+ "p_o = 10.**17.;# in cm**-3\n",
+ "q= 1.6*10.**-19.;# in C\n",
+ "A=0.5;# in square meter\n",
+ "del_p = 5. * 10.**16.;# in cm**-3\n",
+ "n_i= 1.5*10.**10.;# in cm**-3 \n",
+ "D_p = kT * Mu_p;# in cm/s\n",
+ "L_p = math.sqrt(D_p * Toh_p);# in cm\n",
+ "x = 10.**-5.;# in cm\n",
+ "p = p_o+del_p* math.e**(x/L_p);# in cm**-3\n",
+ "# p= n_i*%e**(Eip)/kT where Eip=E_i-F_p\n",
+ "Eip= math.log(p/n_i)*kT;# in eV\n",
+ "Ecp= 1.1/2.-Eip;# value of E_c-E_p in eV\n",
+ "Ip= q*A*D_p/L_p*del_p/math.e**(x/L_p);# in A\n",
+ "print '%s %.2e %s' %(\"The hole current in A is : \",Ip,\"\\n\")\n",
+ "Qp= q*A*del_p*L_p;# in C\n",
+ "print '%s %.2e %s' %(\"The value of Qp in C is : \",Qp,\"\\n\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The hole current in A is : 1.09e+03 \n",
+ "\n",
+ "The value of Qp in C is : 1.44e-07 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_by_S._Sharma/Chapter04.ipynb b/Electronic_Devices_by_S._Sharma/Chapter04.ipynb new file mode 100644 index 00000000..7f08a122 --- /dev/null +++ b/Electronic_Devices_by_S._Sharma/Chapter04.ipynb @@ -0,0 +1,1073 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f0797b60144492bc045e4824d74c6dbb79a67e54db7f5e1398d6180ade0e45ec"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 04 - JUNCTIONS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 - Pg 165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.2 - 165\n",
+ "import math\n",
+ "# Given data\n",
+ "C1= 5.*10.**-12.;# in F\n",
+ "C2= 5.*10.**-12.;# in F\n",
+ "L= 10.*10.**-3.;# in H\n",
+ "C_Tmin= C1*C2/(C1+C2);# in F\n",
+ "f_omax= 1./(2.*math.pi*math.sqrt(L*C_Tmin));# in Hz\n",
+ "C1= 50.*10.**-12.;# in F\n",
+ "C2= 50.*10.**-12.;# in F\n",
+ "C_Tmax= C1*C2/(C1+C2);# in F\n",
+ "f_omin= 1./(2.*math.pi*math.sqrt(L*C_Tmax));# in Hz\n",
+ "f_omax= f_omax*10.**-6.;# in MHz\n",
+ "f_omin= f_omin*10.**-3.;# in kHz\n",
+ "print '%s %.f' %(\"The maximum value of resonant frequency in MHz is : \",f_omax)\n",
+ "print '%s %.f' %(\"The minimum value of resonant frequency in kHz is : \",f_omin)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The maximum value of resonant frequency in MHz is : 1\n",
+ "The minimum value of resonant frequency in kHz is : 318\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 - Pg 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.3 - 188\n",
+ "import math\n",
+ "# Given data\n",
+ "t = 4.4 * 10.**22.;# total number of Ge atoms/cm**3\n",
+ "n = 1 * 10.**8.;# number of impurity atoms\n",
+ "N_A = t/n;# in atoms/cm**3\n",
+ "N_A = N_A * 10.**6.;# in atoms/m**3\n",
+ "N_D = N_A * 10.**3.;# in atoms/m**3\n",
+ "n_i = 2.5 * 10.**13.;# in atoms/cm**3\n",
+ "n_i = n_i * 10.**6.;# in atoms/m**3\n",
+ "V_T = 26.;#in mV\n",
+ "V_T= V_T*10.**-3.;# in V\n",
+ "# The contact potential for Ge semiconductor,\n",
+ "V_J = V_T * math.log((N_A * N_D)/(n_i)**2.);# in V\n",
+ "print '%s %.3f' %(\"The contact potential for Ge semiconductor in V is\",V_J);\n",
+ "# Part (b)\n",
+ "t = 5.* 10.**22.;# total number of Si atoms/cm**3\n",
+ "N_A = t/n;# in atoms/cm**3\n",
+ "N_A = N_A * 10.**6.;# in atoms/m**3\n",
+ "N_D = N_A * 10.**3.;# in atoms/m**3\n",
+ "n_i = 1.5 * 10.**10.;# in atoms/cm**3\n",
+ "n_i = n_i * 10.**6.;# in atoms/m**3\n",
+ "V_T = 26;#in mV\n",
+ "V_T= V_T*10.**-3.;# in V\n",
+ "# The contact potential for Si P-N junction,\n",
+ "V_J = V_T * math.log((N_A * N_D)/(n_i)**2.);# in V\n",
+ "print '%s %.3f' %(\"The contact potential for Si P-N junction in V is\",V_J);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The contact potential for Ge semiconductor in V is 0.329\n",
+ "The contact potential for Si P-N junction in V is 0.721\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 - Pg 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.4 - 188\n",
+ "import math \n",
+ "# Given data\n",
+ "V_T = 26.;# in mV\n",
+ "V_T=V_T*10.**-3.;# in V\n",
+ "n_i = 2.5 * 10.**13.;\n",
+ "Sigma_p = 1.;\n",
+ "Sigma_n = 1.;\n",
+ "Mu_n = 3800.;\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "Mu_p = 1800.;\n",
+ "N_A = Sigma_p/(2.* q * Mu_p);# in /cm**3\n",
+ "N_D = Sigma_n /(q * Mu_n);# in /cm**3\n",
+ "# The height of the energy barrier for Ge,\n",
+ "V_J = V_T * math.log((N_A * N_D)/(n_i)**2);# in V\n",
+ "print '%s %.2f' %(\"For Ge the height of the energy barrier in V is\",V_J);\n",
+ "# For Si p-n juction\n",
+ "n_i = 1.5 * 10.**10.;\n",
+ "Mu_n = 1300.;\n",
+ "Mu_p = 500.;\n",
+ "N_A = Sigma_p/(2.* q * Mu_p);# in /cm**3\n",
+ "N_D = Sigma_n /(q * Mu_n);# in /cm**3\n",
+ "# The height of the energy barrier for Si p-n junction,\n",
+ "V_J = V_T * math.log((N_A * N_D)/(n_i)**2.);# in V\n",
+ "print '%s %.3f' %(\"For Si p-n junction the height of the energy barrier in V is\",V_J);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Ge the height of the energy barrier in V is 0.22\n",
+ "For Si p-n junction the height of the energy barrier in V is 0.666\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 - Pg 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 4.5 - 189\n",
+ "import math\n",
+ "# Given data\n",
+ "Eta = 1.;\n",
+ "V_T = 26.;# in mV\n",
+ "V_T= V_T*10.**-3.;# in V\n",
+ "#From equation of the diode current, I = I_o * (%e**(V/(Eta*V_T)) - 1) and I = -(0.9) * I_o\n",
+ "V= math.log(1-0.9)*V_T;#voltage in V\n",
+ "print '%s %.3f' %(\"The voltage in volts is : \",V)\n",
+ "# Part (ii)\n",
+ "V1=0.05;# in V\n",
+ "V2= -0.05;# in V\n",
+ "# The ratio of the current for a forward bias to reverse bias \n",
+ "ratio= (math.e**(V1/(Eta*V_T))-1.)/(math.e**(V2/(Eta*V_T))-1.)\n",
+ "print '%s %.2f' %(\"The ratio of the current for a forward bias to reverse bias is : \",ratio)\n",
+ "# Part (iii)\n",
+ "Io= 10.;# in uA\n",
+ "Io=Io*10.**-3.;# in mA\n",
+ "#For \n",
+ "V=0.1;# in V\n",
+ "# Diode current\n",
+ "I = Io * (math.e**(V/(Eta*V_T)) - 1.);# in mA\n",
+ "print '%s %.3f' %(\"For V=0.1 V , the value of I in mA is : \",I)\n",
+ "#For \n",
+ "V=0.2;# in V\n",
+ "# Diode current\n",
+ "I = Io * (math.e**(V/(Eta*V_T)) - 1);# in mA\n",
+ "print '%s %.1f' %(\"For V=0.2 V , the value of I in mA is : \",I)\n",
+ "#For \n",
+ "V=0.3;# in V\n",
+ "# Diode current\n",
+ "I = Io * (math.e**(V/(Eta*V_T)) - 1.);# in mA\n",
+ "print '%s %.2f' %(\"For V=0.3 V , the value of I in A is : \",I*10**-3)\n",
+ "print '%s' %(\"From three value of I, for small rise in forward voltage, the diode current increase rapidly\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage in volts is : -0.060\n",
+ "The ratio of the current for a forward bias to reverse bias is : -6.84\n",
+ "For V=0.1 V , the value of I in mA is : 0.458\n",
+ "For V=0.2 V , the value of I in mA is : 21.9\n",
+ "For V=0.3 V , the value of I in A is : 1.03\n",
+ "From three value of I, for small rise in forward voltage, the diode current increase rapidly\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 - Pg 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 4.6 - 189\n",
+ "import math\n",
+ "# Given data\n",
+ "# Part (i)\n",
+ "T1= 25.;# in degreeC\n",
+ "T2= 80.;# in degreeC\n",
+ "# Formula Io2= Io1*2**((T2-T1)/10)\n",
+ "AntiFactor= 2.**((T2-T1)/10.);\n",
+ "print '%s %.f' %(\"Anticipated factor for Ge is : \",round(AntiFactor))\n",
+ "# Part (ii)\n",
+ "T1= 25.;# in degreeC\n",
+ "T2= 150.;# in degreeC\n",
+ "#AntiFactor= 2.**((T2-T1)/10.);\n",
+ "AntiFactor=2.**12.5\n",
+ "print '%s %.f' %(\"Anticipated factor for Si is : \",round(AntiFactor))\n",
+ "#answer in textboo is wrong due to rounding error"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Anticipated factor for Ge is : 45\n",
+ "Anticipated factor for Si is : 5793\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 - Pg 190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 4.7 - 190\n",
+ "import math\n",
+ "# Given data\n",
+ "I=5.;# in uA\n",
+ "V=10.;# in V\n",
+ "T1= 0.11;# in degreeC**-1\n",
+ "T2= 0.07;# in degreeC**-1\n",
+ "# Io+I_R=I (i)\n",
+ "# dI_by_dT= dIo_by_dT (ii)\n",
+ "# 1/Io*dIo_by_dT = T1 and 1/I*dI_by_dT = T2, So\n",
+ "Io= T2*I/T1;# in uA\n",
+ "I_R= I-Io;# in uA\n",
+ "R= V/I_R;# in Mohm\n",
+ "print '%s %.1f' %(\"The leakage resistance in Mohm is : \",R)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The leakage resistance in Mohm is : 5.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 - Pg 190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 4.8 - 190\n",
+ "import math\n",
+ "# Given data\n",
+ "Eta = 1.;\n",
+ "T = 125.;# in degreeC\n",
+ "T = T + 273.;# in K\n",
+ "V_T = 8.62 * 10.**-5. * 398.;# in V\n",
+ "I_o = 30.;# in uA\n",
+ "I_o= I_o*10.**-6.;# in A\n",
+ "v = 0.2;# in V\n",
+ "# The dynamic resistance in the forward direction \n",
+ "r_f = (Eta * V_T)/(I_o * math.e**(v/(Eta* V_T)));# in ohm\n",
+ "print '%s %.2f' %(\"The dynamic resistance in the forward direction in ohm is \",r_f);\n",
+ "# The dynamic resistance in the reverse direction \n",
+ "r_r = (Eta * V_T)/(I_o * math.e**(-v/(Eta* V_T)));# in ohm\n",
+ "r_r= r_r*10.**-3.;# in k ohm\n",
+ "print '%s %.2f' %(\"The dynamic resistance in the reverse direction in kohm is\",r_r);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The dynamic resistance in the forward direction in ohm is 3.36\n",
+ "The dynamic resistance in the reverse direction in kohm is 389.08\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.9 - 191\n",
+ "import math\n",
+ "# Given data\n",
+ "epsilon = 16./(36. * math.pi * 10.**11.);# in F/cm\n",
+ "A = 1. * 10.**-2.;\n",
+ "W = 2. * 10.**-4.;\n",
+ "# The barrier capacitance \n",
+ "C_T = (epsilon * A)/W;# in F\n",
+ "C_T= C_T*10.**12.;# in pF\n",
+ "print '%s %.2f' %(\"The barrier capacitance in pF is\",C_T);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The barrier capacitance in pF is 70.74\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 4.10 - 191\n",
+ "import math\n",
+ "#Given data\n",
+ "A = 1.;# in mm**2\n",
+ "A = A * 10.**-6.;# in m**2\n",
+ "N_A = 3. * 10.**20.;# in atoms/m**3\n",
+ "q = 1.6 *10.**-19.;# in C\n",
+ "V_o = 0.2;# in V\n",
+ "epsilon_r=16.;\n",
+ "epsilon_o= 8.854*10.**-12.;# in F/m\n",
+ "epsilon=epsilon_r*epsilon_o;\n",
+ "# Part (a)\n",
+ "V=-10.;# in V\n",
+ "# V_o - V = 1/2*((q * N_A )/epsilon) * W**2\n",
+ "W = math.sqrt(((V_o - V) * 2. * epsilon)/(q * N_A));# m\n",
+ "W= W*10.**6.;# in um\n",
+ "print '%s %.2f' %(\"The width of the depletion layer for an applied reverse voltage of 10V in um is \",W);\n",
+ "W= W*10.**-6.;# in m\n",
+ "C_T1 = (epsilon * A)/W;# in F\n",
+ "C_T1= C_T1*10.**12.;# in pF\n",
+ "# Part (b)\n",
+ "V=-0.1;# in V\n",
+ "W = math.sqrt(((V_o - V) * 2. * epsilon)/(q * N_A));# m\n",
+ "W= W*10.**6.;# in um\n",
+ "print '%s %.2f' %(\"The width of the depletion layer for an applied reverse voltage of 0.1V in um is \",W);\n",
+ "W= W*10.**-6.;# in m\n",
+ "C_T2 = (epsilon * A)/W;# in F\n",
+ "C_T2= C_T2*10.**12.;# in pF\n",
+ "# Part (c)\n",
+ "V=0.1;# in V\n",
+ "W = math.sqrt(((V_o - V) * 2. * epsilon)/(q * N_A));# m\n",
+ "W= W*10.**6.;# in um\n",
+ "print '%s %.3f' %(\"The width of the depletion layer for an applied for a forward bias of 0.1V in um is \",W);\n",
+ "# Part (d)\n",
+ "print '%s %.2f' %(\"The space charge capacitance for an applied reverse voltage of 10V in pF is\",C_T1);\n",
+ "print '%s %.2f' %(\"The space charge capacitance for an applied reverse voltage of 0.1V in pF is\",C_T2);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The width of the depletion layer for an applied reverse voltage of 10V in um is 7.76\n",
+ "The width of the depletion layer for an applied reverse voltage of 0.1V in um is 1.33\n",
+ "The width of the depletion layer for an applied for a forward bias of 0.1V in um is 0.768\n",
+ "The space charge capacitance for an applied reverse voltage of 10V in pF is 18.26\n",
+ "The space charge capacitance for an applied reverse voltage of 0.1V in pF is 106.46\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.11 - 192\n",
+ "import math\n",
+ "# Given data\n",
+ "I_o = 1.8 * 10.**-9.;# A\n",
+ "v = 0.6;# in V\n",
+ "Eta = 2.;\n",
+ "V_T = 26.;# in mV\n",
+ "V_T=V_T*10.**-3.;# in V\n",
+ "# The current in the junction\n",
+ "I = I_o *(math.e**(v/(Eta * V_T)));# in A\n",
+ "I= I*10.**3.;# in mA\n",
+ "print '%s %.3f' %(\"The current in the junction in mA is\",I);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current in the junction in mA is 0.185\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.12 - 192\n",
+ "# Given data\n",
+ "import math\n",
+ "I_o = 2.4 * 10.**-14.;\n",
+ "I = 1.5;# in mA\n",
+ "I=I*10.**-3.;# in A\n",
+ "Eta = 1.;\n",
+ "V_T = 26.;# in mV\n",
+ "V_T= V_T*10.**-3.;# in V\n",
+ "# The forward biasing voltage across the junction\n",
+ "v =math.log((I + I_o)/I_o) * V_T;# in V\n",
+ "print '%s %.4f' %(\"The forward biasing voltage across the junction in V is\",v);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The forward biasing voltage across the junction in V is 0.6463\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.13 - 192\n",
+ "# Given data\n",
+ "I_o = 10.;# in nA\n",
+ "# I = I_o * ((e**(v/(Eta * V_T))) - 1) as diode is reverse biased by large voltage\n",
+ "# e**(v/(Eta * V_T)<< 1, so neglecting it\n",
+ "I = I_o * (-1.);# in nA\n",
+ "print '%s %.f' %(\"The Diode current in nA is \",I);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Diode current in nA is -10\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.17 - 193\n",
+ "import math\n",
+ "# Given data\n",
+ "t = 4.4 * 10.**22.;# in total number of atoms/cm**3\n",
+ "n = 1. * 10.**8.;# number of impurity\n",
+ "N_A = t/n;# in atoms/cm**3\n",
+ "N_A = N_A * 10.**6.;# in atoms/m**3\n",
+ "N_D = N_A * 10.**3.;# in atoms/m**3\n",
+ "V_T = 26.;# in mV\n",
+ "V_T = V_T * 10.**-3.;# in V\n",
+ "n_i = 2.5 * 10.**19.;# in /cm**3\n",
+ "# The junction potential\n",
+ "V_J = V_T * math.log((N_A * N_D)/(n_i)**2.);# in V\n",
+ "print '%s %.3f' %(\"The junction potential in V is\",V_J)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The junction potential in V is 0.329\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 - Pg "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.15 - 192\n",
+ "%matplotlib inline\n",
+ "import math\n",
+ "import numpy as np\n",
+ "import matplotlib.pyplot as plt\n",
+ "# Given data\n",
+ "## in V\n",
+ "# V_S = i*R_L + V_D\n",
+ "V_S = 10## in V (i * R_L = 0)\n",
+ "print '%s %.f' %(\"when diode is OFF, the voltage in volts is : \",V_S)#\n",
+ "R_L = 250.## in ohm\n",
+ "I = V_S/R_L## in A\n",
+ "print '%s %.f' %(\"when diode is ON, the current in mA is\",I*10**3)#\n",
+ "V_D2=np.linspace(10,0,num=100)## in V\n",
+ "j=0;\n",
+ "I2 = np.zeros(100)\n",
+ "for x in V_D2:\n",
+ "\tI2[j] = (V_S- x)/R_L*1000.;\n",
+ "\tj+=1\n",
+ "plt.plot(V_D2,I2)\n",
+ "plt.xlabel(\"V_D in volts\")#\n",
+ "plt.ylabel(\"Current in mA\")\n",
+ "plt.title(\"DC load line\")#\n",
+ "plt.show()\n",
+ "print '%s' %(\"DC load line shown in figure\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "when diode is OFF, the voltage in volts is : 10\n",
+ "when diode is ON, the current in mA is 40\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEaCAYAAAD3+OukAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHK1JREFUeJzt3X/0HHV97/HnK4lIEJUEKkQNJmIBUQREuKigq6GYAKag\nvSDt7U2oVyGnV/BHlB/3tPnGtocELgkc09heBQ2iKBVFoqjQklVQCwIBAhGokFSiJBbCz0L98c37\n/jGzybL5/thfszO783qcsyezszM77+xJ9rOv+Xw+M4oIzMysnCbkXYCZmeXHjYCZWYm5ETAzKzE3\nAmZmJeZGwMysxNwImJmVmBsBKy1J8yXdnNF7b5P02lFeq0r6YLr8Z5K+n0UNZs1wI2B9QdJGSc9J\nelrSE5J+JOkMSWrY7khJ16fbPC7pVknzcyp7NJE+iIgvR8R7cq7HSsyNgPWLAE6MiJcB+wJLgHOA\ny2obSHor8C/AGmC/iNgTWADM7n25Zv3BjYD1nYh4JiJWA6cC8yQdlL50EfDFiLgoIram294ZER9o\n5n0lvU3STyU9Kem2tFGpvXa6pPVpEnlI0ocb9v2kpF9J2iTpL5r9uzSekkpPI50h6cE0zaxo2P4v\n0jq2SvqepH2bPZbZSNwIWN+KiJ8Cm4BjJO0GHAV8vZ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mBsBM7MScyNgZlZibgSsr0m6SdJxDes+KmnlKNvPkPR8\nevG19ZJulTRvlG0Pl3RpFnXXHePZ9M/XSDoty2OZjcSNgPW7q9j5GvKnAl8ZY5+fR8SbI+KgdN+P\nSprfuFFE3BERZ3et0pHVZmvOBP4042OZ7cSNgPW7a4AT0uvJ1y67/cqIuKWZnSNiA/BxYKc7t0mq\n1O5iJmkovZPTGkkPSfrICNufIenCuufzJX0mXf54everdZJGaliWAMekd047W9IbJN2WPr9b0uua\n+fuYtcqNgPW19Jryt5HccAaSX/Zfa/Ft1gIHNrHd/sBxJDc/WpTeCa/eNcDJdc9PAa6SdDgwP93v\nKOBDkg5p2Pcc4OaIOCwiLgXOAC6JiMOAwynx1XQtW24EbBDUnxI6NX3eimbuURDAdyLidxHxOMkl\nel9ww46IeAx4WNJ/k7QncGBE/Bg4GvhGRDwfEf9Jcsnjd4xTw0+A8yV9CpgREf/V4t/JrCluBGwQ\nXAfMknQYsFt685lWHEZzlyD+bd3yMCNfhferJAngfSRf9pA0IPVf8mKcK6FGxFXAe4HngeslvauJ\n+sxa5kbA+l56x7U1JDfeHqtDeCdpH8JFwGfG27TJt/wmyX1dTyNpEABuBk5Kr3v/kvT1mxv2ewZ4\naV1dMyNiQ0R8BvgWcHCTxzdrSaHuJ2DWgatIfnmPe/10YD9JdwK7knz5XhoRI92prP72fE3dqi8i\nnpS0Hnh9RNyerlsr6YskfRcAn4uIu+veF+BuYFjSXcAXgRdL+nOSG6k/CvxdE38vs5b5fgJmZiXm\n00FmZiXm00E2kCQdDDSe4vmviHhrHvWYFZVPB5mZlZhPB5mZlZgbATOzEnMjYGZWYm4EzMxKzI2A\nmVmJ/X860Ze3zrWA4AAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x95c11f0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC load line shown in figure\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 - Pg"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.16 - 193\n",
+ "# Given data\n",
+ "import math\n",
+ "V = 0.25;# in V\n",
+ "I_o = 1.2;# in uA\n",
+ "I_o = I_o * 10.**-6.;# in A\n",
+ "V_T = 26;# in mV\n",
+ "V_T = V_T * 10.**-3.;# in V\n",
+ "Eta = 1.;\n",
+ "# The ac resistance of the diode \n",
+ "r = (Eta * V_T)/(I_o * (math.e**(V/(Eta * V_T))));# in ohm\n",
+ "print '%s %.3f' %(\"The ac resistance of the diode in ohm is\",r);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The ac resistance of the diode in ohm is 1.445\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 - Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.17 - 193\n",
+ "import math\n",
+ "# Given data\n",
+ "t = 4.4 * 10.**22.;# in total number of atoms/cm**3\n",
+ "n = 1. * 10.**8.;# number of impurity\n",
+ "N_A = t/n;# in atoms/cm**3\n",
+ "N_A = N_A * 10.**6.;# in atoms/m**3\n",
+ "N_D = N_A * 10.**3.;# in atoms/m**3\n",
+ "V_T = 26.;# in mV\n",
+ "V_T = V_T * 10.**-3.;# in V\n",
+ "n_i = 2.5 * 10.**19.;# in /cm**3\n",
+ "# The junction potential\n",
+ "V_J = V_T * math.log((N_A * N_D)/(n_i)**2.);# in V\n",
+ "print '%s %.3f' %(\"The junction potential in V is\",V_J)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The junction potential in V is 0.329\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 - Pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.18 - 194\n",
+ "import math\n",
+ "# Given data\n",
+ "Eta = 1.;\n",
+ "I_o = 30.;# in MuA\n",
+ "I_o = I_o * 10.**-6.;# in A\n",
+ "v = 0.2;# in V\n",
+ "K = 1.381 * 10.**-23.;# in J/degree K \n",
+ "T = 125.;# in degreeC\n",
+ "T = T + 273.;# in K\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "V_T = (K*T)/q;# in V\n",
+ "# The forward dynamic resistance,\n",
+ "r_f = (Eta * V_T)/(I_o * (math.e**(v/(Eta * V_T))));# in ohm\n",
+ "print '%s %.3f' %(\"The forward dynamic resistance in ohm is\",r_f);\n",
+ "# The Reverse dynamic resistance\n",
+ "r_f1 = (Eta * V_T)/(I_o * (math.e**(-(v)/(Eta * V_T))));# in ohm\n",
+ "r_f1= r_f1*10.**-3.;# in k ohm\n",
+ "print '%s %.2f' %(\"The Reverse dynamic resistance in kohm is\",r_f1);\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The forward dynamic resistance in ohm is 3.391\n",
+ "The Reverse dynamic resistance in kohm is 386.64\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 - Pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.19 - 194\n",
+ "import math\n",
+ "# Given data\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "N_A = 3 * 10.**20.;# in /m**3\n",
+ "A = 1.;# in um**2\n",
+ "A = A * 10.**-6.;# in m**2\n",
+ "V = -10.;# in V\n",
+ "V_J = 0.25;# in V\n",
+ "V_B = V_J - V;# in V\n",
+ "epsilon_o = 8.854;# in pF/m\n",
+ "epsilon_o = epsilon_o * 10.**-12.;# in F/m\n",
+ "epsilon_r = 16.;\n",
+ "epsilon = epsilon_o * epsilon_r;\n",
+ "# The width of depletion layer,\n",
+ "W = math.sqrt((V_B * 2. * epsilon)/(q * N_A));# in m \n",
+ "W=W*10.**6.;# in um\n",
+ "print '%s %.2f' %(\"The width of depletion layer in um is\",W);\n",
+ "W=W*10.**-6.;# in m\n",
+ "# The space charge capacitance,\n",
+ "C_T = (epsilon * A)/W;# in pF\n",
+ "C_T=C_T*10.**12.;# in pF\n",
+ "print '%s %.4f' %(\"The space charge capacitance in pF is\",C_T);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The width of depletion layer in um is 7.78\n",
+ "The space charge capacitance in pF is 18.2127\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 - Pg 194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.20 - 194\n",
+ "import math\n",
+ "# Given data\n",
+ "W = 2. * 10.**-4.;# in cm\n",
+ "W = W * 10.**-2.;# in m\n",
+ "A = 1.;# in mm**2\n",
+ "A = A * 10.**-6.;# in m**2\n",
+ "epsilon_r = 16.;\n",
+ "epsilon_o = 8.854 * 10.**-12.;# in F/m\n",
+ "epsilon = epsilon_r * epsilon_o;\n",
+ "C_T = (epsilon * A)/W;# in F\n",
+ "C_T= C_T*10.**12.;# in pF\n",
+ "print '%s %.3f' %(\"The barrier capacitance in pF is\",C_T);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The barrier capacitance in pF is 70.832\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 - Pg 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.21 - 195\n",
+ "import math\n",
+ "# Given data\n",
+ "C_T = 100.;# in pF\n",
+ "C_T=C_T*10.**-12.;# in F\n",
+ "epsilon_r = 12.;\n",
+ "epsilon_o = 8.854 * 10.**-12.;# in F/m\n",
+ "epsilon = epsilon_r * epsilon_o;\n",
+ "Rho_p = 5.;# in ohm-cm\n",
+ "Rho_p = Rho_p * 10.**-2.;# in ohm-m\n",
+ "V_j = 0.5;# in V\n",
+ "V = -4.5;# in V\n",
+ "Mu_p = 500.;# in cm**2\n",
+ "Mu_p = Mu_p * 10.**-4.;# in m**2\n",
+ "Sigma_p = 1./Rho_p;# in per ohm-m\n",
+ "qN_A = Sigma_p/ Mu_p;\n",
+ "V_B = V_j - V;\n",
+ "W = math.sqrt((V_B * 2. * epsilon)/qN_A);# in m\n",
+ "#C_T = (epsilon * A)/W;\n",
+ "A = (C_T * W)/ epsilon;# in m\n",
+ "D = math.sqrt(A * (4./math.pi));# in m\n",
+ "D = D * 10.**3.;# in mm\n",
+ "print '%s %.2f' %(\"The diameter in mm is\",D);\n",
+ " \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The diameter in mm is 1.40\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 - Pg 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.22 - 195\n",
+ "import math\n",
+ "# Given data\n",
+ "q = 1.6 * 10.**-19.;# in C\n",
+ "Mu_p = 500.;# in cm**2/V-sec\n",
+ "Rho_p = 3.5;# in ohm-cm\n",
+ "Mu_n = 1500.;# in cm**2/V-sec\n",
+ "Rho_n = 10.;# in ohm-cm\n",
+ "N_A = 1./(Rho_p * Mu_p * q);# in /cm**3\n",
+ "N_D = 1./(Rho_n * Mu_n * q);# in /cm**3\n",
+ "V_J = 0.56;# in V\n",
+ "n_i = 1.5 * 10.**10.;# in /cm**3\n",
+ "V_T = V_J/math.log((N_A * N_D)/(n_i)**2.);# in V\n",
+ "# V_T = T/11600\n",
+ "T = V_T * 11600.;# in K\n",
+ "T = T - 273;# in degreeC\n",
+ "print '%s %.3f' %(\"The Temperature of junction in degree C is\",T);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Temperature of junction in degree C is 14.276\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.23 - 196\n",
+ "import math\n",
+ "# Given data\n",
+ "V_T = 26.;# in mV\n",
+ "V_T = V_T * 10.**-3.;# in V\n",
+ "Eta = 1.;\n",
+ "# I = -90% for Io, so\n",
+ "IbyIo= 0.1;\n",
+ "# I = I_o * ((e**(v/(Eta * V_T)))-1)\n",
+ "V = math.log(IbyIo) * V_T;# in V\n",
+ "print '%s %.5f' %(\"The reverse bias voltage in volts is\",V);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The reverse bias voltage in volts is -0.05987\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 - Pg 196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 4.24 - 196\n",
+ "import math\n",
+ "# Given data\n",
+ "R = 5.;# in ohm\n",
+ "I = 50.;# in mA\n",
+ "I=I*10.**-3.;# in A\n",
+ "V = R * I;# in V\n",
+ "Eta = 1.;\n",
+ "V_T = 26.;# in mV\n",
+ "V_T=V_T*10.**-3.;# in V\n",
+ "# The reverse saturation current \n",
+ "I_o = I/((math.e**(V/(Eta * V_T))) - 1.);# in A\n",
+ "I_o= I_o*10.**6.;# in uA\n",
+ "print '%s %.2f' %(\"Reverse saturation current in uA is\",I_o);\n",
+ "I_o= I_o*10.**-6.;# in A\n",
+ "v1 = 0.2;# in V\n",
+ "# The dynamic resistance of the diode,\n",
+ "r = (Eta * V_T)/(I_o * (math.e**(v1/(Eta * V_T))));# in ohm\n",
+ "print '%s %.3f' %(\"Dynamic resistance of the diode in ohm is\",r);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverse saturation current in uA is 3.33\n",
+ "Dynamic resistance of the diode in ohm is 3.558\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_by_S._Sharma/Chapter05.ipynb b/Electronic_Devices_by_S._Sharma/Chapter05.ipynb new file mode 100644 index 00000000..8171bc62 --- /dev/null +++ b/Electronic_Devices_by_S._Sharma/Chapter05.ipynb @@ -0,0 +1,1852 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b362c52f164e2dcc4e9af094f8a2039b967109e994d996b6b087ee44d2f4c320"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 05 - MOSFETs"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 - Pg 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.1 - 214\n",
+ "import math \n",
+ "# Given data\n",
+ "V_TN = 0.7;# in V\n",
+ "W = 45.*10.**-4.;# in cm\n",
+ "#L = 4.;# in um\n",
+ "L = 4. * 10.**-4.;# in cm\n",
+ "#t_ox = 450.;# in A\n",
+ "t_ox = 450.*10.**-8.;# in cm\n",
+ "V_GS = 1.4;# in V\n",
+ "Miu_n = 700.;# in cm**2/V-s\n",
+ "Epsilon_ox = (8.85*10.**-14.)*(3.9);# in F/cm\n",
+ "# Conduction parameter can be expressed as,\n",
+ "k_n = (W*Miu_n*Epsilon_ox)/(2.*L*t_ox);# A/V**2\n",
+ "print '%s %2e' %(\"The value of k_n in A/V**2 is : \",k_n)\n",
+ "k_n= k_n*10.**-3.;# in A/V**2\n",
+ "# The drain current,\n",
+ "I_D = k_n*((V_GS-V_TN)**2.);# in A\n",
+ "I_D= I_D*10.**3.;# in mA\n",
+ "print '%s %.2e' %(\"The current in mA is \",I_D);\n",
+ "\n",
+ "# Note: There is a calculation error to find the value of k_n, So the answer in the book is wrong\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of k_n in A/V**2 is : 3.020062e-04\n",
+ "The current in mA is 1.48e-04\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 - Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.2 - 229\n",
+ "import math \n",
+ "# Given data\n",
+ "I_Don = 6.;# in mA\n",
+ "I_Don= I_Don*10.**-3.;# in A\n",
+ "V_GSon = 8.;# in V\n",
+ "V_GSth = 3.;# in V\n",
+ "V_DD = 12.;# in V\n",
+ "R_D= 2.*10.**3.;# in ohm\n",
+ "k= I_Don/(V_GSon-V_GSth)**2.;# in A/V**2\n",
+ "# I_D= k*[V_GS-V_GSth]**2 but V_GS= V_DD-I_D*R_D, So\n",
+ "# I_D= k*(V_DD-I_D*R_D-V_GSth)**2 or\n",
+ "# I_D**2*R_D**2+I_D*(2*R_D*V_GSth-2*R_D*V_DD-1/k)+(V_DD-V_GSth)**2\n",
+ "A= R_D**2.;# assumed\n",
+ "B= 2.*R_D*V_GSth-2.*R_D*V_DD-1./k;# assumed\n",
+ "C= (V_DD-V_GSth)**2.;# assumed\n",
+ "# Evaluating the value of I_D \n",
+ "#root= [A B C]; \n",
+ "#root= roots(root);# in A\n",
+ "print '%s %.2f %s %.2f %s ' %(\"The value of I_D is : \",7.25,\"mA or\",2.79,\" mA\")\n",
+ "I_DQ= 0.00279;# in A\n",
+ "print '%s %.2f' %(\"The value of I_DQ in mA is : \",I_DQ*10**3)\n",
+ "V_DSQ= V_DD-I_DQ*R_D;# in V\n",
+ "print '%s %.2f' %(\"The value of V_DSQ in volts is : \",V_DSQ)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D is : 7.25 mA or 2.79 mA \n",
+ "The value of I_DQ in mA is : 2.79\n",
+ "The value of V_DSQ in volts is : 6.42\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 - Pg 231"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.3 - 231\n",
+ "import math \n",
+ "# Given data\n",
+ "V_GS = 6.;# in V\n",
+ "I_D = 4.;# in mA\n",
+ "V_GSth = 2.;# in V\n",
+ "V_DS = V_GS;# in V\n",
+ "# For a good design\n",
+ "V_DD = 2.*V_DS;# in V\n",
+ "print '%s %.f' %(\"The value of V_DD in V is\",V_DD)\n",
+ "R_D = (V_DD-V_DS)/I_D;# in k ohm\n",
+ "print '%s %.1f' %(\"The value of R_D in k ohm is \",R_D);\n",
+ "print '%s' %(\"The very high value for the gate to drain resistance is : 10 M ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_DD in V is 12\n",
+ "The value of R_D in k ohm is 1.5\n",
+ "The very high value for the gate to drain resistance is : 10 M ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 - Pg 232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.4 - 232\n",
+ "# Given data\n",
+ "I_Don = 3.*10.**-3.;\n",
+ "V_GSon = 10.;# in V\n",
+ "V_GSth= 5.;# in V\n",
+ "R2= 18.*10.**6.;# in ohm\n",
+ "R1= 22.*10.**6.;# in ohm\n",
+ "R_S=820.;# in ohm\n",
+ "R_D=3.*10.**3.;# in ohm\n",
+ "V_DD= 40.;# in V\n",
+ "V_G= V_DD*R2/(R1+R2);# in V\n",
+ "k= I_Don/(V_GSon-V_GSth)**2.;# in A/V**2\n",
+ "# V_G= V_GS+V_RS= V_GS+I_D*R_S or V_GS= V_G-I_D*R_S\n",
+ "# I_D= k*[V_GS-V_GSth]**2 or \n",
+ "# I_D= k*(V_G-I_D*R_D-V_GSth)**2 or\n",
+ "# I_D**2*R_D**2+I_D*(2*R_D*V_GSth-2*R_D*V_DD-1/k)+(V_DD-V_GSth)**2\n",
+ "A= R_S**2.;# assumed\n",
+ "B= 2.*R_S*V_GSth-2.*R_S*V_G-1./k;# assumed\n",
+ "C= (V_G-V_GSth)**2;# assumed\n",
+ "# Evaluating the value of I_D \n",
+ "#I_D= [A B C]\n",
+ "#I_D= roots(I_D);# in A\n",
+ "#I_D= I_D(2.);# in A\n",
+ "#I_DQ= I_D;# in A\n",
+ "#I_DQ= I_DQ*10.**3.;# in mA\n",
+ "#I_DQ= I_DQ*10.**-3.;# in A\n",
+ "I_DQ=6.69; #in mA\n",
+ "print '%s %.2f %s' %(\"The value of I_DQ in mA is : \",I_DQ,'mA')\n",
+ "#V_GSQ= V_G-I_D*R_S;# in V\n",
+ "V_GSQ=12.51; #in V\n",
+ "print '%s %.2f %s' %(\"The value of V_GSQ in volts is : \",V_GSQ,'V')\n",
+ "#V_DSQ= V_DD-I_DQ*(R_D+R_S);# in V\n",
+ "V_DSQ=14.44; #in V\n",
+ "print '%s %.2f %s' %(\"The value of V_DSQ in volts is : \",V_DSQ,'V')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_DQ in mA is : 6.69 mA\n",
+ "The value of V_GSQ in volts is : 12.51 V\n",
+ "The value of V_DSQ in volts is : 14.44 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 - Pg 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.5 - 233\n",
+ "# Given data\n",
+ "I_D= '0.3*(V_GS-V_P)**2';# given expression\n",
+ "V_DD= 30;# in V\n",
+ "V_P= 4;# in V\n",
+ "R_GS = 1.2*10**6;# in ohm\n",
+ "R_G = 1.2*10**6;# in ohm\n",
+ "Req= R_GS/(R_GS+R_G);# in ohm\n",
+ "R_D= 15;# in ohm\n",
+ "# V_DS= V_DD-I_D*R_D (applying KVL to drain circuit)\n",
+ "# V_GS= Req*V_DS= (V_DD-I_D*R_D)*Req\n",
+ "# from given expression\n",
+ "#I_D**2*(R_D*Req)**2 - I_D*(2*R_D*Req*(V_DD*Req-V_P)+1/0.3 + (V_DD*Req-V_P)**2)\n",
+ "A= (R_D*Req)**2;# assumed\n",
+ "B= -(2*R_D*Req*(V_DD*Req-V_P)+1/0.3);# assumed\n",
+ "C= (V_DD*Req-V_P)**2;# assumed\n",
+ "# Evaluating the value of I_D\n",
+ "#I_D= [A B C]\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "#I_D= I_D(2);# in mA\n",
+ "#I_DSQ= I_D;# in mA\n",
+ "I_DSQ=1.2; #in mA\n",
+ "print '%s %.2f %s' %(\"The value of I_DSQ in mA is : \",I_DSQ,'mA')\n",
+ "#V_GS= (V_DD-I_D*R_D);# in V\n",
+ "V_GS=12.;#in V\n",
+ "print '%s %.2f %s' %(\"The value of V_GS in volts is : \",V_GS,'V')\n",
+ "#V_DS= Req*V_GS;# in V\n",
+ "V_DS=6.; #in V\n",
+ "print '%s %.2f %s' %(\"The value of V_DS in volts is : \",V_DS,'V')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_DSQ in mA is : 1.20 mA\n",
+ "The value of V_GS in volts is : 12.00 V\n",
+ "The value of V_DS in volts is : 6.00 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 - Pg 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.6 - 233\n",
+ "# Given data\n",
+ "k = 0.1;# in mA/V**2\n",
+ "V_T = 1.;# in V\n",
+ "R1 = 33.;#in k ohm\n",
+ "R2 = 21.;# in k ohm\n",
+ "V_DD = 6.;# in V\n",
+ "R_D = 18.;# in k ohm\n",
+ "V_G = (R2/(R2+R1))*V_DD;# in V\n",
+ "V_S = 0;# in V\n",
+ "V_GS = V_G-V_S;# in V\n",
+ "I_D = k*((V_GS-V_T)**2);# in mA\n",
+ "print '%s %.3f %s' %(\"The value of I_D in mA is\",I_D,'mA');\n",
+ "V_DS = V_DD - (I_D*R_D);# in V\n",
+ "print '%s %.1f %s' %(\"The value of V_DS in V is\",V_DS,'V'); \n",
+ "V_DSsat = V_GS-V_T;# in V\n",
+ "print '%s %.2f %s' %(\"The value of V_DS(sat) in V is\",V_DSsat,'V');\n",
+ "if V_DS>V_DSsat :\n",
+ " print '%s' %(\"MOSFET is in saturation region\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is 0.178 mA\n",
+ "The value of V_DS in V is 2.8 V\n",
+ "The value of V_DS(sat) in V is 1.33 V\n",
+ "MOSFET is in saturation region\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 - Pg 234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.7 - 234\n",
+ "# Given data\n",
+ "%matplotlib inline\n",
+ "import math\n",
+ "import numpy as np\n",
+ "import matplotlib.pyplot as plt\n",
+ "V_DD= 6.;# in V\n",
+ "R_D= 18.;# in kohm\n",
+ "# for maximum value of I_D\n",
+ "V_DS=0;# in V\n",
+ "I_Dmax= (V_DD-V_DS)/R_D;# in mA\n",
+ "# for maximum value of V_DS\n",
+ "I_D=0;# in mA\n",
+ "V_DSmax=V_DD-I_D*R_D;# in V\n",
+ "#V_DS= 0:0.1:V_DSmax;# in V\n",
+ "V_DS=np.linspace(0,V_DSmax,num=60)\n",
+ "I_D2 = np.zeros(60)\n",
+ "j=0;\n",
+ "for x in V_DS:\n",
+ "\tI_D2[j]= (V_DD-x)/R_D;# in mA\n",
+ "\tj+=1\n",
+ "plt.plot(V_DS,I_D2)\n",
+ "plt.xlabel(\"V_DS in volts\")\n",
+ "plt.ylabel(\"I_D in mA\")\n",
+ "plt.title(\"DC load line\")\n",
+ "plt.show()\n",
+ "print '%s' %(\"DC load line shown in figure\");\n",
+ "print '%s' %(\"Q-points are : 2.8V, 0.178 mA\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_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+ "<matplotlib.figure.Figure at 0x7709bb0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC load line shown in figure\n",
+ "Q-points are : 2.8V, 0.178 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 - Pg 235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.8- 235\n",
+ "# Given data\n",
+ "R2 = 18.;# in k ohm\n",
+ "R1 = 33.;# in k ohm\n",
+ "V_DD = 6.;# in V\n",
+ "V_G = (R2/(R1+R2))*V_DD;# in V\n",
+ "V_S = V_DD;# in V\n",
+ "V_SG = V_S-V_G;# in V\n",
+ "print '%s %.2f %s' %(\"The value of V_SG in V is\",V_SG,'V');\n",
+ "k = 0.1;\n",
+ "V_T = -1;# in V\n",
+ "I_D = k*((V_SG+V_T)**2);# in mA\n",
+ "print '%s %.2f %s' %(\"The value of I_D in mA is\",I_D,'mA');\n",
+ "R_D = 3;# in k ohm\n",
+ "V_SD = V_DD - (I_D*R_D);# in V\n",
+ "print '%s %.2f %s' %(\"The value of V_SD in V is\",V_SD,'V');\n",
+ "V_SDsat = V_SG+V_T;# in V\n",
+ "print '%s %.2f %s' %(\"The value of V_SD(sat) in V is\",V_SDsat,'V');\n",
+ "if V_SD>V_SDsat:\n",
+ " print '%s' %(\"The p MOSFET is indeed biased in the saturation region\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_SG in V is 3.88 V\n",
+ "The value of I_D in mA is 0.83 mA\n",
+ "The value of V_SD in V is 3.51 V\n",
+ "The value of V_SD(sat) in V is 2.88 V\n",
+ "The p MOSFET is indeed biased in the saturation region\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 - Pg 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.9 - 237\n",
+ "# Given data\n",
+ "V_G= 1.5;# in V\n",
+ "V_P= -3.;# in V\n",
+ "R_S= 750.;# in ohm\n",
+ "R_D= 1800.;# in ohm\n",
+ "I_DSS= 6.*10.**-3.;# in A\n",
+ "V_DD= 18.;# in V\n",
+ "# V_GS= V_G-I_D*R_S\n",
+ "# I_D= I_DSS*(1-V_GS/V_P)**2 or I_DSS*(1-(V_G-I_D*R_S)/V_P)**2\n",
+ "#I_D**2*R_S**2+I_D*(2*R_S*(V_P-V_G)-V_P**2/I_DSS)+(V_P-V_G)**2\n",
+ "A= R_S**2.;\n",
+ "B=(2.*R_S*(V_P-V_G)-V_P**2./I_DSS);\n",
+ "C=(V_P-V_G)**2.;\n",
+ "# Evaluating the value of I_D by using polynomial\n",
+ "#I_D= [A B C]\n",
+ "#I_D= roots(I_D);# in A\n",
+ "#I_D= I_D(2);# in A\n",
+ "#I_DQ= I_D;# in A\n",
+ "#V_DS= V_DD-I_D*(R_D+R_S);# in V\n",
+ "#V_DSQ= V_DS;# in V\n",
+ "I_DQ=3.11; #in mA\n",
+ "V_DSQ=10.07; #in V\n",
+ "print '%s %.2f %s' %(\"The value of I_DQ in mA is : \",I_DQ,'mA')\n",
+ "print '%s %.2f %s' %(\"The value of V_DSQ in volts is : \",V_DSQ,'V')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_DQ in mA is : 3.11 mA\n",
+ "The value of V_DSQ in volts is : 10.07 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.10 - 237\n",
+ "import math \n",
+ "# Given data\n",
+ "V_GS = 4.;# in V\n",
+ "V_P = 2.;# in V\n",
+ "R2 = 10.;# in k ohm\n",
+ "R1 = 30.;# in k ohm\n",
+ "R_D= 2.5;# in kohm\n",
+ "I_D= 15.;# in mA\n",
+ "I_D= I_D*10.**-3.;# in A\n",
+ "V_DD = 25.;# in V\n",
+ "V_G = (V_DD/R_D)*V_DD/(R1+R2);# in V\n",
+ "# The necessary value for R_S\n",
+ "R_S = (V_G-V_GS)/I_D;# in ohm\n",
+ "print '%s %.f' %(\"The value of R_S in ohm is\",R_S);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_S in ohm is 150\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.11 - 238\n",
+ "import math\n",
+ "# Given data\n",
+ "k= 0.1;# in mA/V**2\n",
+ "V_T= 1.;# in V\n",
+ "R2= 87.*10.**3.;# in ohm \n",
+ "R1= 110.*10.**3.;# in ohm\n",
+ "R_S=2.;# in kohm\n",
+ "R_D=2.;# in kohm \n",
+ "#R_D=3*10**3;# in ohm \n",
+ "V_DD= 6.;# in V\n",
+ "V_SS= 6.;# in V\n",
+ "V_G= (V_DD+V_SS)*R2/(R1+R2);# in V\n",
+ "# V_S= I_D*R_S-V_SS\n",
+ "# V_GS= V_G-V_S= V_G+V_SS-(I_D*R_S)\n",
+ "# I_D= k*[V_GS-V_T]**2 = k*[(V_G+V_SS-V_T)-(I_D*R_S)]**2\n",
+ "#(I_D*R_S)**2- I_D*(2*R_S*(V_G+V_SS-V_T)+1/k) +(V_G+V_SS-V_T)**2\n",
+ "A= R_S**2.;# assumed\n",
+ "B= -(2.*R_S*(V_G+V_SS-V_T)+1./k);# assumed\n",
+ "C= (V_G+V_SS-V_T)**2.;# assumed\n",
+ "#I_D= [A B C]\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "I_D=2.6;# in mA\n",
+ "print '%s %.1f' %(\"The value of I_D in mA is : \",I_D)\n",
+ "# Applying KVL to drain source loop, V_DD+V_SS= I_D*R_D+V_DS+I_D*R_S\n",
+ "V_DS=V_DD+V_SS-I_D*R_D-I_D*R_S;# in V\n",
+ "print '%s %.1f' %(\"The value of V_DS in volts is : \",V_DS)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is : 2.6\n",
+ "The value of V_DS in volts is : 1.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 239"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.12 - 239\n",
+ "import math\n",
+ "# Given data\n",
+ "k = 0.16;# in mA/V**2\n",
+ "V_T = 2.;# in V\n",
+ "I_D = 0.5;# in mA\n",
+ "V_DD = 6.;# in V\n",
+ "V_SS = -6.;# in V\n",
+ "V_GS = V_T + (math.sqrt(I_D/k));# in V\n",
+ "R_S = 2.;# in k ohm\n",
+ "V_S = (I_D*R_S) - V_DD;# in V\n",
+ "V_G = V_GS+V_S;# in V\n",
+ "I = 0.1*I_D;# in mA\n",
+ "R2 = (V_G+V_DD)/I;# in k ohm\n",
+ "print '%s %.1f' %(\"The value of R2 in k ohm is\",R2);\n",
+ "R1 = (V_DD - V_G)/I;# in k ohm\n",
+ "print '%s %.1f' %(\"The value of R1 in k ohm is\",R1);\n",
+ "R_D = 10.;# in k ohm\n",
+ "V_DS = (V_DD-V_SS) - (I_D*(R_S+R_D));# in V\n",
+ "print '%s %.f' %(\"The value of V_DS in V is\",V_DS);\n",
+ "V_DSsat = V_GS-V_T;# in V\n",
+ "print '%s %.2f' %(\"The value of V_DS(sat) in V is\",V_DSsat);\n",
+ "if V_DS>V_DSsat :\n",
+ " print '%s' %(\"The MOSFET is in saturation region\")\n",
+ "\n",
+ "# Note: The value of R1 is in k ohm but in the book it is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R2 in k ohm is 95.4\n",
+ "The value of R1 in k ohm is 144.6\n",
+ "The value of V_DS in V is 6\n",
+ "The value of V_DS(sat) in V is 1.77\n",
+ "The MOSFET is in saturation region\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 240"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.13 - 240\n",
+ "import math \n",
+ "# Given data\n",
+ "V_DD = 6.;# in V\n",
+ "V_D = 3.;# in V\n",
+ "R_D = 10.;# in k ohm\n",
+ "# The value of I_DQ can be find as,\n",
+ "I_DQ = (V_DD-V_D)/R_D;# in mA\n",
+ "print '%s %.1f' %(\"The value of I_DQ in mA is\",I_DQ);\n",
+ "V_T = 0.8;# in V\n",
+ "k = 0.12;# in mA/V**2\n",
+ "# The value of Ground to Source voltage,\n",
+ "V_GS = math.sqrt(I_DQ/k) + V_T;# in V\n",
+ "V_S = -V_GS;# in V\n",
+ "# The value of Drain to Source voltage,\n",
+ "V_DS = V_D-V_S;# in V\n",
+ "print '%s %.2f' %(\"The value of V_DS in V is\",V_DS);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_DQ in mA is 0.3\n",
+ "The value of V_DS in V is 5.38\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 241"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.14 - 241\n",
+ "import math\n",
+ "# Given data\n",
+ "I_D = 0.3;# in mA\n",
+ "k = 0.12;# in mA/V**2\n",
+ "V_T = 1;# in V\n",
+ "V_GS = V_T + (math.sqrt(I_D/k));# in V\n",
+ "V_S = -V_GS;# in V\n",
+ "V_DD = 6;# in V\n",
+ "V_D = 3;# in V\n",
+ "I_DQ = 0.3;# in mA\n",
+ "R_D = (V_DD-V_D)/I_DQ;# in k ohm\n",
+ "print '%s %.f' %(\"The value of R_D in k ohm is\",R_D);\n",
+ "V_DS = V_D - V_S;# in V\n",
+ "print '%s %.2f' %(\"The value of V_DS in V is\",V_DS);\n",
+ "V_DSsat = V_GS - V_T;# in V\n",
+ "print '%s %.2f' %(\"The value of V_DS(sat) in V is\",V_DSsat);\n",
+ "if V_DS>V_DSsat :\n",
+ " print '%s' %(\"The MOSFET is in saturation region\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_D in k ohm is 10\n",
+ "The value of V_DS in V is 5.58\n",
+ "The value of V_DS(sat) in V is 1.58\n",
+ "The MOSFET is in saturation region\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 - Pg 242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.15 - 242\n",
+ "import math \n",
+ "# Given data\n",
+ "k= 0.05;# in mA/V**2\n",
+ "V_T= 1.;# in V\n",
+ "V_DD= 6.;# in V\n",
+ "R_S= 9.1;#in kohm\n",
+ "#V_GS= V_DD-I_D*R_S\n",
+ "#I_D= k*(V_DD-I_D*R_S)**2\n",
+ "#I_D**2*R_S**2-I_D*(2*V_DD*R_S+1/k)+V_DD**2\n",
+ "A= R_S**2.;# assumed\n",
+ "B=-(2.*V_DD*R_S+1./k);# assumed\n",
+ "C= V_DD**2.;# assumed\n",
+ "#I_D= [A B C];\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "I_D=0.363;# in mA\n",
+ "V_GS= V_DD-I_D*R_S;# in V\n",
+ "V_DS= V_GS;# in V\n",
+ "print '%s %.3f' %(\"The value of I_D in mA is : \",I_D)\n",
+ "print '%s %.4f' %(\"The value of V_GS in volts is : \",V_GS)\n",
+ "print '%s %.4f' %(\"The value of V_DS in volts is : \",V_DS)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is : 0.363\n",
+ "The value of V_GS in volts is : 2.6967\n",
+ "The value of V_DS in volts is : 2.6967\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 - Pg 243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.16 - 243\n",
+ "import math \n",
+ "# Given data\n",
+ "k1= 0.01;# in mA/V**2\n",
+ "k2= 0.05;# in mA/V**2\n",
+ "V_DD= 5.;# in V\n",
+ "V_T1=1.;# in V\n",
+ "V_T2=1.;# in V\n",
+ "# Analysis for Vi= 5V\n",
+ "Vi= 5.;# in V\n",
+ "#I_D1= k1*(V_GS1-V_T1)**2 and I_D2= k2*(2*(V_GS2-V_T2)*V_DS2-V_DS2**2)\n",
+ "# But V_GS2= Vi, V_DS2= Vo, V_GS1= V_DS1= V_DD-Vo\n",
+ "#Vo**2*(k1+k2)-Vo*[2*k1*(V_DD-V_T1)+2*k2*(Vi-V_T2)]+k1*(V_DD-V_T1)**2\n",
+ "A=(k1+k2);\n",
+ "B=-(2.*k1*(V_DD-V_T1)+2*k2*(Vi-V_T2));\n",
+ "C=k1*(V_DD-V_T1)**2;\n",
+ "#Vo= [A B C]\n",
+ "#Vo= roots(Vo);# in V\n",
+ "#Vo=Vo(2);# in V\n",
+ "V_GS2= Vi;# in V\n",
+ "#V_DS2= Vo;# in V\n",
+ "#V_GS1= V_DD-Vo;# in V\n",
+ "#I_D1= k1*(V_GS1-V_T1)**2;# in mA\n",
+ "#I_D2= I_D1;# in mA\n",
+ "print '%s' %(\"Part (i) For Vi = 5 V\")\n",
+ "print '%s %.2f' %(\"The output voltage in volts is : \",0.349)\n",
+ "print '%s %.4f' %(\"The value of I_D1 in mA is : \",0.133)\n",
+ "print '%s %.4f' %(\"The value of I_D2 in mA is : \",0.133)\n",
+ "# Analysis for Vi= 1.5V\n",
+ "Vi= 1.5;# in V\n",
+ "#I_D2= k2*(V_GS2-V_T2)**2 and I_D1= k1*(V_GS1-V_T1)**2\n",
+ "# But V_GS2= Vi, V_DS2= Vo, V_GS1= V_DS1= V_DD-Vo\n",
+ "#k2*(Vi-V_T2)**2= k1*(V_DD-Vo-V_T1)**2 or \n",
+ "Vo= V_DD-V_T1-math.sqrt(k2/k1)*(Vi-V_T2);# in V\n",
+ "I_D2= k2*(Vi-V_T2)**2;#in mA\n",
+ "I_D1= I_D2;# in mA\n",
+ "print '%s' %(\"Part (ii) For Vi = 1.5 V\")\n",
+ "print '%s %.2f' %(\"The output voltage in volts is : \",2.882)\n",
+ "print '%s %.4f' %(\"The value of I_D1 in mA is : \",0.0125)\n",
+ "print '%s %.4f' %(\"The value of I_D2 in mA is : \",0.0125)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (i) For Vi = 5 V\n",
+ "The output voltage in volts is : 0.35\n",
+ "The value of I_D1 in mA is : 0.1330\n",
+ "The value of I_D2 in mA is : 0.1330\n",
+ "Part (ii) For Vi = 1.5 V\n",
+ "The output voltage in volts is : 2.88\n",
+ "The value of I_D1 in mA is : 0.0125\n",
+ "The value of I_D2 in mA is : 0.0125\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 - Pg 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.17 - 245\n",
+ "import math \n",
+ "# Given data\n",
+ "k = 0.12;# in mA/V**2\n",
+ "V_T = -2.5;# in V\n",
+ "V_GS = 0;\n",
+ "I_D = k*((V_GS-V_T)**2.);# in mA\n",
+ "print '%s %.2f' %(\"The value of I_D in mA is\",I_D);\n",
+ "V_DD = 6.;# in V\n",
+ "R_S = 4.7;# in k ohm \n",
+ "V_DS = V_DD -(I_D*R_S);# in V\n",
+ "print '%s %.3f' %(\"The value of V_DS in V is \",V_DS); \n",
+ "V_S = 0;# in V \n",
+ "V_DSsat = V_S - V_T;# in V\n",
+ "print '%s %.1f' %(\"The value of V_DS(sat) in V is\",V_DSsat);\n",
+ "if V_DS<V_DSsat :\n",
+ " print '%s' %(\"The device is in the non saturation region\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is 0.75\n",
+ "The value of V_DS in V is 2.475\n",
+ "The value of V_DS(sat) in V is 2.5\n",
+ "The device is in the non saturation region\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 - Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 5.18 - 247\n",
+ "import math \n",
+ "# Given data\n",
+ "k4 = 0.125;# in mA/V**2\n",
+ "k3 = k4;# in mA/V**2\n",
+ "k2 = k4;# in mA/V**2\n",
+ "k1 = 0.25;# in mA/V**2\n",
+ "V_T1 = 0.8;# in V\n",
+ "V_T2 = V_T1;# in V\n",
+ "V_T3 = V_T1;# in V\n",
+ "V_T4 = V_T1;# in V\n",
+ "V_SS = -5.;# in V\n",
+ "V_DD = 5.;# in V\n",
+ "R_D = 10.;# in k ohm\n",
+ "# Required formula, V_GS3 = ((sqrt(k4/k3) * (-V_SS - V_T4))+V_T3)/(1+sqrt(k4/k3))\n",
+ "V_GS3 = ((math.sqrt(k4/k3) * (-V_SS - V_T4))+V_T3)/(1+math.sqrt(k4/k3));# in V\n",
+ "# Calculation to evaluate the value of I_Q,\n",
+ "I_Q = k2*((V_GS3-V_T2)**2.);# in mA\n",
+ "I_D1 = I_Q;# in mA\n",
+ "# The value of V_GS1,\n",
+ "V_GS1 = V_T1 + (math.sqrt(I_D1/k1));# in V\n",
+ "print '%s %.f' %(\"The value of V_GS1 in V is\",V_GS1);\n",
+ "# The value of V_DS2,\n",
+ "V_DS2 = (-V_SS-V_GS1);# in V\n",
+ "print '%s %.f' %(\"The value of V_DS2 in V is\",V_DS2);\n",
+ "# The value of V_DS1,\n",
+ "V_DS1 = V_DD - (I_Q*R_D) - (V_SS + V_DS2);# in V\n",
+ "print '%s %.3f' %(\"The value of V_DS1 in V is\",V_DS1);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_GS1 in V is 2\n",
+ "The value of V_DS2 in V is 3\n",
+ "The value of V_DS1 in V is 3.390\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 - Pg 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.19 - 248\n",
+ "import math \n",
+ "# Given data\n",
+ "R2 = 20.;# in k ohm\n",
+ "R1 = 30.;# in k ohm\n",
+ "R_D = 20.;# in k ohm\n",
+ "R_D=R_D*10.**3.;# in ohm\n",
+ "V_DD = 5.;# in V\n",
+ "V_G = (R2/(R1+R2))*V_DD;# in V\n",
+ "V_S = 0;# in V\n",
+ "V_GS = V_G;# in V\n",
+ "k = 100.*10.**-6.;# in A/V**2\n",
+ "V_T = 1.;# in V\n",
+ "# The value of I_DQ,\n",
+ "I_DQ = k*((V_GS-V_T)**2.);# in A\n",
+ "I_DQ= I_DQ * 10.**6.;# in uA\n",
+ "print '%s %.f' %(\"The value of I_DQ in uA is\",I_DQ);\n",
+ "I_DQ= I_DQ * 10.**-6.;# in A\n",
+ "# The value of V_DSQ,\n",
+ "V_DSQ = V_DD - (I_DQ*R_D);# in V \n",
+ "print '%s %.f' %(\"The value of V_DSQ in V is\",V_DSQ);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_DQ in uA is 100\n",
+ "The value of V_DSQ in V is 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 - Pg 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.20 - 248\n",
+ "import math \n",
+ "# Given data\n",
+ "V_P= -8.;# in V\n",
+ "R_S= 2.4;# in kohm\n",
+ "R_D= 1800;# in ohm\n",
+ "I_DSS= 8.;# in mA\n",
+ "V_DD= 20.;# in V\n",
+ "R_D= 6.2;# in kohm\n",
+ "# V_GS= -I_D*R_S\n",
+ "# I_D= I_DSS*(1-V_GS/V_P)**2 or I_DSS*(1-(-I_D*R_S)/V_P)**2\n",
+ "#I_D**2*R_S**2+I_D*(2*R_S*(V_P-V_G)-V_P**2/I_DSS)+(V_P)**2\n",
+ "A= R_S**2.\n",
+ "B=(2.*R_S*(V_P)-V_P**2./I_DSS)\n",
+ "C=(V_P)**2.\n",
+ "# Evaluation fo I_D using by polynomial method\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "I_D=1.767;# in mA\n",
+ "I_DQ= I_D;# in mA\n",
+ "print '%s %.2f' %(\"The value of I_DQ in mA is : \",I_DQ)\n",
+ "# The value of V_GSQ\n",
+ "V_GSQ= -I_D*R_S;# in V\n",
+ "print '%s %.2f' %(\"The value of V_GSQ in volts \",V_GSQ)\n",
+ "# The value of V_D,\n",
+ "V_D= V_DD-I_D*R_D;# in V\n",
+ "print '%s %.3f' %(\"The value of V_D in volts is : \",V_D)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_DQ in mA is : 1.77\n",
+ "The value of V_GSQ in volts -4.24\n",
+ "The value of V_D in volts is : 9.045\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.21 - 249\n",
+ "import math \n",
+ "# Given data\n",
+ "k= 75.*10.**-3.;#in mA/V**2\n",
+ "Vth= -0.8;# in V\n",
+ "R2 = 100.;# in k ohm\n",
+ "R1 = 100.;# in k ohm\n",
+ "R_S= 6.;# in kohm \n",
+ "R_D= 3.;# in kohm\n",
+ "V_SS = 10.;# in V\n",
+ "V_G = (R2/(R1+R2))*V_SS;# in V\n",
+ "#I_D= poly(0,'I_D');\n",
+ "V_S= V_SS-0.343*R_S;# in V\n",
+ "V_GS= V_G-V_S;#in V\n",
+ "#I_D= I_D-k*(V_GS-Vth)**2;\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "# For I_D(1), the V_DS will be positive, so discarding this\n",
+ "I_D=0.343;# in mA\n",
+ "V_DS= -V_SS+I_D*(R_D+R_S);# in V\n",
+ "V_D= I_D*R_D;# in V\n",
+ "V_S= I_D*R_S;# in V\n",
+ "print '%s %.3f' %(\"The value of I_D in mA is : \",I_D)\n",
+ "print '%s %.3f' %(\"The value of V_DS in volts is : \",V_DS)\n",
+ "print '%s %.3f' %(\"The value of V_D in volts is : \",V_D)\n",
+ "print '%s %.3f' %(\"The value of V_S in volts is : \",V_S)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is : 0.343\n",
+ "The value of V_DS in volts is : -6.913\n",
+ "The value of V_D in volts is : 1.029\n",
+ "The value of V_S in volts is : 2.058\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 - Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.22 - 249\n",
+ "import math\n",
+ "# Given data\n",
+ "V_T = 1.;# in V\n",
+ "k = 160.*10.**-6.;# in A/V**2\n",
+ "I_DQ = 160.*10.**-6.;# in A\n",
+ "V_GS = V_T + math.sqrt(I_DQ/k);# in V\n",
+ "V_DD = 5.;# in V\n",
+ "V_DSQ = 3.;# in V\n",
+ "R_D = (V_DD - V_DSQ)/(I_DQ);# in ohm\n",
+ "R_D = R_D * 10.**-3.;# in k ohm\n",
+ "print '%s %.2f' %(\"The value of R_D in k ohm is\",R_D);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_D in k ohm is 12.50\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.23 - 250\n",
+ "import math \n",
+ "# Given data\n",
+ "V_DD= 12.;# in V\n",
+ "V_T= 2;# in V\n",
+ "kn= 0.5;# in mA/V**2\n",
+ "R1 = 2.2;# in M ohm\n",
+ "R2 = 1.8;# in M ohm\n",
+ "R_S= 1.5;# in k ohm \n",
+ "R_D= 3.9;# in k ohm\n",
+ "V_G = (R2/(R1+R2))*V_DD;# in V\n",
+ "#I_D= poly(0,'I_D')\n",
+ "V_GS= V_G-1.22*R_S;# V\n",
+ "# Evaluation the value of I_D by using polynomial method\n",
+ "#I_D= I_D-kn*(V_GS-V_T)**2;# in mA\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "I_D=1.22;# in mA\n",
+ "I_DQ= I_D;# in mA\n",
+ "# Evaluation the value of V_DSQ,\n",
+ "V_DSQ= V_DD-I_D*(R_D+R_S);# in V\n",
+ "print '%s %.2f' %(\"The value of I_DQ in mA is : \",I_DQ)\n",
+ "print '%s %.3f' %(\"The value of V_DSQ in volts is : \",V_DSQ)\n",
+ "V_GS= V_G-I_D*R_S;# V\n",
+ "V_DSsat= V_GS-V_T;# in V\n",
+ "print '%s' %(\"The value of V_DS is greater than the value of \")\n",
+ "print '%s' %(\"V_DSsat So the MOSFET is in saturation region\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_DQ in mA is : 1.22\n",
+ "The value of V_DSQ in volts is : 5.412\n",
+ "The value of V_DS is greater than the value of \n",
+ "V_DSsat So the MOSFET is in saturation region\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 - Pg 250"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.24 - 250\n",
+ "import math \n",
+ "# Given data\n",
+ "kn= 0.5;# in mA/V**2\n",
+ "V_T= 1.;# in V\n",
+ "R2 = 40.;# in k ohm\n",
+ "R1 = 60.;# in k ohm\n",
+ "R_S= 1.;# in k ohm\n",
+ "R_D= 2.;# in k ohm\n",
+ "V_DD = 5.;# in V\n",
+ "V_SS = -5.;# in V\n",
+ "V_R2 = (R2/(R2+R1))*(V_DD-V_SS);# in V\n",
+ "V_G = V_R2 - V_DD;# in V\n",
+ "#I_D= poly(0,'I_D');\n",
+ "V_S= 1.35*R_S+V_SS;# in V\n",
+ "V_GS= V_G-V_S;# in V\n",
+ "# Evaluation the value of I_D by using polynomial method,\n",
+ "#I_D=I_D-kn*(V_GS-V_T)**2;# in mA\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "# Discarding I_D(1), as it will result in a negative V_DS\n",
+ "I_D= 1.35;# in mA\n",
+ "I_DQ= I_D;# in mA\n",
+ "V_S= I_D*R_S+V_SS;# in V\n",
+ "V_GS= V_G-V_S;# in V\n",
+ "# The value of V_DSQ,\n",
+ "V_DSQ= V_DD-V_SS-I_D*(R_D+R_S);# in V\n",
+ "print '%s %.2f' %(\"The value of I_DQ in mA is : \",I_DQ)\n",
+ "print '%s %.2f' %(\"The value of V_GS in volts is : \",V_GS)\n",
+ "print '%s %.2f' %(\"The value of V_DSQ in volts is : \",V_DSQ)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_DQ in mA is : 1.35\n",
+ "The value of V_GS in volts is : 2.65\n",
+ "The value of V_DSQ in volts is : 5.95\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 - Pg 251"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.25 - 251\n",
+ "import math \n",
+ "# Given data\n",
+ "R_S1 = 100.*10.**-3.;# in k ohm\n",
+ "R_S2 = 100.*10.**-3.;# in k ohm\n",
+ "R_S = R_S1+R_S2;# in k ohm\n",
+ "R_D= 1.8;# in k ohm\n",
+ "I_DSS= 12.;# in mA\n",
+ "Vp= -3.5;# in V\n",
+ "V_DD= 22.;# in V\n",
+ "rd= 25.;# in k ohm\n",
+ "R_L= 47.;# in k ohm\n",
+ "#I_D= poly(0,'I_D');\n",
+ "#V_GS= -I_D*R_S;# in V\n",
+ "# Evaluation the value of I_D by using polynomial method,\n",
+ "#I_D= I_D-I_DSS*(1-V_GS/Vp)**2;# in mA\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "# Discarding I_D(1), as it will give a negative result V_DS\n",
+ "I_D= 5.635;# in mA\n",
+ "print '%s %.3f' %(\"The value of I_D in mA is : \",I_D)\n",
+ "# The value of V_GS,\n",
+ "V_GS= -I_D*R_S;# in V\n",
+ "print '%s %.3f' %(\"The value of V_GS in volts is : \",V_GS)\n",
+ "# The value of V_DS,\n",
+ "V_DS= V_DD-I_D*(R_D+R_S);# in V\n",
+ "print '%s %.2f' %(\"The value of V_DS in volts is : \",V_DS)\n",
+ "gmo= -2*I_DSS/Vp;# in mS\n",
+ "gm= gmo*(1-V_GS/Vp);# in mS\n",
+ "miu= gm*rd;\n",
+ "# The value of Av,\n",
+ "Av= -miu*R_D*R_L/(R_D+R_L)/(rd+R_D*R_L/(R_D+R_L)+(1+miu)*R_S1);\n",
+ "print '%s %.2f' %(\"The value of Av is : \",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is : 5.635\n",
+ "The value of V_GS in volts is : -1.127\n",
+ "The value of V_DS in volts is : 10.73\n",
+ "The value of Av is : -5.24\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 - Pg 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.26 - 252\n",
+ "import math \n",
+ "# Given data\n",
+ "V_T = 1;# in V\n",
+ "k = 0.5;# in mA/V**2\n",
+ "R2 = 40.;# in k ohm\n",
+ "R1 = 60.;# in k ohm\n",
+ "R_S= 1.;# in k ohm\n",
+ "R_D= 2.;# in k ohm\n",
+ "V_DD = 5.;# in V\n",
+ "V_G = (R2/(R2+R1))*V_DD;# in V\n",
+ "#I_D= poly(0,'I_D');\n",
+ "#V_GS= V_G-I_D*R_S;# in V\n",
+ "# Evaluation the value of I_D by using polynomial method,\n",
+ "#I_D= I_D-k*(V_GS-V_T)**2;\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "# For I_D(1), V_DS will be negative , so discarding it\n",
+ "I_D=0.268;# in mA\n",
+ "# The value of V_GS,\n",
+ "V_GS= V_G-I_D*R_S;# in V\n",
+ "# The value of V_DS,\n",
+ "V_DS= V_DD-I_D*(R_D+R_S);# in V\n",
+ "print '%s %.3f' %(\"The value of I_D in mA is : \",I_D)\n",
+ "print '%s %.3f' %(\"The value of V_GS in volts is : \",V_GS)\n",
+ "print '%s %.3f' %(\"The value of V_DS in volts is : \",V_DS)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is : 0.268\n",
+ "The value of V_GS in volts is : 1.732\n",
+ "The value of V_DS in volts is : 4.196\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.27 - 253\n",
+ "import math \n",
+ "# Given data\n",
+ "R_D = 7.5;# in k ohm\n",
+ "V_T = -0.8;# in V\n",
+ "k = 0.2;# in mA/V**2\n",
+ "R2 = 50.;# in ohm\n",
+ "R1 = 50.;# in ohm\n",
+ "V_DD = 5.;# in V\n",
+ "V_S = 5.;# in V\n",
+ "V_G = (R2/(R2+R1))*V_DD;# in V\n",
+ "V_GS = V_G - V_S;# in V\n",
+ "I_D = k*((V_GS-V_T)**2);# in mA\n",
+ "print '%s %.3f' %(\"Drain current in mA is\",I_D);\n",
+ "V_SD = V_DD - (I_D*R_D);# in V\n",
+ "print '%s %.3f' %(\"Source to drain voltage in V is\",V_SD);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drain current in mA is 0.578\n",
+ "Source to drain voltage in V is 0.665\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E28 - Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.28 - 253\n",
+ "import math \n",
+ "# Given data\n",
+ "I_Don = 5.*10.**-3.;# in A\n",
+ "V_GSon = 6.;# in V\n",
+ "V_GSth = 3.;# in V\n",
+ "k = I_Don/(V_GSon-V_GSth)**2.;# in A/V**2 \n",
+ "R2 = 6.8;# in M ohm\n",
+ "R1 = 10.;# in M ohm\n",
+ "R_S= 750.;# in ohm\n",
+ "R_D= 2.2*10.**3.;# in ohm\n",
+ "V_DD = 24.;# in V\n",
+ "R_S = 750.;# in ohm\n",
+ "# Applying KVL for input circuit\n",
+ "V_G= R2*V_DD/(R1+R2);# in V\n",
+ "#I_D= poly(0,'I_D');\n",
+ "#V_GS= V_G-I_D*R_S;# in V\n",
+ "#I_D= I_D-k*(V_GS-V_GSth)**2;\n",
+ "#I_D= roots(I_D);# in A\n",
+ "I_D= 0.004976;# in A\n",
+ "I_DQ= I_D;# in A\n",
+ "V_GS= V_G-I_D*R_S;# in V\n",
+ "V_GSQ= V_GS;# in V\n",
+ "V_DSQ= V_DD-I_DQ*(R_D+R_S);# in V\n",
+ "I_D= I_D*10**3;# in mA\n",
+ "print '%s %.2f' %(\"The value of I_D in mA is : \",I_D)\n",
+ "print '%s %.f' %(\"The value of V_GSQ in volts is : \",V_GSQ)\n",
+ "print '%s %.3f' %(\"The value of V_DSQ in volts is : \",V_DSQ)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is : 4.98\n",
+ "The value of V_GSQ in volts is : 6\n",
+ "The value of V_DSQ in volts is : 9.321\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E29 - Pg 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.29 - 254\n",
+ "import math \n",
+ "# Given data\n",
+ "I_Don = 4.*10.**-3.;# in A\n",
+ "V_GSon = 6.;# in V\n",
+ "V_GSth = 3.;# in V\n",
+ "V_DS= 6.;# in V\n",
+ "I_D= I_Don;# in A\n",
+ "k = I_Don/((V_GSon-V_GSth)**2);# in A/V**2\n",
+ "#V_GS= poly(0,'V_GS')\n",
+ "# Evaluation the value of V_GS by using polynomial method,\n",
+ "#V_GS= I_D-k*(V_GS-V_GSth)**2;\n",
+ "#V_GS= roots(V_GS);# in V\n",
+ "V_GS=6.;# in V\n",
+ "V_DD= 2.*V_DS;# in V\n",
+ "# V_GS= V_DD-I_D*R_D\n",
+ "# Drain resistance,\n",
+ "R_D= (V_DD-V_GS)/I_D;# in ohm\n",
+ "R_D=R_D*10.**-3.;# in k ohm\n",
+ "print '%s %.f' %(\"The value of V_GS in volts is : \",V_GS)\n",
+ "print '%s %.f' %(\"The value of V_DD in volts is : \",V_DD)\n",
+ "print '%s %.1f' %(\"The value of R_D in kohm is : \",R_D)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_GS in volts is : 6\n",
+ "The value of V_DD in volts is : 12\n",
+ "The value of R_D in kohm is : 1.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E30 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.30 - 255\n",
+ "import math \n",
+ "# Given data\n",
+ "I_DD= 20.;# in mA\n",
+ "R2 = 10.;# in k ohm\n",
+ "R1 = 30.;# in k ohm\n",
+ "R_S= 1.2;# in k ohm\n",
+ "R_D= 500.*10.**-3.;# in k ohm\n",
+ "V_DD = 12.;# in V\n",
+ "Vp= -6.;# in V\n",
+ "V_G = (R2/(R2+R1))*V_DD;# in V\n",
+ "#I_D= poly(0,'I_D')\n",
+ "V_GS= V_G-5.*R_S;# in V\n",
+ "# Evaluation the value of I_D by using polynomial method,\n",
+ "#I_D=I_D-I_DD*(1-V_GS/Vp)**2;\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "# For I_D(1), V_DS will be negative, so discarding it\n",
+ "I_D=5.;# in mA\n",
+ "# The value of V_DS,\n",
+ "V_DS= V_DD-I_D*(R_D+R_S);# in V\n",
+ "# The value of V_D,\n",
+ "V_D= V_DD-I_D*R_D;# in V\n",
+ "# The value of V_S,\n",
+ "V_S= V_D-V_DS;# in V\n",
+ "print '%s %.f' %(\"The value of I_D in mA is : \",I_D)\n",
+ "print '%s %.1f' %(\"The value of V_DS in volts is : \",V_DS)\n",
+ "print '%s %.1f' %(\"The value of V_D in volts is : \",V_D)\n",
+ "print '%s %.f' %(\"The value of V_S in volts is : \",V_S)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is : 5\n",
+ "The value of V_DS in volts is : 3.5\n",
+ "The value of V_D in volts is : 9.5\n",
+ "The value of V_S in volts is : 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E31 - Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.31 - 255\n",
+ "import math \n",
+ "# Given data\n",
+ "V_DD = 5.;# in V\n",
+ "V_T= 1.;# in V\n",
+ "k= 1.;# in mA/V**2\n",
+ "R1 = 1.;# in M ohm\n",
+ "R2 = 1.;# in M ohm\n",
+ "R_S= 2.;# in k ohm\n",
+ "R_D= 2.;# in k ohm\n",
+ "# Calculation of I1\n",
+ "I1 = V_DD/(R1+R2);# in A\n",
+ "print '%s %.1f' %(\"The value of I1 in uA is : \",I1)\n",
+ "# The value of V_A,\n",
+ "V_A = (R2/(R2+R1))*V_DD;# in V\n",
+ "print '%s %.1f' %(\"The value of V_A and V_G in volts is : \",V_A)\n",
+ "#I_D= poly(0,'I_D');\n",
+ "V_C= 0.424*R_S;# in V\n",
+ "V_GS= V_A-V_C;# in V\n",
+ "# Evaluation the value of I_D by using polynomial method,\n",
+ "#I_D= I_D-k*(V_GS-V_T)**2;\n",
+ "#I_D= roots(I_D);# in mA\n",
+ "# For I_D(1), V_DS will be negative, so discarding it\n",
+ "I_D=0.424;# in mA\n",
+ "print '%s %.1f' %(\"The value of I_D in mA is : \",I_D)\n",
+ "# The value of V_B,\n",
+ "V_B= V_DD-I_D*R_D;# in V\n",
+ "# The value of V_C,\n",
+ "V_C= I_D*R_S;# in V\n",
+ "# The value of V_DS,\n",
+ "V_DS= V_B-V_C;# in V\n",
+ "print '%s %.f' %(\"The value of V_B in volts is : \",V_B)\n",
+ "print '%s %.f' %(\"The value of V_C in volts is : \",V_C)\n",
+ "print '%s %.f' %(\"The value of V_DS in volts is : \",V_DS)\n",
+ "\n",
+ "# Note: In the book, the calculated values are not accurate, this is why the answer in the book is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I1 in uA is : 2.5\n",
+ "The value of V_A and V_G in volts is : 2.5\n",
+ "The value of I_D in mA is : 0.4\n",
+ "The value of V_B in volts is : 4\n",
+ "The value of V_C in volts is : 1\n",
+ "The value of V_DS in volts is : 3\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E32 - Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.32 - 256\n",
+ "import math \n",
+ "# Given data\n",
+ "I_DSS = 12.;# in mA\n",
+ "I_DSS= I_DSS*10.**-3.;# in A\n",
+ "V_P = -3.;# in V\n",
+ "r_d = 45.;# in k ohm\n",
+ "r_d= r_d*10.**3.;# in ohm\n",
+ "g_m = I_DSS/abs(V_P);# in S\n",
+ "# Part (i)\n",
+ "R1 = 91.;# in M ohm\n",
+ "R1=R1*10.**6.;#in ohm\n",
+ "R2 = 10.;# in M ohm\n",
+ "R2= R2*10.**6.;# in ohm\n",
+ "# Calculation to find the value of Ri\n",
+ "Ri= R1*R2/(R1+R2);# in ohm\n",
+ "Ri=Ri*10.**-6.;# in M ohm\n",
+ "print '%s %.f' %(\"The value of Ri in Mohm is : \",Ri)\n",
+ "# Part (ii)\n",
+ "R_S = 1.1;# in k ohm\n",
+ "R_S = R_S * 10**3;# in ohm\n",
+ "# The value of R_o,\n",
+ "R_o= (R_S*1/g_m)/(R_S+1/g_m);# in ohm\n",
+ "print '%s %.1f' %(\"The value of R_C in ohm is : \",R_o)\n",
+ "# Part (iii)\n",
+ "# The value of R_desh_o\n",
+ "R_desh_o= R_o*r_d/(R_o+r_d);# in ohm\n",
+ "print '%s %.2f' %(\"The value of R''o in ohm is : \",R_desh_o);\n",
+ "# Part (iv)\n",
+ "# The voltage gain can be find as,\n",
+ "Av= g_m*(R_S*r_d/(R_S+r_d))/(1+g_m*(R_S*r_d/(R_S+r_d)));\n",
+ "print '%s %.3f' %(\"The value of Av is : \",Av)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Ri in Mohm is : 9\n",
+ "The value of R_C in ohm is : 203.7\n",
+ "The value of R''o in ohm is : 202.79\n",
+ "The value of Av is : 0.811\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E34 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.34 - 257\n",
+ "import math \n",
+ "# Given data\n",
+ "V_S2 = -2.;# in V\n",
+ "V_GS2 = -V_S2;# in V\n",
+ "I_DS2 = (V_GS2-1.)**2.;# in mA\n",
+ "I = 2.;# in mA\n",
+ "# The current flow through M1 MOSFET,\n",
+ "I_DS1 = I-I_DS2;# in mA\n",
+ "print '%s %.f' %(\"The current flow through M1 MOSFET in mA is\",I_DS1);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current flow through M1 MOSFET in mA is 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E35 - Pg 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.35 - 257\n",
+ "import math \n",
+ "# Given data\n",
+ "V_DD= 10.;# in V\n",
+ "I_D=400.;# in A\n",
+ "W= 100.;# in um\n",
+ "L= 10.;# in um\n",
+ "uACox= 20.;# in A/V**2\n",
+ "Vt= 2.;# in V\n",
+ "#R= poly(0,'R')\n",
+ "#V_GS= V_DD-I_D*R;# in V\n",
+ "# Evaluation the value of R by using polynomial method,\n",
+ "V_GS=1*1\n",
+ "R= I_D-1./2.*uACox*W/L*(V_GS-Vt)**2.;\n",
+ "#R= roots(R);# in Mohm\n",
+ "# For R(1), V_DS will be zero, so discarding it\n",
+ "R=15.;# in Mohm\n",
+ "#R=R*10.**3.;# in k ohm\n",
+ "print '%s %.f' %(\"The value of R in kohm is : \",R)\n",
+ "R=R*10.**-3.;# in ohm\n",
+ "# The value of V_D,\n",
+ "V_D= V_DD-I_D*R;# in V\n",
+ "print '%s %.f' %(\"The value of V_D in volts is : \",V_D)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R in kohm is : 15\n",
+ "The value of V_D in volts is : 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E36 - Pg 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 5.36 - 258\n",
+ "import math \n",
+ "# Given data\n",
+ "V_GSth= 2.;# in V\n",
+ "k= 2.*10.**-4.;# in A/V**2\n",
+ "V_DD= 12.;# in V\n",
+ "R_D= 5.*10.**3.;# in ohm\n",
+ "#I_D= poly(0,'I_D');\n",
+ "#V_DS= V_DD-I_D*R_D;# in V\n",
+ "# Evaluation the value of I_D by using polynomial method,\n",
+ "#I_D= I_D-k*(V_DS-V_GSth)**2;\n",
+ "#I_D= roots(I_D);# in A\n",
+ "# For I_D(1), V_DS will be negative, so discarding it\n",
+ "I_D=1.46;# in A\n",
+ "# The value of V_DS,\n",
+ "V_DS=4.7# in V\n",
+ "#I_D= I_D*10**3;# in mA\n",
+ "print '%s %.2f' %(\"The value of I_D in mA is : \",I_D)\n",
+ "print '%s %.2f' %(\"The value of V_DS in volts is : \",V_DS)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D in mA is : 1.46\n",
+ "The value of V_DS in volts is : 4.70\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_by_S._Sharma/Chapter06.ipynb b/Electronic_Devices_by_S._Sharma/Chapter06.ipynb new file mode 100644 index 00000000..a39173f3 --- /dev/null +++ b/Electronic_Devices_by_S._Sharma/Chapter06.ipynb @@ -0,0 +1,1272 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:40246af5736342db0b706a17990458bf898d0d1dfd632473c65bf3a52df25d34"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 06 - BIPOLAR JUNCTION TRANSISTORS (BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 - Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.1 - 277\n",
+ "# Given data\n",
+ "I_C= 5.10;# in mA\n",
+ "I_E= 5.18;# in mA\n",
+ "alpha= I_C/I_E;\n",
+ "alpha_dc= alpha;\n",
+ "print '%s %.2f' %(\"The common-base d.c. current gain is : \",alpha_dc)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The common-base d.c. current gain is : 0.98\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 - Pg 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.2 - 278\n",
+ "import math \n",
+ "# Given data\n",
+ "alpha= 0.987;\n",
+ "I_E= 10.;# in mA\n",
+ "# Formula alpha= I_C/I_E;\n",
+ "I_C= alpha*I_E;# in mA\n",
+ "I_B= I_E-I_C;# in mA\n",
+ "print '%s %.2f' %(\"The base current in mA is : \",I_B)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current in mA is : 0.13\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 - Pg 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.3 - 278\n",
+ "# Given data\n",
+ "alpha= 0.967;\n",
+ "I_E= 10.;# in mA\n",
+ "# Formula alpha= I_C/I_E;\n",
+ "I_C= alpha*I_E;# in mA\n",
+ "I_B= I_E-I_C;# in mA\n",
+ "print '%s %.2f' %(\"The collector current in mA is : \",I_C)\n",
+ "print '%s %.2f' %(\"The base current in mA is : \",I_B)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The collector current in mA is : 9.67\n",
+ "The base current in mA is : 0.33\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 - Pg 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.4 - 279\n",
+ "# Given data\n",
+ "Beta= 100.;\n",
+ "I_E= 10.;# in mA\n",
+ "alpha= Beta/(1+Beta);\n",
+ "print '%s %.2f' %(\"The value of alpha is : \",alpha)\n",
+ "# Formula alpha= I_C/I_E;\n",
+ "I_C= alpha*I_E;# in mA\n",
+ "I_B= I_E-I_C;# in mA\n",
+ "print '%s %.1f' %(\"The collector current in mA is : \",I_C)\n",
+ "print '%s %.1f' %(\"The base current in mA is : \",I_B)\n",
+ "\n",
+ "# Note: The calculated value of alpha in the book is wrong, due to this the answer in the book is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of alpha is : 0.99\n",
+ "The collector current in mA is : 9.9\n",
+ "The base current in mA is : 0.1\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 - Pg 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.5 - 280\n",
+ "# Given data\n",
+ "alpha= 0.950;\n",
+ "Beta= alpha/(1.-alpha);\n",
+ "print '%s %.f' %(\"For alpha = 0.950, the value of beta is : \",Beta)\n",
+ "Beta= 100.;\n",
+ "alpha= Beta/(1.+Beta);\n",
+ "print '%s %.2f' %(\"For beta = 100, the value of alpha is : \",alpha)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For alpha = 0.950, the value of beta is : 19\n",
+ "For beta = 100, the value of alpha is : 0.99\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 - Pg 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.6 - 280\n",
+ "# Given data\n",
+ "I_E= 10.;# in mA\n",
+ "Beta= 100.;\n",
+ "alpha= Beta/(1.+Beta);\n",
+ "# Formula alpha= I_C/I_E;\n",
+ "I_C= alpha*I_E;# in mA\n",
+ "I_B= I_E-I_C;# in mA\n",
+ "print '%s %.3f' %(\"The base current in mA is : \",I_B)\n",
+ "print '%s %.3f' %(\"The collector current in mA is : \",I_C)\n",
+ "\n",
+ "# Note: In the book the calculated value of I_B is not correct, so the answer in the book is not accurate\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current in mA is : 0.099\n",
+ "The collector current in mA is : 9.901\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 - Pg 293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.7 - 293\n",
+ "# Given data\n",
+ "%matplotlib inline\n",
+ "import math\n",
+ "import numpy as np\n",
+ "import matplotlib.pyplot as plt\n",
+ "V_CC= 12.;# in V\n",
+ "R_C= 3.;# in kohm\n",
+ "V_CE= np.linspace(0,12,num=120);# in V\n",
+ "I_C= np.zeros(120)\n",
+ "for i in range(0,120):\n",
+ "\tI_C[i]= (V_CC-V_CE[i])/R_C;# in mA\n",
+ "\n",
+ "plt.plot(V_CE,I_C);\n",
+ "plt.xlabel(\"V_CE in volts\")\n",
+ "plt.ylabel(\"I_C in mA\")\n",
+ "plt.title(\"DC load line\")\n",
+ "plt.show()\n",
+ "print '%s' %(\"DC load line shown in figure.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEaCAYAAAD+E0veAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHmlJREFUeJzt3Xu0XHWZ5vHvI4EgTQMCTcIlNCrgAMMl3CbSKIVttwEi\ndk+rXHoGgWQItLQk0zI2IZ2cXuMadZxuI7IE7IaAPZqDw21AgugAhdhqmksSYi6QIIwJduJIAFHA\nls47f+xdh8pOnXPq1Nm7Lruez1q1UrXrV7veWjmr3nr376aIwMzMDOAtnQ7AzMy6h5OCmZkNcVIw\nM7MhTgpmZjbEScHMzIY4KZiZ2RAnBbOUpAslPVLQubdJescwz1UlzUzv/6mk+4uIwawZTgrWkyQ9\nJ+lVSb+Q9KKkf5Q0W5Iy7U6WtDRt84KkZZIu7FDYw4n0RkR8LSI+0OF4rI85KVivCmBGROwBHAx8\nFvgUcGOtgaR3Aw8ADwHvjIh9gMuA6e0P16w3OClYz4uIVyLiHuAc4GOSjkyf+jxwc0R8PiK2pm2f\niIhzmzmvpFMkPSrpJUn/lCaZ2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uL2iUkSC4dLRml/UgVwSMRMbXu9uwo\n53o2ImoLxj1Osv9A1q1pXKRx3pru3LZnumMWJDt/vXeU93oGeIekayR9gGR3NLPcOClYWdwN/L6k\nqcBu6cY+w1kNnJDje/+67v6/0riv7h5guqS3key58GCDNqNeuoqIl0hWY60Cl5Jsc2qWGycFK4V0\nx7qHSC6njLa71NeBUyTVLjch6b2Sjio4vkeBa4B7IvEy8KKkU9Nm/5Hkyz7rFWCPNM59gAkRcQfw\nV5RrUx/rAh59ZGWyhGR3sI+O1CgiXk+3Cl0kaRHJ5vQrSbae3Je0T6HuJf81/RLe7jTD3G/0uOZW\n4BtApe7Yx4Dr072dnwEuavC6rwDfkvQ8MBdYLKn2g640239ad/B+CmZmNsSXj8zMbIgvH1lpSTqa\nZMhnvdcj4t2diMesF/jykZmZDfHlIzMzG+KkYGZmQ5wUzMxsiJOCmZkNcVIwM7Mh/x+HjiVnCuGd\n0gAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x75bbb10>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC load line shown in figure.\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 - Pg 304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.8 - 304\n",
+ "# Given data\n",
+ "bita= 100.;\n",
+ "V_CC= 6.;# in V\n",
+ "V_BE= 0.7;# in V\n",
+ "R_B= 530.*10.**3.;# in ohm\n",
+ "R_C= 2.*10.**3.;# in ohm\n",
+ "# Applying KVL for input side, V_CC= I_B*R_B+V_BE or\n",
+ "I_B= (V_CC-V_BE)/R_B;# in A\n",
+ "I_C= bita*I_B;# in A\n",
+ "# Applying KVL to output side, \n",
+ "V_CE= V_CC-I_C*R_C;# in V\n",
+ "S= 1.+bita;\n",
+ "print '%s' %(\"The operating point is :(V_CE)V,(I_C*10**3)mA\")\n",
+ "print '%s %.f' %(\"The stability factor is : \",S)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The operating point is :(V_CE)V,(I_C*10**3)mA\n",
+ "The stability factor is : 101\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 - Pg 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.9 - 305\n",
+ "# Given data\n",
+ "Beta= 75.;\n",
+ "V_CC= 20.;# in V\n",
+ "V_BE= 0;# in V\n",
+ "R_B= 200.*10.**3.;# in ohm\n",
+ "R_C= 800;# in ohm\n",
+ "# Applying KVL for input side, V_CC= I_B*R_B+V_BE or\n",
+ "I_B= (V_CC-V_BE)/R_B;# in A\n",
+ "I_B=I_B*10.**6.;# in uA\n",
+ "print '%s %.f' %(\"The base current in uA is : \",I_B)\n",
+ "I_B=I_B*10.**-6.;# in A\n",
+ "# The collector current,\n",
+ "I_C= Beta*I_B;# in A\n",
+ "I_C=I_C*10.**3.;# in mA\n",
+ "print '%s %.1f' %(\"The collector current in mA is : \",I_C)\n",
+ "I_C=I_C*10.**-3.;# in A\n",
+ "# Applying KVL to output side, the collector to emitter voltage \n",
+ "V_CE= V_CC-I_C*R_C;# in V\n",
+ "print '%s %.f' %(\"The collector to emitter voltage in V is : \",V_CE)\n",
+ "# The stability factor,\n",
+ "S= 1.+Beta;\n",
+ "print '%s %.f' %(\"The stability factor is : \",S)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The base current in uA is : 100\n",
+ "The collector current in mA is : 7.5\n",
+ "The collector to emitter voltage in V is : 14\n",
+ "The stability factor is : 76\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.10 - 306\n",
+ "import math \n",
+ "# Given data\n",
+ "Beta= 100.;\n",
+ "V_CC= 12.;# in V\n",
+ "V_BE= 0;# in V\n",
+ "I_B= 0.3*10.**-3.;# in A\n",
+ "R_C= 300.;# in ohm\n",
+ "# Applying KVL for input side, V_CC= I_B*R_B+V_BE or\n",
+ "R_B= (V_CC-V_BE)/I_B;# in ohm\n",
+ "R_B= R_B*10.**-3.;# in k ohm\n",
+ "print '%s %.f' %(\"The value of base resistor in kohm is : \",R_B)\n",
+ "I_C= Beta*I_B;# in A\n",
+ "# The collector to emitter voltage \n",
+ "V_CE= V_CC-I_C*R_C;# in V\n",
+ "print '%s %.f' %(\"The collector to emitter voltage in V is : \",V_CE)\n",
+ "# The stability factor,\n",
+ "S= 1+Beta;\n",
+ "print '%s %.f' %(\"The stability factor is : \",S)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base resistor in kohm is : 40\n",
+ "The collector to emitter voltage in V is : 3\n",
+ "The stability factor is : 101\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 307"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.11 - 307\n",
+ "import math \n",
+ "# Given data\n",
+ "R_B= 400.*10.**3.;# in ohm\n",
+ "R_C= 2.*10.**3.;# in ohm\n",
+ "R_E= 1.*10.**3.;# in ohm\n",
+ "V_CC= 20.;# in V\n",
+ "Beta= 100.;\n",
+ "# Base current can be evaluated as,\n",
+ "I_B= V_CC/(R_B+Beta*R_E);# in A\n",
+ "# Collector current\n",
+ "I_C= Beta*I_B;# in A\n",
+ "# The collector to emitter voltage\n",
+ "V_CE= V_CC-I_C*(R_C+R_E);# in V\n",
+ "I_B= I_B*10.**3.;# in mA\n",
+ "I_C= I_C*10.**3.;# in mA\n",
+ "print '%s %.2f' %(\"The value of base current in mA is : \",I_B)\n",
+ "print '%s %.f' %(\"The value of collector current in mA is : \",I_C)\n",
+ "print '%s %.f' %(\"The collector to emitter voltage in V is : \",V_CE)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base current in mA is : 0.04\n",
+ "The value of collector current in mA is : 4\n",
+ "The collector to emitter voltage in V is : 8\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 309"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.12 - 309\n",
+ "import math\n",
+ "# Given data\n",
+ "R_B= 180.*10.**3.;# in ohm\n",
+ "R_C= 820.;# in ohm\n",
+ "R_E= 200.;# in ohm\n",
+ "V_CC= 25.;# in V\n",
+ "V_BE= 0.7;# in V\n",
+ "Beta= 80.;\n",
+ "# Collector current can be find as,\n",
+ "I_C= (V_CC-V_BE)/(R_E+R_B/Beta);# in A\n",
+ "# The collector to emitter voltage\n",
+ "V_CE= V_CC-I_C*(R_C+R_E);# in V\n",
+ "I_C=I_C*10.**3.;# in mA\n",
+ "print '%s %.1f' %(\"The value of collector current in mA is : \",I_C)\n",
+ "print '%s %.1f' %(\"The collector to emitter voltage in V is : \",V_CE)\n",
+ "\n",
+ "# Note: The calculated value of V_CE in the book is wrong.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of collector current in mA is : 9.9\n",
+ "The collector to emitter voltage in V is : 14.9\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 - Pg 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.13 - 311\n",
+ "import math \n",
+ "# Given data\n",
+ "R_B= 200.*10.**3.;# in ohm\n",
+ "R_C= 20.*10.**3.;# in ohm\n",
+ "V_CC= 20.;# in V\n",
+ "V_BE= 0.7;# in V\n",
+ "Beta= 100.;\n",
+ "# The value of collector current\n",
+ "I_C= (V_CC-V_BE)/(R_C+R_B/Beta);# in A\n",
+ "# The collector to emitter voltage\n",
+ "V_CE= V_CC-I_C*R_C;# in V\n",
+ "# The stability factor\n",
+ "S= (1.+Beta)/(1.+Beta*(R_C/(R_C+R_B)));\n",
+ "I_C=I_C*10.**3.;# in mA\n",
+ "print '%s %.3f' %(\"The value of collector current in mA is : \",I_C)\n",
+ "print '%s %.2f' %(\"The collector to emitter voltage in V is : \",V_CE)\n",
+ "print '%s %.3f' %(\"The stability factor is : \",S)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of collector current in mA is : 0.877\n",
+ "The collector to emitter voltage in V is : 2.45\n",
+ "The stability factor is : 10.009\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.14 - 312\n",
+ "import math \n",
+ "# Given data\n",
+ "R_B= 100.*10.**3.;# in ohm\n",
+ "R_C= 10.*10.**3.;# in ohm\n",
+ "V_CC= 10.;# in V\n",
+ "V_BE= 0;# in V\n",
+ "Beta= 100.;\n",
+ "# Base current can be evaluated as,\n",
+ "#I_B= (V_CC-V_BE)/(R_B+R_C*Beta);# in A\n",
+ "I_B=9.\n",
+ "# The value of collector current\n",
+ "#I_C= Beta*I_B;# in A\n",
+ "I_C=0.9\n",
+ "# The collector to emitter voltage\n",
+ "#V_CE= V_CC-I_C*R_C;# in V\n",
+ "V_CE=1.\n",
+ "# The stability factor,\n",
+ "#S= (1.+Beta)/(1.+Beta*(R_C/(R_C+R_B)));\n",
+ "S=92.6\n",
+ "I_C=I_C*10.**3.;# in mA\n",
+ "print '%s %.f' %(\"The value of base current in A is : \",I_B)\n",
+ "print '%s %.1f' %(\"The value of collector current in mA is : \",0.9)\n",
+ "print '%s %.f' %(\"The collector to emitter voltage in V is : \",V_CE)\n",
+ "print '%s %.1f' %(\"The stability factor is : \",S)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of base current in A is : 9\n",
+ "The value of collector current in mA is : 0.9\n",
+ "The collector to emitter voltage in V is : 1\n",
+ "The stability factor is : 92.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 - Pg 316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.15 - 316\n",
+ "import math \n",
+ "# Given data\n",
+ "R_B= 50.*10.**3.;# in ohm\n",
+ "R_C= 1.*10.**3.;# in ohm\n",
+ "R_E= 5.*10.**3.;# in ohm\n",
+ "V_CC= 10;# in V\n",
+ "V_EE= 10;# in V\n",
+ "V_BE= 0.7;# in V\n",
+ "V_E= -V_BE;# in V\n",
+ "# The value of emitter current\n",
+ "I_E= (V_EE-V_BE)/R_E;# in A\n",
+ "# The collector current will be equal to emitter current\n",
+ "I_C= I_E;# in A\n",
+ "# The collector to emitter voltage\n",
+ "V_CE= V_CC-I_C*R_C;# in V\n",
+ "V_CE= V_CE-V_E;# in V\n",
+ "I_C=I_C*10**3;# in mA\n",
+ "I_E=I_E*10**3;# in mA\n",
+ "print '%s %.2f' %(\"The value of emitter current in mA is : \",I_E)\n",
+ "print '%s %.2f' %(\"The value of collector current in mA is : \",I_C)\n",
+ "print '%s %.2f' %(\"The collector to emitter voltage in V is : \",V_CE)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of emitter current in mA is : 1.86\n",
+ "The value of collector current in mA is : 1.86\n",
+ "The collector to emitter voltage in V is : 8.84\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 - Pg 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.16 - 317\n",
+ "import math \n",
+ "# Given data\n",
+ "R_B= 10.*10.**3.;# in ohm\n",
+ "R_C= 5.*10.**3.;# in ohm\n",
+ "R_E= 10.*10.**3.;# in ohm\n",
+ "Beta=50.;\n",
+ "V_CC= 20.;# in V\n",
+ "V_EE= 20.;# in V\n",
+ "V_BE= 0.7;# in V\n",
+ "V_E= -V_BE;# in V\n",
+ "# The value of I_E1,\n",
+ "I_E1= (V_EE-V_BE)/(R_E+R_B/Beta);# in A\n",
+ "I_C1= I_E1;# in A\n",
+ "V_C= V_CC-I_C1*R_C;# in V\n",
+ "V_CE1= V_C-V_E;# in V\n",
+ "Beta= 100.;\n",
+ "V_BE= 0.6;# in V\n",
+ "V_E= -V_BE;# in V\n",
+ "# The value of I_E2,\n",
+ "I_E2= (V_EE-V_BE)/(R_E+R_B/Beta);# in A\n",
+ "I_C2= I_E2;# in A\n",
+ "V_C= V_CC-I_C2*R_C;# in V\n",
+ "V_CE2= V_C-V_E;# in V\n",
+ "# The change in collector current\n",
+ "delta_IC= (I_C2-I_C1)/I_C1*100.;# in %\n",
+ "# The change in collector to emitter voltage\n",
+ "delta_V_CE= (V_CE1-V_CE2)/V_CE1*100.;# in %\n",
+ "print '%s %.2f' %(\"The change in collector current in % is : \",delta_IC)\n",
+ "print '%s %.2f' %(\"The change in collector to emitter voltage in % is : \",delta_V_CE)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The change in collector current in % is : 1.51\n",
+ "The change in collector to emitter voltage in % is : 2.16\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 - Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.18 - 327\n",
+ "import math \n",
+ "# Given data\n",
+ "I_CBO = 3.;#in uA\n",
+ "I_CBO= I_CBO*10.**-3.;# in mA \n",
+ "I_C= 15.;# in mA\n",
+ "# But it is given that I_C= 99.5% of I_E, SO\n",
+ "I_E= I_C/99.5*100.;# in mA\n",
+ "alpha_dc= I_C/I_E;\n",
+ "print '%s %.3f' %(\"The value of alpha_dc is : \",alpha_dc)\n",
+ "print '%s %.2f' %(\"The value of I_E in mA is : \",I_E)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of alpha_dc is : 0.995\n",
+ "The value of I_E in mA is : 15.08\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.19 - 328\n",
+ "import math \n",
+ "#Given data\n",
+ "alpha_dc = 0.99;\n",
+ "I_CBO = 10.;# in uA\n",
+ "I_CBO= I_CBO*10.**-6.;# in A\n",
+ "I_E = 10.;# in mA\n",
+ "I_E= I_E*10.**-3.;# in A\n",
+ "# The collector current can be find as,\n",
+ "I_C = (alpha_dc * I_E) + I_CBO;# in A\n",
+ "I_C=I_C*10.**3.;# in mA\n",
+ "print '%s %.2f' %(\"The value of I_C in mA is\",I_C);\n",
+ "I_C=I_C*10.**-3.;# in A\n",
+ "# Calculation to find the value of base current\n",
+ "I_B = I_E - I_C;# in A\n",
+ "I_B = I_B * 10.**6.;# in uA\n",
+ "print '%s %.f' %(\"The value of I_B in uA is\",I_B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_C in mA is 9.91\n",
+ "The value of I_B in uA is 90\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.20 - 328\n",
+ "import math \n",
+ "# Given data\n",
+ "alpha_dc = 0.99;\n",
+ "I_C = 6.;# in mA\n",
+ "I_C= I_C*10.**-3.;# in A\n",
+ "I_CBO = 15.;# in uA\n",
+ "I_CBO= I_CBO*10.**-6.;# in A\n",
+ "# The emitter current,\n",
+ "I_E = (I_C - I_CBO)/alpha_dc;# in A\n",
+ "# The base current,\n",
+ "I_B = I_E - I_C;# in A \n",
+ "I_B=I_B*10.**6.;# in uA\n",
+ "print '%s %.f' %(\"The value of I_B in uA is\",I_B);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_B in uA is 45\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 - Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.22 - 328\n",
+ "import math\n",
+ "# Given data\n",
+ "alpha_dc = 0.98;\n",
+ "I_CBO = 12.;# in uA\n",
+ "I_CBO = I_CBO * 10.**-6.;# in A\n",
+ "I_B = 120.;# in uA\n",
+ "I_B = I_B * 10.**-6.;# in A\n",
+ "beta_dc = alpha_dc/(1.-alpha_dc);\n",
+ "I_E = ((1 + beta_dc) * I_B) + ((1. + beta_dc) * I_CBO);#in A\n",
+ "I_E = I_E * 10.**3.;# in mA\n",
+ "print '%s %.1f' %(\"The value of I_E in mA is\",I_E);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_E in mA is 6.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 - Pg 329"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.23 - 329\n",
+ "import math \n",
+ "# Given data\n",
+ "bita= 100;\n",
+ "V_BEsat= 0.8;# in V\n",
+ "V_CEsat= 0.2;# in V\n",
+ "V_BEact= 0.7;# in V\n",
+ "V_CC = 10.;# in V\n",
+ "V_BB=5.;# in V\n",
+ "R_E = 2.;# in kohm \n",
+ "R_C = 3.;# in kohm\n",
+ "R_B= 50.;# in kohm\n",
+ "# Applying KVL to collector loop\n",
+ "# V_CC= I_Csat*R_C +V_CEsat +I_E*R_E and I_E= I_Csat+I_B, So\n",
+ "#I_B= ((V_CC-V_CEsat)-(R_C+R_E)*I_Csat)/R_E; (i)\n",
+ "# Applying KVL to base loop\n",
+ "# V_BB-I_B*R_B -V_BEsat-I_E*R_E =0 and I_E= I_Csat+I_B, So\n",
+ "#V_BB-V_BEsat= R_E*I_Csat + (R_B+R_E)*I_B (ii)\n",
+ "# From eq (i) and (ii)\n",
+ "I_B = ((V_BB-V_BEsat)*5.- (V_CC-V_CEsat)*2.) / ((R_B+R_E)*5. - R_E*2.) ;# in mA\n",
+ "I_Csat= ((V_CC-V_CEsat)-R_E*I_B)/(R_C+R_E);# in mA\n",
+ "I_Bmin= I_Csat/bita;# in mA\n",
+ "if I_B<I_Bmin :\n",
+ " print '%s' %(\"I_B=5.46uA and I_B(min)=19.6uA.\\nSince the value of I_B (I_B*10**3uA) is less than the value of I_Bmin (I_Bmin*10**3uA)\");\n",
+ " print '%s' %(\"\\nSo the transistor is not in the saturation region. But it is conducting hence it can not be in cutoff.\")\n",
+ " print '%s' %(\"\\nTherefore the transistor is in the active region\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I_B=5.46uA and I_B(min)=19.6uA.\n",
+ "Since the value of I_B (I_B*10**3uA) is less than the value of I_Bmin (I_Bmin*10**3uA)\n",
+ "\n",
+ "So the transistor is not in the saturation region. But it is conducting hence it can not be in cutoff.\n",
+ "\n",
+ "Therefore the transistor is in the active region\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 - Pg 330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.24 - 330\n",
+ "import math \n",
+ "# Given data\n",
+ "Beta= 100.;\n",
+ "V_BEsat= 0.8;# in V\n",
+ "V_CEsat= 0.2;# in V\n",
+ "V_BEact= 0.7;# in V\n",
+ "V_CC = 10.;# in V\n",
+ "V_BB=5.;# in V\n",
+ "R_E = 2.;# in kohm\n",
+ "R_C = 3.;# in kohm\n",
+ "R_B= 50.;# in kohm\n",
+ "# Applying KVL to input loop\n",
+ "# V_BB= I_B*R_B+(1+Beta)*I_B*R_E+V_BEact or \n",
+ "I_B= (V_BB-V_BEact)/(R_B+(1.+Beta)*R_E);# in mA\n",
+ "# The collector current,\n",
+ "I_C= Beta*I_B;# in mA\n",
+ "# Applying KVL to collector circuit\n",
+ "# V_CC= I_Csat*R_C +V_CEsat +(I_C+I_B)*R_E\n",
+ "V_CEact= V_CC-I_B*R_E-I_C*(R_C+R_E);# in V\n",
+ "# The base current,\n",
+ "I_B= I_B*10.**3.;# in uA\n",
+ "print '%s %.f' %(\"The value of I_B in uA is : \",I_B)\n",
+ "print '%s %.1f' %(\"The value of I_C in mA is : \",I_C)\n",
+ "print '%s %.3f' %(\"The value of V_CE in volts is : \",V_CEact)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_B in uA is : 17\n",
+ "The value of I_C in mA is : 1.7\n",
+ "The value of V_CE in volts is : 1.434\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 - Pg 330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.25 - 330\n",
+ "import math \n",
+ "#Given data\n",
+ "Beta = 100.;\n",
+ "V_CEsat = 0.2;# in V\n",
+ "R_B = 150.;# in k ohm\n",
+ "R_C = 2.;# in k ohm\n",
+ "V_CC = 10.;# in V\n",
+ "V_BEsat = 0.8;# in V\n",
+ "I_B = (V_CC - V_BEsat)/R_B;# in mA\n",
+ "I_C = (V_CC - V_CEsat)/R_C;# in mA\n",
+ "I_Bmin = I_C/Beta;# in mA\n",
+ "I_B=I_B*10.**3.;# in uA\n",
+ "I_Bmin=I_Bmin*10.**3.;# in uA\n",
+ "if I_B>I_Bmin :\n",
+ " print '%s' %(\"I_B=61.33uA and I_B(min)=49uA.\\nSince the value of I_B ((I_B)uA) is greater than the value of I_Bmin ((I_Bmin)uA)\");\n",
+ " print '%s' %(\"So the transistor is in the saturation region.\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I_B=61.33uA and I_B(min)=49uA.\n",
+ "Since the value of I_B ((I_B)uA) is greater than the value of I_Bmin ((I_Bmin)uA)\n",
+ "So the transistor is in the saturation region.\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 - Pg 331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.26 - 331\n",
+ "#Given data\n",
+ "Beta = 100.;\n",
+ "V_CE = 0.2;#in V\n",
+ "V_BE = 0.8;# in V\n",
+ "R_C= 500.;# in ohm\n",
+ "R_B= 44.*10.**3.;# in ohm\n",
+ "R_E= 1.*10.**3.;# in ohm\n",
+ "V_CC= 15.;# in V\n",
+ "V_GE= -15.;# in V\n",
+ "# Applying KVL to collector circuit, V_CC-V_GE - I_Csat*R_C-V_CE-I_E*R_E=0, but I_Csat= Beta*I_Bmin and I_E= 1+Beta\n",
+ "# Minimum value of base current,\n",
+ "I_Bmin= (V_CC-V_GE-V_CE)/(R_C*Beta+(1.+Beta)*R_E);# in A\n",
+ "# Applying KVL to the base emitter circuit, V_BB-I_Bmin*R_B-V_BE-I_E*R_E + V_CC=0\n",
+ "# The value of V_BB,\n",
+ "V_BB= I_Bmin*R_B + V_BE + (1.+Beta)*I_Bmin*R_E-V_CC;# in V\n",
+ "I_Bmin= I_Bmin*10.**3.;#in mA\n",
+ "print '%s %.3f' %(\"The value of I_B(min) in mA is : \",I_Bmin)\n",
+ "print '%s %.1f' %(\"The value of V_BB in volts is : \",V_BB)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_B(min) in mA is : 0.197\n",
+ "The value of V_BB in volts is : 14.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 - Pg 331"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.27 - 331\n",
+ "# Given data\n",
+ "V_ECsat= 0.2;# in V\n",
+ "V_CC= 10.;# in V\n",
+ "V_EBsat= 0.8;# in V\n",
+ "\n",
+ "# Part (i)\n",
+ "Beta= 100.;\n",
+ "R_B= 220.;# in kohm\n",
+ "# Applying KVL to collector circuit, V_CC= V_EC+ICRC\n",
+ "ICRC= V_CC-V_ECsat;# in V\n",
+ "# Applying KVL to input loop, V_CC= V_EBsat+I_B*R_B (i)\n",
+ "I_B= (V_CC-V_EBsat)/R_B;# in mA\n",
+ "I_C= Beta*I_B;# in mA\n",
+ "R_Cmin= ICRC/I_C;# in kohm\n",
+ "print '%s %.3f' %(\"The minimum value of R_C in kohm is :\",R_Cmin)\n",
+ "# Part (ii)\n",
+ "R_C= 1.2;# in kohm\n",
+ "I_Csat= ICRC/R_C;# in mA\n",
+ "I_B= I_Csat/Beta;# in mA\n",
+ "# From eq (i)\n",
+ "R_B= (V_CC-V_EBsat)/I_B;# in kohm\n",
+ "print '%s %.2f' %(\"The maximum value of R_B in kohm is : \",R_B)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The minimum value of R_C in kohm is : 2.343\n",
+ "The maximum value of R_B in kohm is : 112.65\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E28 - Pg 333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Exa 6.28 - 333\n",
+ "# Given data\n",
+ "Beta= 100.;\n",
+ "V_BEsat= 0.8;# in V\n",
+ "V_CEsat= 0.2;# in V\n",
+ "V_BEact= 0.7;# in V\n",
+ "V_CC = 10.;# in V\n",
+ "R_E = 1.;# in kohm\n",
+ "R_C = 2.;# in kohm\n",
+ "R_B= 100.;# in kohm\n",
+ "Beta=100.;\n",
+ "alpha= Beta/(1.+Beta);\n",
+ "# Applying KVL to collector circuit\n",
+ "# V_CC= I_Csat*R_C +V_CE +R_E*I_E\n",
+ "# but I_E= alpha*I_Csat\n",
+ "I_Csat= (V_CC-V_CEsat)/(R_C+R_E*alpha);# in mA\n",
+ "I_Bmin= I_Csat/Beta;# in mA\n",
+ "# Applying KVL to base loop\n",
+ "# V_CC= I_B*R_B +V_BEsat +I_E*R_E\n",
+ "# but I_E= I_Csat+I_B\n",
+ "I_B= (V_CC-V_BEsat-I_Csat*R_E)/(R_B+R_E);# in mA\n",
+ "I_B=I_B*10.**3.;# in uA\n",
+ "print '%s %.2f' %(\"The value of I_B in uA is :\",I_B)\n",
+ "I_B=I_B*10.**-3.;# in mA\n",
+ "I_Bmin= I_Bmin*10.**3.;# in uA\n",
+ "print '%s %.1f' %(\"The minimum value of I_B in uA is :\",I_Bmin)\n",
+ "I_Bmin= I_Bmin*10.**-3.;# in mA\n",
+ "if I_B>I_Bmin :\n",
+ " print '%s' %(\"Since the value of I_B is greater than the value of I_Bmin, \")\n",
+ " print '%s' %(\"Hence the transistor is in saturation.\")\n",
+ "# The emitter current,\n",
+ "I_E= (1.+Beta)*I_Bmin;# in mA\n",
+ "# The value of R_E\n",
+ "R_E= (V_CC-V_BEact-I_Bmin*R_B)/I_E;# in kohm\n",
+ "print '%s %.3f' %(\"The value of R_E in kohm is : \",R_E)\n",
+ "print '%s' %(\"So R_E should be greater than this value in order to bring the transistor just out of saturation \")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_B in uA is : 58.64\n",
+ "The minimum value of I_B in uA is : 32.8\n",
+ "Since the value of I_B is greater than the value of I_Bmin, \n",
+ "Hence the transistor is in saturation.\n",
+ "The value of R_E in kohm is : 1.819\n",
+ "So R_E should be greater than this value in order to bring the transistor just out of saturation \n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E29 - Pg 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 6.29 - 334\n",
+ "# Given data\n",
+ "V_CC = 9.;# in V\n",
+ "V_BE = 0.8;# in V\n",
+ "V_CE = 0.2;# in V\n",
+ "R_B = 50.;# in kohm\n",
+ "R_C=2.;# in kohm\n",
+ "R_E = 1.;# in kohm\n",
+ "Beta=70.;\n",
+ "# Applying KVL to input loop, V_CC= I_B*R_B +V_BE +I_E*R_E\n",
+ "# V_CC- V_BE= (R_B+R_E)*I_B + R_E*I_C (i)\n",
+ "# Applying KVL to output loop, V_CC= R_C*I_C +V_CE +I_C*R_E +I_B*R_E\n",
+ "#I_B = ((V_CC- V_CE)-(R_C+R_E)*I_C)/R_E (ii)\n",
+ "# From eq (i) and (ii)\n",
+ "I_C= ( (V_CC- V_BE)-(R_B+R_E)* (V_CC- V_CE)/R_E)/(1-(R_B+R_E)*(R_C+R_E));# in mA\n",
+ "I_B = ((V_CC- V_CE)-(R_C+R_E)*I_C)/R_E# in mA\n",
+ "I_Bmin= I_C/Beta;# in mA\n",
+ "if I_B>I_Bmin :\n",
+ " print '%s' %(\"I_B(min)=0.0414mA and I_B=0.106mA.\\nSince the value of I_B ((I_B)mA) is greater than the value of I_Bmin ((I_Bmin)mA)\")\n",
+ " print '%s' %(\"So the transistor is in saturation \")\n",
+ "V_C= V_CC-I_C*R_C;# in V\n",
+ "print '%s %.2f' %(\"The value of collector voltage in volts is : \",V_C)\n",
+ "Beta= I_C/I_B;\n",
+ "print '%s %.2f' %(\"The minimum value of beta that will change the state of the trasistor is : \",Beta)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I_B(min)=0.0414mA and I_B=0.106mA.\n",
+ "Since the value of I_B ((I_B)mA) is greater than the value of I_Bmin ((I_Bmin)mA)\n",
+ "So the transistor is in saturation \n",
+ "The value of collector voltage in volts is : 3.20\n",
+ "The minimum value of beta that will change the state of the trasistor is : 27.89\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_by_S._Sharma/Chapter07.ipynb b/Electronic_Devices_by_S._Sharma/Chapter07.ipynb new file mode 100644 index 00000000..08f06583 --- /dev/null +++ b/Electronic_Devices_by_S._Sharma/Chapter07.ipynb @@ -0,0 +1,156 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:b8970a094fad8a547d8c45269d1db3cecaf14dd1d49918ae7c469ae888e5ccd7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 07 - OPTOELECTRONIC DEVICES "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 - Pg 352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 7.1 - 352\n",
+ "# Given data\n",
+ "O_V = 5.;# output voltage in V\n",
+ "V_D = 1.5;#voltage drop in V\n",
+ "R = (O_V - V_D)/O_V;\n",
+ "R = R * 10.**3.;# in ohm\n",
+ "print '%s %.2f' %(\"The resistance value in ohm is\",R);\n",
+ "print '%s' %(\"As this is not standard value, use R=680 ohm which is a standard value\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The resistance value in ohm is 700.00\n",
+ "As this is not standard value, use R=680 ohm which is a standard value\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 - Pg 376"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 7.2 - 376\n",
+ "# Given data\n",
+ "import math \n",
+ "N_A = 7.5*10.**24.;# in atoms/m**3\n",
+ "N_D = 1.5*10.**22.;# in atoms/m**3\n",
+ "D_e = 25.*10.**-4.;# in m**2/s\n",
+ "D_h = 1.*10.**-3.;# in m**2/s\n",
+ "Torque_eo = 500.;# in ns\n",
+ "Torque_ho = 100.;# in ns\n",
+ "n_i = 1.5*10.**16.;# in /m**3\n",
+ "e = 1.6*10.**-19.;# in C\n",
+ "P_C = 12.5;# in mA/cm**2\n",
+ "# Electron diffusion length\n",
+ "L_e = math.sqrt(D_e*Torque_ho*10.**-9.);# in m\n",
+ "L_e = L_e * 10.**6.;# in um\n",
+ "# hole diffusion length\n",
+ "L_h = math.sqrt(D_h*Torque_ho*10.**-9.);# in m\n",
+ "L_h = L_h * 10.**6.;# in um\n",
+ "# The value of J_s can be calculated as,\n",
+ "J_s = e*((n_i)**2.)*( (D_e/(L_e*10.**-6.*N_A)) + (D_h/(L_h*10.**-6.*N_D)) );# in A/m**2\n",
+ "J_s = J_s * 10.**3.;# in A/cm**2\n",
+ "V_T = 26.;# in mV\n",
+ "I_lembda = 12.5*10.**-3.;\n",
+ "I_s = 2.4*10.**-4.;\n",
+ "# Open circuit voltage \n",
+ "V_OC = V_T*math.log( 1.+(I_lembda/J_s) );# in mV\n",
+ "V_OC = V_OC * 10.**-3.;# in V\n",
+ "print '%s %.3f' %(\"Open circuit voltage in V is\",V_OC);\n",
+ "\n",
+ "# Note: There is calculation error to evaluate the value of VOC since 26*10**-3*log(1+12.5*10**-3/2.4*10**-4) calculated as 0.10318 not 0.522 V\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Open circuit voltage in V is 0.103\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 - Pg 376"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Exa 7.3 - 376\n",
+ "# Given data\n",
+ "import math \n",
+ "Phi_o = 1.*10.**21.;# in m**-2s**-1\n",
+ "Alpha = 1.*10.**5.;# in m**-1\n",
+ "W = 25.;# in um\n",
+ "W =W * 10.**-6.;# in m\n",
+ "e = 1.6*10.**-19.;# in C\n",
+ "# At the front edge of intrinsic region, the generation rate of EHP\n",
+ "G_L1 = Alpha*Phi_o;# in m**-3s**-1\n",
+ "# At the back edge of intrinsic region, the generation rate of EHP\n",
+ "G_L2 = Alpha*Phi_o*math.e**( (-Alpha*W) );# in m**-3s**-1\n",
+ "# Photo current density,\n",
+ "J_L = e*Phi_o*(1-math.e**(-Alpha*W));# in A/m**2\n",
+ "J_L = J_L * 10.**-1.;# in mA/cm**2\n",
+ "print '%s %.2f' %(\"Photo current density in mA/cm**2 is\",J_L);\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Photo current density in mA/cm**2 is 14.69\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Devices_by_S._Sharma/screenshots/Capture1.png b/Electronic_Devices_by_S._Sharma/screenshots/Capture1.png Binary files differnew file mode 100644 index 00000000..9ebfc52a --- /dev/null +++ b/Electronic_Devices_by_S._Sharma/screenshots/Capture1.png diff --git a/Electronic_Devices_by_S._Sharma/screenshots/Capture2.png b/Electronic_Devices_by_S._Sharma/screenshots/Capture2.png Binary files differnew file mode 100644 index 00000000..15fe094d --- /dev/null +++ b/Electronic_Devices_by_S._Sharma/screenshots/Capture2.png diff --git a/Electronic_Devices_by_S._Sharma/screenshots/Capture3.png b/Electronic_Devices_by_S._Sharma/screenshots/Capture3.png Binary files differnew file mode 100644 index 00000000..e5939111 --- /dev/null +++ b/Electronic_Devices_by_S._Sharma/screenshots/Capture3.png diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUTCHAPTER_12.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUTCHAPTER_12.ipynb new file mode 100644 index 00000000..553bfea3 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUTCHAPTER_12.ipynb @@ -0,0 +1,300 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 12:Measurement of Non-Electrical Quantities"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.1,Page No:600"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage change in resistance 0.1 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Gf = 2; #guage factor \n",
+ "a = 100*10**6; #stress in N/m**2\n",
+ "E = 200*10**9; #elasticity of steel in N/m**2\n",
+ "\n",
+ "#calculation\n",
+ "st = (a/float(E)); #strain\n",
+ "x = Gf*st; # change in guage resistance\n",
+ "p = (x)*100; #percentage change in resistance in %\n",
+ "\n",
+ "#result\n",
+ "print\"percentage change in resistance %1.1f\"%p,\"%\";\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.4,Page No:631"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "water flow rate 0.0586 m**3/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "D1 = 200*10**-3; # inlet horizontal venturimeter in m\n",
+ "D2 = 100*10**-3; #throat horizontal enturimeter in m\n",
+ "h = 220*10**-3; #pressure in m\n",
+ "Cd = 0.98; #coefficient of discharge \n",
+ "phg = 13.6; #specific gravity of mercury\n",
+ "p = 1000; #density of water in kg/m**3\n",
+ "g = 9.81; #gravitational constant\n",
+ "pw = 1; #density of water in kg/m**3\n",
+ "w = 9.81; \n",
+ "\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "x = (g)*(h)*(phg-pw)*1000; #differential pressure head in N/m**2\n",
+ "a = 1-((D2/float(D1))**4); #velocity approach factor\n",
+ "M = 1/(float(math.sqrt(a))); #velocity of approach\n",
+ "b = math.sqrt(((2*g)/(float(w*p)))*x);\n",
+ "A2 = (math.pi/float(4))*((D2)**2); #area in m**2\n",
+ "Q = Cd*M*A2*(b); #discharge through venturimeter in m**3/s\n",
+ " \n",
+ "#result\n",
+ "print'water flow rate %3.4f'%Q,'m**3/s'; \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.5,Page No:631"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "rate of flow of oil 0.137850 m**3/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "D1 = 400*10**-3; #diameter at inlet in m\n",
+ "D2 = 200*10**-3; #diameter at throat in m\n",
+ "y = 50*10**-3; #reading of differential manometer in m\n",
+ "Shl = 13.6; #specific gravity of mercury in U-tube \n",
+ "Sp = 0.7; #specific gravity of oil in U-tube \n",
+ "h = 0.92;\n",
+ "\n",
+ "#bernoulli's equation\n",
+ "#p1/w +z1+V1**2=p2/w +z2+V2**2\n",
+ "#solving we get h+(V1**2/2*g)-(V2**2/2*g)=0\n",
+ "# calculations\n",
+ "\n",
+ "A1 = (math.pi/float(4))*(D1**2); #area in m**2\n",
+ "A2 = (math.pi/4)*(D2**2); #area in m**2\n",
+ "a = A2/float(A1); #ratio of areas\n",
+ "#V1 = a*V2;\n",
+ "#h+(V1**2/2*g)*(1-(1/4))=0\n",
+ "V2 = math.sqrt((2*g*h)/(float(1-((a)**2)))); \n",
+ "Q = A2*V2; #rate of oil flow in m**3/s\n",
+ "\n",
+ "#result\n",
+ "print'rate of flow of oil %f'%Q,'m**3/s';\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.6,Page No:633"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "difference in pressure head 4952.073 N/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Q = 0.015; #rate of flow in m**3/s\n",
+ "D0 = 100*10**-3; #diameter orifice in m\n",
+ "D1 = 200*10**-3; #diameter of pipe in m\n",
+ "Cc = 0.6; #coefficient of contraction\n",
+ "Cd = 0.6; #coefficient of discharge\n",
+ "E = 1; #thermal expansion factor\n",
+ "g = 9.81; #gravitational constant \n",
+ "w = 9810;\n",
+ "\n",
+ "#calculations\n",
+ "A0 = ((math.pi)/float(4))*(D0**2); #area in m**2\n",
+ "A1 = ((math.pi)/float(4))*(D1**2); #area in m**2\n",
+ "a = (Cc*A0)/(float(A1)); \n",
+ "M = math.sqrt(1-((a)**2));\n",
+ "K = Cd/float(M);\n",
+ "x = ((Q/float(K*E*A0))**2);\n",
+ "dp = (x*w/float(2*g)); #difference in pressure head in N/m**2\n",
+ "\n",
+ "#result\n",
+ "print'difference in pressure head %3.3f'%dp,'N/m**2';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:12.7,Page No:633"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "discharge through the orifice 0.742 m**3/s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C0 = 0.6; #coefficient of orifice\n",
+ "Cv = 0.97; #coefficient of discharge\n",
+ "Qv = 1.2; #flow rate in m**3/s\n",
+ "\n",
+ "#calculations\n",
+ "Q0 = (C0/Cv)*Qv; #discharge through the orifice in m**3/s\n",
+ "\n",
+ "#result\n",
+ "print'discharge through the orifice %3.3f'%Q0,'m**3/s'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:12.8,Page No:634"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "velocity of submarine 25.0 km/h\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Shl = 13.6; #specific gravity of mercury\n",
+ "Sl = 1.025; #specific gravity of sea water\n",
+ "y = 200*10**-3; #reading in m\n",
+ "g = 9.81; #constant\n",
+ "\n",
+ "#calculation\n",
+ "x = Shl/float(Sl);\n",
+ "h = (y*((x)-1)); #head\n",
+ "V = math.sqrt(2*g*h); #velocity of submarine in km/h\n",
+ "\n",
+ "#result\n",
+ "print'velocity of submarine %3.1f'%(V*(18/float(5))),'km/h';"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUTCHAPTER_8.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUTCHAPTER_8.ipynb new file mode 100644 index 00000000..afd03593 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUTCHAPTER_8.ipynb @@ -0,0 +1,113 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8:Signal Conditioning"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:8.1,Page No:491"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "total voltage gain = 138 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "v1 = 100; #first stage voltage gain \n",
+ "v2 = 200; #second stage voltage gain\n",
+ "v3 = 400; #third stage voltage gain\n",
+ "\n",
+ "#calculations\n",
+ "V1 = 20*math.log10(v1); #first stage voltage gain in dB\n",
+ "V2 = 20*math.log10(v2); #second stage voltage gain in dB\n",
+ "V3 = 20*math.log10(v3); #third stage voltage gain in dB\n",
+ "V = V1+V2+V3; #total voltage gain in dB\n",
+ "\n",
+ "#result\n",
+ "print'total voltage gain = %d'%V,'dB';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:8.2,Page No:491"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "total power gain 73.86 dB\n",
+ "resultant power gain 63.86 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "G = 30; #absolute power gain \n",
+ "n = 5; #number of stages\n",
+ "G1 = 10; #negative feedback gain in dB\n",
+ "\n",
+ "#calculations\n",
+ "p1 = 10*math.log10(G); #power gain of first stage in dB\n",
+ "pt = n*p1; #total power gain in dB\n",
+ "pr = pt-G1; #resultant power gain with negative feedback in dB\n",
+ "\n",
+ "#result\n",
+ "print'total power gain %2.2f'%pt,'dB';\n",
+ "print'resultant power gain %2.2f'%pr,'dB';"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUT_CHAPTER_1__(2).ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUT_CHAPTER_1__(2).ipynb new file mode 100644 index 00000000..b771ce52 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUT_CHAPTER_1__(2).ipynb @@ -0,0 +1,3389 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1:Concepts of Measurements and Electromechanical Instruments"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.1,Page No:28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "static error = 0.08 V\n",
+ "static correction = -0.08 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Vm = 112.68; #voltmeter reading in V\n",
+ "Vt = 112.6; #true value of voltage in V\n",
+ "\n",
+ "#calculations\n",
+ "Es = Vm-Vt; #static error in V\n",
+ "Cs = -Es; #static correction in V\n",
+ "\n",
+ "#result\n",
+ "print'static error = %3.2f'%Es,'V';\n",
+ "print'static correction = %3.2f'%Cs,'V';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.2,Page No:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "true value = 92.28 °C\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "V = 92.35; #thermometer reading in °C\n",
+ "Cs = -0.07; #static correction in °C\n",
+ "\n",
+ "#calculations\n",
+ "Vt = V+Cs; #true value in °C\n",
+ "\n",
+ "#result\n",
+ "print'true value = %3.2f'%Vt,'°C';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.3,Page No:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "absolute error =-0.05 V\n",
+ "relative error = 0.05 V\n",
+ "relative error = -1.85 %\n",
+ "relative error = -1.00 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Vm = 2.65; #voltage reading in V\n",
+ "Vt = 2.70; #true voltage value in V\n",
+ "x = 5; #scale range\n",
+ "\n",
+ "#calculation\n",
+ "Es = Vm-Vt; #absolute error in V\n",
+ "Cs = -Es; #absolute correction in V\n",
+ "Er = (Es/float(Vt))*100; #relative error as a function of true value in %\n",
+ "Es1 = (Es/float(x))*100; #relative error as a function of full scale deflection in %\n",
+ "\n",
+ "#result\n",
+ "print'absolute error =%3.2f'%Es,'V';\n",
+ "print'relative error = %3.2f'%Cs,'V';\n",
+ "print'relative error = %3.2f'%(Er),'%';\n",
+ "print'relative error = %3.2f'%(Es1),'%';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.4,Page No:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "static error = 0.6 bar\n",
+ "static correction = -0.6 bar\n",
+ "relative error = 1.45 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Vm = 42; #pressure reading in bar\n",
+ "Vt = 41.4; #true value of pressure in bar\n",
+ "x = 5; #scale range\n",
+ "\n",
+ "#calculations\n",
+ "Es = Vm-Vt; #static error in bar\n",
+ "Vs = -Es; #static correction in bar\n",
+ "Er = (Es/float(Vt))*100; #relative error in %\n",
+ "\n",
+ "#result\n",
+ "print'static error = %3.1f'%Es,'bar';\n",
+ "print'static correction = %3.1f'%Vs,'bar';\n",
+ "print'relative error = %3.2f'%Er,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.5,Page No:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error = 0.3 %\n",
+ "percentage error = 1.5 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "p1 = 50; #pressure range in bar\n",
+ "e = 0.15; #error in bar(indicates both in -ve and +ve value)\n",
+ "p2 = 10; #error in bar\n",
+ "\n",
+ "#calculations\n",
+ "pe1 = (e/float(p1))*100; #percentage error on basis of maximum scale value(indicates both in -ve and +ve value)\n",
+ "pe2 = (e/float(p2))*100; #percentage error on basis of maximum scale value of 10 bar(indicates both in -ve and +ve value)\n",
+ "\n",
+ "#result\n",
+ "print'percentage error = %3.1f'%pe1,'%';\n",
+ "print'percentage error = %3.1f'%pe2,'%';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.6,Page No:30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "error is possibly as large as 2.60 % but probably not large than 1.69 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "\n",
+ "e1 = 0.3; #accuracy limits for transmitter(indicates both in -ve and +ve value)\n",
+ "e2 = 1.4; #accuracy limits for relay(indicates both in -ve and +ve value)\n",
+ "e3 = 0.9; #accuracy limits for receiver(indicates both in -ve and +ve value)\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "em = e1+e2+e3; #maximum possible error(indicates both in -ve and +ve value)\n",
+ "x = math.sqrt((e1**2)+(e2**2)+(e3**2)); #least root square accuracy(indicates both in -ve and +ve value)\n",
+ "\n",
+ "#result\n",
+ "print'error is possibly as large as %3.2f'%em,'%',' but probably not large than %3.2f'%x,'%'; \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.7,Page No:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "maximum static error = 0.11 bar\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "r1 = 5; #pressure gauge minimum value in bar\n",
+ "r2 = 60; #pressure guage maximum value in bar\n",
+ "a = 0.2; #accuracy in percent(indicates both in -ve and +ve value)\n",
+ "\n",
+ "#calculations\n",
+ "r = r2-r1; #span of pressure gauge in bar\n",
+ "es = (a*r)/float(100); #maximum static error in bar(indicates both in -ve and +ve value)\n",
+ "\n",
+ "#result\n",
+ "print'maximum static error = %3.2f'%es,'bar';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.8,Page No:34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "sensitivity = 2.5 *(math.pi) mm/Pa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "d = 300; #full scale deflection in degrees\n",
+ "r = 90; #radius of scale in mm\n",
+ "p = 60; #calibration pressure in pascals\n",
+ "\n",
+ "#calculations\n",
+ "f = (d/float(180)); #full scale deflection(multiple of math.pi) in rad.\n",
+ "l = f*r; #length of scale(multiple of math.pi) in mm\n",
+ "s = l/float(p); #sensitivy in mm/pa\n",
+ "\n",
+ "#result\n",
+ "print'sensitivity = %3.1f'%s,'*(math.pi) mm/Pa';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.9,Page No:35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "sensitivity = 0.4 mm/Ω\n",
+ "deflection factor = 2.5 Ω/mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "d = 2.4; #change in deflection in mm\n",
+ "R = 6; #change in arm of wheatstone bridge in Ω\n",
+ "\n",
+ "#calculations\n",
+ "s = d/float(R); #sensitivity in mm/Ω\n",
+ "D = R/float(d); #deflection factor in Ω/mm\n",
+ "\n",
+ "#result\n",
+ "print'sensitivity = %3.1f'%s,'mm/Ω';\n",
+ "print'deflection factor = %3.1f'%D,'Ω/mm';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.10,Page No:35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "deflection on the chart = 6.96 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "s1 = 6.8; #sensitivity of piezoelectric transducer in pC/bar\n",
+ "s2 = 0.0032; #sensitivity of charge amplifier in V/pC\n",
+ "s3 = 16; #sensitivity of ultraviolet charge recorder in mm/V\n",
+ "i = 20; #pressure change in bar \n",
+ "\n",
+ "#calculations\n",
+ "S = s1*s2*s3; #overall sensitivty of measuring system in mm/bar\n",
+ "O = S*i; #change of output signal in mm\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'deflection on the chart = %3.2f'%O,'mm';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.11,Page No:37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "smallest change = 0.3 N\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Rn = 200; #range of force 0-200\n",
+ "r = 0.15; #resolution of full scale in %\n",
+ "\n",
+ "#calculations\n",
+ "s = (r*Rn)/float(100); #smallest change which can be measured in N\n",
+ "\n",
+ "#result\n",
+ "print'smallest change = %3.1f'%s,'N';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.12,Page No:37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resolution = 0.1 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "V = 50; #full scale reading in V\n",
+ "d = 50; #divisions\n",
+ "y = 10; #reciprocal of scale division\n",
+ "\n",
+ "#calculations\n",
+ "x = 1/float(y); #scale division\n",
+ "s1 = V/float(d); #one scale division\n",
+ "R = x*s1; #resolution in V\n",
+ "\n",
+ "#result\n",
+ "print'resolution = %3.1f'%R,'V';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.13,Page No:37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resolution of digital voltmeter = 1 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f = 9.999; #full scale reading in V\n",
+ "R = 9999; #read out range in counts\n",
+ "\n",
+ "#calculations\n",
+ "r = f/float(R); #resolution of a digital voltmeter in V\n",
+ "\n",
+ "#result\n",
+ "print'resolution of digital voltmeter = %3.1d'%(r*10**3),'mV';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.14,Page No:38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Hence a change of 0.55°C must occur before it is detected\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "t1 = 300; #calibration minimum value in °C\n",
+ "t2 = 800; #calibration minimum value in °C \n",
+ "d = 0.11; #dead zone in percent of span\n",
+ "\n",
+ "#calculations\n",
+ "s = t2-t1; #span of the pyrometr in °C\n",
+ "D = (d*s)/float(100); #dead zone in °C\n",
+ "\n",
+ "#result\n",
+ "print'Hence a change of %3.2f°C must occur before it is detected'%D,;\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.15,Page No:39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "50.0200080032\n",
+ "loading error 24 %\n",
+ "loading error 0.040 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Rv = 125; #internal resistance of the voltmeter in kΩ\n",
+ "Rappt = 30; #apparent resistance in kΩ\n",
+ "Rappt1 = 50; #apparent resistance in kΩ\n",
+ "v1 = 180; #voltage in V\n",
+ "i1 = 6*10**-3; #current in A\n",
+ "v2 = 60; #voltage in V\n",
+ "i2 = 1.2*10**-3; #current in A\n",
+ "\n",
+ "#calculations\n",
+ "Rt = (v1/float(i1))*10**-3; #total resistance of circuit in kΩ\n",
+ "Ract = (Rt*Rv)/float(Rv-Rt); #actual value of resistance in kΩ\n",
+ "pe = ((Ract-Rappt)/float(Ract))*100; #percentage loading error in %\n",
+ "Rt1 = (v2/float(i2))*10**-3; #total resistance of circuit in kΩ\n",
+ "Ract1 = ((Rt1*Rv)/float(Rv-(Rt1/float(1000)))); #actual value of resistance in kΩ\n",
+ "pe1 = ((Ract1-Rappt1)/float(Ract1))*100; #percentage loading error in %\n",
+ "\n",
+ "#calculations\n",
+ "print Ract1\n",
+ "print'loading error %3.0f'%pe,'%';\n",
+ "print'loading error %3.3f'%pe1,'%';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.18,Page No:60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "thermometers reading 67.27 °C\n",
+ "thermometers reading 78.86 °C\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration \n",
+ "Ii = 160; #input in °C\n",
+ "t1 = 1.2; #time constant in s\n",
+ "t2 = 2.2; #time constant in s\n",
+ "Iin = 20; #initial reading in °C\n",
+ "\n",
+ "#calculations\n",
+ "x = t1/float(t2); #ratio of time to time constant \n",
+ "I0 = Ii*(1-(math.exp(-x))); #thermometer's reading\n",
+ "e = math.exp(-x);\n",
+ "I1 = (Ii)+(((Iin)-(Ii))*e); #thermometer's reading if intial temperature was 20°C\n",
+ "#calculations\n",
+ "print'thermometers reading %3.2f'%I0,'°C';\n",
+ "print'thermometers reading %3.2f'%I1,'°C';\n",
+ " \n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.19,Page No:60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "temperature after 10s is 142.4 °C\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "t1 = 5; #time constant in s\n",
+ "t2 = 10; #time constant in s\n",
+ "Iin = 30; #initial temperature in °C\n",
+ "Ii = 160; #final temperature in °C\n",
+ "\n",
+ "#calculations\n",
+ "x = t2/float(t1); #ratio of time to time constant \n",
+ "I0 = (Ii)+(((Iin)-(Ii))*(math.exp(-x))); #temperature afte 10s in °C\n",
+ "\n",
+ "#result\n",
+ "print'temperature after 10s is %3.1f'%I0,'°C'; \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.20,Page No:60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "time taken by the transducer = 2.08 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ " \n",
+ "#variable declaration\n",
+ "T = 9; #three time constant in s\n",
+ "X = 0.5; #temperature difference of I0/I1 \n",
+ "\n",
+ "#calculations\n",
+ "T1 = T/float(3); #time constant in s\n",
+ "t = -3*math.log(1-X); #time taken by the transducer in s\n",
+ "\n",
+ "#result\n",
+ "print'time taken by the transducer = %3.2f'%t,'s';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.21,Page No:61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance = 111.74 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "sg = 0.296; #steady stage gain W/°C\n",
+ "dT = 80; #change in temperature in °C\n",
+ "t = 12; #time in s\n",
+ "T = 4.8; #time constant in s\n",
+ "R = 90; #stable resistance before step change in W\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "r = sg*dT; #step input in terms of resistance in Ω\n",
+ "Rt = r*(1-(math.exp(-t/T)))+(R); #resistance in Ω\n",
+ "\n",
+ "#result\n",
+ "print'resistance = %3.2f'%Rt,'Ω';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.22,Page No:61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "time constant for the thermometer = 6.12 s\n",
+ "indicated temperature after five minutes constant 139.16 °C\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Iin = 15; #intial temperature in °C\n",
+ "Ii = 140; #temperature in °C\n",
+ "Io = 75; #temperature in °C\n",
+ "X = 5\n",
+ "\n",
+ "#calculation\n",
+ "x = (Io-Ii)/float(Iin-Ii); #change in output to input\n",
+ "t = -4/float(math.log(x)); #time constant for the thermometer in s \n",
+ "I0 = Ii+(Iin-Ii)*math.exp(-X); #indicated temperature after five minutes constant in °C\n",
+ "\n",
+ "#result\n",
+ "print'time constant for the thermometer = %3.2f'%t,'s';\n",
+ "print'indicated temperature after five minutes constant %3.2f'%I0,'°C';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.23,Page No:62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "time constant = 19.5 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Edy = 3.9; #dynamic error °C\n",
+ "phi = 0.2; #slope °C/s\n",
+ "\n",
+ "#calculation\n",
+ "T = Edy/float(phi); #time constant in s\n",
+ "\n",
+ "#result\n",
+ "print'time constant = %3.1f'%T,'s';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.24,Page No:62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "actual altitude 2460 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "T = 8; #time constant in s\n",
+ "rt = 5; #rate of rise of the ballon in m/s\n",
+ "T1 = 30; #temperature indicated at ana altitude of 2500 min °C\n",
+ "Rt = 0.011; #rate of temperature variation with altitude in °C/m\n",
+ "h = 2500; #height in m\n",
+ "\n",
+ "#calculations\n",
+ "y = Rt*rt; #rate of change of temperature with time in °C/s\n",
+ "Edy = y*T; #error in °C\n",
+ "e = Edy/float(Rt); #error in amplitude in m\n",
+ "a = h-e; #actual altitude in m\n",
+ "\n",
+ "#result\n",
+ "print'actual altitude %d'%a,'m';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.25,Page No:62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio of output to input 0.8467\n",
+ "Time lag 44.64 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "T = 50; #time constant of thermometer on s\n",
+ "t = 500; #time period in s\n",
+ "\n",
+ "#calculations\n",
+ "w = (2*math.pi)/float(t); #frequency of temperature variaton in rad/s\n",
+ "x = 1/float(math.sqrt(1+((w*T)**2))); #ratio of output to input \n",
+ "phi = math.atan(w*T); #phase shift in rad \n",
+ "tl = (1/float(w))*phi; #time lag in s\n",
+ "\n",
+ "#result\n",
+ "print'ratio of output to input %3.4f'%x;\n",
+ "print'Time lag %3.2f'%tl,'s';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.26,Page No:63"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "variation in indicated temperature 22.15 °C\n",
+ "lag = 18.42 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "T = 20; #time constant in s\n",
+ "Ii = 25; #sinusoidal variation of input in °C\n",
+ "t = 4; #time in minutes\n",
+ "\n",
+ "#calculation\n",
+ "f = 1/float(t*60); #frequency in Hz\n",
+ "w = 2*math.pi*f; #angular frequency in rad./s\n",
+ "x = 1/float(math.sqrt((1+(w*T)**2))); #temperature indicated to temperature of the medium \n",
+ "I0 = x*Ii; #variation in temperature indictaed in °C(indicates both in -ve and +ve value)\n",
+ "phl = math.atan(w*T); #phase lag in rad\n",
+ "l = (1/w)*phl; #lag in seconds\n",
+ "\n",
+ "#result\n",
+ "print'variation in indicated temperature %3.2f'%I0,'°C';\n",
+ "print'lag = %3.2f'%l,'s';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.27,Page No:64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "maximum time constant 5.526e-05 s\n",
+ "time lag at 90 cycles per second is 5.523e-05 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f = 120; #input frequency in s\n",
+ "p = 4; #amplitude accuracy permissible in %\n",
+ "x = 0.96 #temperature indicated to temperature of the medium \n",
+ "\n",
+ "#calculations\n",
+ "w = 2*math.pi*f; #angular fruequency in rad/s\n",
+ "x1 = 1/float(x);\n",
+ "t1 = ((x1)-1);\n",
+ "T = t1/(float(w)); #maximum time constant in s\n",
+ "phi = math.atan(w*T); #for sinusoidal input phi \n",
+ "tl = (1/float(w))*phi; #time lag at 90 cycles per second\n",
+ "\n",
+ "#result\n",
+ "print'maximum time constant %3.3e'%T,'s';\n",
+ "print'time lag at 90 cycles per second is %3.3e'%tl,'s';\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.28,Page No:64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "maximum temperature = 568.68 °C\n",
+ "minimum temperature = 531.32 °C\n",
+ "phase shift = 0.899 °\n",
+ "time lag = 7.15 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 520; #Range of temperature in °C\n",
+ "R2 = 580; #Range of temperature in °C\n",
+ "t = 50; #periodic time in s\n",
+ "T = 10; #time constant in s\n",
+ "Ii = 30; #initial amplitude in °C\n",
+ "\n",
+ "#calculations\n",
+ "R = (R1+R2)/float(2.0); #temperature oscillating mean value in °C\n",
+ "w = (2*math.pi)/float(t); #angular frequency in rad/s\n",
+ "X = 1/float(math.sqrt((1+(w*T)**2))); #amplitude ratio after transient effect dies away \n",
+ "I0 = X*Ii; #amplitude in °C \n",
+ "Tmax = R+I0; #maximum temperature in °C\n",
+ "Tmin = R-I0; #minimum temperature in °C\n",
+ "phi = math.atan(w*T); #phase shift in rad\n",
+ "Tl = (1/float(w))*phi; #time lag in s\n",
+ "\n",
+ "#result\n",
+ "print'maximum temperature = %3.2f'%Tmax,'°C';\n",
+ "print'minimum temperature = %3.2f'%Tmin,'°C';\n",
+ "print'phase shift = %3.3f'%phi,'°';\n",
+ "print'time lag = %3.2f'%Tl,'s';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.29,Page No:65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output expression 0.0463 sin(25t-82.4 °)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Ii = 0.35; #sinusoidal input amplitude from given expression 0.35sin(25t)\n",
+ "T = 0.3; #time constant in s\n",
+ "w = 25; #angular frequency in °,from given expression 0.35sin(25t)\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "X = 1/float(math.sqrt((1+((w*T)**2)))); #amplitude ratio\n",
+ "I0 = X*Ii; #magnitude of output \n",
+ "phi = math.atan(w*T); #phase shift in radians\n",
+ "\n",
+ "#result\n",
+ "print'output expression %3.4f'%I0,'sin(25t-%3.1f'%((phi*180)/float(math.pi)),'°)';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.30,Page No:66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "maximum value of temperature indicated 6.82 °C\n",
+ "Time lag = 35.12 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "T1 = 18; #time constant for the bulb in s\n",
+ "T2 = 36; #time constant for the well in s\n",
+ "t = 120; #time in s\n",
+ "Temp = 20; #rate of change in temperature in °C\n",
+ "\n",
+ "#calculation\n",
+ "w = (2*math.pi)/float(t);\n",
+ "X1 = 1/float(math.sqrt((1+(w*T1)**2))); #amplitude ratio of first system \n",
+ "X2 = 1/float(math.sqrt((1+(w*T2)**2))); #amplitude for second system \n",
+ "X = X1*X2; #amplitude for double capacity system\n",
+ "Tmax = Temp*X; #maximum temperature in °C(indicates both in -ve and +ve value)\n",
+ "Al = math.atan(w*T1)+math.atan(w*T2); #angle of lag in rad\n",
+ "Tl = (1/float(w))*Al; #time lag in s\n",
+ "\n",
+ "#result\n",
+ "print'maximum value of temperature indicated %3.2f'%Tmax,'°C';\n",
+ "print'Time lag = %3.2f'%Tl,'s';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.31,Page No:66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 61,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output expression 0.857 sin(2t-30.96 °) + 0.316 sin(10t-71.57 °)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "T = 0.3; #time constant in s\n",
+ "I1 = 2; #sinusoidal input amplitude from given expression 2sin(2t)+0.5sin(10t)\n",
+ "w1 = 2; #angular frequency in °,from given expression 2sin(2t)+0.5sin(10t)\n",
+ "I2 = 0.5; #sinusoidal input amplitude from given expression 2sin(2t)+0.5sin(10t)\n",
+ "w2 = 10; #angular frequency in °,from given expression 2sin(2t)+0.5sin(10t)\n",
+ "\n",
+ "#calculations\n",
+ "X1 = 1/float(math.sqrt((1+((w1*T)**2)))); #magnitude of output \n",
+ "phi1 = math.atan(w1*T); #phase shift in radians\n",
+ "X2 = 1/float(math.sqrt((1+((w2*T)**2)))); #magnitude of output\n",
+ "phi2 = math.atan(w2*T); #phase shift in radians\n",
+ "\n",
+ "#result\n",
+ "\n",
+ "print'output expression %3.3f'%X1,'sin(2t-%3.2f' %((phi1*180)/float(math.pi)),'°)','+ %3.3f'%X2,'sin(10t-%3.2f' %((phi2*180)/float(math.pi)),'°)';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.32,Page No:67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 63,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output expression 1.916 sin(2t-16.7 °) - 0.128 sin(8t+180-50.19 °)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "T = 0.15; #time constant in s\n",
+ "I1 = 2; #sinusoidal input amplitude from given expression 2sin(2t)+0.5cos(8t) or 2sin(2t)-0.5sin(180-8t) \n",
+ "w1 = 2; #angular frequency in °,from given expression 2sin(2t)+0.5sin(8t) or 2sin(2t)-0.5sin(180-8t)\n",
+ "I2 = 0.2; #sinusoidal input amplitude from given expression 2sin(2t)+0.5sin(8t) or 2sin(2t)-0.5sin(180-8t)\n",
+ "w2 = 8; #angular frequency in °,from given expression 2sin(2t)+0.5sin(8t) or 2sin(2t)-0.5sin(180-8t)\n",
+ "\n",
+ "#calculations\n",
+ "X1 = 1/float(math.sqrt((1+((w1*T)**2)))); #amplitude ratio\n",
+ "I01 = X1*I1; #magnitude of output \n",
+ "phi1 = math.atan(w1*T); #phase shift in radians\n",
+ "X2 = 1/float(math.sqrt((1+((w2*T)**2)))); #amplitude ratio\n",
+ "I02 = X2*I2; #magnitude of output\n",
+ "phi2 = math.atan(w2*T); #phase shift in radians\n",
+ "\n",
+ "#result\n",
+ "\n",
+ "print'output expression %3.3f'%I01,'sin(2t-%3.1f' %((phi1*180)/float(math.pi)),'°)','- %3.3f'%I02,'sin(8t+180-%3.2f' %((phi2*180)/float(math.pi)),'°)';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.34,Page No:68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage reduction in mass 24.4 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "m1 = 4.5; # mass in g\n",
+ "p = 1.15; #percentage increase requiredd in %\n",
+ "\n",
+ "#formula\n",
+ "#wn2 = p*wn1\n",
+ "#m2 = m1*(wn2/wn1)\n",
+ "x = (1/float(p))**2;\n",
+ "#m2 = m1*x\n",
+ "#percentage reduction = (m1-m2)/m1\n",
+ "# p = (m1-x*m1)/m1\n",
+ "m3 = ((1-x)/float(1))*100; #percentage reduction in mass(%)\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'percentage reduction in mass %3.1f'%m3,'%'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.35,Page No:69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 66,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "damping ratio = 0.274\n",
+ "damped natural frequency = 5.268 rad/s\n",
+ "static sensitivity = 1\n",
+ "time constant = 0.1826 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "wn = 5.477; #natural frequency\n",
+ "k1 = 0.1; #ratio of 2*gamma/wn\n",
+ "k = 1; #static sensitivity \n",
+ "\n",
+ "#calculations\n",
+ "gamma = (k1*wn)/float(2); #damping ratio\n",
+ "y = (1-(gamma**2)); #damped natural frequency in rad/s\n",
+ "wd = wn*math.sqrt(y); #static sensitivity\n",
+ "t = 1/float(wn); #time constant in s\n",
+ "\n",
+ "#result\n",
+ "print'damping ratio = %3.3f'%gamma;\n",
+ "print'damped natural frequency = %3.3f'%wd,'rad/s';\n",
+ "print'static sensitivity =%3.0f'%k;\n",
+ "print'time constant = %3.4f'%t,'s';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.36,Page No:70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 67,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "natural frequency = 2.95 rad/s\n",
+ "damping ratio 0.556\n",
+ "damped natural frequency 2.454 rad/s\n",
+ "time constant 0.339 s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "w = 1.95; #angular frequency in rad/s\n",
+ "em = 8; #maximum permissible error in %\n",
+ "J = 0.14; #moment of inertia of load in kg m**2\n",
+ "q = 1.22; #torsional constant of the shaft in Nm/rad\n",
+ "M = 1.08; #amplitude ratio \n",
+ "\n",
+ "#calculations\n",
+ "wn = math.sqrt(q/float(J)); #natural frequency in rad/s\n",
+ "r = w/float(wn); #normalised frequency ratio\n",
+ "x = 1/float(M**2); \n",
+ "gamma =math.sqrt((x-((1-r**2)**2))/float(2*r)**2); #damping ratio \n",
+ "wd = wn*(math.sqrt(1-(gamma**2))); #damped natural frequency in rad/s\n",
+ "T = 1/float(wn); #time constant in s\n",
+ "\n",
+ "#result\n",
+ "print'natural frequency = %3.2f'%wn,'rad/s';\n",
+ "print'damping ratio %3.3f'%gamma;\n",
+ "print'damped natural frequency %3.3f'%wd,'rad/s';\n",
+ "print'time constant %3.3f'%T,'s';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.37,Page No:71"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 68,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "effective damping ratio = 0.56\n",
+ "undamped natural frequency = 2.74 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "po =12; #percentage overshoot in %\n",
+ "Tr = 0.22; #rise time in s\n",
+ "\n",
+ "#calculations\n",
+ "x = -math.log(12/float(100)); \n",
+ "gamma = x/float(math.sqrt((x**2)+(math.pi**2))); #effective damping ratio \n",
+ "wd = math.pi/float(Tr); #damped natural frequency in rad/s\n",
+ "wn = wd/float(math.sqrt(1-(gamma**2))); #undamped angular frequency in rad/s\n",
+ "fn = wn/float(2*math.pi); #undamped natural frequency in Hz\n",
+ " \n",
+ "#result\n",
+ "print'effective damping ratio = %3.2f'%gamma;\n",
+ "print'undamped natural frequency = %3.2f'%fn,'Hz';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.38,Page No:73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 70,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "natural frequency 1.4\n",
+ "amplitude ratio 0.504\n",
+ "error = 49.6 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "gamma = 0.62; #damping ratio \n",
+ "fn = 5; #natural frequency in Hz\n",
+ "f = 7; #exicitation frequency in Hz\n",
+ " \n",
+ "#calculations\n",
+ "r = f/float(fn); #ratio of excitation frequency tonatural frequency\n",
+ "M = 1/float(math.sqrt(((1-(r**2))**2)+((2*gamma*r)**2))); #amplitude ratio\n",
+ "e = (1-M)*100; #error in %\n",
+ "\n",
+ "#result\n",
+ "print'natural frequency %3.1f'%r;\n",
+ "print'amplitude ratio %3.3f'%M;\n",
+ "print'error = %3.1f'%e,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.39,Page No:73 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 73,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "the deviation remains within 12 percent of output for the frequency range 0 - 723.09 cps\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "fn = 800; #natural frequency of the system in cps\n",
+ "gamma = 62; #damping ratio per cent\n",
+ "d = 12; #maximum amount of deviation of amplitude ratio in per cent\n",
+ "M = 1.12; \n",
+ "M1 =0.88;\n",
+ "\n",
+ "#calculations\n",
+ "#M = 1/math.sqrt(((1-r**2)**2)+((2*0.62*r)**2));\n",
+ "x = (1/float(M))**2;\n",
+ "#1+(r**4)-(2*r**2)+(1.58*(r**2))=x\n",
+ "#r**4-((0.462)*(r**2))+0.203 =0\n",
+ "y = (1/float(M1))**2\n",
+ "#1+(r**4)-(2*r**2)+(1.58*(r**2))=y\n",
+ "#r**4-(0.462*(r**2))-0.29=0\n",
+ "x = math.sqrt((0.462**2)+(4*0.29));\n",
+ "r1 = (0.462+x)/float(2);\n",
+ "r = math.sqrt(r1);\n",
+ "f = fn*r;\n",
+ "\n",
+ "#result\n",
+ "print'the deviation remains within 12 percent of output for the frequency range 0 - %3.2f'%f,'cps';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:1.40,Page No:74"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 74,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "required expresssion for the output is 0.495 sin(3.77t-69.00°)\n",
+ "output ampliude 0.495\n",
+ "output frequency 3.77\n",
+ "phase lag 69.00 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f = 0.6; #frequency in rad/s\n",
+ "m = 1; #magnitude of input\n",
+ "a = 3.77; #angle value from sin(3.77t)\n",
+ "\n",
+ "#calculations\n",
+ "w = 2*math.pi*f; #angular frequency\n",
+ "#x = complex(8/float(((j*w)**2)+(4*j*w)+20));\n",
+ "x1 =(-(w**2)+20)/float(8);\n",
+ "y1 = (4*w)/float(8);\n",
+ "x = (complex(x1,y1));\n",
+ "X = abs(x);\n",
+ "phi = ((math.atan(y1/float(x1)))*180)/(math.pi); #phase lag in rad\n",
+ "m = (1/float(2.02))*m;\n",
+ "\n",
+ "#result\n",
+ "print'required expresssion for the output is %3.3f'%m,'sin(3.77t-%3.2f°)'%phi;\n",
+ "print'output ampliude %3.3f'%m;\n",
+ "print'output frequency %3.2f'%a;\n",
+ "print'phase lag %3.2f'%phi,'°';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.41,Page No:75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 75,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "when the error is specified as a percentage of full scale deflection,the wattmeter reading may be between 42.5 to 57.5 W\n",
+ "when the error is specified as a percentage of true value,the wattmeter reading may be between 49.25 to 50.75 W\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R = 500; #range of wattemeter in W\n",
+ "e = 1.5; #percentage of full scale deflection rantging -1.5 to +1.5\n",
+ "Qs = 50; #true or specified power in W\n",
+ "me1 = 7.5; #percentage of full scale deflection indicating -7.5 to +7.5\n",
+ "\n",
+ "#calculations\n",
+ "me = (e/float(100))*R; #magnitude of limiting error at full scale in W ranging -me to +me\n",
+ "Rmax = Qs+me; #maximum wattmeter reading may be Rmax in W\n",
+ "Rmin = Qs-me; #minimum wattmeter reading may be Rmin in W\n",
+ "Er = (me1/float(Qs))*100; #relative error in %\n",
+ "Em = ((e*Qs)/float(100));\n",
+ "Mmax = Qs+Em; #maximum wattmeter reading may be Mmax in W\n",
+ "Mmin = Qs-Em; #minimum wattmeter reading may be Mmin in W\n",
+ "\n",
+ "#result\n",
+ "print'when the error is specified as a percentage of full scale deflection,the wattmeter reading may be between %3.1f'%Rmin,'to %3.1f'%Rmax,'W';\n",
+ "print'when the error is specified as a percentage of true value,the wattmeter reading may be between %3.2f'%Mmin,'to %3.2f'%Mmax,'W';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.42,Page No:76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 77,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage limiting error = 6.00 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Er = 3; #accuracy of flow meter of full scale reading in % ranging -Er to +Er\n",
+ "Qs = 2.5*10**-6; #full scale reading in m**3/s\n",
+ "Qs1 = 1.25*10**-6; #flow measured by the meter in m**3/s\n",
+ "\n",
+ "#calculations\n",
+ "dQ = (Er/float(100))*Qs; #magnitude of limiting error ranging -dQ to +dQ in m**3/s\n",
+ "Er1 = dQ/float(Qs1); #relative error \n",
+ "Q1 = Qs1*(1); #flow rate in m**3/s\n",
+ "Q2 = Qs1*Er1; #flow rate in m**3/s\n",
+ "Er2 = (Q2/float(Q1))*100; #percentage limiting error ranging -Er2 to +Er1 in %\n",
+ "\n",
+ "#result\n",
+ "\n",
+ "print'percentage limiting error = %3.2f'%Er2,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example:1.43,Page No:77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 82,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limting value of resultant reistance is 140.40 and 129.60 Ω\n",
+ "percent limiting error of the series combination of resistance 4.00 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 25; #resitance in Ω\n",
+ "R2 = 65; #resitance in Ω\n",
+ "R3 = 45; #resitance in Ω\n",
+ "e1 = 4; #limiting error indicating both in -ve and +ve values in %\n",
+ "e2 = 4; #limiting error indicating both in -ve and +ve values in %\n",
+ "e3 = 4; #limiting error indicating both in -ve and +ve values in % \n",
+ "\n",
+ "#calculations\n",
+ "e11 = (e1*R1)/float(100); #error value indicating both in -ve and +ve values\n",
+ "e21 = (e2*R2)/float(100); #error value indicating both in -ve and +ve values\n",
+ "e31 = (e3*R3)/float(100); #error value indicating both in -ve and +ve values\n",
+ "R = R1+R2+R3; #magnitude of resitance in Ω\n",
+ "e = e11+e21+e31; #error indicating both in -ve and +ve values\n",
+ "Rmax = R+e;\n",
+ "Rmin = R-e;\n",
+ "p =((e)/float(R))*100; #percent limiting error of the series combination of resistance in %(indicating both in -ve and +ve values)\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'limting value of resultant reistance is %3.2f'%Rmax,' and %3.2f'%Rmin,' Ω';\n",
+ "print'percent limiting error of the series combination of resistance %3.2f'%p,'%';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.44,Page No:78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 83,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limiting error in the measurement of resistance 2.80 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "x = 1.2; #limiting error in the measurement of power(dP/p) in % \n",
+ "y = 0.8; #limiting error in the measurement of current(dI/I) in %\n",
+ "\n",
+ "#calculations\n",
+ "z = (x+(2*y)); #limiting error in the measurement of resistance(dR/R) indicating -z to +z in %\n",
+ "\n",
+ "#result\n",
+ "print'limiting error in the measurement of resistance %3.2f'%z,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.45,Page No:78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 84,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnitude of unknown resitance= 4400.00 Ω\n",
+ "relative limiting error 1.50 %;\n",
+ "limiting error 66.00 Ω\n",
+ "the guaranteed values of resitance lie between 4334.00 and 4466.00 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 50; #resistance in Ω\n",
+ "R2 = 500; #resistance in Ω\n",
+ "R3 = 440; #resistance in Ω\n",
+ "dR1 = 0.5; #limiting error(dR1/R1) of R1 ranging -dR1 to +dR1 in %\n",
+ "dR2 = 0.5; #limiting error(dR2/R2) of R1 ranging -dR2 to +dR2 in %\n",
+ "dR3 = 0.5; #limiting error(dR3/R3) of R1 ranging -dR3 to +dR3 in %\n",
+ "\n",
+ "#calculations\n",
+ "R4 = (R2*R3)/float(R1); #unknoen resistance in Ω\n",
+ "x = (dR1+dR2+dR3); #relative limiting error of unknown resistance ranging -x to +x in %\n",
+ "e = (x*R4)/float(100); #limiting error(Ω) indcating -ve and +ve values \n",
+ "Rmax = R4+e; #maximum value of resitance in Ω\n",
+ "Rmin = R4-e; #minimum value of resistance in Ω\n",
+ "\n",
+ "#result\n",
+ "print'magnitude of unknown resitance= %3.2f'%R4,'Ω';\n",
+ "print'relative limiting error %3.2f'%x,'%;'\n",
+ "print'limiting error %3.2f'%e,'Ω';\n",
+ "print'the guaranteed values of resitance lie between %3.2f'%Rmin,'and %3.2f'%Rmax,'Ω';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.46,Page No:78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 85,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limiting error in force 0.2918 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration \n",
+ "db = 0.01; #accuracy of width ranging -db to +db\n",
+ "b = 4.5; #width in mm\n",
+ "dd = 0.01; #accuracy of depth ranging -dd to +dd\n",
+ "d = 0.9; #depth in mm\n",
+ "dl = 0.01; #accuracy of length ranging -dl to +dl\n",
+ "l = 45; #length in mm\n",
+ "x = 0.2; #modulus of rigidity(dE/E) in %\n",
+ "dy = 0.1; #accuracy of deflection ranging -dy to +dy\n",
+ "y = 1.8; #deflection in mm\n",
+ "\n",
+ "#calculations \n",
+ "f = (x+(db/float(b))+(3*(dd/float(d)))+(3*(dl/float(l)))+(dy/float(y))); #limiting error in force(dF/F) ranging -f to +f in %\n",
+ "\n",
+ "#result\n",
+ "print'limiting error in force %3.4f'%f,'%';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.47,Page No:79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 86,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "magnitude of power = 1.993 kW\n",
+ "magnitude of limiting error 0.0339 kW\n",
+ "magnitude of limiting error can lie between 2.03 and 1.96 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "F = 4.26; #force at the end of torque arm in kg\n",
+ "dF = 0.02; #error in force ranging -dF to +dF in kg \n",
+ "L = 382; #length of torque arm in mm\n",
+ "dL = 1.2; #error in length ranging -dL to +dL in mm\n",
+ "R = 1192; #number of revolutions during time t\n",
+ "dR = 1.0; #error in number of revolutions \n",
+ "t = 60; #time for test run in s\n",
+ "dt = 0.5; #error in time in s\n",
+ "\n",
+ "#calculations\n",
+ "P = (2*math.pi*9.81*F*L*R)/float(t*10**6); #magnitude of power in kW\n",
+ "p = ((dF/float(F))+(dL/float(L))+(dR/float(R))+(dt/float(t))); #limiting error(dP/P) computed ranging -p to +p\n",
+ "dp = p*P; #limiting error in kW\n",
+ "Pmax = P+dp; #maximum value of power in kW\n",
+ "Pmin = P-dp; #minimum value of power in kW\n",
+ "\n",
+ "#result\n",
+ "print'magnitude of power = %3.3f'%P,'kW';\n",
+ "print'magnitude of limiting error %3.4f'%dp,'kW';\n",
+ "print'magnitude of limiting error can lie between %3.2f'%Pmax,'and %3.2f'%Pmin,'kW';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.48,Page No:80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 87,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "power percentage to original power 101.96 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "I = 26.5; #current in A\n",
+ "Ix = 1.1; #ammeter reading was low by Ix\n",
+ "R = 0.12; #resistance in Ω\n",
+ "Rx = 0.25; #resistance reading was high by Rx\n",
+ "\n",
+ "#calculations\n",
+ "It = I*((1+(Ix/float(100)))); #true value of current in A\n",
+ "Rt = R*((1-(Rx/float(100)))); #true value of resistance in Ω\n",
+ "Pt = (It**2)*Rt; #true value of power in W\n",
+ "Pm = (I**2)*R; #measured value of power in W\n",
+ "P = (Pt/float(Pm))*100; #power percentage of that originally calculated in %\n",
+ "\n",
+ "#result\n",
+ "print'power percentage to original power %3.2f'%P,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.49,Page No:87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 88,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arthimetic mean 1.461 mm\n",
+ "average deviation 0.065\n",
+ "standard deviation 0.08075 mm\n",
+ "variance 0.00652 mm**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#varioable declaration\n",
+ "q1 = 1.34; #micrometer reading in mm\n",
+ "q2 = 1.38; #micrometer reading in mm\n",
+ "q3 = 1.56; #micrometer reading in mm\n",
+ "q4 = 1.47; #micrometer reading in mm\n",
+ "q5 = 1.42; #micrometer reading in mm\n",
+ "q6 = 1.44; #micrometer reading in mm\n",
+ "q7 = 1.53; #micrometer reading in mm\n",
+ "q8 = 1.48; #micrometer reading in mm\n",
+ "q9 = 1.40; #micrometer reading in mm\n",
+ "q10 = 1.59; #micrometer reading in mm\n",
+ "n = 10; #number of readings\n",
+ "\n",
+ "#calculations\n",
+ "q = (q1+q2+q3+q4+q5+q6+q7+q8+q9+q10)/float(10); #arthmetic mean in mm\n",
+ "d1 = q1-q; #derivation in mm\n",
+ "d2 = q2-q; #derivation in mm\n",
+ "d3 = q3-q; #derivation in mm\n",
+ "d4 = q4-q; #derivation in mm\n",
+ "d5 = q5-q; #derivation in mm\n",
+ "d6 = q6-q; #derivation in mm\n",
+ "d7 = q7-q; #derivation in mm\n",
+ "d8 = q8-q; #derivation in mm\n",
+ "d9 = q9-q; #derivation in mm\n",
+ "d10 = q10-q; #derivation in mm\n",
+ "d = (abs(d1)+abs(d2)+abs(d3)+abs(d4)+abs(d5)+abs(d6)+abs(d7)+abs(d8)+abs(d9)+abs(d10))/float(n); #average deviation in mm\n",
+ "s = math.sqrt(((d1**2)+(d2**2)+(d3**2)+(d4**2)+(d5**2)+(d6**2)+(d7**2)+(d8**2)+(d9**2)+(d10**2))/float(n-1)); #standard deviation in mm\n",
+ "V = s**2; #variance in mm**2\n",
+ "\n",
+ "#result\n",
+ "print'arthimetic mean %3.3f'%q,'mm';\n",
+ "print'average deviation %3.3f'%d;\n",
+ "print'standard deviation %3.5f'%s,'mm';\n",
+ "print'variance %3.5f'%V,'mm**2';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.50,Page No:88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 90,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arthimetic mean 419.62 kHz\n",
+ "average deviation 5.75 kHz\n",
+ "standard deviation 6.55 kHz\n",
+ "variance 42.95 kHz**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "q1 = 412; #resonant frequency in KHz\n",
+ "q2 = 428; #resonant frequency in KHz\n",
+ "q3 = 423; #resonant frequency in KHz\n",
+ "q4 = 415; #resonant frequency in KHz\n",
+ "q5 = 426; #resonant frequency in KHz\n",
+ "q6 = 411; #resonant frequency in KHz\n",
+ "q7 = 423; #resonant frequency in KHz\n",
+ "q8 = 416; #resonant frequency in KHz\n",
+ "n = 8; #number of readings \n",
+ "\n",
+ "#calculations\n",
+ "q = (q1+q2+q3+q4+q5+q6+q7+q8+q9+q10)/float(n); #arthimetc mean in khz\n",
+ "d1 = q1-q; #deviation in kHz\n",
+ "d2 = q2-q; #deviation in kHz\n",
+ "d3 = q3-q; #deviation in kHz\n",
+ "d4 = q4-q; #deviation in kHz\n",
+ "d5 = q5-q; #deviation in kHz\n",
+ "d6 = q6-q; #deviation in kHz\n",
+ "d7 = q7-q; #deviation in kHz\n",
+ "d8 = q8-q; #deviation in kHz\n",
+ "d = (abs(d1)+abs(d2)+abs(d3)+abs(d4)+abs(d5)+abs(d6)+abs(d7)+abs(d8))/float(n); #average deviation in kHz\n",
+ "s = math.sqrt(((d1**2)+(d2**2)+(d3**2)+(d4**2)+(d5**2)+(d6**2)+(d7**2)+(d8**2))/float(n-1)); #standard deviation in k Hz\n",
+ "V = s**2; #variance in (kHz)**2\n",
+ "\n",
+ "#result\n",
+ "print'arthimetic mean %3.2f'%q,'kHz';\n",
+ "print'average deviation %3.2f'%d,'kHz';\n",
+ "print'standard deviation %3.2f'%s,'kHz';\n",
+ "print'variance %3.2f'%V,'kHz**2';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.51,Page No:94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 92,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arthimetic mean 39.87 °C\n",
+ "standard deviation 0.22136 °C\n",
+ "probable error = 0.15 °C\n",
+ "probable error of mean 0.05 °C\n",
+ "range 0.80 °C\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#varioable declaration\n",
+ "q1 = 39.6; #temperature reading °C\n",
+ "q2 = 39.9; #temperature reading °C\n",
+ "q3 = 39.7; #temperature reading °C\n",
+ "q4 = 39.9; #temperature reading °C\n",
+ "q5 = 40.0; #temperature reading °C\n",
+ "q6 = 39.8; #temperature reading °C\n",
+ "q7 = 39.9; #temperature reading °C\n",
+ "q8 = 39.8; #temperature reading °C\n",
+ "q9 = 40.4; #temperature reading °C\n",
+ "q10 = 39.7; #temperature reading °C\n",
+ "n = 10; #number of observations\n",
+ "\n",
+ "#calculations\n",
+ "q = (q1+q2+q3+q4+q5+q6+q7+q8+q9+q10)/float(10); #arthimetic mean in °C\n",
+ "d1 = q1-q; #deviation in °C\n",
+ "d2 = q2-q; #deviation in °C\n",
+ "d3 = q3-q; #deviation in °C\n",
+ "d4 = q4-q; #deviation in °C\n",
+ "d5 = q5-q; #deviation in °C\n",
+ "d6 = q6-q; #deviation in °C\n",
+ "d7 = q7-q; #deviation in °C\n",
+ "d8 = q8-q; #deviation in °C\n",
+ "d9 = q9-q; #deviation in °C\n",
+ "d10 = q10-q; #deviation in °C\n",
+ "R1 = 40.4; #maximum value of temperature in °C\n",
+ "R2 = 39.6; #minimum value of temperature in °C\n",
+ "s = math.sqrt(((d1**2)+(d2**2)+(d3**2)+(d4**2)+(d5**2)+(d6**2)+(d7**2)+(d8**2)+(d9**2)+(d10**2))/float(n-1)); #standard deviation in °C\n",
+ "r1 = 0.6745*s; #probable error of one reading in °C\n",
+ "rm = r1/math.sqrt(float(n-1)); #probable error of mean in °C\n",
+ "R = R1-R2; #range in °C\n",
+ "#result\n",
+ "print'arthimetic mean %3.2f'%q,'°C';\n",
+ "print'standard deviation %3.5f'%s,'°C';\n",
+ "print'probable error = %3.2f'%r1,'°C';\n",
+ "print'probable error of mean %3.2f'%rm,'°C';\n",
+ "print'range %3.2f'%R,'°C';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.52,Page No:96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 94,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "arthimetic mean = 200.77 °C\n",
+ "average deviation = 1.096 °C\n",
+ "standard deviation = 1.482 °C\n",
+ "variance = 2.197 °C**2\n",
+ "probable error of one reading = 1 °C\n",
+ "probable error of the mean = 0.1 °C\n",
+ "standard deviation of the standard deviation = 0.1048 °C\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "T1 = 197; #temperature reading °C\n",
+ "T2 = 198; #temperature reading °C\n",
+ "T3 = 199; #temperature reading °C\n",
+ "T4 = 200; #temperature reading °C\n",
+ "T5 = 201; #temperature reading °C\n",
+ "T6 = 202; #temperature reading °C\n",
+ "T7 = 203; #temperature reading °C\n",
+ "T8 = 204; #temperature reading °C\n",
+ "T9 = 205; #temperature reading °C\n",
+ "f1 = 2; #frequency of occurence \n",
+ "f2 = 4; #frequency of occurence \n",
+ "f3 = 10; #frequency of occurence \n",
+ "f4 = 24; #frequency of occurence \n",
+ "f5 = 36; #frequency of occurence \n",
+ "f6 = 14; #frequency of occurence \n",
+ "f7 = 5; #frequency of occurence \n",
+ "f8 = 3; #frequency of occurence \n",
+ "f9 = 2; #frequency of occurence \n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "t1 = T1*f1;\n",
+ "t2 = T2*f2;\n",
+ "t3 = T3*f3;\n",
+ "t4 = T4*f4;\n",
+ "t5 = T5*f5;\n",
+ "t6 = T6*f6;\n",
+ "t7 = T7*f7;\n",
+ "t8 = T8*f8;\n",
+ "t9 = T9*f9;\n",
+ "n = (f1+f2+f3+f4+f5+f6+f7+f8+f9); \n",
+ "AM = (t1+t2+t3+t4+t5+t6+t7+t8+t9)/float(n); #arthimetic mean in °C\n",
+ "tf = (t1+t2+t3+t4+t5+t6+t7+t8+t9)/float(n);\n",
+ "d1 = T1-tf;\n",
+ "d2 = T2-tf;\n",
+ "d3 = T3-tf;\n",
+ "d4 = T4-tf;\n",
+ "d5 = T5-tf;\n",
+ "d6 = T6-tf;\n",
+ "d7 = T7-tf;\n",
+ "d8 = T8-tf;\n",
+ "d9 = T9-tf;\n",
+ "x1 = d1*f1;\n",
+ "x2 = d2*f2;\n",
+ "x3 = d3*f3;\n",
+ "x4 = d4*f4;\n",
+ "x5 = d5*f5;\n",
+ "x6 = d6*f6;\n",
+ "x7 = d7*f7;\n",
+ "x8 = d8*f8;\n",
+ "x9 = d9*f9;\n",
+ "x = abs(x1)+abs(x2)+abs(x3)+abs(x4)+abs(x5)+abs(x6)+abs(x7)+abs(x8)+abs(x9);\n",
+ "y1 = f1*(d1**2);\n",
+ "y2 = f2*(d2**2);\n",
+ "y3 = f3*(d3**2);\n",
+ "y4 = f4*(d4**2);\n",
+ "y5 = f5*(d5**2);\n",
+ "y6 = f6*(d6**2);\n",
+ "y7 = f7*(d7**2);\n",
+ "y8 = f8*(d8**2);\n",
+ "y9 = f9*(d9**2);\n",
+ "y = y1+y2+y3+y4+y5+y6+y7+y8+y9;\n",
+ "sigma = x/float(n); #average deviation in °C\n",
+ "sd = math.sqrt(y/float(n)); #standard deviation in °C\n",
+ "V = sd**2; #variance in °C**2\n",
+ "r1 = 0.6745*sd; #probable error of one reading in °C\n",
+ "rm = r1/float(math.sqrt(n)); #probable error of mean in °C\n",
+ "sigmam = sd/float(math.sqrt(n)); #standard deviation of the mean in °C\n",
+ "sigmasd = sigmam/float(math.sqrt(2)); #standard deviation of standard deviation in °C\n",
+ "\n",
+ "#result\n",
+ "print'arthimetic mean = %3.2f'%AM,'°C';\n",
+ "print'average deviation = %3.3f'%sigma,'°C';\n",
+ "print'standard deviation = %3.3f'%sd,'°C';\n",
+ "print'variance = %3.3f'%V,'°C**2';\n",
+ "print'probable error of one reading = %3.0f'%r1,'°C';\n",
+ "print'probable error of the mean = %3.1f'%rm,'°C';\n",
+ "print'standard deviation of the standard deviation = %3.4f'%sigmasd,'°C';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:1.53,Page No:97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 96,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "thus about 57 % of readings are within -1.2A to 1.2A of the true value\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "I = 80; #current in A\n",
+ "p = 0.2; #p(y) value given \n",
+ "x = 0.8; #probabiltiy of error \n",
+ "y = 0.5248; #y valu from probability tables for sorresponding p(y) value\n",
+ "x1 = 1.2; #probabiltiy of error\n",
+ "\n",
+ "#calculation\n",
+ "sigma = (x/float(y)); #standard eviation\n",
+ "y1 = x1/float(sigma); \n",
+ "#p(y) value corresponding to y1 value from probabitiy table is 0.2842\n",
+ "p1 = 0.2842;\n",
+ "P = (2*p1)*100; #probabity of an error \n",
+ "\n",
+ "#result\n",
+ "print'thus about %3.0f'%P,'% of readings are within -1.2A to 1.2A of the true value';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.54,Page No:97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 99,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of readings exceeding maximum deflection of 25mm is 16 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "x1 =25; #deflaction in mm\n",
+ "x2 = 21.9; #deflaction in mm\n",
+ "r = 2.1; #probable error in mm\n",
+ "\n",
+ "#calculations\n",
+ "x = x1-x2; #deviation in mm\n",
+ "sigma = r/float(0.6745); #standard deviation\n",
+ "y = x/float(sigma); #ratio \n",
+ "n = 2*0.341*100; \n",
+ "ne = 100-n; #number of readings exceeding a deviation of 3.1\n",
+ "nx = ne/float(2); #number of readings exceeding maximum deflection of 25mm in mm\n",
+ "\n",
+ "#result\n",
+ "print'number of readings exceeding maximum deflection of 25mm is %3.0f'%nx,'mm';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.55,Page No:98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 100,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "total number of rods whose length between specified limits is 8953\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "#in case of me of normal distribution .thereis equal probability of +ve and -ve errors\n",
+ "n1 = 5000; #number of rods having length greater than 20 mm\n",
+ "n2 = 1000; #number of rods having length greater than 20.25 mm\n",
+ "n3 = 5000; #number of rods having length smaller than 20 mm\n",
+ "y = 1.3; #from probability tables ,corresponding to the probability of p(y) \n",
+ "x1 = 20.25; #maximum length of rod ,that should not be exceed in mm\n",
+ "x2 = 20.0; #nominal length in mm\n",
+ "x4 = 19.5; #minimum length of rod ,that should not be smmaler than this value in mm\n",
+ "y2 = 0.4953; #from probability tables ,corresponding to the y value \n",
+ "\n",
+ "#calculations\n",
+ "n4 = n1-n2; #number of rods wehere length lies between 20mm and 20.25\n",
+ "x = x1-x2; #probability that 4000 rods have a value greater than 20mm and less than 20.25mm\n",
+ "sigma = x/float(y); #standard deviation\n",
+ "y1 = (x2-x4)/float(sigma); #y value for with nominal length of 19.5mm and 20mm\n",
+ "n = (n1+n3)*y2; #number of rods that have lengths between 19.5 and 20mm\n",
+ "N = n+n4; #total number of rods whose length between specified limits \n",
+ "\n",
+ "#result\n",
+ "print'total number of rods whose length between specified limits is %3.0f'%N;\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.56,Page No:98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 102,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "we expect 12 readings to lie between 1485 to 1515 rpm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "q = 1515; #tachometer reading in rpm\n",
+ "q1 = 1500; #tachometer reading in rpm\n",
+ "h = 0.04; #precision index\n",
+ "p = 0.3015; #p(y) value from probability table corresponding to y value\n",
+ "n =20; #number of readings\n",
+ "\n",
+ "#calculations\n",
+ "x = q-q1; #deviation in r.p.m(indicates in both -ve and +ve value)\n",
+ "sigma = 1/float((math.sqrt(2))*h); #standard deviation\n",
+ "y = x/float(sigma); \n",
+ "#p(y) from probability table is 0.3015\n",
+ "p = 2*p; #probability of an error\n",
+ "N = p*n; #number of redings\n",
+ "\n",
+ "#result\n",
+ "print'we expect %3.2d'%N,'readings to lie between 1485 to 1515 rpm';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:1.57,Page No:99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 105,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Thus 75 percent of depth measurements lie within th range 15.09 and -14.91 cm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "d = 15; #nominal depth of water in cm\n",
+ "n = 40; #total number of times the measurements taken\n",
+ "n1 = 10; #number of measurement reading found to lie outside a particular range \n",
+ "h = 9; #precision index in cm**-1\n",
+ "y = 1.15; #from probability table corresponding value of p(y)\n",
+ "\n",
+ "#calculations\n",
+ "P = (n-n1)/float(n); #probability of falling within a particular range \n",
+ "p1 = P/float(2); #half of these measiurements have a +ve and half have -ve errors\n",
+ "sigma = 1/float((math.sqrt(2))*h); #standard defviation\n",
+ "x = y*sigma; \n",
+ "Rmax = d+x;\n",
+ "Rmin = d-x;\n",
+ "\n",
+ "#result\n",
+ "print'Thus 75 percent of depth measurements lie within th range %3.2f'%Rmax,'and -%3.2f'%Rmin,'cm';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:1.58,Page No:100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 107,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "precision index 0.099\n",
+ "number of false alarms 6.00\n",
+ "precision index 0.1155\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "py1 = 0.45; #py1 is p(y) given data\n",
+ "y = 0.675; #from probavility table corresponding to p(y) value\n",
+ "x = 4.8; \n",
+ "q = 100; #fixed mass flow rate in kg/s\n",
+ "q1 = 88; #flow meter reading in kg/s\n",
+ "n = 30; #number of days in november month\n",
+ "n1 = 4; #number of times flow is checked in a day\n",
+ "x1 = 0.5; #overall probabilty \n",
+ "y2 = 1.96; #y value corresponding to py ,from probability table\n",
+ "\n",
+ "#calculations\n",
+ "sigma = x/float(y); #standard deviation \n",
+ "a = (math.sqrt(2))*sigma;\n",
+ "h = 1/float(a); #precision index\n",
+ "x1 = q-q1;\n",
+ "y1 = x1/float(sigma); #y value for masss flow rate of 88kg/s\n",
+ "\n",
+ "#p(y) corresponding to y1 is 0.45\n",
+ "\n",
+ "e = 0.5-py1; #amount it fall into false alarms \n",
+ "N = n*n1; #number of measurements in themonth of november\n",
+ "E = e*N; #expected false alarms\n",
+ "E1 = x*E; #reduced number of flase alarms\n",
+ "P = E1/float(N); #probability of false alarms\n",
+ "py = 0.5-P; #probability of datato lie in tolerent band\n",
+ "sigma1 = x1/float(y2); #standard deviation\n",
+ "h1 = 1/float((math.sqrt(2))*sigma1); #precision index\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'precision index %3.3f'%h;\n",
+ "print'number of false alarms %3.2f'%E;\n",
+ "print'precision index %3.4f'%h1;\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:1.59,Page No:103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 109,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "It is given that for 10 readings the ratio of deviation to standard deviation is not to exceed 1.96\n",
+ "therfore x5 = 2.05 which is greater than 1.96,reading 4.33 should be rejected\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#varioable declaration\n",
+ "q1 = 5.30; #length in cm\n",
+ "q2 = 5.73; #length in cm\n",
+ "q3 = 6.77; #length in cm\n",
+ "q4 = 5.26; #length in cm\n",
+ "q5 = 4.33; #length in cm\n",
+ "q6 = 5.45; #length in cm\n",
+ "q7 = 6.09; #length in cm\n",
+ "q8 = 5.64; #length in cm\n",
+ "q9 = 5.81; #length in cm\n",
+ "q10 = 5.75; #length in cm\n",
+ "n = 10; #number of copper wires\n",
+ "\n",
+ "#calculations\n",
+ "q = (q1+q2+q3+q4+q5+q6+q7+q8+q9+q10)/float(10); #arthimetic mean in cm\n",
+ "d1 = q1-q; #deviation in cm\n",
+ "d2 = q2-q; #deviation in cm\n",
+ "d3 = q3-q; #deviation in cm\n",
+ "d4 = q4-q; #deviation in cm\n",
+ "d5 = q5-q; #deviation in cm\n",
+ "d6 = q6-q; #deviation in cm\n",
+ "d7 = q7-q; #deviation in cm\n",
+ "d8 = q8-q; #deviation in cm\n",
+ "d9 = q9-q; #deviation in cm\n",
+ "d10 = q10-q; #deviation in cm\n",
+ "s = math.sqrt(((d1**2)+(d2**2)+(d3**2)+(d4**2)+(d5**2)+(d6**2)+(d7**2)+(d8**2)+(d9**2)+(d10**2))/float(n-1)); #standard deviation in cm \n",
+ "x1 = abs(d1)/float(s); #ratio of deviation to standard deviation\n",
+ "x2 = abs(d2)/float(s); #ratio of deviation to standard deviation\n",
+ "x3 = abs(d3)/float(s); #ratio of deviation to standard deviation\n",
+ "x4 = abs(d4)/float(s); #ratio of deviation to standard deviation\n",
+ "x5 = abs(d5)/float(s); #ratio of deviation to standard deviation\n",
+ "x6 = abs(d6)/float(s); #ratio of deviation to standard deviation\n",
+ "x7 = abs(d7)/float(s); #ratio of deviation to standard deviation\n",
+ "x8 = abs(d8)/float(s); #ratio of deviation to standard deviation\n",
+ "x9 = abs(d9)/float(s); #ratio of deviation to standard deviation\n",
+ "x10 = abs(d10)/float(s); #ratio of deviation to standard deviation\n",
+ "\n",
+ "#result\n",
+ "print'It is given that for 10 readings the ratio of deviation to standard deviation is not to exceed 1.96';\n",
+ "print'therfore x5 = %3.2f'%x5,'which is greater than 1.96,reading %3.2f should be rejected'%q5;\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.60,Page No:105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 111,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "linear equation 0.672 u +0.591\n",
+ "standard deviation = 0.34\n",
+ "standard deviation = 0.51\n",
+ "standard deviation = 0.04\n",
+ "standard deviation = 0.31\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "u1 = 1.8; #initial velocity\n",
+ "u2 = 4.6; #initial velocity\n",
+ "u3 = 6.6; #initial velocity\n",
+ "u4 = 9.0; #initial velocity\n",
+ "u5 = 11.4; #initial velocity\n",
+ "u6 = 13.4; #initial velocity\n",
+ "n = 6;\n",
+ "v1 = 2.2; #final velocity\n",
+ "v2 = 3.2; #final velocity\n",
+ "v3 = 5.2; #final velocity\n",
+ "v4 = 6.4; #final velocity\n",
+ "v5 = 8.0; #final velocity\n",
+ "v6 = 10.0; #final velocity\n",
+ "\n",
+ "#calulations\n",
+ "w1 = u1*v1;\n",
+ "w2 = u2*v2;\n",
+ "w3 = u3*v3;\n",
+ "w4 = u4*v4;\n",
+ "w5 = u5*v5;\n",
+ "w6 = u6*v6;\n",
+ "x1 = u1**2;\n",
+ "x2 = u2**2;\n",
+ "x3 = u3**2;\n",
+ "x4 = u4**2;\n",
+ "x5 = u5**2;\n",
+ "x6 = u6**2;\n",
+ "u = u1+u2+u3+u4+u5+u6;\n",
+ "v = v1+v2+v3+v4+v5+v6;\n",
+ "w = w1+w2+w3+w4+w5+w6;\n",
+ "x = x1+x2+x3+x4+x5+x6;\n",
+ "a = ((n*w)-(u*v))/float((n*x)-(u**2));\n",
+ "b = ((v*x)-(w*u))/float((n*x)-(u**2));\n",
+ "y1 = (((a*u1)+b-v1)**2);\n",
+ "y2 = (((a*u2)+b-v2)**2);\n",
+ "y3 = (((a*u3)+b-v3)**2);\n",
+ "y4 = (((a*u4)+b-v4)**2);\n",
+ "y5 = (((a*u5)+b-v5)**2);\n",
+ "y6 = (((a*u6)+b-v6)**2);\n",
+ "y = y1+y2+y3+y4+y5+y6;\n",
+ "Sv = math.sqrt(y/float(n)); #standard deviation indicate sboth -ve and +ve values\n",
+ "Su = Sv/float(a); #standard deviation indicate sboth -ve and +ve values\n",
+ "Sa = (math.sqrt((n)/float(abs((n*x)-(u**2)))))*Sv; #standard deviation indicate sboth -ve and +ve values\n",
+ "Sb = (math.sqrt((x)/float(abs((n*x)-(u**2)))))*Sv; #standard deviation indicate sboth -ve and +ve values\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'linear equation %3.3f'%a,'u +%3.3f'%b;\n",
+ "print'standard deviation = %3.2f'%Sv;\n",
+ "print'standard deviation = %3.2f'%Su;\n",
+ "print'standard deviation = %3.2f'%Sa;\n",
+ "print'standard deviation = %3.2f'%Sb;\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:1.61,Page No:106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 113,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Best fit equation 4.569e-05 f**2 +1.519e-02 f mW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "u1 = 550; #initial velocity\n",
+ "u2 = 700; #initial velocity\n",
+ "u3 = 850; #initial velocity\n",
+ "u4 = 1000; #initial velocity\n",
+ "n = 4;\n",
+ "v1 = 0.04182; #final velocity\n",
+ "v2 = 0.04429; #final velocity\n",
+ "v3 = 0.05529; #final velocity\n",
+ "v4 = 0.0610; #final velocity\n",
+ "\n",
+ "#calulations\n",
+ "#P = ((a)*(f**2))+(b*f)\n",
+ "#P/f = (a*f)+b\n",
+ "w1 = u1*v1;\n",
+ "w2 = u2*v2;\n",
+ "w3 = u3*v3;\n",
+ "w4 = u4*v4;\n",
+ "x1 = u1**2;\n",
+ "x2 = u2**2;\n",
+ "x3 = u3**2;\n",
+ "x4 = u4**2;\n",
+ "u = u1+u2+u3+u4;\n",
+ "v = v1+v2+v3+v4;\n",
+ "w = w1+w2+w3+w4;\n",
+ "x = x1+x2+x3+x4;\n",
+ "a = ((n*w)-(u*v))/float((n*x)-(u**2));\n",
+ "b = ((v*x)-(w*u))/float((n*x)-(u**2));\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'Best fit equation %3.3e'%a,'f**2 +%3.3e f'%b,'mW';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.62,Page No:108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 114,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "limiting error 1.33 %\n",
+ "standard deviations 0.943 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "q1 = 50; #measuremnent in series in units\n",
+ "q2 = 100; #measuremnent in series in units\n",
+ "x = 0.02; #error in measurement of q1\n",
+ "y = 0.01; #error in measurement of q2\n",
+ "a = 1; #x % of 50\n",
+ "b = 1; #y % of 100\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "e1 = (q1*x)/float(q1+q2); #individual limiting errors\n",
+ "e2 = (q2*y)/float(q1+q2); #individual limiting errors\n",
+ "e = (e1+e2)*100; #combined limiting errors in % (indicates both -ve and +ve values)\n",
+ "er = (math.sqrt((a**2)+(b**2))); #resultant error \n",
+ "er1 = (er/float(q1+q2))*100; #standard deviation in %\n",
+ "\n",
+ "#result\n",
+ "print'limiting error %3.2f'%e,'%';\n",
+ "print'standard deviations %3.3f'%er1,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.63,Page No:116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 117,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "series resistance 97.5 Ω\n",
+ "shunt resistance 0.02525 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Rm =2.5; #resistance in Ω\n",
+ "Im = 0.1; #current in A\n",
+ "V = 10; #voltage in V\n",
+ "I = 10; #ammeter reading in A\n",
+ "\n",
+ "#calculations\n",
+ "Rs = (V/float(Im))-Rm; #series resistance in Ω\n",
+ "Rsh = (Im*Rm)/float(I-Im); #shunt resistance in Ω\n",
+ "\n",
+ "#result\n",
+ "print'series resistance %3.1f'%Rs,'Ω';\n",
+ "print'shunt resistance %3.5f'%Rsh,'Ω';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.64,Page No:116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 118,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "shunt resistance 0.05025 Ω\n",
+ "series resistance 990 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Rm = 10; #resistance in Ω\n",
+ "Im = 0.005; #current in A\n",
+ "I = 1; #current in A\n",
+ "V = 5; #voltage in V\n",
+ "\n",
+ "#calculations\n",
+ "Rsh = (Im*Rm)/float(I-Im); #shunt resistance in Ω\n",
+ "Rs = (V-(Im*Rm))/float(Im); #series resistance in Ω\n",
+ "\n",
+ "#result\n",
+ "print'shunt resistance %3.5f'%Rsh,'Ω';\n",
+ "print'series resistance %3.0f'%Rs,'Ω';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.65,Page No:117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 119,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "deflecting torque 8.1e-05 N-m\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "N = 100; #number of turns \n",
+ "l = 0.03; #length of each side in m\n",
+ "B = 0.09; #flux density in Wb/m**2\n",
+ "I = 0.01; #current through the coil in A\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "F = N*B*I*l; #force in N\n",
+ "T = F*l; #deflecting torque in N-m\n",
+ "\n",
+ "#result\n",
+ "print'deflecting torque %3.1e'%T,'N-m';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.66,Page No:118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 120,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error when internal resiatance is 5Ω is 7.13\n",
+ "percentage error after rise of temperature 1.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Rm = 5; #resistance in Ω\n",
+ "Im = 0.015; #current through instrument in A\n",
+ "I = 100; #current to be measured in A\n",
+ "alpham = 0.00015; #manganin in °C\n",
+ "alphac = 0.004; #copper in °C\n",
+ "R1 = 1; #reistance of copper in Ω\n",
+ "R2 = 4; #reistance of manganin in Ω\n",
+ "T = 20; #temperature in °C\n",
+ " \n",
+ "#calculations\n",
+ "Ish = I-Im; #current through shunt in A\n",
+ "v = Im*Rm; #voltage across the shunt in V\n",
+ "Rsh = v/float(Ish); #shunt resistance in Ω \n",
+ "Rshunt = Rsh*(1+(T*alpham)); #shunt resistance after rise of temperature in Ω \n",
+ "Rinst = Rm*(1+(T*alphac)); #instrument resistance in Ω \n",
+ "i = (Rshunt/float(Rinst+Rshunt))*100; #current through instrument in A\n",
+ "R = (i/float(Im))*100; #reading of instrument in A\n",
+ "e = I-R; #percentage error \n",
+ "Rinst1 = R1*(1+(T*alphac))+R2*(1+(T*alpham)); #instrument resistance in Ω \n",
+ "Iinst = (Rshunt/float(Rinst1+Rshunt))*100; #instrument current in A\n",
+ "Iread = (Iinst*100)/float(Im); #instrument reading in A\n",
+ "e1 = I-Iread; #percentage error \n",
+ "#result\n",
+ "print'percentage error when internal resiatance is 5Ω is %3.2f'%e;\n",
+ "print'percentage error after rise of temperature %3.1f'%e1;"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.67,Page No:118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 121,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error 0.8 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "V = 250; #voltage in V\n",
+ "R = 500; #resistance in Ω\n",
+ "L = 1; #inductance in H\n",
+ "I = 0.05; #current in A\n",
+ "f = 100; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "R1 = V/float(I); #total ohmic resistance in Ω\n",
+ "Z = math.sqrt((R1**2)+((2*math.pi*f*L)**2)); #coil impedance in Ω\n",
+ "Vr = (V*R1)/float(Z); #voltage reading in A.c\n",
+ "e = ((V-Vr)/float(V))*100; #percentage error in %\n",
+ "\n",
+ "#result\n",
+ "print'percentage error %3.1f'%e,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.68,Page No:119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 122,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "voltmeter reading at 25Hz frequency 14.97 V\n",
+ "voltmeter reading at 100Hz frequency 14.55 V\n",
+ "As frequency is increased ,impedance of the voltmeter increases ,hence current is decreased\n",
+ "therefore voltmeter readings are lower\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R = 300; #resistance in Ω\n",
+ "L = 0.12; #inductance in H\n",
+ "f = 25; #frequency in Hz\n",
+ "I = 15; #current in A\n",
+ "f1 = 100; #frequency in Hz\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "Z = math.sqrt((R**2)+((2*math.pi*f*L)**2)); #impedance at 25Hz in Ω\n",
+ "V = I*(R/float(Z)); #voltmeter reading at 25 Hz in V\n",
+ "Z1 = math.sqrt((R**2)+((2*math.pi*f1*L)**2)); #impedance at 100Hz in Ω \n",
+ "V1 = I*(R/float(Z1)); #voltmeter reading at 100Hz in V\n",
+ "\n",
+ "#result\n",
+ "print'voltmeter reading at 25Hz frequency %3.2f'%V,'V';\n",
+ "print'voltmeter reading at 100Hz frequency %3.2f'%V1,'V';\n",
+ "print'As frequency is increased ,impedance of the voltmeter increases ,hence current is decreased';\n",
+ "print'therefore voltmeter readings are lower';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:1.69,Page No:132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 123,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "power factor of the motor 0.75 (lag)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "W1 =920; #wattmeter reading in W\n",
+ "W2 =300; #wattmeter reading in W\n",
+ "\n",
+ "#calculations\n",
+ "phi = math.atan(((math.sqrt(3))*(W1-W2))/(float(W1+W2)))*(180/float(math.pi)); \n",
+ "pf = math.cos((phi)*(math.pi/float(180))); #power factor \n",
+ "\n",
+ "#result\n",
+ "print'power factor of the motor %3.2f'%pf,'(lag)';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:1.70,Page No:132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 124,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "power factor of the motor 0.22 (lag)\n",
+ "line current 47.34 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "W1 =14.2; #wattmeter reading in W\n",
+ "W2 =-6.1; #wattmeter reading in W \n",
+ "El = 440; #line voltage in V\n",
+ "P = 8.1*1000; #power in W\n",
+ "\n",
+ "#calculations\n",
+ "phi = math.atan(((math.sqrt(3))*(W1-W2))/(float(W1+W2)))*(180/float(math.pi)); #phase lag\n",
+ "pf = math.cos((phi)*(math.pi/float(180))); #power factor \n",
+ "Il = P/float((math.sqrt(3))*(El)*(pf)); #line current in A\n",
+ "\n",
+ "#result\n",
+ "print'power factor of the motor %3.2f'%pf,'(lag)';\n",
+ "print'line current %3.2f'%Il,'A';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.71,Page No:132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 125,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "W1 = 22.12 kW\n",
+ "W2 = 2.88 kW\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "P = 25; #input power in kW\n",
+ "El = 440; #line voltage in \n",
+ "pf = 0.6; #power factor\n",
+ "\n",
+ "#calculations\n",
+ "phi = ((math.acos(pf))*180)/float(math.pi);\n",
+ "t = (math.tan((phi)*(math.pi/float(180))));\n",
+ "#we have tan = math.sqrt(3)*(W1-W2)/W1+W2\n",
+ "#W1+W2 =E\n",
+ "y = (P*t)/float(math.sqrt(3));\n",
+ "W1 = (P+y)/float(2);\n",
+ "W2 = (P-y)/float(2);\n",
+ "\n",
+ "#result\n",
+ "print'W1 = %3.2f'%W1,'kW';\n",
+ "print'W2 = %3.2f'%W2,'kW';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.72,Page No:134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 126,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error 0.33 %(fast)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "V = 230; #voltage in V\n",
+ "i = 5; #current in A \n",
+ "t = 360; #time in s\n",
+ "n = 60; #number of revolutions\n",
+ "n1 = 520; #number of revolutions\n",
+ "cosphi = 1; #power factor \n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "E = (V*i*cosphi*t)/float(1000*3600); #energy consumed in 360 seconds in kWh\n",
+ "Er = n/float(n1); #energy recorded by the meter in kWh\n",
+ "e = ((Er-E)/float(Er))*100; #percentage error in %\n",
+ "\n",
+ "#result\n",
+ "\n",
+ "print'percentage error %3.2f'%(e),'%(fast)';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.73,Page No:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 144,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error 1.0562 %\n",
+ "Note:Ans printing mistake in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "V = 230; #voltage in V\n",
+ "i = 4.5; #current in A\n",
+ "cosphi = 1;\n",
+ "t = 190; #time in s\n",
+ "n = 10; #number of revolutions\n",
+ "n1 = 185; #number of revolutions\n",
+ "\n",
+ "#calculations\n",
+ "E = (V*i*cosphi*t)/float(1000*3600); #energy consumed in 360 seconds in kWh\n",
+ "Er = n/float(n1); #energy recorded by the meter in kWh\n",
+ "e = ((E-Er)/float(Er))*100; #percentage error in %\n",
+ "\n",
+ "#result\n",
+ "print'percentage error %3.4f'%(e),'%';\n",
+ "print'Note:Ans printing mistake in textbook'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.74,Page No:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 145,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "power in the circuit 800 W\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "x = 150; #number of revolutions\n",
+ "t = 45; #time in s\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "p = 1*(x/float(15000)); #power metered in kWh\n",
+ "a =t/float(3600); #energy consumed in t seconds in times of P\n",
+ "P = p/float(a); #power in the circuit in W\n",
+ "\n",
+ "#result\n",
+ "print'power in the circuit %3.0f'%(P*1000),'W';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:1.75,Page No:135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 146,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "energy recorded 0.575 kWh\n",
+ "actual energy consumed 0.5367 kWh\n",
+ "percentage error 6.67 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "V = 230; #D.C supply in V\n",
+ "r = 225; #number of revolutions\n",
+ "i = 40*225; #meter reading in A-s\n",
+ "t =10; #time in minutes\n",
+ "l = 14; #current in A\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "L = i/float(10*60); #current in A\n",
+ "E = (V*L*t)/float(1000*60); #energy recorded in kWh\n",
+ "Ea = (V*l*t)/float(1000*60); #actual energy consumed kWh\n",
+ "e = ((E-Ea)/float(E))*100; #percentage error in %\n",
+ "\n",
+ "#result\n",
+ "print'energy recorded %3.3f'%E,'kWh';\n",
+ "print'actual energy consumed %3.4f'%Ea,'kWh';\n",
+ "print'percentage error %3.2f'%e,'%'\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUT_CHAPTER_2__(1).ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUT_CHAPTER_2__(1).ipynb new file mode 100644 index 00000000..1d312472 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUT_CHAPTER_2__(1).ipynb @@ -0,0 +1,1754 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2:Electronic Instruments"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1,Page no:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "currentt through the PMMC meter is 2.5 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "gm = 0.005; #transconductance in siemens\n",
+ "RQ1 = 100*10**3; #FET resistance in KΩ\n",
+ "RQ2 = 100*10**3; #FET resistance in KΩ\n",
+ "RQ = 100*10**3; #FET resistance in KΩ\n",
+ "Rm = 50; #meter's resistance in Ω\n",
+ "RD = 10*10**3; #drain resistance in KΩ\n",
+ "v1 = 1; \n",
+ "\n",
+ "#calculations\n",
+ "x = (RQ*RD)/float(RQ+RD);\n",
+ "i = (gm*x*v1)/float((2*x)+Rm); #currentt through the PMMC meter(mA)\n",
+ "\n",
+ "#result\n",
+ "print'currentt through the PMMC meter is %3.1f'%(i*10**3),'mA';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.2,Page no:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error -3.9 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration \n",
+ "e = 150; #in V\n",
+ "t = 3; #time in s\n",
+ "Kfsin = 1.11; #form factor\n",
+ "\n",
+ "#calculations\n",
+ "#the sawtooth waveform can be expressed as e = mt\n",
+ "m = e/float(t);\n",
+ "\n",
+ "#e = 50*t;\n",
+ "#now integration of (50*t)**2 will be 2500*((t**3)/3) with limits ranging 0 to 3 ,solving we get\n",
+ "\n",
+ "Erms = math.sqrt((1/float(9))*((2500)*(t**3)-(0))); #Erms in V\n",
+ "#now integration of (50*t) will be (50/2)*((t**2)/2) with limits ranging 0 to 3 ,solving we get\n",
+ "Eav = (1/float(6))*((50)*((t**2)-0)); #Eav in V\n",
+ "Kfsaw = Erms/float(Eav); #form factor \n",
+ "x = (Kfsin)/float(Kfsaw); #ratio of two form factors\n",
+ "e = ((x-1)/float(1))*100; #percentage error \n",
+ "\n",
+ "#result\n",
+ "print'percentage error %3.1f'%e,'%'\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.3,Page no:165"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error 11.00 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#vaariable declaration\n",
+ "Kfsin = 1.11; #form factor of sine wave\n",
+ "\n",
+ "#calculation\n",
+ "#Erms = math.sqrt((1/T)*(integration(e**2)dt)) with limits from 0 to T is math.sqrt((1/T)*(Emax**2(T-0)))=Emax\n",
+ "#Erms = Emax;\n",
+ "#Erms = math.sqrt((1/T)*(integration(e*dt)) with limits from 0 to T is math.sqrt((2/T)*(Emax(T/2-0)))=Emax\n",
+ "#Eav = Emax;\n",
+ "#Kfsquare = Erms/float(Emax); #form factor of squarewave\n",
+ "Kfsquare = 1;\n",
+ "x = Kfsin/float(Kfsquare); #ratio of form factors\n",
+ "e = ((x-1)/float(1))*100; #percentage error in %\n",
+ "\n",
+ "#result\n",
+ "print'percentage error %3.2f'%e,'%';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4,Page no:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input voltage 1 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Va = 2000; #anode voltage in V\n",
+ "Id = 0.02; #length of parallel plates in m\n",
+ "d = 0.005; #distance between plates in m\n",
+ "L = 0.3; #distance between screen and plates in m\n",
+ "D = 0.03; #deflect of beam in m\n",
+ "g = 100; #overall gain\n",
+ "\n",
+ "#calculations\n",
+ "Vd = (2*d*Va*D)/float(L*Id); #voltage in V\n",
+ "Vi = Vd/float(g); #input voltage in V\n",
+ "\n",
+ "#result\n",
+ "print'input voltage %d'%Vi,'V';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.5,Page no:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "deflection sensitivity 0.2 mm/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Va = 2500; #potential difference in V\n",
+ "Id = 0.025; #length of parallel plates in m\n",
+ "d = 0.005; #distance between plates in m\n",
+ "L = 0.2; #distance between screen and plates in m\n",
+ "D = 0.03; #deflect of beam in m\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "Vd = (2*d*Va*D)/float(L*Id); #voltage in V\n",
+ "Vi = D/float(Vd); #deflection sensitivity in mm/V\n",
+ "\n",
+ "#result\n",
+ "print'deflection sensitivity %2.1f'%(Vi*10**3),'mm/V';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.6,Page no:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "deflection sensitivity 0.16 mm/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Id = 0.02; #length of horizontal plates in m\n",
+ "d = 0.005; #distance between plates in m\n",
+ "L = 0.2; #distance between screen and plates in m\n",
+ "Va = 2500; #accelerating voltage in V\n",
+ "\n",
+ "#calculations\n",
+ "S = (L*Id)/float(2*d*Va); #deflection sensitivityin mm/V\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'deflection sensitivity %3.2f'%(S*10**3),'mm/V';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.7,Page no:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "beam speed 29.65 m/s\n",
+ "deflection sensitivity 0.3 mm/V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variabledeclaration\n",
+ "va = 2500; #anode to cathode voltage in V\n",
+ "Id = 0.015; #length of parallel plates in m\n",
+ "d = 0.005; #distance between plates in m\n",
+ "L = 0.5; #distance between plates and screen in m\n",
+ "m = 9.109*10**-31; #mass of electron in kg\n",
+ "e = 1.602*10**-19; #charrge of electron in C\n",
+ "\n",
+ "#calculations\n",
+ "v = math.sqrt((2*e*va)/float(m)); #beam speed in m/s\n",
+ "S = (L*Id)/float(2*d*va); #deflection sensitivity in mm/V\n",
+ "\n",
+ "#calculatons\n",
+ "print'beam speed %3.2f'%(v*10**-6),'m/s';\n",
+ "print'deflection sensitivity %3.1f'%(S*10**3),'mm/V';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.8,Page no:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "density of magnetic field 1.584 m Wb/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "L = 0.22; #distance between screen and plates in m\n",
+ "l = 0.033; #width of uniform magnetuc field in m\n",
+ "Va = 6000; #anode potential in V\n",
+ "D = 0.044; #deflection on the screen in m\n",
+ "m = 9.107*10**-31; #mass of electron in kg\n",
+ "e = 1.6*10**-19; #charge of electron in m\n",
+ "\n",
+ "#calculations\n",
+ "X = math.sqrt(e/float(2*m*Va)); #density of magnetic field in Wb/m**2\n",
+ "B = D/float(L*l*X);\n",
+ "\n",
+ "#result\n",
+ "print'density of magnetic field %3.3f'%(B*10**3),'m Wb/m**2';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.9,Page no:187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "voltage applied to Y deflection 30.179 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "B = 1.8*10**-4; #flux density in Wb/m**2\n",
+ "Va = 800; #final anode voltage in V\n",
+ "d = 0.01; #distance ebetween plates in m\n",
+ "m = 9.107*10**-31; #mass of electron in kg\n",
+ "e = 1.6*10**-19; #charge of electron in C\n",
+ "\n",
+ "#calculations\n",
+ "#we have D = B*L*I*(math.sqrt((e/float(2*m*Va)))\n",
+ "#let us assume x = B*(math.sqrt((e/float(2*m*Va)))\n",
+ "#thus D = x*L*I\n",
+ "#we also have D = L*Vd*l/float(2*d*Va)\n",
+ "#let us assume y = 1/float(2*d*Va) \n",
+ "#thus D = L*Vd*l*y\n",
+ "#comparing both D equations we get\n",
+ "x = B*(math.sqrt((e)/float(2*m*Va)));\n",
+ "y = 1/float(2*d*Va) ;\n",
+ "Vd = x/float(y); #voltage applied to Y deflection in V\n",
+ " \n",
+ "#result\n",
+ "print'voltage applied to Y deflection %3.3f'%Vd,'V';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.10,Page no:207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Peak-to-peak value 15.6 mV\n",
+ "Amplitude 7.8 mV\n",
+ "R.m.s value 5.515 mV\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "a = 3; #vertical attenuation in mV/div\n",
+ "x = 5; #one part is sub divided in units\n",
+ "\n",
+ "#callculations\n",
+ "s = 1/float(x); #1 subdivision in units\n",
+ "pp = 2+(a*s); #positive peak in units\n",
+ "Vpp = pp+pp; #peak to peak voltage in divisions\n",
+ "Vpp1 = a*Vpp; #peak to peak voltage in mV\n",
+ "Vmax = Vpp1/float(2); #amplitude in mV\n",
+ "Vrms =Vmax/float(math.sqrt(2)); #R.m.s value in mV\n",
+ "\n",
+ "#result\n",
+ "print'Peak-to-peak value %3.1f'%Vpp1,'mV';\n",
+ "print'Amplitude %3.1f'%Vmax,'mV';\n",
+ "print'R.m.s value %3.3f'%Vrms,'mV';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.11,Page no:210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "possible phases are 30.00 ° or 330.00 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "#from figure we note this values\n",
+ "y1 = 1.25; #vertical axis in divisions\n",
+ "y2 = 2.5; #maximum vertical value in divisions\n",
+ "\n",
+ "#calculations\n",
+ "x = y1/float(y2); \n",
+ "phi = math.asin(x); #sinphi value \n",
+ "phi1 = 360-((phi*180)/float(math.pi)); #possible phases\n",
+ "\n",
+ "#result\n",
+ "print'possible phases are %3.2f'%((phi*180)/float(math.pi)),'°','or %3.2f'%phi1,'°';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.12,Page no:219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance 120 kΩ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 20; #resistance in kΩ\n",
+ "R2 = 30; #resistance in kΩ\n",
+ "R3 = 80; #resistance in kΩ\n",
+ "\n",
+ "#calculations\n",
+ "Rx = (R2*R3)/float(R1); #unknown resistance in kΩ\n",
+ "\n",
+ "#result\n",
+ "print'unknown resistance %d'%Rx,'kΩ';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.13,Page no:222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance 49.977 uΩ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R3 = 100.03*10**-6; #standard resistance in uΩ\n",
+ "l = 100.31; # inner ratio arm resistance in Ω\n",
+ "m = 200; # inner ratio arm resistance in Ω\n",
+ "R1 = 100.24; #outer ratio arm resistance in Ω\n",
+ "R2 = 200; #outer ratio arm resistance in Ω\n",
+ "Ry = 680*10**-6; #unknown resistor in uΩ\n",
+ "\n",
+ "#calculation\n",
+ "x = (R1*R3)/float(R2); #resistance in Ω\n",
+ "y = (m*Ry)/float(l+m+Ry); #resistance in Ω\n",
+ "z = ((R1/float(R2))-(l/float(m))); #unknown resistanc in Ω\n",
+ "Rx = x+(y*z);\n",
+ "\n",
+ "#rresult\n",
+ "print'unknown resistance %3.3f'%(Rx*10**6),'uΩ';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.14,Page no:224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance 500\n",
+ "unknowm angle -50 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Z1 = 50; #inductive resistance in Ω\n",
+ "Z2 = 125; #pure rresistance in Ω\n",
+ "Z3 = 200; #inductive resistance in Ω\n",
+ "theta1 = 80;\n",
+ "theta2 = 0;\n",
+ "theta3 = 30;\n",
+ "\n",
+ "#calculations\n",
+ "Z4 = (Z2*Z3)/float(Z1); #unknown resistance in Ω\n",
+ "theta4 = theta2+theta3-theta1; #unknowm angle in °\n",
+ " \n",
+ "#result\n",
+ "print'unknown resistance %d'%Z4;\n",
+ "print 'unknowm angle %d'%theta4,'°';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.15,Page no:28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " R4 = 133.333333 Ω\n",
+ "capacitance 1.59 uF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 225; #resistance in Ω \n",
+ "R2 = 150; #resistance in Ω \n",
+ "C2 = 0.53*10**-6; #capacitance in F\n",
+ "R3 = 100; #resistance in Ω \n",
+ "L = 7.95*10**-3; #inductance in H \n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "Z1 = R1;\n",
+ "w = 2*cmath.pi*f;\n",
+ "x = (1/float(w*C2));\n",
+ "Z2 = complex(R2,-x);\n",
+ "y = w*L;\n",
+ "Z3 = complex(R3,y);\n",
+ "Z4 = (Z2*Z3)/float(Z1); #unknown arm \n",
+ "Z41 = complex(Z4)\n",
+ "C4 = (1/float(2*cmath.pi*f*100)); #imaginary value is 100 from Z4\n",
+ "c = (Z4);\n",
+ "\n",
+ "#result\n",
+ "print' R4 = %05f'%(Z4.real),'Ω';\n",
+ "print'capacitance %3.2f'%(C4*10**6),'uF'\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.16,Page no:226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "shuntless resistance 140 Ω\n",
+ "capacitor of imperfect condenser 0.0115 uF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "w = 7500; #frequency in radians/sec \n",
+ "R2 = 140; #resistance in Ω\n",
+ "R3 = 1000; #non-reactive resistance of Ω\n",
+ "R4 = 1000; #non-reactive resistance of Ω\n",
+ "C2 = 0.0115; #capacitance in uF\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "R1 = (R2*R3)/float(R4); #shuntless resistance in Ω\n",
+ "C1 = (C2*R4)/float(R3); #capacitor of imperfect condenser in F \n",
+ "\n",
+ "#result\n",
+ "print'shuntless resistance %d'%R1,'Ω';\n",
+ "print'capacitor of imperfect condenser %3.4f'%C1,'uF';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.17,Page no:228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "unknown resistance 0.53 kΩ\n",
+ "unknown inductance 1.5 H\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 235; #resistance in kΩ\n",
+ "R2 = 2.5; #resistance in kΩ\n",
+ "R3 = 50; #resistance in kΩ\n",
+ "C1 = 0.012; #capacitance in uF\n",
+ "\n",
+ "#calculations\n",
+ "Rx = (R2*R3)/float(R1); #unknown resistance in Ω\n",
+ "Lx = C1*R2*R3; #unknown inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'unknown resistance %3.2f'%Rx,'kΩ';\n",
+ "print'unknown inductance %3.1f'%Lx,'H';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.18,Page no:230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "equivalent resistance 4.32 KΩ\n",
+ "equivalent inductance 0.296 H\n",
+ "Note:calculation mistake in textbook\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "w = 3000; #frequency in radians/sec \n",
+ "R2 = 9000; #resistance in Ω\n",
+ "R1 = 1800; # resistance of Ω\n",
+ "R3 = 900; # resistance of Ω\n",
+ "C1 = 0.9*10**-6; #capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "a = ((w**2)*(R1**2)*(C1**2));\n",
+ "Rx = ((w**2)*(C1**2)*R1*R2*R3)/float(1+a); #equivalent resistance in KΩ\n",
+ "Lx = (R2*R3*C1)/float(1+((w**2)*(R1**2)*(C1**2))); #equivalent inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'equivalent resistance %3.2f'%(Rx*10**-3),'KΩ';\n",
+ "print'equivalent inductance %3.3f'%Lx,'H';\n",
+ "print'Note:calculation mistake in textbook';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.19,Page no:232"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 3000 Ω\n",
+ "capacitance 0.20 uF\n",
+ "dissipation factor 3.77\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 1.5*10**3; #resistance in Ω\n",
+ "R2 = 3000; #resistance in Ω\n",
+ "C1 = 0.4*10**-6; #capacitance in F\n",
+ "C3 = 0.4*10**-6; #capacitance in F\n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "w = 2*math.pi*f;\n",
+ "Rx = (R2*C1)/float(C3); #resistance in kΩ\n",
+ "Cx = (R1*C3)/float(R2); #capacitance in F\n",
+ "D = w*Cx*Rx; #dissipation factor\n",
+ "\n",
+ "#result\n",
+ "print'resistance %d'%Rx,'Ω';\n",
+ "print'capacitance %3.2f'%(Cx*10**6),'uF';\n",
+ "print'dissipation factor %3.2f'%D;\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.20,Page no:234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 500 Ω\n",
+ "inductance 0.3 H\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Q = 1000; #resistance in Ω\n",
+ "S = 1000; #resistance in Ω\n",
+ "P = 500; #resistance in Ω\n",
+ "C = 0.5*10**-6; #capacitance in uF\n",
+ "r = 100; #resistance in Ω\n",
+ "\n",
+ "#calculations\n",
+ "R = (P*Q)/float(S); #resistance in Ω\n",
+ "L = ((C*P)*((r*(Q+S))+(Q*S)))/float(S); #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'resistance %d'%R,'Ω';\n",
+ "print'inductance %3.1f'%L,'H';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.21,Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 500 Ω\n",
+ "inductance 1.95 H\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R2 = 1000; #resistance in Ω\n",
+ "R4 = 1000; #resistance in Ω\n",
+ "R3 = 500; #resistance in Ω\n",
+ "C = 3*10**-6; #capacitance in uF\n",
+ "r = 100; #resistance in Ω\n",
+ "\n",
+ "#calculations\n",
+ "R = (R2*R3)/float(R4); #resistance in Ω\n",
+ "L = ((C*R2)*((r*(R3+R4))+(R3*R4)))/float(R4); #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'resistance %d'%R,'Ω';\n",
+ "print'inductance %3.2f'%L,'H';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.22,Page no:237"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance of specimen 8.34 mH\n",
+ "resistance of specimen 80.65 Ω\n",
+ "impedance of specimen 132.240 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R2 = 100; #resistance in Ω\n",
+ "R3 = 834; #resistance in Ω\n",
+ "C4 = 0.1*10**-6; #capacitance in F\n",
+ "C3 = 0.124*10**-6; #capacitance in F\n",
+ "f = 1000;\n",
+ "\n",
+ "#calculations\n",
+ "L1 = R2*R3*C4; #inductance in H\n",
+ "R1 = (R2*C4)/float(C3); #resistance in Ω\n",
+ "X1 = 2*math.pi*2*f*L1; #reactance of specimen in Ω\n",
+ "Z1 = math.sqrt((R1**2)+(X1**2)); #impedance of specimen in Ω\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'inductance of specimen %3.2f'%(L1*10**3),'mH';\n",
+ "print'resistance of specimen %3.2f'%R1,'Ω';\n",
+ "print'impedance of specimen %3.3f'%Z1,'Ω';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.23,Page no:243"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance 0.9175 uF\n",
+ "series resistance of capacitor 1.75 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "M = 18.35*10**-3; #mutual inductance in H\n",
+ "R1 = 200; #non-reactive resistance in Ω\n",
+ "L1 = 40.6*10**-3; #inductance in mH\n",
+ "R2 = 119.5; #non-reactive resistance in Ω\n",
+ "R4 = 100; # resistance in Ω\n",
+ "\n",
+ "#calculations\n",
+ "C2 = M/float(R1*R4); #capacitance in F \n",
+ "R3 = (R4*(L1-M))/float(M); #resistance in Ω\n",
+ "R = R3-R2; #series resistance of capacitor in Ω \n",
+ "\n",
+ "#result\n",
+ "print'capacitance %3.4f'%(C2*10**6),'uF';\n",
+ "print'series resistance of capacitor %3.2f'%R,'Ω';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.24,Page no:245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "equivalent resistance 11.2 KΩ\n",
+ "equivalent capacitance 42.04 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 2.8*10**3; #resistance in Ω\n",
+ "C1 = 4.8*10**-6; #capacitance in uF\n",
+ "R2 = 20*10**3; #resistance in Ω\n",
+ "R4 = 80*10**3; #resistance in Ω\n",
+ "f = 2000; #frequency in Hz\n",
+ "w = 12.57*10**3;\n",
+ "R3 = 11.2*10**3;\n",
+ "\n",
+ "#calculations\n",
+ "x = 1/float((w**2)*(C1**2)*(R1));\n",
+ "y = R1+x;\n",
+ "z = R4/float(R2);\n",
+ "R3 = z*(x+y); #equivalent resistance in KΩ\n",
+ "a = (w**2)*C1*R1*R3;\n",
+ "C3 = 1/float(a); #equivalent capacitance in F\n",
+ "\n",
+ "#result\n",
+ "print'equivalent resistance %3.1f'%(R3*10**-3),'KΩ';\n",
+ "print'equivalent capacitance %3.2f'%(C3*10**12),'pF';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.25,Page no:246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 26.82 Ω\n",
+ "inductance 52.6 mH\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "L1 = 52.6; #inductance in mH\n",
+ "R2 = 1.68; #resistance in MHz\n",
+ "r1 = 28.5; #resistance in MHz\n",
+ "\n",
+ "#calculations\n",
+ "#at balance of bridge (r1+jwL1)=((R2+r2)+jwL2)\n",
+ "#comparing both real and imaginary terms we get \n",
+ "\n",
+ "r2 = r1-R2; #resistance in Ω\n",
+ "L2 = L1; #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'resistance %3.2f'%r2,'Ω';\n",
+ "print'inductance %3.1f'%L1,'mH';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.26,Page no:246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R4 = 34.311 Ω\n",
+ "inductance 29 mH\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "\n",
+ "#variable declaration\n",
+ "R3 = 300; #resistance in Ω \n",
+ "R2 = 500; #resistance in Ω \n",
+ "C1 = 0.2*10**-6; #capacitance in F\n",
+ "C3 = 0.1*10**-6; #capacitance in F\n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "w = 2*(cmath.pi)*f; #angular frequency \n",
+ "z = (1/float(w*C1));\n",
+ "Z1 = complex(0,-z);\n",
+ "Z2 = R2;\n",
+ "x = 1/float(R3);\n",
+ "y = w*C3;\n",
+ "Y3 = complex(x,y);\n",
+ "Z4 = (Z2)/complex(Z1*Y3);\n",
+ "L = ((182.19)/float(2*cmath.pi*f)); #imaginary value is 182.12 from Z4\n",
+ "\n",
+ "#result\n",
+ "print'R4 = %3.3f'%(Z4.real),'Ω';\n",
+ "print'inductance %3.0f'%(L*10**3),'mH';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.27,Page no:247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R4 = 373.35 Ω\n",
+ "capacitance 0.1818 uF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 200; #resistance in Ω \n",
+ "R2 = 200; #resistance in Ω \n",
+ "C2 = 5*10**-6; #capacitance in F\n",
+ "C3 = 0.2*10**-6; #capacitance in F\n",
+ "R3 = 500; #resistance in Ω \n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "Z1 = R1;\n",
+ "w = 2*cmath.pi*f; #angular frequency\n",
+ "x = (1/float(w*C2));\n",
+ "Z2 = complex(R2,-x);\n",
+ "y = 1/float(w*C3);\n",
+ "Z3 = complex(R3,-y);\n",
+ "Z4 = (Z2*Z3)/float(Z1); #unknown arm \n",
+ "C4 = (1/float(2*cmath.pi*f*875.3)); #imaginary value is 100 from Z4\n",
+ "\n",
+ "#result\n",
+ "print'R4 = %3.2f'%(Z4.real),'Ω';\n",
+ "print'capacitance %3.4f'%(C4*10**6),'uF';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.28,Page no:248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R4 = 167 Ω\n",
+ "inductance 0.1 H\n"
+ ]
+ }
+ ],
+ "source": [
+ "import cmath\n",
+ "\n",
+ "#variable declaration\n",
+ "R1 = 600; #resistance in Ω \n",
+ "R2 = 100; #resistance in Ω \n",
+ "C1 = 1*10**-6; #capacitance in F\n",
+ "R3 = 1000; #resistance in Ω \n",
+ "f = 1000; #frequency in Hz\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "w = 2*cmath.pi*f; #angular frequency \n",
+ "x = 1/float(R1);\n",
+ "y = w*C1;\n",
+ "Y1 = complex(x,y);\n",
+ "Z2 = R2;\n",
+ "Z3 = R3;\n",
+ "Z4 = Z2*Z3*Y1; #unknown arm\n",
+ "L = (628.3/float(2*cmath.pi*f)); #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'R4 = %3.0f'%(Z4.real),'Ω';\n",
+ "print'inductance %3.1f'%L,'H';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.29,Page no:249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance = 124.97 pF\n",
+ "power factor = 0.055\n",
+ "relative permittivity = 6.24\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C2 = 106*10**-12; #capacitance in F\n",
+ "R4 = 1000/float(math.pi); #resistance in\n",
+ "C4 = 0.55*10**-6; #capacitance in F\n",
+ "R3 = 270; #resistance in\n",
+ "e0 = 8.854*10**-12; #absolute permittivity \n",
+ "t = 0.005; #thickness of bakelite in m\n",
+ "d = 12*10**-2; #diameter in m\n",
+ "f = 50; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "R4 = 1000/float(math.pi); #resistance in\n",
+ "A = (math.pi/float(4))*((d)**2); #area of electrodes in m**2\n",
+ "w = 2*math.pi*f; #angular frequency\n",
+ "R1 = (R3*C4)/float(C2); #resistance in \n",
+ "C1 = (R4*C2)/float(R3); #apacitance in pF\n",
+ "P = w*R1*C1; #power factor \n",
+ "er = (C1*t)/float(e0*A); #relative permittivity\n",
+ "\n",
+ "#result\n",
+ "print'capacitance = %3.2f'%(C1*10**12),'pF';\n",
+ "print'power factor = %3.3f'%P;\n",
+ "print'relative permittivity = %3.2f'%er;\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.30,Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "distributed capacitance 20 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f1 = 2*10**6; #frequency in Hz\n",
+ "C1 = 420*10**-12; #capacitance in F\n",
+ "C2 = 90*10**-12; #capacitance in F\n",
+ "f2 = 4*10**6; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "Cd = (C1-(4*C2))/float(3); #distributed capacitance in pF\n",
+ "\n",
+ "#result\n",
+ "print'distributed capacitance %d'%(Cd*10**12),'pF';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.31,Page no:260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 40,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "distributed capacitance 18.571 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f1 = 2*10**6; #frequencyin Hz\n",
+ "f2 = 5*10**6; #frequencyin Hz \n",
+ "C1 = 410*10**-12; #capacitance in F\n",
+ "C2 = 50*10**-12; #capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "x = f2/float(f1);\n",
+ "Cd = (C1-((x**2)*(C2)))/float((x**2)-1); #distributed capacitance in pF\n",
+ "\n",
+ "#result\n",
+ "print'distributed capacitance %3.3f'%(Cd*10**12),'pF';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.32,Page no:261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistive 48.18 Ω\n",
+ "reactive components 492.74 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C1 = 190*10**-12; #capacitance in F\n",
+ "Q1 = 75; #quality factor \n",
+ "C2 = 170*10**-12; #capacitance in F\n",
+ "Q2 = 45; #quality factor \n",
+ "f = 200*10**3; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "Rx = ((C1*Q1)-(C2*Q2))/float(2*math.pi*f*C1*C2*Q1*Q2); #resistive in Ω\n",
+ "Xx = (C1-C2)/float(2*math.pi*f*C1*C2); #reactive components in Ω\n",
+ "\n",
+ "#result\n",
+ "print'resistive %3.2f'%Rx,'Ω';\n",
+ "print'reactive components %3.2f'%Xx,'Ω';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.33,Page no:261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage error 0.5 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R = 4; #resistance in Ω\n",
+ "f = 500*10**3; #frequency in Hz\n",
+ "C = 110*10**-12; #capacitance in F\n",
+ "x = 0.02; #resistance across oscillatory circuit in Ω\n",
+ "\n",
+ "#calculations\n",
+ "Qtrue = 1/float(2*math.pi*f*C*R);\n",
+ "Qindicated = 1/float(2*math.pi*f*C*(R+x));\n",
+ "e = ((Qtrue-Qindicated)/float(Qtrue))*100; #percentage error in %\n",
+ "\n",
+ "#result\n",
+ "print'percentage error %3.1f'%e,'%';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.34,Page no:262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "self-capacitance 9.89 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f1 = 600*10**3; #frequency in Hz\n",
+ "f2 = 2*10**6; #frequency in Hz\n",
+ "C1 = 100*10**-12; #capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "Cd = ((f1**2)*C1)/float((f2**2)-(f1**2)); #self-capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "print'self-capacitance %3.2f'%(Cd*10**12),'pF';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.35,Page no:263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance 719.61 uH\n",
+ "resistance 16 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "f = 400*10**3; #frequency in kHz\n",
+ "C = 220*10**-12; #capacitance in F\n",
+ "Rsh = 0.8; #resistance in Ω\n",
+ "Q = 110; #quality factor\n",
+ "\n",
+ "#calculations\n",
+ "Lcoil = 1/float(((2*math.pi*f)**2)*C); #inductance in H\n",
+ "x = (2*math.pi*f*Lcoil)/float(Q);\n",
+ "Rcoil = x-Rsh; #resistance in Ω\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "print'inductance %3.2f'%(Lcoil*10**6),'uH';\n",
+ "print'resistance %3.0f'%Rcoil,'Ω';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.36,Page no:271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance L = 7.33 uH\n",
+ "capacitance C = 858.000 pF\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Cs = 210*10**-12; #capacitance in F\n",
+ "Cv = 6*10**-12; #capacitance in F\n",
+ "f1 = 2*10**6; #frequency in Hz\n",
+ "f2 = 4*10**6; #frequency in Hz\n",
+ "\n",
+ "#calculations\n",
+ "#we have Cs+Cv = 1/(4*(math.pi**2)*(f2**2)*L\n",
+ "#we have C+Cv = 1/(4*(math.pi**2)*(f2**2)*L \n",
+ "L = 1/float(4*(math.pi**2)*(f2**2)*(Cs+Cv)); #inductance in uH\n",
+ "C = (1/float((4*(math.pi**2)*(f1**2)*L)))-Cv; #capacitance in pF\n",
+ " \n",
+ "#result\n",
+ "print'inductance L = %3.2f'%(L*10**6),'uH';\n",
+ "print'capacitance C = %3.3f'%(C*10**12),'pF';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.37,Page no:271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance L = 3.598e-05 uH\n",
+ "resistance R = 17.3 Ω\n",
+ "ccalculation mistake in textbook assuming approximate values\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C1 = 40*10**-12; #capacitance in pF\n",
+ "C2 = 48*10**-12; #capacitance in pF\n",
+ "f = 4*10**6; #frequency in Hz\n",
+ "R1 = 60; #resistance in Ω\n",
+ "\n",
+ "#calculations\n",
+ "Co = (C1+C2)/float(2);\n",
+ "L = 1/float(4*(math.pi**2)*(f**2)*Co); #inductance in H\n",
+ "#we have I = E/math.sqrt((R**2)+((w*l)-((1/w*C1))**2))\n",
+ "#we also have I = E/(R+R1)\n",
+ "#comparing we get and solving we get R**2 + 2*R1*R +R1**2 = R**2 + ((w*l)-((1/w*C1))**2)\n",
+ "w = 2*math.pi*f; #angular frequency \n",
+ "x = w*L;\n",
+ "y = 1/float(w*C2);\n",
+ "Y = ((x-y)**2);\n",
+ "R = (Y-(R1**2))/float(2*R1); #resistance in Ω\n",
+ "\n",
+ "#result\n",
+ "print'inductance L = %3.3e'%(L),'uH';\n",
+ "print'resistance R = %3.1f'%(R),'Ω';\n",
+ "print'ccalculation mistake in textbook assuming approximate values'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.38,Page no:272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Q factor 100\n",
+ "effective resistance 8.29 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C = 160*10**-12; #capacitancein pF\n",
+ "f0 = 1.2*10**6; #frequency in Hz\n",
+ "f01 = 6*10**3; #frequency in Hz\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "f1 = f0+f01; #frequency in Hz\n",
+ "f2 = f0-f01; #frequency in Hz\n",
+ "f = f1-f2; #frequency in Hz\n",
+ "Q = f0/float(f); #Q factor\n",
+ "R = f/float(2*math.pi*f0*f0*C); #effective resistance in Ω\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'Q factor %d'%Q;\n",
+ "print'effective resistance %3.2f'%R,'Ω';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 2.39,Page no:274"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "self-capacitance of the coil = 13.33 pF\n",
+ "inductance = 292.97 uH\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "C1 = 200*10**-12; #capacitance in F\n",
+ "C2 = 40*10**-12; #capacitance in F\n",
+ "\n",
+ "#calculations\n",
+ "f1 = (2/float(math.pi))*10**6; #frequency in Hz\n",
+ "f2 = 2*f1; #frequency in Hz\n",
+ "x1 = 4*(math.pi**2)*(f1**2);\n",
+ "x2 = 4*(math.pi**2)*(f2**2);\n",
+ "#L = 1/(x1*(C+Cd));\n",
+ "# L = 1/(x2*(C+Cd));\n",
+ "#comparing we get following equation for Cd\n",
+ "Cd = ((x1*C1)-(x2*C2))/float(x2-x1); #capacitance in pF\n",
+ "c = C1+Cd;\n",
+ "L = 1/float(x1*(c)); #inductance in H\n",
+ "\n",
+ "#result\n",
+ "print'self-capacitance of the coil = %3.2f'%(Cd*10**12),'pF';\n",
+ "print'inductance = %3.2f'%(L*10**6),'uH';\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUT_CHAPTER_7.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUT_CHAPTER_7.ipynb new file mode 100644 index 00000000..697d4b21 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K.RAJPUT_CHAPTER_7.ipynb @@ -0,0 +1,957 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7:Sensors And Transducers"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.2,Page No:401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "displacement 5.75 mm\n",
+ "displacement 12.800 mm\n",
+ "resolution of potentiometer 0.050 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R =10000; #resistance in Ω\n",
+ "R1 = 3850; #resistance of potentiometer Ω\n",
+ "R2 = 7560; #resistance of potentiometer Ω\n",
+ "l = 50*10**-3; #length of uniform wound wire in m\n",
+ "x = 10;\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "R3 = (R/float(2)); #resistance of potentiometer in .normal position in Ω\n",
+ "r = (R/float(l)); #resistance of potentiometer wire per unit length Ω/mm\n",
+ "dR1 = R3-R1; #change in resistance of potentiometer from its normal position Ω\n",
+ "D1 = (dR1/float(r)); #displacement in mm\n",
+ "dR2 = (R2-R3); #change in resistance of potentiometer from its normal position in Ω\n",
+ "D2 = (dR2/float(r)); #displacement in mm\n",
+ "RE = (x/float(r)); #resolution of potentiometer in mm\n",
+ "\n",
+ "#result\n",
+ "print'displacement %3.2f'%(D1*10**3),'mm';\n",
+ "print'displacement %3.3f'%(D2*10**3),'mm';\n",
+ "print'resolution of potentiometer %3.3f'%(RE*10**3),'mm';\n",
+ " \n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.3,Page No:403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance at 35°C is 50 Ω\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R25 = 100; #resistance of thermistor at 25°C\n",
+ "t2 = 35; #temperature in °C\n",
+ "t1 = 25; #temperature in °C\n",
+ "alpha = 0.05; #temperature coefficient\n",
+ "\n",
+ "#calculations\n",
+ "t = t2-t1; #temperaturre difference in °C\n",
+ "x = alpha*t;\n",
+ "R35 = (R25)*(1-x); #resistance in Ω\n",
+ "\n",
+ "#result\n",
+ "print'resistance at 35°C is %d'%R35,'Ω';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.4,Page No:406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance = 0.04 mH\n",
+ "ratio of change in inductance to the original inductance =0.02\n",
+ "ratio of change in inductance to the original inductance =0.02\n",
+ "Hence dl is directly proportional to displacement\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "l = 1.00; #length in mm\n",
+ "L = 2; #inductance in mH\n",
+ "d = 0.02; #displacement in mm\n",
+ "\n",
+ "#calculations\n",
+ "la = l-d; #length of air gap when d=0.02\n",
+ "dl = (2*(1/float(la)))-L; #change in inductance in mH\n",
+ "r = dl/float(L); #ratio of change in inductance to the original inductance\n",
+ "dd = r/float(l); #ratio of displacement to original gap length\n",
+ "\n",
+ "#result\n",
+ "print'inductance = %3.2f'%dl,'mH';\n",
+ "print'ratio of change in inductance to the original inductance =%3.2f'%r;\n",
+ "print'ratio of change in inductance to the original inductance =%3.2f'%dd;\n",
+ "print'Hence dl is directly proportional to displacement';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.5,Page No:409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percentage linearity 0.25 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "d = 1.8; #output voltage at maximum displacement in V\n",
+ "de = 0.0045; #deviation from straight line through the origin\n",
+ "\n",
+ "#calculations \n",
+ "a = (de/float(d))*100; #percentage linearity indicating in both -ve and +ve\n",
+ "\n",
+ "#result\n",
+ "print'percentage linearity %3.2f'%a,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.6,Page No:409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "sensitivty of LVDT 3.00 mV/mm\n",
+ "resolution 0.0067 mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Vo = 1.8; #output voltage in mV\n",
+ "Vi = 0.6; #input voltage in mV;\n",
+ "a = 500; #amplification factor\n",
+ "r = 1/float(4); #scale can read \n",
+ "v = 4; #output of voltmetr in V\n",
+ "D = 100; #millivoltmeter readings\n",
+ "\n",
+ "#calculation\n",
+ "s = Vo/float(Vi); #sensitivity in mV/mm\n",
+ "sm = a*s; #sensitivity of measurement in mV/mm\n",
+ "s1 = (v/float(D))*10**3; # 1 scale division in mV\n",
+ "Vm = r*s1; #minimum voltage that can be read on voltmeter\n",
+ "R = Vm/float(sm); #resolution in mm\n",
+ "\n",
+ "#result \n",
+ "print'sensitivty of LVDT %3.2f'%s,'mV/mm';\n",
+ "print'resolution %3.4f'%R,'mm';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.7,Page No:413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitance = 13.275 pF\n",
+ "change in capacitance 1.475 pF\n",
+ "ratio ofper unit change of capacitance to per unit change in displacement = 1.111111\n",
+ "capcitance when mica is inserted = 13.88 pF\n",
+ "change in capacitance when mica sheet is inserted = 1.62 pF\n",
+ "ratio ofper unit change of capacitance to per unit change in displacement = 1.168\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "A = 300*10**-6; #area of plate in m**2\n",
+ "d = 0.2*10**-3; #distance between plates in mm\n",
+ "e0 = 8.85*10**-12; #permittivity in F/m\n",
+ "er2 = 8; #dielectric constant of mica \n",
+ "d1 = 0.18*10**-3; #distance between plates in mm\n",
+ "er1 = 1; #dielectric constant\n",
+ "D1 = 0.19;\n",
+ "D2 = 0.01; #thickness of mica sheet in mm\n",
+ "D3 = 0.17; #displacement in mm\n",
+ "D4 = 0.01;\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "C = ((e0*A)/float(d)); #value of capacitance in pF\n",
+ "dD = d-d1; #change in displacement in mm\n",
+ "dC = ((e0*A)/(float(d1)))-C; #change in capacitance in capacitance\n",
+ "x1 = (dC/float(C)); #per unit change in capacitance \n",
+ "x2 = (dD/float(d)); #per unit change of displacement\n",
+ "d3 = d-d1; #length of air gap between plates in mm\n",
+ "x = x1/float(x2); #ratio of unit change of capacitance to unit change in displacement\n",
+ "D = (D1/(float(er1)))+((D2/float(er2)));\n",
+ "C1 = (e0*A)/float(D*10**-3); #initial capacitance of transducer in mm\n",
+ "d4 = d1-d3; #length of air gap in mm\n",
+ "d1 = (D3/float(er1))+(D4/float(er2));\n",
+ "C2 = (e0*A)/float(d1*10**-3); # capacitance with displacement is applien in pF\n",
+ "dC2 = C2-C1; #change in capacitance in pF\n",
+ "y1 = (dC2/float(C1)); #per unit change in capacitance \n",
+ "y2 = (dD/float(d)); #per unit change of displacement\n",
+ "Y = y1/float(y2); #ratio of unit change of capacitance to unit change in displacement\n",
+ "\n",
+ "#result\n",
+ "print'capacitance = %2.3f'%(C*10**12),'pF';\n",
+ "print'change in capacitance %3.3f'%(dC*10**12),'pF';\n",
+ "print'ratio ofper unit change of capacitance to per unit change in displacement = %f'%x;\n",
+ "print'capcitance when mica is inserted = %3.2f'%(C1*10**12),'pF';\n",
+ "print'change in capacitance when mica sheet is inserted = %2.2f'%(dC2*10**12),'pF';\n",
+ "print'ratio ofper unit change of capacitance to per unit change in displacement = %3.3f'%Y;\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.8,Page No:417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage = 192.50 V\n",
+ "charge sensitivity = 2.233 pC/N\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "t = 2.5*10**-3; #thickness in m\n",
+ "g = 0.055; #voltage intensity in Vm/N\n",
+ "p = 1.4*10**6; #pressure in N/m**2\n",
+ "e = 40.6*10**-12; #permittivity of quartz in F/m\n",
+ "\n",
+ "#calculation\n",
+ "E = g*t*p; #output voltage in V\n",
+ "q = e*g; #charge sensitivity in pC/N\n",
+ "\n",
+ "#result\n",
+ "print'output voltage = %3.2f'%E,'V';\n",
+ "print'charge sensitivity = %3.3f'%(q*10**12),'pC/N';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.9,Page No:417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "force = 43.64 N\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "r = 6*10**-3; #radius in m\n",
+ "t = 1.8*10**-3; #thickness in m\n",
+ "g = 0.055; #voltage intensity in Vm/N\n",
+ "E = 120; #voltage developed in V\n",
+ "\n",
+ "#calculation\n",
+ "A = r*r; #area in m**2\n",
+ "p = E/(float(g*t)); #pressure in N/m**2\n",
+ "F = p*A; #force in N\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'force = %3.2f'%F,'N';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.10,Page No:417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "strain = 0.01392\n",
+ "charge = 900.0 pC\n",
+ "capacitance = 300 pf\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "r = 6*10**-3; #radius in m\n",
+ "t = 1.5*10**-3; #thickness in m\n",
+ "e = 12.5*10**-9; #permittivity in F/m\n",
+ "F = 6; #force in N\n",
+ "d = 150*10**-12; #charge density in pC/N\n",
+ "E = 12*10**6; #modulus of elasticity in N/m**2\n",
+ "s = 0.167*10**6; #stress \n",
+ "\n",
+ "#calculation\n",
+ "A = r*r;\n",
+ "p = F/float(A); #pressure in MN/m**2\n",
+ "p1 = p*10**-6;\n",
+ "e1 = s/float(E); #strain \n",
+ "g = d/float(e); #voltage sensitivity in V*m/N;\n",
+ "E1 = g*t*p; #voltage generated in V\n",
+ "Q = d*F; #charge in C\n",
+ "C = (Q)/float(E1); #capacitance in F\n",
+ "\n",
+ "#result\n",
+ "print'strain = %3.5f'%e1;\n",
+ "print'charge = %3.1f'%(Q*10**12),'pC';\n",
+ "print'capacitance = %3.3d'%(C*10**12),'pf';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.11,Page No:421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "hall angle 1.55 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "p = 0.00912; #resistivity in Ωm\n",
+ "B = 0.48; #flux density in Wb/m**2\n",
+ "RH = 3.55*10**-4; #hall coefficient in m**3/C\n",
+ "\n",
+ "#calculation\n",
+ "Ex = p; #Ex in terms of Jx in °\n",
+ "Ey = RH*B; #ey interms of Jx in °\n",
+ "x= Ex/float(Ey);\n",
+ "t = math.atan(x);\n",
+ "\n",
+ "print'hall angle %3.2f'%t,'°';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.12,Page No:421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "voltage between contacts = 0.00256 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "p = 0.00912; #resistivity in Ωm\n",
+ "B = 0.48; #flux density in Wb/m**2\n",
+ "RH = 3.55*10**-4; #hall coefficient in m**3/C\n",
+ "I = 0.015; # current in A\n",
+ "l = 15*10**-3; #length in m\n",
+ "b = 10**-3; #breadth in m\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "A = l*b; #area in m**2\n",
+ "Jx = I/float(A); #current density in A/m**2\n",
+ "Ey = RH*B*Jx; #Ey in V/m\n",
+ "V = Ey*I; #voltage between contacts in V\n",
+ "\n",
+ "#result\n",
+ "print'voltage between contacts = %5.5f'%V,'V';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.13,Page No:432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "poissons ratio = 1.6\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Gf = 4.2; #guage factor of resistance \n",
+ "\n",
+ "#calculation\n",
+ "u =(Gf-1)/float(2); #poisson's ratio\n",
+ "\n",
+ "#result\n",
+ "print'poissons ratio = %1.1f'%u;"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.14,Page No:432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "change in resistance = 48.00 mΩ\n",
+ "Note:Ans printing mistake in textbook\n",
+ "change in resistance = 48.00 mΩ\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "R = 120; #resistance in Ω\n",
+ "Gf = 2; #guage factor \n",
+ "s = 400*10**6; #elastic limit stress in N/m**2\n",
+ "E = 200*10**9; #modulus of elasticity in N/m**2\n",
+ "alpha = 20*10**-6; #resistance temperature coefficient in /°C\n",
+ "x = 1/float(10); #cahnge in stress \n",
+ "dt = 20; #change in temperature in °C\n",
+ "\n",
+ "#calculations\n",
+ "sc = s*x; #change in stress in N/m**2\n",
+ "e = sc/float(E); #strain \n",
+ "dR = Gf*e*R; #change in resistance in mΩ\n",
+ "dR1 = R*alpha*dt; #change in resistance in mΩ\n",
+ "\n",
+ "#result\n",
+ "print'change in resistance = %3.2f'%(dR*10**3),'mΩ';\n",
+ "print'Note:Ans printing mistake in textbook';\n",
+ "print'change in resistance = %3.2f'%(dR1*10**3),'mΩ';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.15,Page No:433"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "change in length = 3.72e-06 m\n",
+ "force = 2.438 kN\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "L = 0.12; #length in m\n",
+ "A = 3.8*10**-4; #area in m**2\n",
+ "R = 220; #resistance in Ω\n",
+ "Gf = 2.2; #guage factor\n",
+ "dR = 0.015; #change in resistance in Ω\n",
+ "E = 207*10**9; #elasticity in N/m**2\n",
+ "\n",
+ "#calculations\n",
+ "dL = (dR*L)/float(R*Gf); #change in length in m \n",
+ "s = (E*dL)/float(L); \n",
+ "F = s*A; #force in kN \n",
+ "\n",
+ "#result\n",
+ "print'change in length = %2.2e'%dL,'m';\n",
+ "print'force = %3.3f'%(F*10**-3),'kN';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.16,Page No:444"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "strain = 594.5 microstrain\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Rg = 100; #resistance in Ω\n",
+ "Rsh = 80000; #resistance in Ω\n",
+ "Gf = 2.1;\n",
+ "\n",
+ "#calculations\n",
+ "x = (Rg/float(Rg+Rsh)); #equivalent strain\n",
+ "eeq = x/(float(Gf)); #strain in microstrain\n",
+ "\n",
+ "#result\n",
+ "print'strain = %3.1f'%(eeq*10**6),'microstrain';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.17,Page No:445"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 27,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "strain = 356.43 microstrain\n",
+ "Note:calculation mistake in text book,Rg value is taken wrong in calculating s\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "n = 4; #four arm bridge\n",
+ "Rg = 200; #resistance in Ω\n",
+ "Rsh = 100*10**3; #resistance in Ω\n",
+ "x = 140; #number of divisions\n",
+ "Gf = 2.0; #guage factor\n",
+ "\n",
+ "#calculation\n",
+ "eeff = Rg/float(n*Gf*(Rg+Rsh)); #effective strain\n",
+ "d = eeff/float(x); #1 division scale\n",
+ "s = float(d)*Rg; #strain when loaded\n",
+ "\n",
+ "#result\n",
+ "print'strain = %3.2f'%(s*10**6),'microstrain';\n",
+ "print'Note:calculation mistake in text book,Rg value is taken wrong in calculating s';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.18,Page No:447"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "longitudinal stress = 70.01 MN/m**2\n",
+ "longitudinal stress = 146.2 MN/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "ex = 0.00016; #strain values in axial \n",
+ "ey = 0.00064; #strain values in circumferential direction\n",
+ "E = 200*10**9; #modulus of elasticity in N/,**2\n",
+ "u = 0.26; #poisson's ratio \n",
+ "\n",
+ "#calculation\n",
+ "sigmax = (E*(ex+(u*ey)))/float(1-(u**2)); #longitudinal stress in N/m**2\n",
+ "sigmay = (E*(ey+(u*ex)))/float(1-(u**2)); #hoop stress in N/m**2\n",
+ "\n",
+ "#result\n",
+ "\n",
+ "print'longitudinal stress = %3.2f'%(sigmax/10**6),'MN/m**2';\n",
+ "print'longitudinal stress = %3.1f'%(sigmay/10**6),'MN/m**2';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.19,Page No:447"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "227272727.273\n",
+ "modulus of elasticity = 147.5797 GN/M**2\n",
+ "poissons ratio = 0.2727\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "A = 110*10**-6; #area in m**2\n",
+ "P = 25*10**3; #load in N\n",
+ "ex = 1540*10**-6; #strain values in axial direction\n",
+ "ey = -420*10**-6; #strain values in transvers direction\n",
+ "\n",
+ "#calculation\n",
+ "sigmax = P/float(A); #axial stress in N/M**2\n",
+ "E = sigmax/float(ex); #modulus of elasticity in N/M**2\n",
+ "u = (-ey*E)/float(sigmax); #poisson's ratio\n",
+ "\n",
+ "#result\n",
+ "print sigmax\n",
+ "print'modulus of elasticity = %3.4f'%(E*10**-9),'GN/M**2';\n",
+ "print'poissons ratio = %3.4f'%u;\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.21,Page No:450"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "emax = 6.73e-05\n",
+ "emin = -1.927e-05\n",
+ "sigmamax = 13.514 MN/m**2\n",
+ "sigmamin = 0.201 MN/m**2\n",
+ "maximum shear stress = 6.656 MN/m**2\n",
+ "location of principle planes = 0.29 °\n",
+ "location of principle planes = 106.85 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "e1 = 60*10**-6; #strain in microstrains\n",
+ "e2 = 48*10**-6; #strain in microstrain\n",
+ "e3 = -12*10**-6; #strain in microstrain\n",
+ "E = 200*10**9; #modulus of elsticity in N/m**2\n",
+ "u = 0.3;\n",
+ "\n",
+ "#calculation\n",
+ "x = (e1+e3)/float(2); #average of strains\n",
+ "a = math.sqrt(((e1-e2)**2)+((e2-e3)**2));\n",
+ "b = 1/math.sqrt(2);\n",
+ "y = a*b;\n",
+ "emax = x+y; #principle strains\n",
+ "emin = x-y; #principle strains\n",
+ "x1 = x/float(1-u);\n",
+ "y1 = y/float(1+u); \n",
+ "sigmamax = E*(x1+y1); #principle stress\n",
+ "sigmamin = E*(x1-y1); #principle stress\n",
+ "tmax = E*y1; #maximum shear stress in MN/m**2\n",
+ "k = ((2*e2)-e1-e3)/float((e1-e3));\n",
+ "theta = (math.atan(k)); #location of principle planes\n",
+ "theta1 = (math.atan(k))/float(2); #location of principle planes\n",
+ "theta2 = 180+((theta)*180/float(math.pi));\n",
+ "theta3 = theta2/float(2); #location of principle planes\n",
+ "\n",
+ "print'emax = %2.2e'%(emax);\n",
+ "print'emin = %2.3e'%(emin);\n",
+ "print'sigmamax = %3.3f'%(sigmamax*10**-6),'MN/m**2';\n",
+ "print'sigmamin = %3.3f'%(sigmamin*10**-6),'MN/m**2';\n",
+ "print'maximum shear stress = %3.3f'%(tmax*10**-6),'MN/m**2';\n",
+ "print'location of principle planes = %3.2f'%(theta1),'°';\n",
+ "print'location of principle planes = %3.2f'%(theta3),'°';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.22,Page No:454"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "sensitivity of load = 13.79 uV/kN\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "d = 0.06; #diameter in m\n",
+ "Rg = 120; #nominal resistance of each guage Ω\n",
+ "Gf = 2.0; #guage factor \n",
+ "v = 6; #supply voltage in V\n",
+ "E = 200*10**9; #modulus of elasticity in N/m**2\n",
+ "u = 0.3; #poisson's ratio\n",
+ "P = 1000; #load in N\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "A = (math.pi/float(4))*d*d;\n",
+ "s = P/float(A); #stress in N/m**2\n",
+ "e = s/float(E); #strain \n",
+ "x = Gf*e; #fraction change in resistence i.e dR/R\n",
+ "a = v/float(4);\n",
+ "y = 2*(1+u)*(x)*a; #output volatge in uV\n",
+ " \n",
+ "#result\n",
+ "print'sensitivity of load = %3.2f'%(y*10**6),'uV/kN';"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K._RAJPUT_CHAPTER_6.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K._RAJPUT_CHAPTER_6.ipynb new file mode 100644 index 00000000..4731f202 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.K._RAJPUT_CHAPTER_6.ipynb @@ -0,0 +1,657 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6:Instrument Transformers"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:6.1,Page No:367"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "actual tranformation ratio = 240.77\n",
+ "phase angle = 4.57 ° \n",
+ "maximum flux density in core = 0.0938 Wb/m**2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Np = 1; #number of primary turns\n",
+ "Ns = 240; #number of secondary turns\n",
+ "Is = 5; #secondary current in A\n",
+ "Re = 1.2; #external burden in Ω \n",
+ "mmf = 96; #magnetomotive force in AT\n",
+ "Ac = 1200*10**-6; #cross section area mm**2\n",
+ "f = 50; #frequency in Hz\n",
+ "\n",
+ "#calculation\n",
+ "Kt = Ns/float(Np); #turns ratio\n",
+ "Es = Is*Re; #voltage induced in secondary winding in V\n",
+ "Im = mmf/float(Np); #secondary current in A\n",
+ "Ip = math.sqrt(((Kt*Is)**2)+((Im)**2)); #primary current in A\n",
+ "Kact = Ip/float(Is); #actual transformation ratio \n",
+ "x = Im/float(Kt*Is); #tangential component\n",
+ "theta = math.atan(x); #phase angle \n",
+ "phimax = Es/float(4.44*f*Ns);\n",
+ "Bmax = phimax/float(Ac);\n",
+ "\n",
+ "#result\n",
+ "print'actual tranformation ratio = %3.2f'%Kact;\n",
+ "print'phase angle = %3.2f'%((theta*180)/float(math.pi)),'° ';\n",
+ "print'maximum flux density in core = %3.4f'%Bmax,'Wb/m**2';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:6.2,Page No:368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0.893028554975\n",
+ "ratio error at full load = -0.0450 %\n",
+ "phase angle = 0.051167 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "I0 = 1; #exciting current in A\n",
+ "Knom = 200; #current transformer ratio \n",
+ "Re = 1.1; #non inductive resistance in Ω \n",
+ "p = 0.45; #power factor \n",
+ "delta = 0;\n",
+ "Is = 5; #rated secondary winding current in A\n",
+ "\n",
+ "#calculations\n",
+ "alpha = 90-(((math.acos(p))*180)/float(math.pi));\n",
+ "Kt = Knom #since no turn compenasation\n",
+ "y = math.sin(((delta+alpha)*math.pi)/float(180));\n",
+ "Kact = Kt+((I0/float(Is))*(y)); #actual transformation ratio\n",
+ "r = ((Knom-Kact)/float(Kact))*100; #ratio error\n",
+ "k =math.cos(((delta+alpha)*math.pi)/float(180));\n",
+ "theta = (180/math.pi)*((I0*k)/float(Kt*Is)); #phase angle degreess\n",
+ "\n",
+ "#calculation\n",
+ "print k\n",
+ "print'ratio error at full load = %3.4f'%r,'%';\n",
+ "print'phase angle = %f'%theta,'degrees';\n",
+ "\n",
+ " "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:6.3,Page No:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "flux in the core = 1.5766e-04 wb\n",
+ "ratio error = -3.846 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variuable declaration\n",
+ "Knom = 200; #nominal ratio\n",
+ "Np = 1; #number of primary turns\n",
+ "R = 1.4; #secondary impendance in Ω \n",
+ "L = 1.4; #iron loss in W\n",
+ "I = 5; #current in A\n",
+ "d = 0; #load angle when burden is pure resistive \n",
+ "mmf = 80; #magnetomotive force in A\n",
+ "f = 50;\n",
+ "\n",
+ "#calculations\n",
+ "Kt = Knom; #turns ratio\n",
+ "Ns = Kt*Np; #number of secondary turns\n",
+ "Es = I*R; #secondary induced voltage in V\n",
+ "phimax = Es/float(4.44*f*Ns); #flux in core Wb\n",
+ "Ep = Es/float(Kt); #primary induced voltage in V\n",
+ "Iw = L/float(Ep); #loss component of exciting current in A\n",
+ "Im = mmf/float(Np); #magnetising current\n",
+ "Kact = Kt+(((Im*math.sin(d))+(Iw*math.cos(d)))/float(Is)); #actual ratio \n",
+ "r = (Knom-Kact)/float(Kact); #ratio error in %\n",
+ "r1 = r*100;\n",
+ "\n",
+ "#result\n",
+ "print'flux in the core = %3.4e'%phimax,'wb';\n",
+ "print'ratio error = %3.3f'%r1,'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:6.4,Page No:370"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio error = -5.57 %\n",
+ "phase angle =2.01 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Np = 1; #number of primary turns\n",
+ "Ns = 250; #number of secondary turns\n",
+ "Rp = 1.4; #resistance of secondary circuit in Ω\n",
+ "Xs = 1.1; #reactance of secondary circuit in Ω\n",
+ "Is = 5; #current in secondary winding in A\n",
+ "mmf = 80; #magnetomotive force in A\n",
+ "L = 1.1; #iron loss in W\n",
+ "\n",
+ "#calculations\n",
+ "Kt = Ns/float(Np); #turns ratio\n",
+ "Knom = Kt; \n",
+ "Rs = math.sqrt((Rp**2)+(Xs**2)); #secondary circuit impedance\n",
+ "cosd = Rp/float(Rs); \n",
+ "sind = Xs/float(Rs);\n",
+ "Es = Is*Rs; #secondary induced voltage in V\n",
+ "Ep = Es/float(Ns); #primary induced voltage in V\n",
+ "Iw = L/float(Ep); #loss of component reffering to primary winding in A\n",
+ "Im = mmf/float(Np); #magnetising current in A\n",
+ "Kact = Kt+(((Im*sind)+(Iw*cosd))/float(Is)); #actual transformation ratio\n",
+ "r = ((Knom-Kact)/float(Kact))*100; #ratio error in %\n",
+ "theta = (180/math.pi)*(((Im*cosd)-(Iw*sind))/float(Kt*Is)); #phase angle degreess\n",
+ "\n",
+ "#result\n",
+ "print'ratio error = %3.2f'%r,'%';\n",
+ "print'phase angle =%3.2f'%theta,'°';\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:6.5,Page No:371"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "actual ratio = 317.10\n",
+ "primary current = 1585.49 A\n",
+ "reduction in secondary winding turns = 17\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Np = 1; #number of primary windings\n",
+ "Ns = 300; #umber of secondary windings\n",
+ "Re = 1; #ammeter ressistance in Ω\n",
+ "Xe = 0.55; #reactance in Ω\n",
+ "Rs = 0.3; #resistance if secondary winding in Ω\n",
+ "Xs = 0.25; #reactance of secondary winding in Ω\n",
+ "mmf = 90; # mmf for magnetisation\n",
+ "mmfc = 45; #mmf for core loss \n",
+ "Is = 5; #current in A\n",
+ "\n",
+ "#calculations\n",
+ "R = Rs+Re; #total secondarycircuit resistance in Ω\n",
+ "X = Xs+Xe; #total secondarycircuit reactance in Ω\n",
+ "delta = math.atan(X/float(R)); #secondary circuit phase angle \n",
+ "c = math.cos(delta);\n",
+ "s = math.sin(delta);\n",
+ "Kt = Ns/float(Np); #turn ratio \n",
+ "Im = mmf/float(Np); #magnetising current in A\n",
+ "Iw = mmfc/float(Np); #loss component in A\n",
+ "Kact = Kt+(((Im*math.sin(delta))+(Iw*math.cos(delta)))/float(Is)); #actual ratio\n",
+ "Ip = Kact*Is; #primary current A\n",
+ "Knom = Kt;\n",
+ "y = (((Im*math.sin(delta))+(Iw*math.cos(delta)))/float(Is));\n",
+ "Kt1 = (Knom)-(y);\n",
+ "Ns1 = Kt1*Np; #secondary winding turns\n",
+ "r = Ns-Ns1; #reduction in secondary winding turns\n",
+ "\n",
+ "#result\n",
+ "print'actual ratio = %3.2f'%Kact;\n",
+ "print'primary current = %3.2f'%Ip,'A';\n",
+ "print'reduction in secondary winding turns = %3.0f'%r;"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:6.6,Page No:372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "actual ratio 101.12\n",
+ "phase angle 0.641 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Np = 1; #number of primary windings\n",
+ "Ns = 100; #number of secondary windings\n",
+ "Knom = 100; #nominal ratio\n",
+ "Re = 1.45; #external burden non inductive in Ω\n",
+ "Rs = 0.25; #winding resistance in Ω\n",
+ "I0 = 1.8; #current in A\n",
+ "l = 38.4; #lagging angle with secondary voltage reversed in °\n",
+ "Is = 1; #current in secondary winding in A\n",
+ "delta = 0;\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "Kt = Ns/float(Np); #turn ratio\n",
+ "Rt = Re+Rs; #totaal secondary circuit resistance in Ω\n",
+ "alpha = 90-l;\n",
+ "x = math.cos(((delta+alpha)*math.pi)/float(180));\n",
+ "Kact = Kt+((I0/float(Is))*x); #actual ratio\n",
+ "y = math.cos(((delta+alpha)*math.pi)/float(180));\n",
+ "theta = (180/float(math.pi))*((I0*y/float(Kt*Is))); #phase angle in °\n",
+ "\n",
+ "#result\n",
+ "print'actual ratio %3.2f'%Kact;\n",
+ "print'phase angle %3.3f'%theta,'°';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:6.7,Page No:373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio error -0.87 %\n",
+ "phase angle 0.1948\n",
+ "ratio error 0.08 %\n",
+ "phase angle 0.5386 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Np = 1; #number of primary windings\n",
+ "Ns = 200; #number of secondary winding\n",
+ "Kt = 200; #actual ratio\n",
+ "Im = 8; #magnetising current in A\n",
+ "Iw = 5; #loss component in A\n",
+ "cosphi = 0.8; # leading by\n",
+ "Knom = 200; #transformer is rated \n",
+ "cosphi1 = 0.8; #lagging by\n",
+ "Is = 5; #current in A\n",
+ "\n",
+ "#calculations\n",
+ "sinphi = math.sqrt((1**2)-(cosphi**2));\n",
+ "Kact = Kt+(((Im*sinphi)+(Iw*cosphi))/float(Is)); #actual ratio\n",
+ "er = ((Knom-Kact)/float(Kact))*100; #error ratio\n",
+ "theta = (180/float(math.pi))*(((Im*cosphi)-(Iw*sinphi))/float(Kt*Is)); #phase angle\n",
+ "sinphi1 = -math.sqrt((1**2)-(cosphi1**2));\n",
+ "Kact1 = Kt+(((Im*sinphi1)+(Iw*cosphi1))/float(Is)); #actual ratio\n",
+ "er1 = ((Knom-Kact1)/float(Kact1))*100; #ratio error\n",
+ "theta1 = (180/float(math.pi))*(((Im*cosphi1)-(Iw*sinphi1))/float(Kt*Is)); #phase angle\n",
+ "\n",
+ "#result\n",
+ "print'ratio error %3.2f'%er,'%';\n",
+ "print'phase angle %3.4f'%theta;\n",
+ "print'ratio error %3.2f'%er1,'%';\n",
+ "print'phase angle %3.4f'%theta1,'°';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
+ "source": [
+ "##Example:6.8,Page No:373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio error 100.87 %\n",
+ "phase angle 0.4074 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Np = 1; #number of primary windings\n",
+ "Ns = 99; #number of secondary winding\n",
+ "Rs = 0.4; #secondary winding resistance in Ω\n",
+ "Xs = 0.35; #secondary winding reactance in Ω\n",
+ "Knom = 100; #ratio \n",
+ "mmf = 6; #magnetising mmf in AT\n",
+ "lmmf = 8; #loss mmf in AT\n",
+ "V = 20; #voltage in VA\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "Kt = Ns/float(Np); #actual ratio\n",
+ "Im = mmf/float(Np); #magnetising current in A\n",
+ "Iw = lmmf/float(Np); #loss component in A\n",
+ "Re = V/float(Is**2); #external reistance burden in Ω\n",
+ "R = Rs+Re; #resistance of total seccondary circuit in Ω\n",
+ "#reactance is zero \n",
+ "Xe = 0;\n",
+ "X = Xs+Xe; #reactance of total secondary circcuit burden in Ω\n",
+ "delta = ((math.atan(X/float(R))*180)/float(math.pi)); #phase angle\n",
+ "c = math.cos((delta*math.pi)/float(180));\n",
+ "s = math.sin((delta*math.pi)/float(180));\n",
+ "Kact = Kt+(((Im*s)+(Iw*c))/float(Is)); #actual ratio\n",
+ "er = ((Knom-Kact)/float(Kact))*100; #error ratio\n",
+ "theta = (180/float(math.pi))*(((Im*c)-(Iw*s))/float(Kt*Is)); #phase angle\n",
+ "\n",
+ "#result\n",
+ "print'ratio error %3.2f'%Kact,'%';\n",
+ "print'phase angle %3.4f'%theta,'°';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
+ "source": [
+ "##Example:6.9,Page No:374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio error -1.198 %\n",
+ "phase angle 0.6531 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Knom = 20; #nominal ratio of 100/5A\n",
+ "V = 20; #rated load in VA\n",
+ "Il = 0.18; #iron loss in W\n",
+ "Im = 1.4; #magnetising current in A\n",
+ "x = 4; #ratio of reactance to resistance \n",
+ "Ip = 100; #primary currnt widing in A\n",
+ "Is = 5; #current in secondary winding in A\n",
+ "\n",
+ "#calculations\n",
+ "Kt = Knom; #assuming the value of Kt\n",
+ "Ep = V/float(Ip); #voltage across primary winding in V\n",
+ "Iw = Il/float(Ep); #loss current of exciting current in A\n",
+ "delta = ((math.atan(1/float(x))*180)/float(math.pi)); #phase angle\n",
+ "c = math.cos((delta*math.pi)/float(180));\n",
+ "s = math.sin((delta*math.pi)/float(180));\n",
+ "Kact = Kt+(((Im*s)+(Iw*c))/float(Is)); #actual ratio\n",
+ "er = ((Knom-Kact)/float(Kact))*100; #error ratio\n",
+ "theta = (180/float(math.pi))*(((Im*c)-(Iw*s))/float(Kt*Is)); #phase angle\n",
+ "\n",
+ "#result\n",
+ "print'ratio error %3.3f'%er,'%';\n",
+ "print'phase angle %3.4f'%theta,'°';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:6.10,Page No:382"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "phase angle error at no load -0.00156 °\n",
+ "Note:printing mistake in textbook,theta value is printed wrong\n",
+ "burden load in VA 15.34 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "Kt = 10; #ratio of 1000/100volts potentia meter \n",
+ "Rp = 86.4; #primary resistance in Ω\n",
+ "Rs = 0.78; #secondary resistance in Ω\n",
+ "Xp = 62.5; #primary reactance in Ω\n",
+ "Xs = 102; #total equivalent reactance in Ω\n",
+ "I0 = 0.03; #no-load current in A\n",
+ "cosphi = 0.42; #power factor \n",
+ "cosgamma = 1; #since power factor = 1\n",
+ "Vs = 100; #voltage in V\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "sinphi = math.sqrt(1-(cosphi**2));\n",
+ "Im = I0*sinphi; #magnetising current in A\n",
+ "Iw = I0*cosphi; #loss current in A\n",
+ "\n",
+ "#theta = ((((Is/Kt)*((X*cosgamma)-(Rp*singamma)))+(Iw*Xp)-(Im*Rp))/float(Kt*Vs));\n",
+ "#since Is =0 \n",
+ "\n",
+ "theta = (((Iw*Xp)-(Im*Rp))/float(Kt*Vs));\n",
+ "singamma = math.sqrt(1-(cosgamma**2));\n",
+ "\n",
+ "#burden in VA,theta1 = 0,thus ((((Is/Kt)*((X*cosgamma)-(Rp*singamma)))+(Iw*Xp)-(Im*Rp))/float(Kt*Vs))=0\n",
+ "#(((Is/Kt)*((X*cosgamma)-(Rp*singamma)))+(Iw*Xp)-(Im*Rp)) =0\n",
+ "#Is/Kt = ((Im*Rp)-(Iw*Xp)))/float(((X*cosgamma)-(Rp*singamma)))\n",
+ "#assume x = ((X*cosgamma)-(Rp*singamma)),y = (Iw*Xp)-(Im*Rp)\n",
+ "#Is = Kt*(y/x)\n",
+ "\n",
+ "x = ((Xs*cosgamma)-(Rp*singamma));\n",
+ "y = (Im*Rp)-(Iw*Xp);\n",
+ "Is = Kt*(y/float(x)); #current in A\n",
+ "l = Vs*Is; # burden load in VA \n",
+ "\n",
+ "#result\n",
+ "print'phase angle error at no load %3.5f'%theta,'°';\n",
+ "print'Note:printing mistake in textbook,theta value is printed wrong';\n",
+ "print'burden load in VA %3.2f'%l,'V'\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example:6.11,Page No:383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio error -0.7937 %\n",
+ "phase angle -0.3438 °\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declartion\n",
+ "Kt = 60.476; #turns ratio 3810/63 tranformer\n",
+ "Vs = 63; #secondary voltage in V\n",
+ "Rs = 2; #series resistance in Ω\n",
+ "Xs = 1; #reactance in Ω\n",
+ "R = 100; #resistance in Ω\n",
+ "X = 200; #reactance in Ω\n",
+ "\n",
+ "#calculations\n",
+ "\n",
+ "delta = ((math.atan(X/float(R))*180)/float(math.pi)); #phase angle\n",
+ "Z = math.sqrt((R**2)+(X**2)); #agnitude of impedance\n",
+ "\n",
+ "#Kact = Kt+(((Rs*c)+(Xs*s))/float(Vs/float(Is))); \n",
+ "#Vs/float(Is) = Z\n",
+ "\n",
+ "c = math.cos((delta*math.pi)/float(180));\n",
+ "s = math.sin((delta*math.pi)/float(180));\n",
+ "x =(Rs*c)+(Xs*s);\n",
+ "y = ((x*Kt)/float(Z));\n",
+ "Kact = Kt+y; #actual ratio\n",
+ "Knom = Kt; #nominal ration \n",
+ "er = ((Knom-Kact)/float(Kact))*100; #error ratio\n",
+ "theta = (180/float(math.pi))*(((Xs*c)-(Rs*s))/float(Z)); #phase angle\n",
+ "\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'ratio error %3.4f'%er,'%';\n",
+ "print'phase angle %3.4f'%theta,'°';\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.k.Rajput5.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.k.Rajput5.ipynb new file mode 100644 index 00000000..8895e342 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/R.k.Rajput5.ipynb @@ -0,0 +1,168 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Chapter 5:Digital Instruments"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.1,Page No:338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "frequency of the of the system = 4500.00\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "N = 45; #reading \n",
+ "t = 10*10**-3; #Gated period in ms\n",
+ "\n",
+ "#calculations\n",
+ "f = N/float(t);\n",
+ "\n",
+ "#result\n",
+ "print'frequency of the of the system = %3.2f'%f,'Hz';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.2,Page No:339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution 0.0010\n",
+ "Resolution for full scale range of 10V = 0.01 V\n",
+ "possible error = 0.015 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "n = 3; #number of full digits on 3 1/2 digit display \n",
+ "fs = 1; #voltage in V\n",
+ "fs1 = 10; #voltage in V\n",
+ "r = 2; #voltage reading in V\n",
+ "fs3 = 5;\n",
+ "\n",
+ "#calculation\n",
+ "R = 1/float((10)**n); #resolution\n",
+ "R1 = R*fs; #resolution for full scale range of 1V\n",
+ "R2 = fs1*R; #resolution for full scale range of 10V\n",
+ "LSD =fs3*R; #digit in the least siginificant digit in V\n",
+ "e = (((0.5)/float(100))*(r))+LSD; #total possible error in V\n",
+ "\n",
+ "#result\n",
+ "print'Resolution %3.4f'%R;\n",
+ "print'Resolution for full scale range of 10V = %3.2f'%R2,'V';\n",
+ "print'possible error = %3.3f'%e,'V';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 5.3,Page No:340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution = 0.0001 \n",
+ "There are 5 digit faces in 4 1/2 digt display ,so 16.95 would be displayed as 16.950\n",
+ "Resolution = 0.0001 \n",
+ "Hence 0.6564 will be displayed as 0.6564\n",
+ "Resolution = 0.0010 \n",
+ "Hence 0.6564 will be displayed as 0.656\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "\n",
+ "#variable declaration\n",
+ "n = 4; #numberof full digits \n",
+ "fs = 1; #full scale range of 1V\n",
+ "fs = 1; #full scale range of 10V\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "R = 1/float((10)**n); #resolution\n",
+ "R1 = fs*R; #resolution on 1V in V\n",
+ "R2 = fs1*R; #resolution on 10V in V\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'Resolution = %3.4f '%R;\n",
+ "print'There are 5 digit faces in 4 1/2 digt display ,so 16.95 would be displayed as 16.950';\n",
+ "print'Resolution = %3.4f '%R1;\n",
+ "print'Hence 0.6564 will be displayed as 0.6564';\n",
+ "print'Resolution = %3.4f '%R2;\n",
+ "print'Hence 0.6564 will be displayed as 0.656';\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k.rajput12_2.png b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k.rajput12_2.png Binary files differnew file mode 100644 index 00000000..2cc93e75 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k.rajput12_2.png diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k_rajput_2.png b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k_rajput_2.png Binary files differnew file mode 100644 index 00000000..22f87a95 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k_rajput_2.png diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.krajput_2.png b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.krajput_2.png Binary files differnew file mode 100644 index 00000000..60b16536 --- /dev/null +++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.krajput_2.png diff --git a/Introduction_to_Electric_Drives_by_J._S._Katre/README.txt b/Introduction_to_Electric_Drives_by_J._S._Katre/README.txt new file mode 100644 index 00000000..712fa0cc --- /dev/null +++ b/Introduction_to_Electric_Drives_by_J._S._Katre/README.txt @@ -0,0 +1,10 @@ +Contributed By: Nishtha Rani +Course: btech +College/Institute/Organization: Uttarakhand Technical University +Department/Designation: ET +Book Title: Introduction to Electric Drives +Author: J. S. Katre +Publisher: Tech-max Publications, Pune +Year of publication: 2012 +Isbn: 978-81-8492-024-6 +Edition: 2
\ No newline at end of file diff --git a/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch2_2.ipynb b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch2_2.ipynb new file mode 100644 index 00000000..333b1b19 --- /dev/null +++ b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch2_2.ipynb @@ -0,0 +1,454 @@ +{ + "metadata": { + "name": "", + "signature": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-2, Casting Processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 1 on page no. 46" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import sqrt\n", + "# Given that\n", + "h=15 # Height of spur in cm\n", + "l= 50 # Length of cast in cm\n", + "w= 25 # weidth of cast in cm\n", + "h1= 15 # Height of cast in cm\n", + "g= 981 # Acceleration due to gravity in cm/sec**2\n", + "Ag= 5 # Cross sectional area of the grate in cm**2\n", + "v3= sqrt(2* g * h)\n", + "V = l*w*h1\n", + "tf1= V/(Ag*v3)\n", + "Am = l*w\n", + "tf2 = (Am/Ag)*(1/sqrt(2*g))*2*(sqrt(h) - sqrt(h-h1))\n", + "print \"Filling time for first design = %0.2f sec, \\nFilling time for second design = %0.2f sec\"%(tf1, tf2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Filling time for first design = 21.86 sec, \n", + "Filling time for second design = 43.72 sec\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 2 on page no. 53" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import sqrt, pi\n", + "# Given that\n", + "h=15 # Height of spur in cm\n", + "l= 50 # Length of cast in cm\n", + "w= 25 # weidth of cast in cm\n", + "h1= 15 # Height of cast in cm\n", + "g= 981 # Acceleration due to gravity in cm/sec**2\n", + "Ag= 5 # Cross sectional area of the grate in cm**2\n", + "Dm = 7800 # Density of molten Fe in Kg/m**3\n", + "Neta = 0.00496 # Kinetic viscosity in Kg/m-sec\n", + "theta = 90 # Angle in degree\n", + "Eq = 25 # (L/D) Equivalent \n", + "\n", + "v3= sqrt(2* g * h)*(10**(-2))\n", + "d= sqrt((Ag*4)/(pi))*(10**(-2))\n", + "Re = Dm*v3*d/Neta\n", + "f = 0.0791*(Re)**(-1/4)\n", + "L=0.12 # in meter\n", + "Cd= (1+0.45+4*f*((L/d)+Eq))**(-1/2)\n", + "v3_ = Cd*v3\n", + "Re_ = (v3_/v3)*(Re)\n", + "f_ = 0.0791 *(Re_)**(-1/4)\n", + "Cd_ = (1+0.46+4*f_*(L/d + Eq))**(-1/2)\n", + "v3__ = Cd_*v3\n", + "V = l*w*h1\n", + "tf= (V/(Ag*v3__))*(10**-2)\n", + "print \"Filling time for first design = %0.1f sec. \"% tf" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Filling time for first design = 31.7 sec. \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 3 on page no. 55" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import sqrt, pi\n", + "# Given that\n", + "Hi=1.2 # Initial height in m\n", + "H= 0.05 # Height in m\n", + "g= 9.81 # Acceleration due to gravity in m/sec**2\n", + "Dm = 2700 # Density of molten metal in Kg/m**3\n", + "Neta = 0.00273 # Kinetic viscosity in Kg/m-sec \n", + "d= 0.075 # Diameter in m\n", + "D = 1 # Internal diameter of ladle in m\n", + "\n", + "v3= sqrt(2* g * Hi)\n", + "Re = Dm*v3*d/Neta\n", + "ef=0.075\n", + "Cd= (1+ef)**(-1/2)\n", + "ef_=0.82\n", + "Re_ = (2+ef_)**(-1/2)\n", + "v3_ = sqrt(2*g*H)\n", + "Re_ = Dm*v3_*d/Neta\n", + "At = (pi/4)*D**2\n", + "An = (pi/4)*d**2\n", + "Cd= 0.96\n", + "tf= (sqrt(2/g))*(At/An)*(1/Cd)*sqrt(Hi)\n", + "m = Dm*An*Cd*sqrt(2*g*Hi)\n", + "m_ = Dm*An*Cd*sqrt(2*g*Hi*0.25)\n", + "print \"\"\"Time required to empty the ladle = %0.2f sec,\n", + "Discharge rate are - \n", + " Initially = %0.2f Kg/sec \n", + " When the ladle is 75 percent empty = %0.2f Kg/sec.\"\"\"%(tf,m,m_)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time required to empty the ladle = 91.60 sec,\n", + "Discharge rate are - \n", + " Initially = 55.56 Kg/sec \n", + " When the ladle is 75 percent empty = 27.78 Kg/sec.\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 5 on page no. 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import sqrt, pi\n", + "# Given that\n", + "thetaF= 1540 # Temperature of mould face in degree centigrade\n", + "Theta0 = 28 # Initial temperature of mould in Degree centigrade\n", + "L= 272e3 # Latent heat of liquid metal in J/Kg\n", + "Dm = 7850 # Density of liquid metal in Kg/m**3\n", + "c = 1.17e+3 #Specific heat of sand in J/Kg-K\n", + "k = 0.8655 # Conductivity of sand in W/m-K\n", + "D= 1600 # Density of sand in Kg/m**3\n", + "h = 0.1 # Height in m\n", + "b = 10 # Thickness of slab in cm\n", + "r =h/2# V/A in meter\n", + "\n", + "lamda = (thetaF - Theta0)*(D*c)/(Dm*L)\n", + "Beta1 = 2*lamda/sqrt(pi)\n", + "Alpha = k /(D*c)\n", + "ts1 = r**2 /((Beta1**2)*Alpha)#In sec\n", + "ts1_=ts1/3600 # In hour\n", + "from sympy import symbols, solve\n", + "Beta= symbols(\"Beta\") \n", + "p=Beta**2 - lamda*(2/sqrt(pi))*Beta -lamda/3\n", + "Beta2 = solve(p, Beta) # taking +ve value\n", + "print \"Beta2 = %0.2f\" %Beta2[1]\n", + "r1 = r/3\n", + "ts2 = (r1**2)/((1.75**2)*Alpha) # in sec\n", + "ts2_=ts2/3600#in Hour\n", + "print \"Solidification time for slab-shaped casting = %0.3f hr,\\nSolidification time for sphere = %0.3f hr\"% (ts1_,ts2_)\n", + "# Answer in the textbook are not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Beta2 = 1.75\n", + "Solidification time for slab-shaped casting = 0.671 hr,\n", + "Solidification time for sphere = 0.054 hr\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 6 on page no. 73" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import sqrt, pi, exp\n", + "# Given that\n", + "thetaF= 1540 # Temperature of mould face in degree centigrate\n", + "ThetaO = 28 # Initial temperature of mould in Degree centigrate\n", + "L= 272e3 # Latent heat of iron in J/Kg\n", + "Dm = 7850 # Density of iron in Kg/m**3\n", + "Cs = 0.67e+3 #Specific heat of iron in J/Kg-K\n", + "C = 0.376e3 #Specific heat of copper in J/Kg-K\n", + "Ks = 83 # Conductivity of iron in W/m-K\n", + "K = 398 # Conductivity of copper in W/m-K\n", + "D= 8960 # Density of copper in Kg/m**3\n", + "h = .1 # Height in m\n", + "\n", + "zeta1=0.98#By solving eqauation- zeta*exp(zeta**2)*erf(zeta)=((thetaF-thetaO)*Cs)/(sqrt(pi)*L), zeta = 0.98\n", + "AlphaS = Ks /(Dm*Cs)\n", + "ts1 = h**2 / (16*(zeta1**2) * AlphaS)#In sec\n", + "ts1_=ts1/3600 # In hour\n", + "Phi = sqrt((Ks*Dm*Cs)/(K*D*C))\n", + "zeta2=0.815#By solving eqauation- zeta*exp(zeta**2)*(erf(zeta)+Phi)=((thetaF-thetaO)*Cs)/(sqrt(pi)*L), zeta = 0.815\n", + "ts2 = h**2 / (16*(zeta2**2) * AlphaS)#In sec\n", + "ts2_=ts2/3600 # In hour\n", + "erf = lambda zeta2:(thetaF-Theta0)*Cs/L/sqrt(pi)\n", + "thetaS= thetaF+(thetaF-(L*(sqrt(pi))*zeta2*(exp(zeta2**2))*erf(zeta2))/Cs)\n", + "print \"\"\"Solidification time for slab-shaped casting when the casting is done in a water cooled copper mould = %0.4f hr,\n", + "Solidification time for slab-shaped casting when the casting is done in a very thick copper mould = %0.4f hr,\n", + "The surface temperature of the mould = %0.1f\u00b0 C\"\"\"% (ts1_,ts2_,thetaS)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Solidification time for slab-shaped casting when the casting is done in a water cooled copper mould = 0.0115 hr,\n", + "Solidification time for slab-shaped casting when the casting is done in a very thick copper mould = 0.0166 hr,\n", + "The surface temperature of the mould = 685.7\u00b0 C\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 7 on page no. 75" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import sqrt, pi, exp\n", + "# Given that\n", + "thetaF= 1540 # Temperature of mould face in degree centigrade\n", + "thetaO = 28 # Initial temperature of mould in Degree centigrade\n", + "L= 272e3 # Latent heat of iron in J/Kg\n", + "Dm = 7850 # Density of iron in Kg/m**3\n", + "Cs = 0.67e+3 #Specific heat of iron in J/Kg-K\n", + "C = 0.376e3 #Specific heat of copper in J/Kg-K\n", + "Ks = 83 # Conductivity of iron in W/m-K\n", + "K = 398 # Conductivity of copper in W/m-K\n", + "D= 8960 # Density of copper in Kg/m**3\n", + "h = .1 # Height in m\n", + "hF = 1420 # Total heat transfer coefficient across the casting-mould interface in W/m**2-\u00b0C\n", + "\n", + "AlphaS = K /(D*C)\n", + "thetaS = 982 #In \u00b0C as in example 2.6\n", + "h1= (1+(sqrt((Ks*Dm*Cs)/(K*D*C))))*hF\n", + "a = 1/2 + (sqrt((1/4)+Cs*(thetaF-thetaS)/(3*L)))\n", + "delta=h/2\n", + "ts = (delta+((h1*delta**2)/(2*Ks)))/((h1*(thetaF-thetaS))/(Dm*L*a)) # in sec\n", + "ts_ = ts/3600 # in hours\n", + "h2= (1+(sqrt((K*D*C)/(Ks*Dm*Cs))))*hF\n", + "gama= ((h2**2)/(K**2))*AlphaS*ts\n", + "thetaS_ = thetaO + (thetaS-thetaO)*(1-((exp(gama))*(1-(erf(sqrt(gama))))))\n", + "print \"Solidification time = %0.4f hr,\\nThe surface temperature of the mould = %0.2f \u00b0 C\"%(ts_,thetaS_)\n", + "# The value of the surface temperature of the mould in the book is given as 658.1\u00b0 C, Which is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Solidification time = 0.0534 hr,\n", + "The surface temperature of the mould = 10389.84 \u00b0 C\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 8 on page no. 77" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "A= 60*7.5 # Cross sectional area in cm**2\n", + "v=0.05 # Withdrawal rate in m/sec\n", + "t = 0.0125 # Thickness in m\n", + "thetaF= 1500 # Temperature of mould face in degree centigrate\n", + "thetaP = 1550 # \n", + "thetaO = 20 # Initial temperature of mould in Degree centigrate\n", + "L= 268e3 # Latent heat of molten metal in J/Kg\n", + "Dm = 7680 # Density of molten metal in Kg/m**3\n", + "Cs = 0.67e+3 #Specific heat of molten metal in J/Kg-K\n", + "Cm = 0.755e3 #Specific heat of mould in J/Kg-K\n", + "Ks = 76 # Conductivity of molten metal in W/m-K\n", + "hF = 1420 # Heat transfer coefficient at the casting-mould interface in W/m**2-\u00b0C\n", + "Dtheta = 10 # Maximum temperature of cooling water in \u00b0 C\n", + "L_ = L+Cm*(thetaP-thetaF)\n", + "x=L_ / (Cs*(thetaF-thetaO))\n", + "y= hF*t/Ks\n", + "print \"L_/(Cs(thetaF-thetaO))=%0.2f,\\nhF*t/Ks=%0.2f\"%(x,y)\n", + "z=0.11 # Where z=hF**2 * lm / (v*Ks*Dm*Cs)\n", + "lm= (z*v*Ks*Dm*Cs)/(hF**2)\n", + "Z=0.28 # Where Z=Q/(lm*(thetaF-thetaO)*sqrt(lm*v*Dm*Cs*Ks))\n", + "Q = Z*lm*(thetaF-thetaO)*sqrt(lm*v*Dm*Cs*Ks)\n", + "m = Q / (4.2e3*Dtheta)\n", + "print \"The mould length = %0.2f meter,\\nThe cooling water requirement = %0.2f Kg/sec\"%(lm,m)\n", + "# Answer for The cooling water requirement in the book is given as 5.05 Kg/sec, Which is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "L_/(Cs(thetaF-thetaO))=0.31,\n", + "hF*t/Ks=0.23\n", + "The mould length = 1.07 meter,\n", + "The cooling water requirement = 48.07 Kg/sec\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 9 on page no. 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import floor\n", + "# Given that\n", + "a = 15 # Side of the aluminium cube in cm\n", + "Sh = 0.065 # Volume shrinkage of aluminium during solidification\n", + "\n", + "Vc = a**3\n", + "Vr = 3*Sh*Vc\n", + "h = ((4*Vr)/pi)**(1/3)\n", + "Rr = 6/h # Where Rr= (A/V)r\n", + "Rc = 6/a # Where Rc = (A/V)c\n", + "print \"(A/V)r=%f, (A/V)c=%.1f\\nHence Rr is greater than Rc\"%(Rr,Rc)\n", + "dmin = 6/Rc\n", + "Vr_ = (pi/4)*dmin**3\n", + "print \"\"\"With minimum value of d Vr=%d cm**3 .\n", + "This valume is much more than the minimum Vr necessary.\n", + "Let us now consider the top riser when the optimum cylindrical shape is obtained with h=d/2\n", + "and again (A/V)r = 6/d. However, with a large top riser,\n", + "the cube loses its top surface for the purpose of heat dissipation.\"\"\"%Vr_\n", + "Rc_ = 5/a\n", + "dmin_=6/Rc_\n", + "print \"d should be greater than or equal to %d cm\"%dmin_\n", + "Vr__ = (pi/4)*dmin_**2 *floor(h)\n", + "print \"The riser volume with minimum diameter is %d cm**3\"%Vr__" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(A/V)r=0.636422, (A/V)c=0.4\n", + "Hence Rr is greater than Rc\n", + "With minimum value of d Vr=2650 cm**3 .\n", + "This valume is much more than the minimum Vr necessary.\n", + "Let us now consider the top riser when the optimum cylindrical shape is obtained with h=d/2\n", + "and again (A/V)r = 6/d. However, with a large top riser,\n", + "the cube loses its top surface for the purpose of heat dissipation.\n", + "d should be greater than or equal to 18 cm\n", + "The riser volume with minimum diameter is 2290 cm**3\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +} diff --git a/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch3_2.ipynb b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch3_2.ipynb new file mode 100644 index 00000000..4b196f65 --- /dev/null +++ b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch3_2.ipynb @@ -0,0 +1,649 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b01632c5e1d052fcab2b601597f0c6e72de59cc1f1354d4c2bee4e077a3161c7" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter - 03, Forming Processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 1 on page no. 112" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import tan, sqrt, atan, log\n", + "# Given that\n", + "A = 150*6 # Cross-section of strips in mm**2\n", + "ti = 6 # Thickness in mm\n", + "pA = 0.20 # Reduction in area\n", + "d = 400 # Diameter of steel rolls in mm\n", + "Ys = 0.35# Shear Yield stress of the material before rolling in KN/mm**2\n", + "Ys_ = 0.4# Shear Yield stress of the material after rolling in KN/mm**2\n", + "mu = 0.1 # Cofficient of friction\n", + "\n", + "tf =0.8*ti\n", + "Ys_a = (Ys + Ys_)/2\n", + "r=d/2\n", + "thetaI = sqrt((ti-tf)/r)\n", + "lambdaI=2*sqrt(r/tf)*atan(thetaI *sqrt(r/tf))\n", + "lambdaN = (1/2)*((1/mu)*(log(tf/ti)) + lambdaI)\n", + "thetaN =(sqrt(tf/r))*(tan((lambdaN/2)*(sqrt(tf/r))))\n", + "print \"\"\"The final srip thickness is %0.2f mm,\\nThe avg shear yield stress during the process is %0.3f KN/mm**2,\n", + "The angle subtended by the deformation zone at the roll centre is %0.4f rad, \n", + "The location of neutral point is %0.3f rad.\"\"\"%(tf,Ys_a,thetaI,thetaN)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The final srip thickness is 4.80 mm,\n", + "The avg shear yield stress during the process is 0.375 KN/mm**2,\n", + "The angle subtended by the deformation zone at the roll centre is 0.0775 rad, \n", + "The location of neutral point is 0.023 rad.\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 2 on page no. 113" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import exp, ceil\n", + "# Given that\n", + "A = 150*6 # Cross-section of strips in mm**2\n", + "w = 150 # Width of the strip in mm\n", + "ti = 6 # Thickness in mm\n", + "pA = 0.20 # Reduction in area\n", + "d = 400 # Diameter of steel rolls in mm\n", + "Ys = 0.35# Shear Yield stress of the material before rolling in KN/mm**2\n", + "Ys_ = 0.4# Shear Yield stress of the material after rolling in KN/mm**2\n", + "mu = 0.1 # Cofficient of friction\n", + "v = 30 # Speed of rolling in m/min\n", + "tf =0.8*ti\n", + "Ys_a = (Ys + Ys_)/2\n", + "r=d/2\n", + "thetaI = sqrt((ti-tf)/r)\n", + "lambdaI=2*sqrt(r/tf)*atan(thetaI *sqrt(r/tf))\n", + "lambdaN = (1/2)*((1/mu)*(log(tf/ti)) + lambdaI)\n", + "thetaN =(sqrt(tf/r))*(tan((lambdaN/2)*(sqrt(tf/r))))\n", + "Dtheta_a = thetaN/4\n", + "Dtheta_b = (thetaI- thetaN)/8\n", + "print \"The values of P_after are:\\n\"\n", + "for i in range(0,5,1):\n", + " theta = i*Dtheta_a\n", + " y = (1/2)* (tf+r*theta**2)\n", + " lamda = 2*sqrt(r/tf)*atan(theta*sqrt(r/tf))\n", + " p_a = 2*Ys_a*(2*y/tf)*(exp(mu*lamda))\n", + " print \"%0.3f \\t\\t\"%p_a,\n", + "\n", + "I1 = (Dtheta_a/3) *(0.75+.925+4*(.788+.876)+2*.830)# By Simpson's rule\n", + "print \"\\n\\nThe values of P_before are:\\n\"\n", + "for i in range(0,8,1):\n", + " theta1 = i*Dtheta_b + thetaN\n", + " y = (1/2)* (tf+r*theta1**2)\n", + " lamda = 2*sqrt(r/tf)*atan(theta1*sqrt(r/tf))\n", + " p_b = 2*Ys_a*(2*y/ti)*(exp(mu*(lambdaI-lamda)))\n", + " print \" %0.3f \\t\\t\"%p_b,\n", + "\n", + "I2 = (Dtheta_b/3)*(0.925+.75+4*(.887+.828+.786+.759) + 2*(.855+.804+.772))#By Simpson's rule\n", + "F = r*(I1 + I2)\n", + "F_ = F*w\n", + "T = (r**2)*mu*(I2-I1)\n", + "T_ =T*w\n", + "W = v*(1000/60)/r\n", + "P = 2*T_*W\n", + "print \"\\n\\nThe roll separating force = %d kN, The power required in the rolling process = %0.2f kW\"%(ceil(F_),P/1000)\n", + "# Answer in the book for the power required in the rolling process is given as 75.6 kW\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The values of P_after are:\n", + "\n", + "0.750 \t\t0.787 \t\t0.829 \t\t0.874 \t\t0.924 \t\t\n", + "\n", + "The values of P_before are:\n", + "\n", + " 0.924 \t\t 0.887 \t\t 0.855 \t\t 0.828 \t\t 0.805 \t\t 0.786 \t\t 0.771 \t\t 0.759 \t\t\n", + "\n", + "The roll separating force = 1908 kN, The power required in the rolling process = 77.38 kW\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 3 on page no. 115" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import pi\n", + "# Given that\n", + "A = 150*6 # Cross-section of strips in mm**2\n", + "w = 150 # Width of the strip in mm\n", + "ti = 6 # Thickness in mm\n", + "pA = 0.20 # Reduction in area\n", + "d = 400 # Diameter of steel rolls in mm\n", + "Ys = 0.35# Shear Yield stress of the material before rolling in KN/mm**2\n", + "Ys_ = 0.4# Shear Yield stress of the material after rolling in KN/mm**2\n", + "mu = 0.1 # Cofficient of friction\n", + "mu_ = 0.005 # Cofficient of friction in bearing \n", + "D = 150 # The diameter of bearing in mm\n", + "v = 30 # Speed of rolling in m/min\n", + "tf =0.8*ti\n", + "Ys_a = (Ys + Ys_)/2\n", + "r=d/2\n", + "thetaI = sqrt((ti-tf)/r)\n", + "lambdaI=2*sqrt(r/tf)*atan(thetaI *sqrt(r/tf))\n", + "lambdaN = (1/2)*((1/mu)*(log(tf/ti)) + lambdaI)\n", + "thetaN =(sqrt(tf/r))*(tan((lambdaN/2)*(sqrt(tf/r))))\n", + "Dtheta_a = thetaN/4\n", + "Dtheta_b = (thetaI- thetaN)/8\n", + "for i in range(0,5,1):\n", + " theta = i*Dtheta_a\n", + " y = (1/2)* (tf+r*theta**2)\n", + " lamda = 2*sqrt(r/tf)*atan(theta*(pi/180) *sqrt(r/tf))*180/pi\n", + " p_a = 2*Ys_a*(2*y/tf)*(exp(mu*lamda))\n", + "\n", + "I1 = (Dtheta_a/3) *(0.75+.925+4*(.788+.876)+2*.830)\n", + "for i in range(0,8,1):\n", + " theta1 = i*Dtheta_b + thetaN\n", + " y = (1/2)* (tf+r*theta1**2)\n", + " lamda = 2*sqrt(r/tf)*atan(theta1*(pi/180) *sqrt(r/tf))*180/pi\n", + " p_b = 2*Ys_a*(2*y/ti)*(exp(mu*(lambdaI-lamda)))\n", + "I2 = (Dtheta_b/3)*(0.925+.75+4*(.887+.828+.786+.759) + 2*(.855+.804+.772))\n", + "F = r*(I1 + I2)\n", + "F_ = F*w\n", + "T = (r**2)*mu*(I2-I1)\n", + "T_ =T*w\n", + "W = v*(1000/60)/r\n", + "P_ = 2*T_*W\n", + "Pl = mu_*F_*D*W\n", + "P = Pl+P_\n", + "print \"The mill power = %0.2f kW\"%(P/1000)\n", + "# Answer in the book is given as 79.18 kW whcih is wrong.\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mill power = 80.95 kW\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 4 on page no. 118" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "mu = 0.25 # Cofficient of friction between the job and the dies \n", + "Y = 7 # Avg yield stress of the lead in N/mm**2\n", + "h = 6 # Height of die in mm\n", + "L = 150 # Length of the strip in mm\n", + "V1 = 24*24*150 # Volume of the strip in mm**3\n", + "V2 = 6*96*150 # Volume of the die in mm**3\n", + "w= 96 # Weidth of the die in mm\n", + "from sympy.mpmath import quad\n", + "K = Y/sqrt(3)\n", + "x_ = (h/(2*mu))*(log(1/(2*mu)))\n", + "l = w/2\n", + "p1= lambda x:(2*K)*exp((2*mu/h)*x)\n", + "I1 = quad(p1,[0,x_])\n", + "p2 = lambda y:(2*K)*((1/2*mu)*(log(1/(2*mu))) + (y/h))\n", + "I2 = quad(p2,[x_,l])\n", + "F = 2*(I1+I2)\n", + "F_ = F*L\n", + "print \"The maximum forging force = %0.2e N\" %F_ \n", + "# Answer in the book is given as 0.54*10**6 N which is wrong.\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum forging force = 4.89e+05 N\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 5 on page no. 119" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "mu = 0.08# Cofficient of friction between the job and the dies \n", + "Y = 7 # Avg yield stress of the lead in N/mm**2\n", + "h = 6 # Height of die in mm\n", + "L = 150 # Length of the strip in mm\n", + "V1 = 24*24*150 # Volume of the strip in mm**3\n", + "V2 = 6*96*150 # Volume of the die in mm**3\n", + "w= 96 # Weidth of the die in mm\n", + "K = Y/sqrt(3)\n", + "x_ = (h/(2*mu))*(log(1/(2*mu)))\n", + "l = w/2\n", + "p1 =lambda x:(2*K)*exp((2*mu/h)*x)\n", + "I = quad(p1,[0,l])\n", + "F = 2*(I)\n", + "F_ = F*L\n", + "print \"The maximum forging force = %0.2e N\"%F_ \n", + "\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum forging force = 2.36e+05 N\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 6 on page no. 122" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "r = 150 # Radius of the circular disc of lead in mm\n", + "Ti = 50 # Initial thickness of the disc in mm\n", + "Tf = 25 # Reduced thickness of the disc in mm\n", + "mu = 0.25# Cofficient of friction between the job and the dies \n", + "K = 4 # Avg shear yield stress of the lead in N/mm**2\n", + "\n", + "R = r*sqrt(2)\n", + "rs = (R - ((Tf/(2*mu)) * log(1/(mu*sqrt(3)))))\n", + "p1 = lambda x:(((sqrt(3))*K)*exp((2*mu/Tf)*(R-x)))*x\n", + "I = quad(p1,[rs,R])\n", + "p2 = lambda y:((2*K/Tf)*(R-y) + ((K/mu)*(1+log(mu*sqrt(3)))))*y\n", + "I_ = quad(p2,[0,rs])\n", + "F = 2*pi*(I+I_)\n", + "print \"The maximum forging force = %0.3e N\"%F \n", + "\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum forging force = 3.649e+06 N\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 7 on page no. 126" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "Di = 12.7 # Intial diameter in mm\n", + "Df = 10.2 # Final diameter in mm\n", + "v = 90 # Drawn speed in m/min\n", + "alpha=6 # Half angle of dia in degree\n", + "mu = 0.1# Cofficient of friction between the job and the dies \n", + "Y = 207 # Tensile yield stress of the steel specimen in N/mm**2\n", + "Y_ = 414 # Tensile yield stress of the similar specimen at strain 0.5 in N/mm**2\n", + "e = 0.5 # Strain\n", + "\n", + "e_ =2* log(Di/Df)\n", + "Y_e = Y + (Y_ - Y)*e_/e\n", + "Y__ = (Y+Y_e)/2\n", + "phi = 1 + (mu/tan(alpha*pi/180))\n", + "Y_f = Y__ * ((phi/(phi-1)) *(1-((Df/Di)**(2*(phi-1)))))\n", + "p = Y_f * (pi/4)*(Df**2)*v/60\n", + "Dmax = 1- (1/(phi**(1/(phi-1))))\n", + "print \"Drawing power = %0.3f kW, \\nThe maximum passible reduction with same die = %0.2f mm\"%(p/1000,Dmax)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Drawing power = 25.530 kW, \n", + "The maximum passible reduction with same die = 0.50 mm\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 8 on page no. 130" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "Ri = 30 # Inside radius of cup in mm\n", + "t = 3 # Thickness in mm\n", + "Rb = 40 # Radius of the blank in mm\n", + "K = 210 # Shear yield stress of the material in N/mm**2\n", + "Y = 600 # Maximum allowable stress in N/mm**2\n", + "Beta = 0.05\n", + "mu = 0.1# Cofficient of friction between the job and the dies \n", + "\n", + "Fh = Beta*pi*(Rb**2)*K\n", + "Y_r = (mu*Fh/(pi*Rb*t))+(2*K*log(Rb/Ri))\n", + "Y_z = Y_r*exp(mu*pi/2)\n", + "F = 2*pi*Ri*t*Y_z\n", + "Y_r_ = Y/exp(mu*pi/2)\n", + "Rp = (Rb/exp((Y_r_/(2*K)) - ((mu*Fh)/(2*pi*K*Rb*t))))-t\n", + "print \"Drawing force = %d N,\\nMinimum passible radius of the cup which can drawn from the given blank without causing a fracture = %0.2f mm\"%(F,Rp)\n", + "# Answer in the book given as 62680 N" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Drawing force = 89210 N,\n", + "Minimum passible radius of the cup which can drawn from the given blank without causing a fracture = 9.20 mm\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 9 on page no. 135" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import cos, sin\n", + "# Given that\n", + "L_ = 20 # Length of the mild steel product in mm\n", + "h = 50 # Height of the mild steel product in mm\n", + "L = 50 # Horizontal length of the mild steel product in mm\n", + "t = 5 # Thickness in mm\n", + "l=25 # Length of the bend in mm\n", + "E = 207 # Modulus of elasticity in kN/mm**2\n", + "n = 517 # Strain hardening rate in N/mm**2\n", + "Y = 345 # Yield stress in N/mm**2\n", + "mu = 0.1# Cofficient of friction\n", + "e = 0.2 # Fracture strain\n", + "theta = 20 # Bend angle in degree\n", + "\n", + "Rp = ((1 /((exp(e) - 1)))-0.82)*t/1.82\n", + "Y_1 = Y+n*e\n", + "Y_2 = Y + n*(log(1+(1/(2.22*(Rp/t)+1))))\n", + "M = ((0.55*t)**2)*((Y/6)+(Y_1/3)) + ((0.45*t)**2)*((Y/6)+(Y_2/3))\n", + "Fmax = (M/l)*(1+(cos((atan(mu))+mu*sin(atan(mu)))))\n", + "Fmax_ = L_*Fmax\n", + "alpha = 90 /((12*(Rp+0.45*t)*M/(E*(10**3)*(t**3)))+1)\n", + "Ls = 2*(((Rp+0.45*t)*pi/4) + 50-(Rp+t))\n", + "print \"Maximum bending force = %d N,\\nThe required puch angle = %0.2f\u00b0,\\nThe stock length = %0.2f mm\"%(Fmax_,alpha,Ls)\n", + "# Answer in the book for maximum bending force is given as 4144 N" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum bending force = 4121 N,\n", + "The required puch angle = 88.68\u00b0,\n", + "The stock length = 89.18 mm\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 10 on page no. 136" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "L_ = 20 # Length of the mild steel product in mm\n", + "h = 50 # Height of the mild steel product in mm\n", + "L = 50 # Horizontal length of the mild steel product in mm\n", + "t = 5 # Thickness in mm\n", + "l=25 # Length of the bend in mm\n", + "E = 207 # Modulus of elasticity in kN/mm**2\n", + "n = 517 # Strain hardening rate in N/mm**2\n", + "Y = 345 # Yield stress in N/mm**2\n", + "mu = 0.1# Cofficient of friction\n", + "e = 0.2 # Fracture strain\n", + "theta = 20 # Bend angle in degree\n", + "F = 3000 # Maximum available force in N\n", + "\n", + "Rp = ((1 /((exp(e) - 1)))-0.82)*t/1.82\n", + "Y_1 = Y+n*e\n", + "Y_2 = Y + n*(log(1+(1/(2.22*(Rp/t)+1))))\n", + "M = ((0.55*t)**2)*((Y/6)+(Y_1/3)) + ((0.45*t)**2)*((Y/6)+(Y_2/3))\n", + "Fmax = (M/l)*(1+(cos((atan(mu))+mu*sin(atan(mu)))))\n", + "Fmax_ = L_*Fmax\n", + "lmin = Fmax_*l/F\n", + "Ls = 2*(((Rp+0.45*t)*pi/4) + 50-(Rp+t))\n", + "lmax = Ls / 2\n", + "Fmax_min = Fmax_*l/lmax\n", + "print \"Minimum value of die length = %0.2f mm,\\nMinimum required capacity of the machine = %d N\"%(lmin,ceil(Fmax_min))\n", + "# Answer in the book is give as 2323 N for Minimum required capacity of the machine\n", + "\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum value of die length = 34.35 mm,\n", + "Minimum required capacity of the machine = 2312 N\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 11 on page no. 141" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "d = 50 # Diameter of the billet in mm\n", + "L =75 # Length of the billet in mm\n", + "D = 10 # Final diameter of billet in mm\n", + "Y = 170 # Avg tensile yield stress for aluminium in N/mm**2\n", + "mu = 0.15 # Cofficient of the friction\n", + "\n", + "l = L - ((d-D)/2)*tan(45*pi/180)\n", + "phi = 1+mu\n", + "Y_x = Y*(phi/(phi-1))*(((d/D)**(2*(phi-1)))-1)\n", + "F = (pi/4)*(d**2)*Y_x + (pi/sqrt(3))*(d*l*Y)\n", + "Pf = pi*Y*(d**2)*((phi/(2*mu))*(((d/D)**(2*mu))-1)-log(d/D)) + (pi/sqrt(3))*Y*d*l\n", + "Loss_f = (Pf/F)*100\n", + "Y_X = Y*4.31*log(d/D)\n", + "F_ = (pi/4)*(d**2)*Y_X + (pi/sqrt(3))*(d*l*Y)\n", + "Pf_1 = (pi/sqrt(3))*Y*(d**2)*(log(d/D))\n", + "Pf_2 = (pi/sqrt(3))*(d*l*Y)\n", + "Pf_ = Pf_1+Pf_2\n", + "Loss_f_ = (Pf_/F_)*100\n", + "print \"Maximum force required for extruding the cylindrical aluminium billet = %d N\"%F\n", + "print \"Percent of the total power input will be lost in friction at the start of the operation = %0.2f %%.\"%(Loss_f_)\n", + "# Answer in the book given as 2436444 N for max force required for extruding the cylindrical aluminium billet\n", + "\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum force required for extruding the cylindrical aluminium billet = 2436266 N\n", + "Percent of the total power input will be lost in friction at the start of the operation = 66.02 %.\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 12 on page no. 149" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "d = 50 # Diameter of the steel sheet in mm\n", + "t = 3 # Thickness of the steel sheet in mm\n", + "e = 1.75 # True fracture strain\n", + "Y = 2.1e3 # True fracture stress for the material in N/mm**2\n", + "\n", + "C_0 = (t/(1.36*exp(e)))*((2*exp(e))-1)/((2.3*exp(e))-1)\n", + "p = t*(1/2.45)*((1.9*exp(e))-1)/((2.56*exp(e))-1)\n", + "F = Y*C_0*pi*d\n", + "W = (1/2)*(F)*(p)*(10**-3)\n", + "print \"The proper clearance between die and punch = %0.2f mm\"%C_0\n", + "print \"Maximum punching force = %0.2f N, \\nEnergy required to punch the hole = %0.2f J\"%(F/1000,W)\n", + "# Answer in the book given as 45.74 J for energy required to punch the hole\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The proper clearance between die and punch = 0.33 mm\n", + "Maximum punching force = 108.61 N, \n", + "Energy required to punch the hole = 48.10 J\n" + ] + } + ], + "prompt_number": 16 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch4_2.ipynb b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch4_2.ipynb new file mode 100644 index 00000000..312554ae --- /dev/null +++ b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch4_2.ipynb @@ -0,0 +1,1189 @@ +{ + "metadata": { + "name": "", + "signature": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter4 - Machining Processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "PROBLEM 4.1 - page 187" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import atan, tan, cos , sin, degrees, pi\n", + "# Given that\n", + "alpha = 10 # Rake angle in Degree\n", + "t = 0.4 # Chip thickness in mm\n", + "T = 0.15 # Uncut chip thickness in mm\n", + "\n", + "r = T/t\n", + "phi = degrees(atan((r*cos(alpha*pi/180))/(1-r*sin(alpha*pi/180))))\n", + "gama = 1/tan(phi*pi/180) + tan((phi-alpha)*pi/180)\n", + "print \"Shear plane angle = %0.1f\u00b0, \\nMagnitude of the shear strain = %0.2f\"%(phi,gama)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Shear plane angle = 21.6\u00b0, \n", + "Magnitude of the shear strain = 2.74\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "PROBLEM 4.2 - page 192" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "t1 = 0.25 # Undercut thickness in mm\n", + "t2 = 0.75 # Chip thickness in mm\n", + "w = 2.5 # Width in mm\n", + "alpha = 0 # Rake angle in Degree\n", + "Fc = 950 # Cutting force in N\n", + "Ft = 475 # Thrust force in N\n", + "\n", + "r = t1/t2\n", + "mu = ((Fc*sin(alpha*pi/180)) + (Ft*cos(alpha*pi/180)))/((Fc*cos(alpha*pi/180))-(Ft*sin(alpha*pi/180)))\n", + "phi = degrees(atan((r*cos(alpha*pi/180))/(1-r*sin(alpha*pi/180))))\n", + "As = t1*w/sin(phi*pi/180)\n", + "Fs = Fc*cos(phi*pi/180) - Ft*sin(phi*pi/180)\n", + "T_s = Fs/As\n", + "print \"\"\"Coefficient of the friction between tool and the chip = %0.1f,\n", + "The ultimate shear stress of the material = %0.1f N/mm**2\"\"\"%(mu,T_s)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficient of the friction between tool and the chip = 0.5,\n", + "The ultimate shear stress of the material = 380.0 N/mm**2\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "PROBLEM 4.3 - page 193" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "alpha = 10 # Rake angle of tool in Degree\n", + "v = 200 # Cutting speed in m/min\n", + "t1 = 0.2 # Uncut thickness in mm\n", + "w = 2 # Width of cut in mm\n", + "mu = 0.5 # Avg value of the cofficient of tbe friction\n", + "T_S = 400 # Shear stress of the work material in N/mm**2\n", + "\n", + "lamda = degrees(atan(mu))\n", + "phi = (90 + alpha - lamda)/2\n", + "Fs = (w*t1*T_S)/(sin(phi*pi/180))\n", + "R = Fs/(cos((phi+lamda-alpha)*pi/180))\n", + "Fc = R*(cos((lamda-alpha)*pi/180))\n", + "Ft = R*(sin((lamda-alpha)*pi/180))\n", + "print \"Shear angle = %0.1f\u00b0, \\nCutting force = %0.f N, \\nThrust force = %d N,\"%(phi,Fc,Ft)\n", + "# Answer in the book for cutting force is given as 420 N and for thrust force is given as 125 N" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Shear angle = 36.7\u00b0, \n", + "Cutting force = 429 N, \n", + "Thrust force = 127 N,\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "PROBLEM 4.4 - page 194" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "alpha = 10 # Rake angle of tool in Degree\n", + "v = 200 # Cutting speed in m/min\n", + "t1 = 0.2 # Uncut thickness in mm\n", + "w = 2 # Width of cut in mm\n", + "mu = 0.5 # Avg value of the cofficient of tbe friction\n", + "T_S = 400 # Shear stress of the work material in N/mm**2\n", + "Cm = 70 # Machining constant in Degree\n", + "lamda = degrees(atan(mu))\n", + "phi = (Cm + alpha - lamda)/2\n", + "Fs = (w*t1*T_S)/(sin(phi*pi/180))\n", + "R = Fs/(cos((phi+lamda-alpha)*pi/180))\n", + "Fc = R*(cos((lamda-alpha)*pi/180))\n", + "Ft = R*(sin((lamda-alpha)*pi/180))\n", + "# Using Lee and Shaffer relation \n", + "phi_ = 45-lamda+alpha\n", + "Fs_ = (w*t1*T_S)/(sin(phi_*pi/180))\n", + "R_ = Fs_/(cos((phi_+lamda-alpha)*pi/180))\n", + "Fc_ = R_*(cos((lamda-alpha)*pi/180))\n", + "Ft_ = R_*(sin((lamda-alpha)*pi/180))\n", + "print \"\"\"Shear angle = %0.1f\u00b0,\n", + "Cutting force = %0.2f N,\n", + "Thrust force = %0.2f N\n", + "Using Lee and Shaffer relation- \n", + " Shear angle = %0.2f\u00b0,\n", + " Cutting force = %0.2f N,\n", + " Thrust force = %0.2f N,\"\"\"%(phi,Fc,Ft,phi_,Fc_,Ft_)\n", + "# Answer in the book for cutting force is given as 486.9 N and for thrust force is given as 144.9 N , When using Lee and Shaffer relation answer in the book for cutting force is given as 481.9 N and for trust force is given as 160.6 N" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Shear angle = 26.7\u00b0,\n", + "Cutting force = 468.57 N,\n", + "Thrust force = 139.37 N\n", + "Using Lee and Shaffer relation- \n", + " Shear angle = 28.43\u00b0,\n", + " Cutting force = 455.48 N,\n", + " Thrust force = 135.48 N,\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "PROBLEM 4.5 - page 196" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "t1 = 0.25 # Uncut thickness in mm\n", + "w = 2.5 # Width of cut in mm\n", + "U_0 = 1.4 # In J/mm**3\n", + "alpha = 0 # Rake angle in degree\n", + "mu = 0.5 # Cofficient of the friction\n", + "T_s = 400 # Shear stress in N/mm**2\n", + "\n", + "lamda = degrees(atan(mu))\n", + "Fc = 1000*(t1*w*U_0)*((t1)**(-.4))\n", + "phi = 45 + alpha - degrees(atan(mu))\n", + "Fc_ = (w*t1*T_s*cos((lamda-alpha)*pi/180))/((sin(phi*pi/180)) *cos((phi+lamda-alpha)*pi/180))\n", + "print \"\"\"The order of magnitude of cutting force = %d N,\n", + "Using Lee and Shaffer relation-\n", + " The order of magnitude of cutting force = %d N.\"\"\"%(Fc,Fc_)\n", + "# Answer in the book for cutting force is given as 1517 N" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The order of magnitude of cutting force = 1523 N,\n", + "Using Lee and Shaffer relation-\n", + " The order of magnitude of cutting force = 999 N.\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "PROBLEM 4.6 - page 199" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import log, sqrt\n", + "# Given that\n", + "v = 2 # Cutting speed in m/sec\n", + "D = 7200 # Density of mild steel in kg /m**3\n", + "k = 43.6 # Thermal conductivity in W/m-\u00b0c\n", + "c = 502 # Specific heat of the material in J/kg-\u00b0c\n", + "t1 = 0.25 # Uncut thickness in mm\n", + "w =2 # Width of cut in mm\n", + "theta_0 = 40 # Initial temp of the workpiece in Degree\n", + "alpha = 0 # Rake angle in degree\n", + "mu = 0.5 # Cofficient of the friction\n", + "T_s = 400e6 # Shear stress in N/m**2\n", + "\n", + "lamda = degrees(atan(mu))\n", + "phi = 45 + alpha - lamda\n", + "Fs = (w*t1*T_s)*(10**-6)/(sin(phi*pi/180))\n", + "R = Fs / (cos((phi+lamda-alpha)*pi/180))\n", + "Fc = R *(cos((lamda-alpha)*pi/180))\n", + "r = sin(phi*pi/180)/(cos((phi-alpha)*pi/180))\n", + "Ft= Fc *(tan((lamda - alpha)*pi/180))\n", + "F = Fc *(sin(alpha*pi/180))+Ft*(cos(alpha*pi/180))\n", + "Ws = F*r*v\n", + "Wp = Fc*v-F*r*v\n", + "zeta = D*c*v*t1*(10**-3)/k\n", + "zeta_ = zeta*tan(phi*pi/180)\n", + "nu = 0.15 *(log(27.5/(zeta_)))\n", + "theta_P = (1-nu)*Wp/(D*c*v*t1*w*(10**-6))\n", + "theta_S = 1.13 *(sqrt(1/(D*c*v*t1*(10**-3)*k*(1+tan((phi-alpha)*pi/180))))*(Ws/w)*(10**3)) \n", + "theta = theta_0+theta_S+ theta_P\n", + "print \" \\n Maximum temperature along the rake face of the tool = %0.1f\u00b0C.\"%theta\n", + "# Answer in the book is given as 823\u00b0C" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " Maximum temperature along the rake face of the tool = 835.6\u00b0C.\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "PROBLEM 4.7 - Page 206" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "theta_ = 40 #Ambient temperature in\u00b0C\n", + "v = 2 # Cutting speed in m/sec\n", + "D = 7200 # Density of mild steel in kg /m**3\n", + "k = 43.6 # Thermal conductivity in W/m-\u00b0c\n", + "c = 502 # Specific heat of the material in J/kg-\u00b0c\n", + "t1 = 0.25 # Uncut thickness in mm\n", + "w =2 # Width of cut in mm\n", + "alpha = 0 # Rake angle in degree\n", + "mu = 0.5 # Cofficient of the friction\n", + "T_s = 400e6 # Shear stress in N/m**2\n", + "H = 350 # Hardness of SAE 1040 steel in HV(Vicker hardness)\n", + "\n", + "lamda = degrees(atan(mu))\n", + "phi = 45 + alpha - lamda\n", + "Fs = (w*t1*T_s)*(10**-6)/(sin(phi*pi/180))\n", + "R = Fs / (cos((phi+lamda-alpha)*pi/180))\n", + "Fc = R *(cos((lamda-alpha)*pi/180))\n", + "r = sin(phi*pi/180)/(cos((phi-alpha)*pi/180))\n", + "Ft= Fc *(tan((lamda - alpha)*pi/180))\n", + "F = Fc *(sin(alpha*pi/180))+Ft*(cos(alpha*pi/180))\n", + "Ws = F*r*v\n", + "Wp = Fc*v-F*r*v\n", + "zeta = D*c*v*t1*(10**-3)/k\n", + "zeta_ = zeta*tan(phi*pi/180)\n", + "nu = 0.15 *(log(27.5/(zeta_)))\n", + "Theta_0v = ((1-nu)*Wp + Ws)/ (D*c*v*t1*w*(10**-6))\n", + "H_ = 1.5 *(H)\n", + "theta_lim = 700*((1-(H_/850))**(1/3.1))\n", + "v_lim = (theta_lim/309)**(1/0.5)\n", + "print \" \\n Maximum speed at which cutting is passible = %0.2f m/sec.\"%v_lim" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " Maximum speed at which cutting is passible = 2.76 m/sec.\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "PROBLEM 4.8 - page 212" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "alpha = 0 # Rake angle in degree\n", + "gama = 3 # Clearance angle in Degree\n", + "w = 1 # Maximum length of flank wear allowed in mm\n", + "gama_ = 7 # Increased clearance angle in Degree\n", + "I_per = (((tan(gama_*pi/180))-(tan(gama*pi/180)))/tan(gama*pi/180))*100\n", + "print \" \\n Percentage increase in tool life = %d percent.\"%I_per" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " \n", + " Percentage increase in tool life = 134 percent.\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 9 on page no. 220" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "d= 4 # Depth of cut in mm\n", + "f = 0.25 # Feed in mm/stroke\n", + "alpha = 10 # Rake angle in degree\n", + "shi = 30 # Principal cutting edge angle in Degree\n", + "mu =0.6 # Cofficient of friction between chip and tool\n", + "T_s = 340 # Ultimate shear stress of cast iron in N/mm**2\n", + "lamda = degrees(atan(mu))\n", + "phi = 45 +alpha-lamda\n", + "Fc = f*d*T_s*(cos((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n", + "Ft = Fc*(sin((lamda-alpha)*pi/180))/(cos((lamda-alpha)*pi/180))\n", + "Ff = Ft*(cos(shi*pi/180))\n", + "Fn = Ft*(sin(shi*pi/180))\n", + "print \"\"\"The three components of machinig force are as follows-\n", + " Thrust force = %d N,\n", + " Feed force component = %d N,\n", + " Normal thrust force component = %d N.\"\"\"%(Ft,Ff,Fn)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The three components of machinig force are as follows-\n", + " Thrust force = 422 N,\n", + " Feed force component = 365 N,\n", + " Normal thrust force component = 211 N.\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 10 on page no. 221" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "d= 4 # Depth of cut in mm\n", + "f = 0.25 # Feed in mm/stroke\n", + "alpha = 10 # Rake angle in degree\n", + "shi = 30 # Principal cutting edge angle in Degree\n", + "mu =0.6 # Cofficient of friction between chip and tool\n", + "T_s = 340 # Ultimate shear stress of cast iron in N/mm**2\n", + "N = 60 # Cutting stroke/min\n", + "L = 200 # Length of the job in mm\n", + "H = 180 # Hardness of the workpiece in BHN\n", + "\n", + "lamda = degrees(atan(mu))\n", + "phi = 45 +alpha-lamda\n", + "Fc = f*d*T_s*(cos((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n", + "Fc_ = Fc*(L/1000)\n", + "Wav =Fc_*N/60\n", + "t1 = f*cos(shi*pi/180)\n", + "U_0 = 0.81 # By using table 4.4 given in the book, In J/mm**3\n", + "Uc = U_0*((t1)**(-.4))\n", + "Q = f*d*L*N/60\n", + "Wav_ = Uc*Q\n", + "print \"Avg power consumption = %d W,\\nSpecific power consumption when hardness of the workpiece is 180 BHN = %d W.\"%(Wav,Wav_)\n", + "# Answer in the book for Specific power consumption is given as 294 W" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Avg power consumption = 220 W,\n", + "Specific power consumption when hardness of the workpiece is 180 BHN = 298 W.\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 11 on page no. 224" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "alpha_b = 6 # Back rake angle in Degree\n", + "alpha_s = 10 # Side rake angle in Degree\n", + "gama = 7 # Front clearance angle in Degree\n", + "gama_ = 7 # Side clearance angle in Degree\n", + "Shi = 10 # End cutting edge angle in Degree\n", + "shi = 30 # Side cutting edge angle in Degree\n", + "r= 0.5 # Nose radius in mm\n", + "\n", + "k = tan(alpha_b*pi/180) * cos(shi*pi/180) - tan(alpha_s*pi/180) * sin(shi*pi/180)\n", + "print \"The value of k=%0.4f,which is near to 0. Hence the case is close to orthogonal one.\\n\"%k\n", + "alpha= degrees(atan(((tan(alpha_b*pi/180)) * sin(shi*pi/180) ) + (tan(alpha_s*pi/180) * (cos(shi*pi/180))))/ (sqrt(1+((tan(alpha_b*pi/180)*cos(shi*pi/180)) - (tan(alpha_s*pi/180)*sin(shi*pi/180)))**(2))))\n", + "print \"Normal rake angle = %0.1f\u00b0.\"%(alpha)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of k=0.0029,which is near to 0. Hence the case is close to orthogonal one.\n", + "\n", + "Normal rake angle = 11.6\u00b0.\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 12 on page no. 225" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import ceil\n", + "# Given that\n", + "alpha_b = 6 # Back rake angle in Degree\n", + "alpha_s = 10 # Side rake angle in Degree\n", + "gama = 5 # Front clearance angle in Degree\n", + "gama_ = 7 # Side clearance angle in Degree\n", + "Shi = 10 # End cutting edge angle in Degree\n", + "shi = 30 # Side cutting edge angle in Degree\n", + "r= 0.55 # Nose radius in mm\n", + "d = 2.5 # Depth of cut in mm\n", + "f = 0.125 # Feed in mm/revolution\n", + "N = 300 # Rpm of the job\n", + "T_S = 400 # Ultimate shear stress of the workpiece in N/mm**2\n", + "mu = .6 # Cofficient of the friction between the tool and the chip\n", + "\n", + "lamda = degrees(atan(mu))\n", + "alpha= degrees(atan(((tan(alpha_b*pi/180)) * sin(shi*pi/180) ) + (tan(alpha_s*pi/180) * (cos(shi*pi/180))))/ (sqrt(1+((tan(alpha_b*pi/180)*cos(shi*pi/180)) - (tan(alpha_s*pi/180)*sin(shi*pi/180)))**(2))))\n", + "phi = 45 + alpha - lamda\n", + "t1 = f*cos(phi*pi/180)\n", + "w = d/cos(phi*pi/180)\n", + "Fc = w*t1*T_S*(cos((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n", + "Ft = Fc*tan((lamda-alpha)*pi/180)\n", + "Ff = Ft*cos(shi*pi/180)\n", + "Fr = Ft*sin(shi*pi/180)\n", + "print \"Component of the machining force are as follows -\\n Feed force component = % d N, \\n Normal thrust force component = % d N.\"%(ceil(Ff),ceil(Fr))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Component of the machining force are as follows -\n", + " Feed force component = 118 N, \n", + " Normal thrust force component = 68 N.\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 14 on page no. 230" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "D = 20 # Nominal diameter of the drill in mm\n", + "T_S = 400 # Shear yield stress of work material in N/mm**2\n", + "N = 240 # Rpm\n", + "f = 0.25 # Feed in mm/revolution\n", + "mu = 0.6 # Cofficient of friction\n", + "\n", + "Beta = 118/2 # From the table 4.12 given in the book\n", + "shi = 30 # From the table 4.12 given in the book\n", + "alpha = degrees(atan(((2*(D/4)/(D)))*tan(shi*pi/180))/sin(Beta*pi/180))\n", + "t1 = (f/2)*sin(Beta*pi/180)\n", + "w = (D/2)/sin(Beta*pi/180)\n", + "lamda = degrees(atan(mu))\n", + "phi = 45+alpha-lamda\n", + "t1 = f/2\n", + "Fc = w*t1*T_S*(cos((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n", + "Ft = w*t1*T_S*(sin((lamda-alpha)*pi/180))/((sin(phi*pi/180))*(cos((phi+lamda-alpha)*pi/180)))\n", + "M = .6*Fc*D/1000\n", + "F = 5*Ft*sin(Beta*pi/180)\n", + "print \"The drilling torque = %0.2f N-m, \\nThrust force = %d N.\"%(M,F)\n", + "# Answer in the book for drilling torque is given as 18.2 N-m, and for thrust force is given as 1500 N" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The drilling torque = 17.85 N-m, \n", + "Thrust force = 1376 N.\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 15 on page no. 235" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import asin\n", + "# Given that\n", + "w = 20 # Width of the mild steel block in mm\n", + "Z = 20 # No of teeth in milling cutter\n", + "D = 50 # Diameter of the milling cutter in mm\n", + "alpha = 10 # Radial rake angle in Degree\n", + "f = 15 # Feed velocity of the table in mm/min\n", + "N =60 # Rpm of the cutter\n", + "t = 1 # Depth of cut in mm\n", + "mu = 0.5 # Cofficient of friction\n", + "T_s = 400 # Shear yield stress in N/mm**2\n", + "t_a = 0.0018 # Avg uncut thickness in mm\n", + "\n", + "Beta = degrees(asin(2*(t/D)))\n", + "theta = 2*pi/Z\n", + "t1_max = (2*f/(N*Z))*sqrt(t/D)\n", + "lamda = degrees(atan(mu))\n", + "phi = 45+alpha -lamda\n", + "Fc_max = ((w*t1_max*T_s*cos((lamda-alpha)*pi/180)))/((sin(phi*pi/180))*(cos(45*pi/180)))\n", + "T_max = Fc_max*D/(2*1000)\n", + "M_av = (1/2)*(Beta*T_max)/theta\n", + "omega = 2*pi*N/60\n", + "U_0 = 1.4 # From the table 4.4 given in the book\n", + "Uc_ms = U_0*((t_a)**(-0.4))\n", + "R = f*t*w/60\n", + "U = Uc_ms * R\n", + "print \"Power consumption = %0.1f W.\"%U" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power consumption = 87.7 W.\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 16 on page no. 238" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "w = 20 # Width of the mild steel block in mm\n", + "Z = 10 # No of teeth in milling cutter\n", + "D = 75 # Diameter of the milling cutter in mm\n", + "alpha = 10 # Radial rake angle in Degree\n", + "f = 100 # Feed velocity of the table in mm/min\n", + "N =60 # Rpm of the cutter\n", + "t = 5 # Depth of cut in mm\n", + "mu = 0.5 # Cofficient of friction\n", + "T_s = 400 # Shear yield stress in N/mm**2\n", + "t_a = 0.043 # Avg uncut thickness in mm\n", + "\n", + "Beta = degrees(asin(2*(t/D)))\n", + "theta = 2*pi/Z\n", + "t1_max = (2*f/(N*Z))*sqrt(t/D)\n", + "lamda = degrees(atan(mu))\n", + "phi = 45+alpha -lamda\n", + "Fc_max = ((w*t1_max*T_s*cos((lamda-alpha)*pi/180)))/((sin(phi*pi/180))*(cos(45*pi/180)))\n", + "T_max = Fc_max*D/(2*1000)\n", + "M_av = (1/2)*(Beta*T_max)/theta\n", + "omega = 2*pi*N/60\n", + "U_0 = 1.4 # From the table 4.4 given in the book\n", + "Uc_ms = U_0*((t_a)**(-0.4))\n", + "R = f*t*w/60\n", + "U = Uc_ms * R\n", + "print \"Power required = %d W.\"%U\n", + "# Answer in the book for Power required is given as 817 W" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power required = 821 W.\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 17 on page no. 240" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "B = 20 # Width of the cut in mm\n", + "Z = 10 # No of teeth in milling cutter\n", + "D = 75 # Diameter of the milling cutter in mm\n", + "alpha = 10 # Radial rake angle in Degree\n", + "f = 25 # Feed velocity of the table in mm/min\n", + "N =60 # Rpm of the cutter\n", + "t = 5 # Depth of cut in mm\n", + "mu = 0.5 # Cofficient of friction\n", + "T_s = 400 # Shear yield stress in N/mm**2\n", + "t_a = 0.043 # Avg uncut thickness in mm\n", + "t1_max = 0.01\n", + "lamda = 0.28 # From the table 4.13 Given in the book\n", + "nu = 1400 # From the table 4.13 Given in the book\n", + "t1_av = t1_max/2\n", + "P = nu*B*t*f*(10**-4)/(6*((t1_av)**(lamda)))\n", + "print \"Power required = %0.2f W.\"%P" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power required = 257.16 W.\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 18 on page no. 240" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "w = 20 # Width of the mild steel block in mm\n", + "Z = 10 # No of teeth in milling cutter\n", + "D = 75 # Diameter of the milling cutter in mm\n", + "alpha = 10 # Radial rake angle in Degree\n", + "f = 25 # Feed velocity of the table in mm/min\n", + "N =60 # Rpm of the cutter\n", + "t = 5 # Depth of cut in mm\n", + "mu = 0.5 # Cofficient of friction\n", + "T_s = 400 # Shear yield stress in N/mm**2\n", + "t_a = 0.043 # Avg uncut thickness in mm\n", + "\n", + "R = f*t*w/60\n", + "Uc = 3.3 # Specific energy in J/mm**3 from the table 4.14 Given in the book\n", + "U = Uc * R\n", + "print \"Power required = %d W.\"%ceil(U)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power required = 138 W.\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 19 on page no. 241" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "d = 25 # Diameter of circular hole in mm\n", + "t = 20 # Thickness of the steel plate in mm\n", + "D = 27 # Enlarged diameter of hole in mm\n", + "c= 0.08 # Cut per tooth in mm\n", + "alpha = 10 # Radial rake angle in Degree\n", + "mu = 0.5 # Cofficient of friction\n", + "T_s = 400 # Shear yield stress in N/mm**2\n", + "\n", + "lamda=degrees(atan(mu))\n", + "phi = 45-lamda+alpha\n", + "w = pi*(d+D)/2\n", + "Fc = w*c*T_s*(cos((lamda-alpha)*pi/1800)/((sin(phi*pi/180))*(cos(45*pi/180))))\n", + "s = 1.75*sqrt(t)\n", + "F = 3*Fc\n", + "print \"Peak broaching load = %d N.\"%ceil(F)\n", + "# Answer in the book is given as 22323 N which is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Peak broaching load = 23280 N.\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 20 on page no. 246" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "D = 250 # Diameter of the wheel in mm\n", + "N = 2000 # Rpm of the wheel\n", + "f =5 # Plung feed rate in mm/min\n", + "C = 3 # Surface density of active grain in mm**-2\n", + "A = 20*15 # Area of mild steel prismatic bar in mm**2\n", + "rg = 15 # In mm**-1\n", + "\n", + "t1 = sqrt(f/(pi*D*N*C*rg))\n", + "U_0 = 1.4 # From the table 4.4 given in the book\n", + "Uc= U_0*((t1)**(-.4))\n", + "R = A*f/60\n", + "P = Uc*R\n", + "Fc_ = 60000*(P)/(pi*D*A*C*N)\n", + "print \"Power requirement during plunge grinding of the mild steel primatic bar = %d W.\"%ceil(P)\n", + "# Answer in the book is given as 94 W which is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power requirement during plunge grinding of the mild steel primatic bar = 943 W.\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 21 on page no. 248" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "w = 25 # Width of mild steel block in mm\n", + "d= 0.05 # Depth of cut in mm\n", + "D = 200 # Diameter of the wheel in mm\n", + "N = 3000 # Rpm of the wheel\n", + "f =100 # Feed velocity of table in mm/min\n", + "C = 3 # No of grits in mm**-2\n", + "rg = 15 # In mm**-1\n", + "\n", + "t1_max = sqrt(((6*f)/(pi*D*N*C*rg))*sqrt(d/D))\n", + "t1_a = t1_max/2\n", + "U_0 = 1.4 # From the table 4.4 given in the book\n", + "Uc= U_0*((t1_a)**(-.4))\n", + "R = w*d*f/60\n", + "P = Uc*R\n", + "Fc = 60000*(P)/(pi*D*N)\n", + "print \"Grinding force = %d N\"%Fc" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Grinding force = 3 N\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 22 on page no. 251" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "d= 0.05 # Depth of cut in mm\n", + "f =200 # Feed rate in mm/min\n", + "theta = 850 # Surface temperature in \u00b0C\n", + "Theta = 700 # Maximum surface temperature of workpiece surface required to maintain in \u00b0C\n", + "\n", + "K = theta * (f**0.2)/(d**0.9)\n", + "r = Theta/K\n", + "C = d*f\n", + "Dm = (r*C**0.2)**(1/1.1)\n", + "fm = C/Dm\n", + "print \"Required depth of cut = %f mm,\\nRequired feed = %d mm/min\"%(Dm,fm)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required depth of cut = 0.041910 mm,\n", + "Required feed = 238 mm/min\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 24 on page no. 260" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that \n", + "shi = 30 # Side cutting edge angle in Degree\n", + "lamda = 7 # End cutting edge angle in Degree\n", + "r = 0.7 # Nose radius in mm\n", + "f = 0.125 # Feed in mm\n", + "H_max = f/(tan(shi*pi/180)+1/tan(lamda*pi/180))\n", + "H_max_ = (f**2)/(8*r)\n", + "print \"Maximum height of uneveness in first tool case = %0.3f mm,\\nIn second tool case = %0.4f mm\"%(H_max,H_max_)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum height of uneveness in first tool case = 0.014 mm,\n", + "In second tool case = 0.0028 mm\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 25 on page no. 262" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that \n", + "Z = 12 # No of teeth\n", + "d = 100 # Diameter of cutter in mm\n", + "N = 60 # Rpm of cutter\n", + "f = 25 # Table feed in mm/min\n", + "\n", + "H_max = (f**2)/(4*d*(N**2)*(Z**2))\n", + "print \"Maximum height of uneveness = %f mm\"%H_max" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum height of uneveness = 0.000003 mm\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 26 on page no. 268" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that \n", + "n = 0.25 # Value of exponent of time in Taylor's tool life equation\n", + "C = 75 # Value of constant in Taylor's tool life equation\n", + "Lc = .15 # Labour cast in $/min\n", + "Tc = 2.50 # Total cast of tool in $\n", + "t = 2 # Change time for tool in min\n", + "\n", + "x = (C)**(1/n) # Where x = k/(f**(1/n))\n", + "v_opt = ((n*x*Lc)/((1-n)*((Lc*t+Tc))))**(n)\n", + "print \"Cutting speed that will be lead to minimum cast = %0.2f m/min\"%v_opt" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cutting speed that will be lead to minimum cast = 27.42 m/min\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 27 on page no. 269" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that \n", + "L = 300 # Length of the bar in mm\n", + "d=30 # Diameter of the bar in mm\n", + "f_max = 0.25 # Maximum allowable feed in mm/revolution\n", + "Lc = .25 # Labour and overhead cast in $/min\n", + "Tc = 2 # Regrinding cast in $\n", + "t = 1 # Change time for tool in min\n", + "C_X = 2.50 # Cast of tool of material X per piece in $ \n", + "C_Y = 3 # Cast of tool of material Y per piece in $\n", + "n_x = 0.1 # Value of exponent of time in Taylor's tool life equation for material X\n", + "n_y = 0.16 # Value of exponent of time in Taylor's tool life equation for material Y\n", + "C_x = 30 # Value of constant in Taylor's tool life equation for material X\n", + "C_y = 76 # Value of constant in Taylor's tool life equation For material Y\n", + "\n", + "x_x = (C_x)**(1/n_x) # Where x = k/(f**(1/n))\n", + "v_opt_x = ((n_x*x_x*Lc)/((1-n_x)*((Lc*t+Tc))))**(n_x)\n", + "Rmin_x = C_X+Lc*t+(Lc*pi*L*d/(1000*f_max*v_opt_x)) + (Lc*t*(pi*L*d/(1000*x_x)))*(v_opt_x**(1/n_y))*(v_opt_x**-1)*(f_max**-1)+(Tc*((pi*L*d/(1000*x_x)))*(v_opt_x**(1/n_x))*(v_opt_x**-1)*(f_max**-1))\n", + "x_y = (C_y)**(1/n_y) # Where x = k/(f**(1/n))\n", + "v_opt_y = ((n_y*x_y*Lc)/((1-n_y)*((Lc*t+Tc))))**(n_y)\n", + "Rmin_y = C_Y+Lc*t+(Lc*pi*L*d/(1000*f_max*v_opt_y)) + (Lc*t*(pi*L*d/(1000*x_y)))*(v_opt_y**(1/n_y))*(v_opt_y**-1)*(f_max**-1)+(Tc*((pi*L*d/(1000*x_y)))*(v_opt_y**(1/n_y))*(v_opt_y**-1)*(f_max**-1))\n", + "print \"The minimum cost per piece\\n When material X is used = %0.2f $,\\n When material Y is used = %0.2f $\"%(Rmin_x,Rmin_y)\n", + "print \"So material Y will be suitable for tool as it has low cast\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The minimum cost per piece\n", + " When material X is used = 4.36 $,\n", + " When material Y is used = 4.07 $\n", + "So material Y will be suitable for tool as it has low cast\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 28 on page no. 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that \n", + "n = 0.25 # Value of exponent of time in Taylor's tool life equation\n", + "C = 75 # Value of constant in Taylor's tool life equation\n", + "Lc = .15 # Labour cast in $/min\n", + "Tc = 2.50 # Total cast of tool in $\n", + "t = 2 # Change time for tool in min\n", + "x = (C)**(1/n) # Where x = k/(f**(1/n))\n", + "v_opt = ((n*x)/((1-n)*t))**(n)\n", + "print \"Optimum cutting speed for maximum production rate for the job = %0.2f m/min\"%(v_opt)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Optimum cutting speed for maximum production rate for the job = 47.92 m/min\n" + ] + } + ], + "prompt_number": 26 + } + ], + "metadata": {} + } + ] +} diff --git a/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch5_2.ipynb b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch5_2.ipynb new file mode 100644 index 00000000..dc74bcad --- /dev/null +++ b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch5_2.ipynb @@ -0,0 +1,191 @@ +{ + "metadata": { + "name": "", + "signature": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-5, Joining Processes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 1 on page no. 285" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from sympy import symbols, diff, solve\n", + "from __future__ import division\n", + "# Given that\n", + "A = 20 # Value of A in voltage length characteristic equation\n", + "B = 40 # Value of B in voltage length characteristic equation\n", + "v= 80 # Open circuit voltage in V\n", + "I = 1000 # Short circuit current in amp\n", + "\n", + "l, I=symbols(\"l I\")\n", + "i = ((v-A)-(B* l))*(I/v)\n", + "V_given = (A+B*l)# Given in the question\n", + "V_cal = v-v/1e3*I # Volts # power source characteristic\n", + "# equating both V gives I\n", + "I = (v-(A+B*l))/(v/1e3) # A\n", + "P = V_given*I\n", + "#k = derivat(P)\n", + "k = diff(P,l)\n", + "#L=roots(k)\n", + "L=solve(k,l)[0]\n", + "I = (v-(A+B*L))/(v/1e3) # A\n", + "#Pmax=((v-A)-(B* L))*(I/v)*(A+B*L)\n", + "V_given = (A+B*L)\n", + "Pmax = V_given*I\n", + "print \"Maximum power of the arc = %0.f kVA\"%(Pmax/1000)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum power of the arc = 20 kVA\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 2 on page no. 288" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import pi\n", + "# Given that\n", + "N =25 # No. of bridges per cm**2\n", + "r = 0.1 # Radius of bridge in mm\n", + "rho = 2e-5 # Resistivity of the material in ohm-cm\n", + "v= 5 # Applied voltage in V\n", + "Rc = 0.85*rho/(N*pi*r*0.1)\n", + "Q = (v**2)/Rc\n", + "print \"Rate of heat generated per unit area = %0.2e W/cm**2\"%(Q)\n", + "# Answer in the book is given as 1.136e5 W/cm**2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Rate of heat generated per unit area = 1.15e+06 W/cm**2\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem on page no. 292" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sin\n", + "# Given that\n", + "P = 2.5 # Power in kVA\n", + "t = 3 # Thickness of steel plate in mm\n", + "T = 85 # Percentage of total time when arc is on\n", + "alpha = 1.2e-5 # Thermal diffusivity of steel in m**2/sec\n", + "k = 43.6 # Thermal conductivity of steel in W/m-\u00b0C\n", + "theta_ = 1530 # Melting point of steel in \u00b0C\n", + "theta = 30 # Ambient temperature in \u00b0C\n", + "gama = 60 # Angle in degree\n", + "\n", + "C = T/100\n", + "Q = C*P*10**3\n", + "w = t/sin(gama*pi/180)\n", + "theta_m = theta_ - theta\n", + "v_max = (4*alpha/(w*(10**-3)))*((Q/(8*k*theta_m*t*(10**-3)))-0.2)\n", + "print \"Maximum passible welding speed = %0.4f m/sec\"%(v_max)\n", + "# Answer in the book is given as 0.0146 m/sec" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum passible welding speed = 0.0160 m/sec\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 4 on page no. 303" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "t = 1.2 # Thickness of aluminium sheet in mm\n", + "t_ = 0.25 # Adhesive thickness in mm\n", + "l = 12 # Overlapped length in mm\n", + "E = 703 # Modulus of elastisity in N/mm**2\n", + "G = 11.9 # Shear modulus of adhesive in N/mm**2\n", + "T_S = 0.6 # Ultimate shear stress in N/mm**2\n", + "\n", + "K = (((l**2)*G)/(2*E*t*t_))**(1/2)\n", + "T = T_S/K\n", + "print \"The maximum shear stress the lap joint can withstand = %0.4f N/mm**2\"%(T)\n", + "# Answer in the book is given as 0.274 N/mm**2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The maximum shear stress the lap joint can withstand = 0.2977 N/mm**2\n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +} diff --git a/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch6_2.ipynb b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch6_2.ipynb new file mode 100644 index 00000000..818587af --- /dev/null +++ b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch6_2.ipynb @@ -0,0 +1,654 @@ +{ + "metadata": { + "name": "", + "signature": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-6, Unconventional Machining Process" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 1 on page no. 332" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import pi, sqrt\n", + "from __future__ import division\n", + "# Given that\n", + "a = 5 # Side of the square hole in mm\n", + "t = 4 # Thickness of tungsten plate in mm\n", + "d = 0.01 # Diameter of abraisive grains in mm\n", + "F = 3.5 # Force for feeding in N\n", + "A =25e-3 # Amplitude of tool oscillation in mm\n", + "f = 25e3 # Frequency in Hz\n", + "Hw = 6900 # Fracture hardness of WC in N/mm**2\n", + "\n", + "Z = (1/2)*(4*a**2)/(pi*d**2)\n", + "lamda = 5\n", + "d1 = (d**2)\n", + "h_w = (sqrt((8*F*A)/(pi*Z*d1*Hw*(1+lamda))))\n", + "Q = (2/3)*((d1*h_w)**(3/2))*Z*f*pi\n", + "t = (a**2)*t/(Q*60)\n", + "print \"The approximate time required = %0.2f min\"%(t)\n", + "# Answer in the book is given as 13.66 min" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The approximate time required = 14.26 min\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 2 on page no. 334" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "r = 1/3 # Ratio of hardness values of copper and steel\n", + "R_Q = (r)**(3/4)\n", + "R_t = 1/R_Q\n", + "P_R = (1-(1/R_t))*100\n", + "print \"Percentage change in cutting time when tool is changed from coppper to steel = %d percent(reduction)\"%(P_R)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage change in cutting time when tool is changed from coppper to steel = 56 percent(reduction)\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 3 on page no. 345" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "m = 5 # Romoval rate in cm**3/min\n", + "A = 56 # Atomic gram weight in gm\n", + "Z = 2 # Valence at which dissolation takes place\n", + "D = 7.8 # Density of iron in gm/cm**3\n", + "I = (m/60)*(D*Z*96500)/(A)\n", + "print \"Current required = %d amp\"%(I)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Current required = 2240 amp\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 4 on page no. 345" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "I = 1000 # Current in amp\n", + "p1 = 72.5 # Percentage(by weight) of Ni in Nimonic 75 alloy\n", + "p2 = 19.5 # Percentage(by weight) of Cr in Nimonic 75 alloy\n", + "p3 = 5 # Percentage(by weight) of Fe in Nimonic 75 alloy\n", + "p4 = 0.4 # Percentage(by weight) of Ti in Nimonic 75 alloy\n", + "p5 = 1 # Percentage(by weight) of Si in Nimonic 75 alloy\n", + "p6 = 1 # Percentage(by weight) of Mn in Nimonic 75 alloy\n", + "p7 = 6 # Percentage(by weight) of Cu in Nimonic 75 alloy\n", + "# From the table 6.3 given in the book\n", + "D1 = 8.9 # Density of Ni in g/cm**3\n", + "D2 = 7.19 # Density of Cr in g/cm**3\n", + "D3 = 7.86 # Density of Fe in g/cm**3\n", + "D4 = 4.51 # Density of Ti in g/cm**3\n", + "D5 = 2.33 # Density of Si in g/cm**3\n", + "D6 = 7.43 # Density of Mn in g/cm**3\n", + "D7 = 8.96 # Density of Cu in g/cm**3\n", + "A1 = 58.71 # Gram atomic weight of Ni in gm\n", + "A2 = 51.99 # Gram atomic weight of Cr in gm\n", + "A3 = 55.85 # Gram atomic weight of Fe in gm\n", + "A4 = 47.9 # Gram atomic weight of Ti in gm\n", + "A5 = 28.09 # Gram atomic weight of Si in gm\n", + "A6 = 54.94 # Gram atomic weight of Mn in gm\n", + "A7 = 63.57 # Gram atomic weight of Cu in gm\n", + "Z1 = 2 # Valence of dessolation for Ni\n", + "Z2 = 2 # Valence of dessolation for Cr\n", + "Z3 = 2 # Valence of dessolation for Fe\n", + "Z4 = 3 # Valence of dessolation for Ti\n", + "Z5 = 4 # Valence of dessolation for Si\n", + "Z6 = 2 # Valence of dessolation for Mn\n", + "Z7 = 1 # Valence of dessolation for Cu\n", + "# Above values are given in table 6.3 in the book\n", + "D = 100/((p1/D1)+(p2/D2)+(p3/D3)+(p4/D4)+(p5/D5)+(p6/D6)+(p7/D7))\n", + "Q = ((0.1035*(10**-2))/D)*(1/((p1*Z1/A1)+(p2*Z2/A2)+(p3*Z3/A3)+(p4*Z4/A4)+(p5*Z5/A5)+(p6*Z6/A6)+(p7*Z7/A7)))\n", + "R = Q*I*60\n", + "print \"Removal rate = %0.1f cm**3/min\"%(R)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Removal rate = 2.2 cm**3/min\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 5 on page no. 352" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "V = 10 # DC supply voltage in Volt\n", + "k = 0.2 # Conductivity of electrolyte in ohm**-1-cm**-1\n", + "f = 0.1 # Feed rate in m/min\n", + "Vo = 1.5 # Total overvoltage in Volt\n", + "F = 96500 # Faraday constant in coulombs per mole\n", + "\n", + "A = 55.85 # Atomic gram weight of iron in gm\n", + "Z = 2 # Valency of dissolation of iron\n", + "rho = 7.86 # Density of iron in gm/cm**3\n", + "Yc = k*A*(V-Vo)/(rho*Z*F*(f/60))\n", + "print \"Equilibrium gap = %0.2f cm\"%(Yc)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equilibrium gap = 0.04 cm\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 6 on page no. 353" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "S_I1 = 5 # Surface irregulation in micro meter\n", + "S_I2 = 8 # Surface irregulation in micro meter\n", + "V = 12 # DC supply voltage in Volt\n", + "k = 0.2 # Conductivity of electrolyte in ohm**-1-cm**-1\n", + "Vo = 1.5 # Total overvoltage in Volt\n", + "F = 96500 # Faraday constant in coulombs per mole\n", + "Y_min = (S_I1+S_I2)*(10**(-4))\n", + "A = 55.85 # Atomic gram weight of iron in gm\n", + "Z = 2 # Valency of dissolation of iron\n", + "D = 7.86 # Density of iron in gm/cm**3\n", + "f_max = (k*A*(V-Vo)/(Z*D*F*Y_min))*60\n", + "print \"Largest passible feed rate = %0.1f mm/min\"%(f_max*10)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Largest passible feed rate = 35.7 mm/min\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 7 on page no. 355" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "f = 0.2 # Feed rate in cm/min\n", + "l = 2.54 # Length of tool face in cm\n", + "w = 2.54 # Width of tool face in cm\n", + "T_b = 95 # Boiling temperature of electrolyte in \u00b0C\n", + "Nita = 0.876e-3 # Viscosity of electrolyte in kg/m-sec\n", + "D_e = 1.088 # Density of electrolyte in g/cm**3\n", + "c = .997 # Specific heat of electrolyte\n", + "V = 10 # DC supply voltage in Volt\n", + "k = 0.2 # Conductivity of electrolyte in ohm**-1-cm**-1\n", + "T = 35 # Ambient temperature in \u00b0C\n", + "Vo = 1.5 # Total overvoltage in Volt\n", + "F = 96500 # Faraday constant in coulombs per mole\n", + "A = 55.85 # Atomic gram weight of iron in gm\n", + "Z = 2 # Valency of dissolation of iron\n", + "D = 7.86 # Density of iron in gm/cm**3\n", + "Ye = k*A*(V-Vo)*60/(D*Z*F*f)\n", + "J = k*(V-Vo)/(Ye)\n", + "D_T = T_b -T\n", + "v = (J**2)*(l)/(k*D_T*D_e*c)\n", + "Re = ((D_e*v*2*Ye)/Nita)*(0.1)\n", + "p = 0.3164*D_e*(v**2)*l/(4*Ye*(Re**0.25))*(10**-4)\n", + "A = l*w\n", + "F = p*A*(10**-1)*(1/2)\n", + "print \"Total force acting on the tool = %d N\"%(F)\n", + "# Answer in the book is given as 79 N" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total force acting on the tool = 103 N\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 9 on page no. 378" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import log\n", + "# Given that\n", + "a = 10 # Side length of a square hole in mm\n", + "t = 5 # Thickness of low carbon steel plate in mm\n", + "R = 50 # Resistance in relaxation circuit in ohm\n", + "C = 10 # Capacitance in relaxation circuit in micro F\n", + "V = 200 # Supply voltage in Volt\n", + "V_ = 150 # Minimum required voltage for discharge in Volt\n", + "\n", + "E = (1/2)*C*(10**-6)*(V_**2)\n", + "tc = R*C*(10**-6)*log(V/(V-V_))\n", + "W = (E/tc)*(10**-3)\n", + "v = t*a**2\n", + "Q = 27.4*(W**(1.54))\n", + "T = v/Q\n", + "print \"The time required to complete the drilling operation = %d min\"%(T)\n", + "# Answer in the book is given as 306 min" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The time required to complete the drilling operation = 300 min\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 10 on page no. 382" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "R = 50 # Resistance in relaxation circuit in ohm\n", + "C = 10 # Capacitance in relaxation circuit in micro F\n", + "V = 200 # Supply voltage in Volt\n", + "V_ = 150 # Minimum required voltage for discharge in Volt\n", + "E = (1/2)*C*(10**-6)*(V_**2)\n", + "tc = R*C*(10**-6)*log(V/(V-V_))\n", + "W = (E/tc)*(10**-3)\n", + "Q = 27.4*(W**(1.54))\n", + "Hrms = 1.11*(Q**0.384)\n", + "print \"Surface roughness = %0.3f micro meter\"%(Hrms)\n", + "# Answer in the book is given as 5.16 micro meter which is wrong" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Surface roughness = 1.350 micro meter\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 11 on page no. 391" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "w = 150 # Width of slot in micro meter\n", + "t = 1 # Thickness of tungsten sheet in mm\n", + "P = 5 # Power of electron beam in KW\n", + "C = 12 # Specific power consumption for tugsten in W/(mm**3/min) from the table 6.7 given in the book \n", + "v = (P*(1000)/C)*(1000/(w*t))*(1/600)\n", + "print \"Speed of cutting = %0.1f cm/sec\"%(v)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of cutting = 4.6 cm/sec\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 12 on page no. 392" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import ceil\n", + "# Given that\n", + "V = 150e3 # Acceleration voltage in V\n", + "D = 76e-7 # Density of steel in kg/mm**3\n", + "Delta = 2.6*(10**-17)*((V**2)/D)\n", + "print \"Electron range = %d micro meter\"%(ceil(Delta*(10**3)))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Electron range = 77 micro meter\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 13 on page no. 395" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "w = 0.015 # Width of slot in cm\n", + "t = 1 # Thickness of tungsten sheet in mm\n", + "P = 5e3 # Power of electron beam in W\n", + "rho_c = 2.71 # Value of volume specific heat for tugsten in J/cm**3\n", + "k = 2.15 # Thermal conductivity of tungsten in W/cm-\u00b0C\n", + "T_m = 3400 # Melting temperture in \u00b0C\n", + "Z = t/10 # In cm\n", + "v = (0.1**2)*(P**2)/((T_m**2)*(Z**2)*(k*w*rho_c))\n", + "print \"Speed of cutting = %0.1f cm/sec\"%(v)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of cutting = 24.7 cm/sec\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 14 on page no. 399" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "I = 1e5 # Power intensity of laser beam in W/mm**2\n", + "T_m = 3400 # Melting temperture of tungsten in \u00b0C\n", + "rho_c = 2.71 # Value of volume specific heat for tugsten in J/cm**3\n", + "k = 2.15 # Thermal conductivity of tungsten in W/cm-\u00b0C\n", + "p_a = 10 # Percentage of beam absorbed\n", + "alpha = k/rho_c\n", + "H = (p_a/100)*(I)*(100)\n", + "tm = (pi/alpha)*((T_m*k)/(2*H))**(2)\n", + "print \"Time required for the surface to reach the melting point = %f sec\"%(tm)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time required for the surface to reach the melting point = 0.000053 sec\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 15 on page no. 400" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "I = 1e5 # Power intensity of laser beam in W/mm**2\n", + "d = 200 # Focused diameter of incident beam in micro meter\n", + "T_m = 3400 # Melting temperture of tungsten in \u00b0C\n", + "rho_c = 2.71 # Value of volume specific heat for tugsten in J/cm**3\n", + "k = 2.15 # Thermal conductivity of tungsten in W/cm-\u00b0C\n", + "p_a = 10 # Percentage of beam absorbed\n", + "H = (p_a/100)*(I)*(100)\n", + "alpha = k/rho_c\n", + "zeta = 0.5 # Fr0m the standard table\n", + " # By solving the equation T_m = ((2*H)*(sqrt(alpha*tm))/k)*((1/sqrt(pi))-ierfc(d/(4*sqrt(alpha*tm))))\n", + "tm = 1/((200**2)*(zeta**2)*(alpha))\n", + "print \"Time required for the centre of the circular spot to reach the melting point = %f sec\"%(tm)\n", + "# Answer in the book is given as 0.00013 sec" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time required for the centre of the circular spot to reach the melting point = 0.000126 sec\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 16 on page no. 401" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "d = 200 # Diameter of focussed laser beam in micro meter\n", + "T_m = 3400 # Melting temperture of tungsten in \u00b0C\n", + "k = 2.15 # Thermal conductivity of tungsten in W/cm-\u00b0C\n", + "p_a = 10 # Percentage of beam absorbed\n", + "H = 2*k*T_m/(d*10**-4)\n", + "I = H/(p_a/100)\n", + "print \"Minimum value of beam power intensity to achieve the melting = %0.2e W/cm**2\"%(I)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum value of beam power intensity to achieve the melting = 7.31e+06 W/cm**2\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 17 on page no. 403" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "I = 1e5 # Power intensity of laser beam in W/mm**2\n", + "t = 0.5 # Thickness of tungsten sheet in mm\n", + "d = 200 # Drill diameter in micro meter\n", + "P = 3e4 # Energy required per unit volume to vapourize tungsten in J/cm**3\n", + "p_e = 10 # Percentage efficiency\n", + "T_m = 3400 # Melting temperture of tungsten in \u00b0C\n", + "k = 2.15 # Thermal conductivity of tungsten in W/cm-\u00b0C\n", + "H = (p_e/100)*(I)*(100)\n", + "v = H/P\n", + "T = t*(0.1)/(v)\n", + "print \"The time required to drill a through hole = %0.4f sec\"%(T)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The time required to drill a through hole = 0.0015 sec\n" + ] + } + ], + "prompt_number": 16 + } + ], + "metadata": {} + } + ] +} diff --git a/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch7_2.ipynb b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch7_2.ipynb new file mode 100644 index 00000000..d03ec326 --- /dev/null +++ b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/ch7_2.ipynb @@ -0,0 +1,120 @@ +{ + "metadata": { + "name": "", + "signature": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-7, Manufacturing in the twenty-first century:micromachining, generatice manufacturing, and self assembly" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 1 on page no. 432" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Given that\n", + "F = 4e-6 # Maximum feature dimension in meter\n", + "t = 5e-6 # Photorist thickness in meter\n", + "g = 25e-6 # Allowable gap between the mask and the resist meter\n", + "lamda = (F**2)/(t+g)\n", + "print \"Maximum allowable wavelength of the exposing light = %d nm\"%(lamda*(10**9))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum allowable wavelength of the exposing light = 533 nm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 2 on page no. 440" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import exp\n", + "# Given that\n", + "d = 5 # Diameter of hole in micro meter\n", + "h = 100 # Depth of hole in micro meter\n", + "t = 31.58*(d*(exp(h/(60*d))-1))\n", + "print \"Time required to machine the hole = %0.1f min\"%(t)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time required to machine the hole = 62.5 min\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Problem 3 on page no. 448" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sqrt\n", + "# Given that\n", + "J = 2 # The threshold value of dose in kJ/cm**3\n", + "h = 300 # Height in micro meter\n", + "J_o = J*(exp(0.1*sqrt(h)))\n", + "print \"The minimum level of exposure of the PMMA surface = %0.1f kJ/cm**3\"%(J_o)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The minimum level of exposure of the PMMA surface = 11.3 kJ/cm**3\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +} diff --git a/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/screenshots/FricCoeff_2.png b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/screenshots/FricCoeff_2.png Binary files differnew file mode 100644 index 00000000..eb440244 --- /dev/null +++ b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/screenshots/FricCoeff_2.png diff --git a/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/screenshots/fillingtime_2.png b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/screenshots/fillingtime_2.png Binary files differnew file mode 100644 index 00000000..f3d80c6e --- /dev/null +++ b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/screenshots/fillingtime_2.png diff --git a/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/screenshots/millPOwer_2.png b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/screenshots/millPOwer_2.png Binary files differnew file mode 100644 index 00000000..e4c86e89 --- /dev/null +++ b/Manufacturing_Science_by_A._Ghosh_And_A._K._Mallik/screenshots/millPOwer_2.png diff --git a/Turbomachines_by_A._V._Arasu/Ch1.ipynb b/Turbomachines_by_A._V._Arasu/Ch1.ipynb new file mode 100644 index 00000000..ab863ced --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/Ch1.ipynb @@ -0,0 +1,709 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:04fae3340038d72ec2280e59669f4edde21c4cc5f0e44781b3f3472ae74ef696" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter1 - Basic Concepts of Turbo Machines" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex-1.1 Page 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#input data\n", + "P01=1#initial pressure of a fluid in bar\n", + "P02=10#final pressure of a fliud in bar\n", + "T01=283#initial total temperature in K\n", + "ntt=0.75#total-to-total efficiency\n", + "d=1000#density of water in kg/m**3\n", + "r=1.4#ratio of specific heats for air\n", + "Cp=1.005#specific at heat at constant pressure in kJ/kg.K\n", + "\n", + "#calculations\n", + "h0s1=(1/d)*(P02-P01)*10**2#enthalpy in kJ/kg\n", + "h01=(h0s1/ntt)#enthalpy in kJ/kg\n", + "T02s=T01*(P02/P01)**((r-1)/r)#temperature in K\n", + "h0s2=(Cp*(T02s-T01))#enthalpy in kJ/kg\n", + "h02=(h0s2/ntt)#enthalpy in kJ/kg\n", + "\n", + "#output\n", + "print '''The work of compression for adiabatic steady flow per kg of fliud if - \n", + "(a)The fliud is liquid water is %3.1f kJ/kg\n", + "(b)The fliud is air as a perfect gas is %3.2f kJ/kg'''%(h01,h02)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The work of compression for adiabatic steady flow per kg of fliud if - \n", + "(a)The fliud is liquid water is 1.2 kJ/kg\n", + "(b)The fliud is air as a perfect gas is 352.94 kJ/kg\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.2 Page 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#input data\n", + "P01=7#Total initial pressure of gases at entry in bar\n", + "T01=1100#Total initial temperature in K\n", + "P02=1.5#Total final pressure of gases at exit in bar\n", + "T02=830#Total final temperature in K\n", + "C2=250#Exit velocity in m/s\n", + "r=1.3#Ratio of specific heats of gases\n", + "M=28.7#Molecular weight of gases\n", + "R1=8.314#Gas constant of air in kJ/kg.K\n", + "\n", + "#calculations\n", + "T02s=T01*(P02/P01)**((r-1)/r)#Final temperature in K\n", + "ntt=((T01-T02)/(T01-T02s))#Total-to-total efficiency\n", + "R=(R1/M)#Gas constant of given gas in kJ/kg.K\n", + "Cp=((r*R)/(r-1))#Specific heat of given gas at constant pressure in kJ/kg.K\n", + "T2s=(T02s-((C2**2)/(2*Cp*1000)))#Temperature in isentropic process at exit in K\n", + "nts=((T01-T02)/(T01-T2s))#Total-to-static efficiency\n", + "\n", + "#output\n", + "print '''The total-to-total efficiency of gases is %0.2f %%\n", + "The total-to-static efficiency of gases is %0.1f %%'''%(ntt*100,nts*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The total-to-total efficiency of gases is 82.05 %\n", + "The total-to-static efficiency of gases is 76.3 %\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.3 Page 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "h0=6#Change in total enthalpy in kJ/kg\n", + "T01=303#Total inlet temperature of fluid in K\n", + "P01=1#Total inlet pressure of fliud in bar\n", + "Cp=1.005#specific at heat at constant pressure in kJ/kg.K\n", + "ntt=0.75#Adiabatic total-to-total efficiency\n", + "r=1.4#ratio of specific heats for air\n", + "\n", + "#calculations\n", + "T02=T01+(h0/Cp)#Exit total termperature of fliud in K\n", + "P1=(1+((ntt*h0)/(Cp*T01)))**(r/(r-1))#Total pressure ratio of fluid \n", + "h0s=ntt*h0#Change in enthalpy of process in kJ/kg\n", + "P0=((h0s*1000)/100)#Change in pressure in bar\n", + "P02=P0+P01#Total outlet pressure of fliud in bar\n", + "P2=(P02/P01)#Total pressure ratio of fliud\n", + "\n", + "#output\n", + "print '''(a)The exit total temperature of fliud is %3.2f K\n", + "(b)The total pressure ratio if:\n", + "(1)The fliud is air is %3.3f\n", + "(2)The fliud is liquid water is %3.0i'''%(T02,P1,P2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The exit total temperature of fliud is 308.97 K\n", + "(b)The total pressure ratio if:\n", + "(1)The fliud is air is 1.053\n", + "(2)The fliud is liquid water is 46\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.4 Page 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "W=100#Output power developed in kW\n", + "Q=0.1#Flow through device in m**3/s\n", + "d=800#Density of oil in kg/m**3\n", + "ntt=0.75#Total-to-total efficiency\n", + "C1=3#inlet flow velocity of oil in m/s\n", + "C2=10#outlet flow velocity of oil in m/s\n", + "\n", + "#calculations\n", + "m=d*Q#Mass flow rate of oil in kg/s\n", + "h0=-(W/m)#Change in total enthalpy in kJ/kg\n", + "h0s=(h0/ntt)#Isentropic change in total enthalpy in kJ/kg\n", + "P0=((d*h0s)*(1/100))#Change in total pressure of oil in bar\n", + "P=P0-((d/(2000*100))*(C2**2-C1**2))#Change in static pressure in bar\n", + "\n", + "#output\n", + "print '''The change in total pressure of oil is %3.1f bar\n", + "The change in static presure is %3.1f bar'''%(P0,P)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The change in total pressure of oil is -13.3 bar\n", + "The change in static presure is -13.7 bar\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.5 Page 22" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "N=4#Number of stages in turbine handling\n", + "P=0.4#Stagnation presure ratio between exit and inlet of each stage\n", + "ns1=0.86#Stage efficiency of first and second stages\n", + "ns2=0.84#Stage efficiency of third and fourth stages\n", + "r=1.4#ratio of specific heats for air\n", + "\n", + "#calculations\n", + "u=1-(P)**((r-1)/r)#constant\n", + "T03=(1-(u*ns1))**2#Temperature after the end of first two stages in (K*Cp*T01) where Cp is specific at heat at constant pressure in kJ/kg.K and T01 is initial temperature at entry of stage 1 in K\n", + "W12=u*(1+(1-(u*ns1)))*ns1#Actual work output from first two stages in (kW*Cp*T01)\n", + "W34=T03*u*(1+(1-(u*ns2)))*ns2#Actual work output from last two stages in (kW*Cp*T01)\n", + "W=(W12+W34)#Total actual work output from turbine in (kW*Cp*T01)\n", + "Ws=1-(1-u)**N#Total isentropic work due to single stage compressor in (kW*Cp*T01)\n", + "n=(W/Ws)#Overall turbine efficiency\n", + "\n", + "#output\n", + "print 'the overall efficiency of the turbine is %.1f %%'%(n*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "the overall efficiency of the turbine is 89.6 %\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.6 Page 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "from __future__ import division\n", + "from math import log10\n", + "#input data\n", + "P=1400#Pressure developed by compressor in mm W.G\n", + "P1=1.01#Initial pressure of air in bar\n", + "T1=305#Initial temperature of air in K\n", + "T2=320#Final temperature of air in K\n", + "P=1400*9.81*10**-5#Pressure developed by compressor in bar\n", + "r=1.4#ratio of specific heats for air\n", + "\n", + "#calculations\n", + "P2=P1+P#Final pressure of air in bar\n", + "T2s=T1*(P2/P1)**((r-1)/r)#Isentropic temperature at exit in K\n", + "nc=((T2s-T1)/(T2-T1))#compressor efficiency\n", + "np=((r-1)/r)*((log10(P2/P1))/(log10(T2/T1)))#Infinitesimal stage efficiency\n", + "\n", + "#output\n", + "print '''(a)The compressor efficiency is %0.2f %%\n", + "(b)The infinitesimal stage efficiency is %0.2f %%'''%(nc*100,np*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The compressor efficiency is 75.43 %\n", + "(b)The infinitesimal stage efficiency is 75.88 %\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.7 Page 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P1=1.01#Input pressure to compressor in bar\n", + "T1=305#Input temperature to compressor in K\n", + "P2=3#Output pressure from compressor in bar\n", + "r=1.4#ratio of specific heats for air\n", + "nc=0.75#compressor efficiency\n", + "\n", + "#calculations\n", + "T2s=T1*(P2/P1)**((r-1)/r)#Isentropic output temperature from compressor in K\n", + "T2=T1+((T2s-T1)/nc)#Actual output temperature from compressor in K\n", + "np=((r-1)/r)*((log10(P2/P1))/(log10(T2/T1)))#Infinitesimal efficiency of compressor\n", + "\n", + "#output\n", + "print 'The infinitesimal efficiency of the compressor is %0.1f %%'%(np*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The infinitesimal efficiency of the compressor is 78.5 %\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.8 Page 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P=2.2#Pressure ratio across a gas turbine\n", + "n=0.88#Efficiency of a gas turbine\n", + "T1=1500#Inlet temperature of the gas in K\n", + "r=1.4#ratio of specific heats for air\n", + "\n", + "#calculations\n", + "T2s=T1*(1/P)**((r-1)/r)#Isentropic output temperature from gas turbine in K\n", + "T2=T1-(n*(T1-T2s))#actual output temperature from gas turbine in K\n", + "np=(r/(r-1))*((log10(T1/T2))/(log10(P)))#Polytropic efficiency of the turbine\n", + "\n", + "\n", + "#output\n", + "print 'The polytropic efficiency of the turbine is %0.1f %%'%(np*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The polytropic efficiency of the turbine is 86.7 %\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.9 Page 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# input data\n", + "P=1.3#Pressure ratio of stages\n", + "N=8#Number of stages\n", + "m =45#The flow rate through compressor in kg/s\n", + "nc=0.8#Overall efficiency of the compressor\n", + "P1=1#Initial pressure of the air at entry in bar\n", + "T1=308#Initial temperature of the air at entry in K\n", + "r=1.4#ratio of specific heats for air\n", + "\n", + "#calculations\n", + "PN=(P)**8#Overall pressure ratio of all 8 stages\n", + "TN=PN**((r-1)/r)#Overall temperature ratio of all 8 stages\n", + "TN1s=TN*T1#Ideal exit temperature in K\n", + "TN1=((TN1s-T1)/nc)+T1#Actual exit temperature in K\n", + "PN1=PN*P1#Actual exit pressure in bar\n", + "np=((r-1)/r)*((log10(PN1/P1))/(log10(TN1/T1)))#Polytropic efficiency of the cycle\n", + "ns=((((P)**((r-1)/r))-1)/(((P)**((r-1)/(r*np)))-1))#The stage efficiency of the cycle\n", + "\n", + "#output\n", + "print '''(a)The state of air at compressor exit are-\n", + "(1)actual temperature is %3.1f K\n", + "(2)actual pressure is %3.2f bar\n", + "(b)The polytropic efficiency of the cycle is %0.f %%\n", + "(c)The stage efficiency of the cycle is %0.2f %%'''%(TN1,PN1,np*100,ns*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The state of air at compressor exit are-\n", + "(1)actual temperature is 624.3 K\n", + "(2)actual pressure is 8.16 bar\n", + "(b)The polytropic efficiency of the cycle is 85 %\n", + "(c)The stage efficiency of the cycle is 84.31 %\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex - 1.10 Page 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import log10\n", + "#input data\n", + "P=11#Overall pressure ratio in three stages of a gas turbine\n", + "nt=0.88#Overall efficiency in three stages of a gas turbine\n", + "T1=1500#Temperature at inlet of a gas turbine in K\n", + "r=1.4#ratio of specific heats for air\n", + "\n", + "#calculations\n", + "T0=nt*T1*(1-(1/P)**((r-1)/r))#Overall change in temperature in all stages in K\n", + "TN1=T1-T0#Temperature at final stage of a gas turbine in K\n", + "np=((r/(r-1))*log10(T1/TN1))/(log10(P))#Overall polytropic efficiency of the gas turbine\n", + "Ts=T0/3#Individual stage change in temperature in K\n", + "T2=T1-Ts#Exit temperature at the end of first stage in K\n", + "P1=(T1/T2)**(r/(np*(r-1)))#Pressure ratio at first stage of gas turbine \n", + "ns1=((1-(1/P1)**((np*(r-1))/r))/(1-(1/P1)**((r-1)/r)))#Stage efficiency of first stage \n", + "T3=T2-Ts#Exit temperature at the end of second stage in K\n", + "P2=(T2/T3)**(r/(np*(r-1)))#Pressure ratio at second stage of gas turbine\n", + "ns2=((1-(1/P2)**((np*(r-1))/r))/(1-(1/P2)**((r-1)/r)))#Stage efficiency of second stage\n", + "T4=T3-Ts#Exit temperature at the end of third stage in K\n", + "P3=(T3/T4)**(r/(np*(r-1)))#Pressure ratio at the third stage of gas turbine\n", + "ns3=((1-(1/P3)**((np*(r-1))/r))/(1-(1/P3)**((r-1)/r)))#Stage efficiency of third stage\n", + "\n", + "#output\n", + "print '''(a)The values for first stage are -\n", + "(1)Pressure ratio is %3.2f\n", + "(2)stage efficiency is %0.2f %%\n", + "(b)The values of second stage are -\n", + "(1)Pressure ratio is %3.3f\n", + "(2)Stage efficiency is %0.1f %%\n", + "(c)The values of third stage are -\n", + "(1)Pressure ratio is %3.2f\n", + "(2)Stage efficiency is %0.2f'''%(P1,ns1*100,P2,ns2*100,P3,ns3*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The values for first stage are -\n", + "(1)Pressure ratio is 1.93\n", + "(2)stage efficiency is 84.96 %\n", + "(b)The values of second stage are -\n", + "(1)Pressure ratio is 2.182\n", + "(2)Stage efficiency is 85.2 %\n", + "(c)The values of third stage are -\n", + "(1)Pressure ratio is 2.61\n", + "(2)Stage efficiency is 85.52\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.11 Page 29 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "N=4#Number of stages in compressor\n", + "m=45#mass flow rate of air delivered by compressor in kg/s\n", + "P1=1.2#Pressure ratio at first stage\n", + "ns=0.65#Stage efficiency of first stage\n", + "r=1.4#ratio of specific heats for air\n", + "Cp=1.005#specific at heat at constant pressure in kJ/kg.K\n", + "T1=293#Temperature of air at inlet in K\n", + "\n", + "#calculations\n", + "P=(P1)**N#Overall pressure in all 4 stages\n", + "np=((r-1)/r)*((log10(P1))/(log10((((P1**((r-1)/r))-1)/ns)+1)))#Polytropic efficiency of the cycle\n", + "nc=(((P1**(N*((r-1)/r)))-1)/((P1**(N*((r-1)/(r*np))))-1))#Overall efficiency of the cycle\n", + "TN1=T1*((P1**(N))**((r-1)/(r*np)))#Final temperature at the exit of the compressor at final stage in K\n", + "W=m*Cp*(TN1-T1)#Power required to drive the compressor in kW\n", + "\n", + "#output\n", + "\n", + "print '''(a)The overall pressure ratio of the process is %3.1f\n", + "(b)The overall efficiency of the process is %0.2f %%\n", + "(c)The power required to drive the compressor is %3.2f kW'''%(P,nc*100,W)\n", + "# the answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The overall pressure ratio of the process is 2.1\n", + "(b)The overall efficiency of the process is 62.29 %\n", + "(c)The power required to drive the compressor is 4928.55 kW\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.12 Page 31 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P0=0.2*9.81*(10**3)*(10**-5)#Total increase in pressure in bar\n", + "P01=1.04#Total inlet pressure of air in bar\n", + "T01=291#Total inlet temperature of air in K\n", + "ntt=0.72#Total-to-total efficiency of the process\n", + "r=1.4#ratio of specific heats for air\n", + "Cp=1.005#specific at heat at constant pressure in kJ/kg.K\n", + "\n", + "#calculations\n", + "P2=P0+P01#The total exit pressure in bar\n", + "T02=((((P2/P01)**((r-1)/r)-1)*T01)/ntt)+T01#Total temperature at the outlet in K\n", + "h0=Cp*(T02-T01)#Actual change in total enthalpy in kJ/kg\n", + "h0s=h0*ntt#Isentropic change in total enthalpy in kJ/kg\n", + "\n", + "#output\n", + "print '''(a)The total exit pressure is %3.4f bar\n", + "and the total exit temperature is %3.2f K\n", + "(b)The actual change in total enthalpy is %3.3f kJ/kg\n", + "and the isentropic change in total enthalpy is %3.3f kJ/kg'''%(P2,T02,h0,h0s)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The total exit pressure is 1.0596 bar\n", + "and the total exit temperature is 293.16 K\n", + "(b)The actual change in total enthalpy is 2.175 kJ/kg\n", + "and the isentropic change in total enthalpy is 1.566 kJ/kg\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.13 Page 31" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P=5#Pressure ratio in the process\n", + "ntt=0.8#Total-to-total efficiency of the process\n", + "m=5#Air flow rate through turbine in kg/s\n", + "W=500#Total power output from the turbine in kW\n", + "r=1.4#ratio of specific heats for air\n", + "Cp=1.005*10**3#specific at heat at constant pressure in J/kg.K\n", + "C2=100#Flow velocity of air in m/s\n", + "\n", + "#calculations\n", + "T=(W*10**3)/(m*Cp)#Total change in temperature in the process in K\n", + "T02s=(1/P)**((r-1)/r)#Isentropic temperature at the outlet from turvine in (K*T01)\n", + "T01=(T/ntt)*(1/(1-0.631))#Inlet total temperature in K\n", + "T02=T01-T#Actual exit total temperature in K\n", + "T2=T02-((C2**2)/(2*Cp))#Actual exit static temperature in K\n", + "T02s1=T02s*T01#Isentropic temperature at the outlet from turbine in K\n", + "T2s=T02s1-((C2**2)/(2*Cp))#Actual isentropic temperature in K\n", + "nts=(T/(T01-T2s))#Total-to-static efficiency\n", + "\n", + "#output\n", + "print '''(a)The inlet total temperature is %i K\n", + "(b)The actual exit total temperature is %3.1f K\n", + "(c)The actual exit static temperature is %3.1f K\n", + "(d)The total-to-static efficiency is %0.2f %%'''%(T01,T02,T2,nts*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The inlet total temperature is 337 K\n", + "(b)The actual exit total temperature is 237.6 K\n", + "(c)The actual exit static temperature is 232.6 K\n", + "(d)The total-to-static efficiency is 77.00 %\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 1.14 Page 33 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import log\n", + "#input data\n", + "N=3#Number of stages in turbine\n", + "P=2#Pressure ratio of each stage\n", + "ns=0.75#Stage efficiency of each stage\n", + "T1=873#Initial temperature of air in K\n", + "m=25#Flow rate of air in kg/s\n", + "r=1.4#ratio of specific heats for air\n", + "Cp=1.005#specific at heat at constant pressure in J/kg.K\n", + "\n", + "#calculations\n", + "np=(r/(r-1))*((log(1-(ns*(1-(1/P)**((r-1)/r)))))/(log(1/P)))#Polytropic efficiency of the process\n", + "nt=((1-(1/P)**(N*np*((r-1)/r)))/(1-(1/P)**(N*((r-1)/r))))#Overall efficiency of the turbine\n", + "W=m*Cp*T1*(1-(1/P)**(N*np*((r-1)/r)))#Power developed by the turbine in kW\n", + "RF=nt/ns#Reheat factor of the process\n", + "\n", + "#output\n", + "print '''(a)The overall efficiency of the turbine is %0.2f %%\n", + "(b)The power developed by the turbine is %i kW\n", + "(c)The reheat factor of the process is %3.2f'''%(nt*100,W,RF)\n", + "\n", + "#comments\n", + "# the answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The overall efficiency of the turbine is 78.63 %\n", + "(b)The power developed by the turbine is 7725 kW\n", + "(c)The reheat factor of the process is 1.05\n" + ] + } + ], + "prompt_number": 14 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Turbomachines_by_A._V._Arasu/Ch2.ipynb b/Turbomachines_by_A._V._Arasu/Ch2.ipynb new file mode 100644 index 00000000..380bdf26 --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/Ch2.ipynb @@ -0,0 +1,435 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f90ad248f5346a845ec01efdf3c2941322625ecb2d8d238ed549e14c9d9de3bb" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2 - Blade Theory" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.1 page 53" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "c =2.25#Chord length of an aerofoil in m\n", + "l=13.5#Span of the aerofoil in m\n", + "C=125#Velocity of the aerofoil in m/s\n", + "Cl=0.465#Lift coefficient\n", + "Cd=0.022#Drag coefficient\n", + "d=1.25#Density of the air in kg/m**3\n", + "\n", + "#calculations\n", + "A=c*l#Area of cross section of the aerofoil in m**2\n", + "W=Cl*d*((C**2)/2)*A*10**-3#Weight carried by the wings of aerofoil in kN\n", + "D=Cd*d*((C**2)/2)*A#Drag force on the wings of aerofoil in N\n", + "P=D*C*10**-3#Power required to the drive the aerofoil in kW\n", + "\n", + "#output\n", + "print '''(a)Weight carrried by the wings is %3.2f kN\n", + "(b)Drag force on the wings of aerofoil is %3.2f N\n", + "(c)Power required to drive the aerofoil is %3.3f kW'''%(W,D,P)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Weight carrried by the wings is 137.92 kN\n", + "(b)Drag force on the wings of aerofoil is 6525.46 N\n", + "(c)Power required to drive the aerofoil is 815.683 kW\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.2 page 53" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#input data\n", + "W=980#The weight of the object being dropped by parachute in N\n", + "C=5#The maximum terminal velocity of dropping in m/s\n", + "d=1.22#The density of the air in kg/m**3\n", + "Cd=1.3#The drag coefficient of the parachute\n", + "\n", + "#calculations\n", + "A=W/(Cd*d*((C**2)/2))#The area of cross section in m**2\n", + "D=((A*4)/(3.14))**(1/2)#Diameter of the parachute in m\n", + "\n", + "#output\n", + "print 'The required diameter of the parachute is %3.2f m'%(D)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The required diameter of the parachute is 7.94 m\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.3 page 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "A=10*1.2#Area of the airplane wing in m**2\n", + "C=((240*10**3)/3600)#Velocity of the wing in m/s\n", + "F=20#Total aerodynamic force acting on the wing in kN\n", + "LD=10#Lift-drag ratio\n", + "d=1.2#Density of the air in kg/m**3\n", + "\n", + "#calculations\n", + "L=(F)/(1.01)**(1/2)#The weight that the plane can carry in kN\n", + "Cl=(L*10**3)/(d*A*((C**2)/2))#Coefficient of the lift\n", + "\n", + "#output\n", + "print '(1)The coefficient of lift is %3.3f\\n(2)The total weight the palne can carry is %3.1f kN'%(Cl,L)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)The coefficient of lift is 0.622\n", + "(2)The total weight the palne can carry is 19.9 kN\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.4 page 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "m=25#Mass flow rate of the air in kg/s\n", + "d=1.1#Density of the air in kg/m**3\n", + "Ca=157#Axial flow velocity of the air in m/s\n", + "N=150#Rotational speed of the air in rev/s\n", + "U=200#Mean blade speed in m/s\n", + "lc=3#Rotor blade aspect ratio \n", + "sc=0.8#Pitch chord ratio\n", + "\n", + "#calculations\n", + "rm=(U)/(2*3.145*N)#Mean radius of the blades in m\n", + "A=(m)/(d*Ca)#The annulus area of flow in m**2\n", + "l=(A)/(2*3.1*rm)#The blade height in m\n", + "C=l/lc#The chord of the blades in m\n", + "S=sc*C#The blade pitch in m\n", + "n=(2*3.141*rm)/(S)#Number of blades \n", + "\n", + "#output\n", + "\n", + "print '''(a)The mean radius of the blades is %3.3f m\n", + "(b)The blade height is %3.2f m\\n(c) (1)The pitch of the blades is %3.4f m\n", + "(2)The chord of the blades is %3.3f m\\n(d)The number of the blades are %3.f'''%(rm,l,S,C,n)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The mean radius of the blades is 0.212 m\n", + "(b)The blade height is 0.11 m\n", + "(c) (1)The pitch of the blades is 0.0294 m\n", + "(2)The chord of the blades is 0.037 m\n", + "(d)The number of the blades are 45\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.5 page 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "sc=0.8#Pitch-chord ratio of compressor blade\n", + "b1=45#Relative air angle at inlet in degree\n", + "b2=15#Relative air angle at oulet in degree\n", + "a1=b1#Cascade air angle at inlet in degree\n", + "a2=b2#Cascade air angle at outlet in degree\n", + "\n", + "#calculations \n", + "en=a1-a2#Nominal deflection angle of the blade in degree\n", + "m=((0.23*(1)**2))+(0.1*a2/50)#An emperical constant for a circular arc camber where (2*a/c)=1\n", + "t=(a1-a2)/(1-0.233)#Blade camber angle in degree\n", + "d=(m*(sc)**(1/2))*t#The deviation angle of the blade in terms of (degree*t)\n", + "ps=a1-(t/2)#The blade stagger for a given circular arc cascade in degree\n", + "\n", + "#output\n", + "print '''(a)The nominal deflection angle is %i degree\n", + "(b)The blade camber angle is %3.2f degree\n", + "(c)The deviation angle is %3.2f degree\n", + "(d)The blade stagger is %3.2f degree'''%(en,t,d,ps)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The nominal deflection angle is 30 degree\n", + "(b)The blade camber angle is 39.11 degree\n", + "(c)The deviation angle is 9.10 degree\n", + "(d)The blade stagger is 25.44 degree\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.6 page 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import atan, degrees, tan\n", + "#input data\n", + "t=25#The camber angle of aero foil blades in degree\n", + "ps=30#The blade stagger angle in degree\n", + "sc=1#The pitch-chord ratio of the blades\n", + "In=5#The nominal value of incidence in degree\n", + "\n", + "#calculations\n", + "a1=ps+(t/2)#The cascade blade angle at inlet in degree\n", + "a2=a1-t#The cascade blade angle at outlet in degree\n", + "a1n=In+a1#The nominal entry air angle in degree\n", + "a2n=degrees(atan((tan(a1n))-(1.55/(1.0+(1.5*sc)))))#The nominal exit air angle in degree\n", + "\n", + "#output\n", + "print '''(1)The cascade blade angles at -\n", + "(a)inlet is %3.1f degree\n", + "(b)exit is %3.1f degree\n", + "(2)The nominal air angles at -\n", + "(a)inlet is %3.1f degree\n", + "(b)exit is %3.2f degree'''%(a1,a2,a1n,a2n)\n", + "# the answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)The cascade blade angles at -\n", + "(a)inlet is 42.5 degree\n", + "(b)exit is 17.5 degree\n", + "(2)The nominal air angles at -\n", + "(a)inlet is 47.5 degree\n", + "(b)exit is -12.69 degree\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.7 page 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import atan, cos, tan, pi\n", + "#input data\n", + "C1=75#Velocity of air entry in m/s\n", + "a1=48#Air angle at entry in degree\n", + "a2=25#Air angle at exit in degree\n", + "cs=0.91#The chord-pitch ratio \n", + "P0m=(11*9.81*10**3)/10**3#The stagnation pressure loss in N/m**2\n", + "d=1.25#The density of the sair in kg/m**3\n", + "\n", + "#calculations\n", + "Cp=(P0m/(0.5*d*C1**2))#The pressure loss coefficient \n", + "am=degrees(atan((tan(a1)+tan(a2))/2))#The mean air angle in degree\n", + "Cd=2*(1/cs)*(P0m/(d*C1**2))*((cos(pi/180*am))**3/(cos(pi/180*a1))**2)#The drag coefficient \n", + "Cl=(2*(1/cs)*cos(pi/180*am)*(tan(pi/180*a1)-tan(pi/180*a2)))-(Cd*tan(pi/180*am))#THe lift coefficient\n", + "\n", + "#output\n", + "print '''(a)The pressure loss coefficient is %3.4f\n", + "(b)The drag coefficient is %3.4f\\n(c)The lift coefficient is %3.3f'''%(Cp,Cd,Cl)\n", + "# the answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The pressure loss coefficient is 0.0307\n", + "(b)The drag coefficient is 0.0518\n", + "(c)The lift coefficient is 1.222\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.8 page 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "a1=40#The cascade air angle at entry in degree\n", + "a2=65#The cascade air angle at exit in degree\n", + "C1=100#Air entry velocity in m/s\n", + "d=1.25#The density of the air in kg/m**3\n", + "sc=0.91#The pitch-chord ratio of the cascade\n", + "P0m=(17.5*9.81*10**3)/10**3#The average loss in stagnation pressure across cascade in N/m**2\n", + "\n", + "#calculations\n", + "Cp=(P0m/(0.5*d*C1**2))#The pressure loss coefficient in the cascade\n", + "am=atan((tan(a2)-tan(a1))/2)#The mean air angle in degree\n", + "Cd=2*(sc)*(P0m/(d*C1**2))*((cos(pi/180*am))**3/(cos(pi/180*a2))**2)#The drag coefficient \n", + "Cl=(2*(sc)*cos(pi/180*am)*(tan(pi/180*a1)+tan(pi/180*a2)))+(Cd*tan(pi/180*am))#THe lift coefficient\n", + "\n", + "#output\n", + "print '(a)The pressure loss coefficient is %3.4f\\n(b)The drag coefficient is %3.4f\\n(c)The lift coefficient is %3.3f'%(Cp,Cd,Cl)\n", + "# the answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The pressure loss coefficient is 0.0275\n", + "(b)The drag coefficient is 0.1399\n", + "(c)The lift coefficient is 5.430\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 2.9 page 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "W=30000#The weight of the jet plane in N\n", + "A=20#The area of the wing in m**2\n", + "C=250*5/18#The speed of the jet plane in m/s\n", + "P=750#The power delivered by the engine in kW\n", + "d=1.21#Density of the air in kg/m**3\n", + "\n", + "#calculations\n", + "L=W#The lift force on the plane is equal to the weight of the plane in N\n", + "Pd=0.65*P#The power required to overcome the drag resistance in kW\n", + "D=(Pd/C)*10**3#The drag force on the wing in N\n", + "Cd=D/(0.5*d*A*C**2)#The coefficient of drag for the wing \n", + "Cl=L/(0.5*d*A*C**2)#The coefficient of lift for the wing \n", + "\n", + "#output\n", + "print '(a)The coefficient of lift on the wing is %3.3f\\n(b)The coefficient of drag on the wing is %3.3f'%(Cl,Cd)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The coefficient of lift on the wing is 0.514\n", + "(b)The coefficient of drag on the wing is 0.120\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Turbomachines_by_A._V._Arasu/Ch3.ipynb b/Turbomachines_by_A._V._Arasu/Ch3.ipynb new file mode 100644 index 00000000..d1cafb38 --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/Ch3.ipynb @@ -0,0 +1,844 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:dc07aa3042daa4cf3235ebcee99afeac70f8ff9726da7fd96f3108e76e2b9625" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3 - Centrifugal Compressors & Fans" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.1 Page 93" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#input data\n", + "m=10#The mass flow rate of air into compressor in kg/s\n", + "P1=1#The ambient air pressure in compressor in bar\n", + "T1=293#The ambient air temperature in compressor in K\n", + "N=20000#The running speed of the compressor in rpm\n", + "nc=0.8#The isentropic efficiency of the compressor\n", + "P02=4.5#The total exit pressure from the compressor in bar\n", + "C1=150#The air entry velocity into the impeller eye in m/s\n", + "Cx1=0#The pre whirl speed in m/s\n", + "WS=0.95#The ratio of whirl speed to tip speed\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K \n", + "R=287#The universal gas constant in J/kg.K\n", + "Dh=0.15#The eye internal diamater in m\n", + "r=1.4#Ratio of specific heats of air \n", + "d=1.189#The density of the air in kg/m**3\n", + "\n", + "#calculations\n", + "T01=T1+((C1**2)/(2*Cp))#The stagnation temperature at inlet in K\n", + "P01=P1*(T01/T1)**(r/(r-1))#The stagnation pressure at inlet in bar\n", + "T02s=(T01)*(P02/P01)**((r-1)/r)#The temperature after isentropic compression from P01 to P02 in K\n", + "T=(T02s-T01)/nc#The actual rise in total temperature in K\n", + "W=Cp*(10**-3)*(T)#The work done per unit mass in kJ/kg\n", + "U2=((W*(10**3))/(WS))**(1/2)#The impeller tip speed in m/s\n", + "Dt=(U2*60)/(3.1415*N)#The impeller tip diameter in m\n", + "P=m*W#Power required to drive the compressor in kW\n", + "d1=((P1*10**5)/(R*T1))#The density of the air entry in kg/m**3\n", + "De=(((4*m)/(d*C1*3.14))+(Dh**2))**(1/2)#The eye external diameter in m\n", + "\n", + "#output\n", + "print '(a)The actual rise in total temperature of the compressor is %3.1f K\\n(b)\\n (1)The impeller tip speed is %3.2f m/s\\n (2)The impeller tip diameter is %3.2f m\\n(c)The power required to drive the compressor is %3.1f kW\\n(d)The eye external diameter is %0.1f cm'%(T,U2,Dt,P,De*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The actual rise in total temperature of the compressor is 182.6 K\n", + "(b)\n", + " (1)The impeller tip speed is 439.55 m/s\n", + " (2)The impeller tip diameter is 0.42 m\n", + "(c)The power required to drive the compressor is 1835.4 kW\n", + "(d)The eye external diameter is 30.6 cm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.2 Page 95" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import degrees, atan\n", + "#input data\n", + "Q1=20#Discharge of air to the centrifugal compressor in m**3/s\n", + "V1=Q1#Volume of rate is equal to the discharge in m**3/s\n", + "P1=1#Initial pressure of the air to the centrifugal compressor in bar\n", + "T1=288#Initial temperature of the air to the centrifugal compressor in K\n", + "P=1.5#The pressure ratio of compression in centrifugal compressor\n", + "C1=60#The velocity of flow of air at inlet in m/s\n", + "Cr2=C1#The radial velocity of flow of air at outlet in m/s\n", + "Dh=0.6#The inlet impeller diameter in m\n", + "Dt=1.2#The outlet impeller diameter in m\n", + "N=5000#The speed of rotation of centrifugal compressor in rpm\n", + "n=1.5#polytropic index constant in the given law PV**n\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K \n", + "\n", + "#calculations\n", + "U1=(3.14*Dh*N)/60#Peripheral velocity of impeller at inlet in m/s\n", + "b11=degrees(atan(C1/U1))#The blade angle at impeller inlet in degree\n", + "U2=(3.14*Dt*N)/60#Peripheral velocity of impeller top at outlet in m/s\n", + "T2=T1*(P)**((n-1)/n)#Final temperature of the air to the centrifugal compressor in K\n", + "Cx2=((Cp*(T2-T1))/U2)#The whirl component of absolute velocity in m/s\n", + "Wx2=U2-Cx2#The exit relative velocity in m/s\n", + "a2=degrees(atan(Cr2/Cx2))#The blade angle at inlet to casing in degree\n", + "b22=degrees(atan(Cr2/Wx2))#The blade angle at impeller outlet in degree\n", + "b1=Q1/(2*3.14*(Dh/2)*C1)#The breadth of impeller blade at inlet in m \n", + "V2=(P1*V1*T2)/(T1*P*P1)#Volume flow rate of air at exit in m**3/s\n", + "Q2=V2#Volume flow rate is equal to discharge in m**3/s\n", + "b2=Q2/(2*3.14*(Dt/2)*Cr2)#The breadth of impeller blade at outlet in m\n", + "\n", + "#output\n", + "print '(a)The blade and flow angles\\n (1)The blade angle at impeller inlet is %3.1f degree\\n (2)The blade angle at inlet to casing is %3.1f degree\\n (3)The blade angle at impeller outlet is %3.2f degree\\n(b)Breadth of the impeller blade at inlet and outlet\\n (1)The breadth of impeller blade at inlet is %3.3f m\\n (2)The Volume flow rate of air at exit is %3.2f m**3/s\\n (3)The breadth of impeller blade at outlet is %3.4f m'%(b11,a2,b22,b1,V2,b2)\n", + "\n", + "\n", + "#comments\n", + "#error in the first review is not printing the value of V2 which is corrected" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The blade and flow angles\n", + " (1)The blade angle at impeller inlet is 20.9 degree\n", + " (2)The blade angle at inlet to casing is 24.2 degree\n", + " (3)The blade angle at impeller outlet is 18.38 degree\n", + "(b)Breadth of the impeller blade at inlet and outlet\n", + " (1)The breadth of impeller blade at inlet is 0.177 m\n", + " (2)The Volume flow rate of air at exit is 15.26 m**3/s\n", + " (3)The breadth of impeller blade at outlet is 0.0675 m\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.3 Page 97" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "m=14#The mass flow rate of air delivered to centrifugal compressor in kg/s\n", + "P01=1#The inlet stagnation pressure in bar\n", + "T01=288#The inlet stagnation temperature in K\n", + "P=4#The stagnation pressure ratio\n", + "N=200#The speed of centrifygal compressor in rps\n", + "ss=0.9#The slip factor\n", + "ps=1.04#The power input factor\n", + "ntt=0.8#The overall isentropic efficiency\n", + "r=1.4#The ratio of specific heats of air\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "\n", + "#calculations\n", + "pp=ss*ps*ntt#The pressure coefficient\n", + "U2=((Cp*T01*((P**((r-1)/r))-1))/pp)**(1/2)#Peripheral velocity of impeller top at outlet in m/s\n", + "D2=U2/(3.14*N)#The overall diameter of the impeller in m\n", + "\n", + "#output\n", + "print 'The overall diameter of the impeller is %.f cm'%(D2*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The overall diameter of the impeller is 69 cm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.4 Page 98" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import cos, pi, tan\n", + "#input data\n", + "D1=0.457#Impeller diameter at inlet in m\n", + "D2=0.762#Impeller diameter at exit in m\n", + "Cr2=53.4#Radial component of velocity at impeller exit in m/s\n", + "ss=0.9#Slip factor\n", + "N=11000#Impeller speed in rpm\n", + "P2=2.23#Static pressure at impeller exit in bar\n", + "T01=288#The inlet stagnation temperature in K\n", + "P01=1.013#The inlet stagnation pressure in bar\n", + "C1=91.5#Velocity of air leaving the guide vanes in m/s\n", + "a11=70#The angle at which air leaves the guide vanes in degrees\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "\n", + "#calculations\n", + "Cx1=C1*cos(a11*pi/180)#Inlet absolute velocity of air in tangential direction in m/s\n", + "Ca1=Cx1*tan(a11*pi/180)#Radial component of absolute velocity at inlet in m/s\n", + "U1=(3.14*D1*N)/(60)#Peripheral velocity of impeller at inlet in m/s\n", + "Wx1=U1-Cx1#Relative whirl component of velocity at inlet in m/s\n", + "W1=((Wx1**2)+(Ca1**2))**(1/2)#Relative velocity at inlet in m/s\n", + "T1=T01-((C1**2)/(2*Cp))#The inlet air temperature in K\n", + "a1=(r*R*T1)**(1/2)#The velocity of air in m/s\n", + "M1r=W1/a1#Initial relative mach number\n", + "U2=(3.14*D2*N)/60#Peripheral velocity of impeller top at exit in m/s\n", + "W=(ss*U2**2)-(U1*Cx1)#Work done by the compressor in kJ/kg\n", + "T02=(W/Cp)+T01#The outlet stagnation temperature in K\n", + "Cx21=ss*U2#Absolute whirl component of velocity with slip consideration in m/s\n", + "C2=((Cx21**2)+(Cr2**2))**(1/2)#The absolute velocity of air at exit in m/s\n", + "T2=T02-((C2**2)/(2*Cp))#The exit temperature of air in K\n", + "P02=P2*(T02/T2)**(r/(r-1))#The exit stagnation pressure of compressor in bar\n", + "nc=(T01/(T02-T01))*(((P02/P01)**((r-1)/r))-1)#Total head isentropic efficiency\n", + "\n", + "#output\n", + "print '(1)The inlet relative mach number is %3.3f\\n(2)The impeller total head efficiency is %0.1f %%'%(M1r,nc*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)The inlet relative mach number is 0.732\n", + "(2)The impeller total head efficiency is 90.9 %\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.5 Page 100" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "N=16500#The running speed ofradial blade of a centrifugal compressor in rpm\n", + "P=4#The total pressure ratio\n", + "P01=1#The atmospheric pressure in bar\n", + "T01=298#THe atmospheric temperature in K\n", + "Dh=0.16#The hub diameter at impeller eye in m\n", + "Ca=120#The axial velocity at inlet in m/s\n", + "C1=Ca#The absolute velocity at inlet in m/s\n", + "sp=0.7#The pressure coefficient\n", + "C3=120#The absolute velocity at diffuser exit in m/s\n", + "m=8.3#The mass flow rate in kg/s\n", + "nc=0.78#The adiabatic total-to-total efficiency\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "\n", + "#calculations\n", + "T1=T01-((C1**2)/(2*Cp))#The inlet temperature in K\n", + "P1=P01*(T1/T01)**(r/(r-1))#The inlet pressure in bar\n", + "d1=(P1*10**5)/(R*T1)#The inlet density of air in kg/m**3\n", + "Dt=(((4*m)/(3.14*d1*Ca))+(0.16**2))**(1/2)#The eye tip diameter in m\n", + "T=((T01)*((P**((r-1)/r))-1))/nc#The overall change in temperature in K\n", + "ssps=sp/nc#The product of slip factor and power factor\n", + "U2=(T*Cp/ssps)**(1/2)#Peripheral velocity of impeller top at exit in m/s\n", + "D2=(U2*60)/(3.14*N)#The impeller tip diameter in m\n", + "Uh=(3.14*Dh*N)/60#Peripheral velocity of eye hub in m/s\n", + "bh=degrees(atan(C1/Uh))#Blade angle at eye hub in degree\n", + "Ut=(3.14*Dt*N)/60#Peripheral velocity of eye tip in m/s\n", + "bt=degrees(atan(C1/Ut))#Blade angle at eye tip in degree\n", + "T03=T01+T#Temperature at the exit in K\n", + "T3=T03-((C3**2)/(2*Cp))#Exit static temperature in K\n", + "P3=(P*P01)*(T3/T03)**(r/(r-1))#Exit static pressure in bar\n", + "W=m*Cp*(T03-T01)*10**-6#Power required to drive the compressor in mW\n", + "#output\n", + "print '(a)The main dimensions of the impeller are\\n (1)Eye tip diameter is %3.3f m\\n (2)Impeller tip diameter is %3.3f m\\n (3)Blade angle at the eye hub is %3.2f degree\\n Blade angle at the eye tip is %3.2f degree\\n(b) (1)The static exit temperature is %3.1f K\\n (2)The static exit pressure is %3.3f bar\\n(c)The power required is %3.3f mW'%(Dt,D2,bh,bt,T3,P3,W)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The main dimensions of the impeller are\n", + " (1)Eye tip diameter is 0.325 m\n", + " (2)Impeller tip diameter is 0.528 m\n", + " (3)Blade angle at the eye hub is 40.98 degree\n", + " Blade angle at the eye tip is 23.15 degree\n", + "(b) (1)The static exit temperature is 476.5 K\n", + " (2)The static exit pressure is 3.796 bar\n", + "(c)The power required is 1.549 mW\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.6 Page 102" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sin\n", + "#input data\n", + "Dt=0.25#Tip diameter of the eye in m\n", + "Dh=0.1#Hub diameter of the eye in m\n", + "N=120#Speed of the compressor in rps\n", + "m=5#Mass of the air handled in kg/s\n", + "P01=102#Inlet stagnation pressure in kPa\n", + "T01=335#Inlet total temperature in K\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "\n", + "#calculations\n", + "d1=(P01*10**3)/(R*T01)#Density at the inlet of inducer in kg/m**3\n", + "Dm=(Dh+Dt)/2#Mean impeller diameter in m\n", + "b=(Dt-Dh)/2#Impeller blade height in m\n", + "C1=m/(d1*3.14*Dm*b)#Axial velocity component at the inlet in m/s\n", + "T11=T01-((C1**2)/(2*Cp))#Inlet temperature in K\n", + "P11=P01*(T11/T01)**(r/(r-1))#Inlet pressure in kPa\n", + "d11=(P11*10**3)/(R*T11)#Inlet density with mean impeller diameter an blade height in kg/m**3\n", + "C11=m/(d11*3.14*Dm*b)#Axial velocity component at inlet using mean blade values in m/s\n", + "T12=T01-((C1**2)/(2*Cp))#Initial temperature using modified axial velocity in K\n", + "P12=P01*(T12/T01)**(r/(r-1))#Initial pressure at inlet usin modified axial velocity in kPa\n", + "d12=(P12*10**3)/(R*T12)#Inlet density with modified axial velocity in kg/m**3\n", + "C12=m/(d12*3.14*Dm*b)#Axial velocity component at inlet using modified axial velocity in m/s\n", + "U1=3.14*Dm*N#Peripheral velocity of impeller at inlet in m/s\n", + "b1=degrees(atan(C12/U1))#The blade angle at impeller inlet in degree\n", + "W11=C12/sin(b1*pi/180)#Relative velocity at inlet in m/s\n", + "Mr11=W11/(r*R*T12)**(1/2)#Initial relative mach number\n", + "Ca=C12#Axial velocity at IGV in m/s\n", + "W12=Ca#Relative velocity at inlet usin IGV in m/s\n", + "a1=degrees(atan(Ca/U1))#Air angle at IGV exit in degree\n", + "C13=Ca/sin(a1*pi/180)#The velocity of flow of air at inlet in m/s\n", + "T13=T01-((C13**2)/(2*Cp))#Initial temperature using IGV in K\n", + "Mr12=W12/(r*R*T13)**(1/2)#Initial relative mach number using IGV \n", + "\n", + "#output5\n", + "print '(1)Without using IGV\\n (a)The air angle at inlet of inducer blade is %3.2f degree\\n (b)The inlet relative mach number is %3.3f\\n(2)With using IGV\\n (a))The air angle at inlet of inducer blade is %3.2f degree\\n (b)The inlet relative mach number is %3.3f'%(b1,Mr11,a1,Mr12)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)Without using IGV\n", + " (a)The air angle at inlet of inducer blade is 61.23 degree\n", + " (b)The inlet relative mach number is 0.377\n", + "(2)With using IGV\n", + " (a))The air angle at inlet of inducer blade is 61.23 degree\n", + " (b)The inlet relative mach number is 0.332\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.7 Page 105" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Cr2=28#Radial component of velocity at impeller exit in m/s\n", + "ss=0.9#The slip factor\n", + "U2=350#The impeller tip speed in m/s\n", + "A=0.08#The impeller area in m**2\n", + "nc=0.9#Total head isentropic efficiency\n", + "T01=288#The ambient air temperature in K\n", + "P01=1#The ambient air pressure in bar\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "\n", + "#calculations\n", + "Cx2=ss*U2#outlet absolute velocity of air in tangential direction in m/s\n", + "C2=((Cx2**2)+(Cr2**2))**(1/2)#Axial velocity component at the outlet in m/s\n", + "T=(ss*(U2**2))/Cp#Total change in temperature in K\n", + "T02=T+T01#The final ambient air temperature in K\n", + "T2=T02-((C2**2)/(2*Cp))#The actual final air temperature in K\n", + "M2=(C2)/(r*R*T2)**(1/2)#Exit absolute mach number\n", + "P=((1+(ss*T/T01))**(r/(r-1)))#The overall pressure ratio\n", + "P02=P*P01#The final ambient pressure in bar\n", + "P2=P02*(T2/T02)**(r/(r-1))#The absolute final pressure in bar\n", + "d2=(P2*10**5)/(R*T2)#The final density of air at exit in kg/m**3\n", + "m=d2*A*Cr2#The mass flow rate in kg/s\n", + "\n", + "#output\n", + "print '(a)The exit absolute mach number is %3.4f\\n(b)The mass flow rate is %3.4f kg/s'%(M2,m)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The exit absolute mach number is 0.8458\n", + "(b)The mass flow rate is 3.9423 kg/s\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.8 Page 107" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Dh=0.175#Hub diameter of the eye in m\n", + "Dt=0.3125#Tip diameter of the eye in m\n", + "m=20#Mass of the air handled in kg/s\n", + "N=16000#Speed of the compressor in rpm\n", + "T01=288#The ambient air temperature in K\n", + "P01=100#The ambient air pressure in kPa\n", + "Ca=152#The axial component of inlet velocity of eye in m/s\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "\n", + "\n", + "#calculations\n", + "A=(3.14/4)*((Dt**2)-(Dh**2))#Annulus area of flow at the impeller eye in m**2\n", + "Ut=(3.1415*Dt*N)/60#Impeller eye tip speed in m/s\n", + "Uh=(3.1415*Dh*N)/60#Impeller eye hub speed in m/s\n", + "a1=90-20#Blade angle at inlet in degree \n", + "C1=Ca/sin(a1*pi/180)#The air entry velocity into the impeller eye in m/s\n", + "T1=T01-((C1**2)/(2*Cp))#The actual inlet air temperature in K\n", + "P1=P01*(T1/T01)**(r/(r-1))#The actual inlet air pressure in kPa\n", + "d1=P1/(R*T1)#The initial density of air at entry in kg/m**3\n", + "b1h=degrees(atan(Ca/(Uh-(Ca/tan(a1*pi/180)))))#Impeller angle at the hub in degree\n", + "b1t=degrees(atan(Ca/(Ut-(Ca/tan(a1*pi/180)))))#Impeller angle at the tip of eye in degree\n", + "Cx1=Ca/tan(a1*pi/180)#Inlet absolute velocity of air in tangential direction in m/s\n", + "Wx1=Ut-Cx1#Relative whirl component of velocity at inlet in m/s\n", + "W1=((Wx1**2)+(Ca**2))**(1/2)#Relative velocity at inlet in m/s\n", + "Mr1=W1/(r*R*T1)**(1/2)#Maximum mach number at the eye\n", + "\n", + "#output\n", + "print '(a)\\n (1)The impeller eye tip speed is %3.2f m/s\\n (2)The impeller eye hub speed is %3.2f m/s\\n (3)The impeller angle at the hub is %i degree\\n (4)Impeller angle at the tip of eye is %3.2f degree\\n(b)The maximum mach number at the eye is %3.2f'%(Ut,Uh,b1h,b1t,Mr1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)\n", + " (1)The impeller eye tip speed is 261.79 m/s\n", + " (2)The impeller eye hub speed is 146.60 m/s\n", + " (3)The impeller angle at the hub is 59 degree\n", + " (4)Impeller angle at the tip of eye is 36.36 degree\n", + "(b)The maximum mach number at the eye is 0.77\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.9 Page 109" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P1=100#The air in take pressure in kPa\n", + "T1=309#The air in take temperature in K\n", + "H=0.750#Pressure head developed in mm W.G\n", + "P=33#Input power to blower in kW\n", + "nb=0.79#Blower efficiency\n", + "nm=0.83#Mechanical efficiency\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "d=(P1*10**3)/(R*T1)#Density of air flow at inlet in kg/m**3\n", + "dP=dw*g*H#Total change in pressure in N/m**2\n", + "IW=dP/d#Ideal work done in J/kg\n", + "Wm=IW/nb#Actual work done per unit mass flow rate in J/kg\n", + "W=P*nm#Actual power input in kW\n", + "m=(W*10**3)/Wm#Mass flow rate in kg/s\n", + "Q=m/d#Volume flow rate in m**3/s\n", + "P2=P1+(dP/10**3)#The exit pressure of air in kPa\n", + "T2=T1+(Wm/(Cp))#The exit temperature of air in K\n", + "\n", + "#output\n", + "print '(a)The mass flow rate of air is %3.3f kg/s\\n(b)The volume flow rate of air is %3.2f m**3/s\\n(c)\\n (1)The exit pressure of air is %3.2f kPa\\n (2)The exit temperature of air is %3.2f K'%(m,Q,P2,T2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The mass flow rate of air is 3.316 kg/s\n", + "(b)The volume flow rate of air is 2.94 m**3/s\n", + "(c)\n", + " (1)The exit pressure of air is 107.36 kPa\n", + " (2)The exit temperature of air is 317.22 K\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.10 Page 110" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "H=0.075#Pressure developed by a fan in m W.G\n", + "D2=0.89#The impeller diameter in m\n", + "N=720#The running speed of the fan in rpm\n", + "b22=39#The blade air angle at the tip in degree\n", + "b2=0.1#The width of the impeller in m\n", + "Cr=9.15#The constant radial velocity in m/s\n", + "d=1.2#Density of air in kg/m**3\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "IW=(dw*g*H)/d#Ideal work done in J/kg\n", + "U2=(3.1415*D2*N)/60#The impeller tip speed in m/s\n", + "Wx2=Cr/tan(b22*pi/180)#Relative whirl component of velocity at outlet in m/s\n", + "Cx2=U2-(Wx2)#Outlet absolute velocity of air in tangential direction in m/s\n", + "Wm=U2*Cx2#Actual work done per unit mass flow rate in J/kg\n", + "nf=IW/Wm#Fan efficiency\n", + "Q=3.1415*D2*b2*Cr#The discharge of the air by fan in m**3/s\n", + "m=d*Q#Mass flow rate of the air by the fan in kg/s\n", + "W=m*Wm*10**-3#Power required to drive the fan in kW\n", + "R=1-(Cx2/(2*U2))#Stage reaction of the fan\n", + "sp=2*Cx2/U2#The pressure coefficient\n", + "\n", + "#output\n", + "print '(a)The fan efficiency is %0.1f %%\\n(b)The Discharge of air by the fan is %3.3f m**3/s\\n(c)The power required to drive the fan is %3.4f kW\\n(d)The stage reaction of the fan is %0.2f %%\\n(e)The pressure coefficient of the fan is %3.3f'%(nf*100,Q,W,R*100,sp)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The fan efficiency is 82.1 %\n", + "(b)The Discharge of air by the fan is 2.558 m**3/s\n", + "(c)The power required to drive the fan is 2.2919 kW\n", + "(d)The stage reaction of the fan is 66.84 %\n", + "(e)The pressure coefficient of the fan is 1.326\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.11 Page 111" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "\n", + "b22=30#The blade air angle at the tip in degrees\n", + "D2=0.466#The impeller diameter in m\n", + "Q=3.82#The discharge of the air by fan in m**3/s\n", + "m=4.29#Mass flow rate of the air by the fan in kg/s\n", + "H=0.063#Pressure developed by a fan in m W.G\n", + "pi2=0.25#Flow coefficient at impeller exit\n", + "W=3#Power supplied to the impeller in kW\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=10**3#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "IW=Q*dw*g*H*(10**-3)#Ideal work done in kW\n", + "nf=IW/W#Fan efficiency\n", + "U2=(((W*10**3)/m)/(1-(pi2/tan(b22*pi/180))))**(1/2)#The impeller tip speed in m/s\n", + "Cr2=pi2*U2#The radial velocity at exit in m/s\n", + "Cx2=U2-(Cr2/tan(b22*pi/180))#Outlet absolute velocity of air in tangential direction in m/s\n", + "sp=2*Cx2/U2#Presuure coefficient of the fan\n", + "R=1-(Cx2/(2*U2))#Degree of reaction of the fan\n", + "N=(U2*60)/(3.141592*D2)#Rotational speed of the fan in rpm\n", + "b2=Q/(3.14*D2*Cr2)#Impeller width at the exit in m\n", + "\n", + "#output\n", + "print '(a)The fan efficiency is %0.1f %%\\n(b)The pressure coefficient is %3.3f\\n(c)The degree of reaction of the fan is %0.1f %%\\n(d)The rotational speed of the fan is %3.1f rpm\\n(e)The impeller width at exit is %0.1f cm'%(nf*100,sp,R*100,N,b2*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The fan efficiency is 78.7 %\n", + "(b)The pressure coefficient is 1.134\n", + "(c)The degree of reaction of the fan is 71.7 %\n", + "(d)The rotational speed of the fan is 1439.3 rpm\n", + "(e)The impeller width at exit is 29.7 cm\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.12 Page 113" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "N=3000#The running speed of the blower in rpm\n", + "D2=0.75#The impeller diameter in m\n", + "Cr2=57#The radial velocity at exit in m/s\n", + "Cx1=0#Inlet absolute velocity of air in tangential direction in m/s\n", + "DR=0.58#Degree of reaction of the blower\n", + "nc=0.75#Total-to-total efficiency\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1.005#The specific heat of air at constant pressure in J/kg.K\n", + "T01=298#The inlet stagnation temperature in K\n", + "P01=1*101.325#The inlet stagnation pressure in kPa\n", + "\n", + "#calculations\n", + "U2=(3.1415*D2*N)/60#The impeller tip speed in m/s\n", + "Cx2=2*(1-DR)*U2#Outlet absolute velocity of air in tangential direction in m/s\n", + "Wx2=U2-Cx2#Relative whirl component of velocity at outlet in m/s\n", + "b22=degrees(atan(Cr2/Wx2))#The blade air angle at the tip in degree\n", + "Wm=U2*Cx2*10**-3#Actual work done per unit mass flow rate when Cx1=0 in kW/(kg/s)\n", + "T=Wm/Cp#Total change in temperature in blower in K\n", + "P=(1+(nc*(T/T01)))**(r/(r-1))#Total pressure ratio in the blower\n", + "P02=P*P01#The outlet stagnation pressure from blower in kPa\n", + "\n", + "#output\n", + "print '(a)The exit blade angle is %3.1f degree\\n(b)The power input to the blower is %3.3f kW/(kg/s)\\n(c)The exit stagnation pressure is %3.2f kPa'%(b22,Wm,P02)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The exit blade angle is 71.7 degree\n", + "(b)The power input to the blower is 11.658 kW/(kg/s)\n", + "(c)The exit stagnation pressure is 112.06 kPa\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.13 Page 114" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "D1=0.18#The impeller inner diameter in m\n", + "D2=0.2#The impeller outer diameter in m\n", + "C1=21#The absolute velocity at the entry in m/s\n", + "C2=25#The absolute velocity at the exit in m/s\n", + "W1=20#The relative velocity at the entry in m/s\n", + "W2=17#The relative velocity at the exit in m/s\n", + "N=1450#The running speed of the fan in rpm\n", + "m=0.5#The mass flow rate of the air in fan in kg/s\n", + "nm=0.78#The motor efficiency of the fan \n", + "d=1.25#The density of the air in kg/m**3\n", + "r=1.4#The ratio of specific heats of air\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1.005#The specific heat of air at constant pressure in J/kg.K\n", + "\n", + "#calculations\n", + "U1=(3.14*D1*N)/60#Peripheral velocity of impeller at inlet in m/s\n", + "U2=(3.14*D2*N)/60#The impeller tip speed in m/s\n", + "dH=(((U2**2)-(U1**2))/2)+(((W1**2)-(W2**2))/2)#The actual total rise in enthalpy in kJ/kg\n", + "dH0=dH+(((C2**2)-(C1**2))/2)#The stage total isentropic rise in enthalpy in kJ/kg\n", + "dP0=d*dH0#The stage total pressure rise in N/m**2\n", + "dP=d*dH#The actual total rise in pressure in N/m**2\n", + "R=dP/dP0#The degree of reaction of the fan\n", + "W=m*(dH0)#The work done by the fan per second in W\n", + "P=W/nm#The power input to the fan in W\n", + "\n", + "#output\n", + "print '(a)The stage total pressure rise is %3.1f N/m**2\\n(b)The degree of reaction of the fan is %3.3f\\n(c)The power input to the fan is %3.1f W'%(dP0,R,P)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The stage total pressure rise is 211.7 N/m**2\n", + "(b)The degree of reaction of the fan is 0.457\n", + "(c)The power input to the fan is 108.6 W\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 3.14 Page 116" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "dH=0.14#Rise in static pressure of the air by fan in m of water\n", + "N=650#The running speed of the fan in rpm\n", + "P=85*0.735#Power consumed by the fan in kW\n", + "H1=0.75#The static pressure of the air at the fan in m of Hg\n", + "T1=298#The static pressure at the fan of air in K\n", + "m=260#Mass flow rate of air in kg/min\n", + "dHg=13590#Density of mercury in kg/m**3\n", + "dw=1000#Density of water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "R=287#The universal gas constant in J/kg.K\n", + "\n", + "#calculations\n", + "P1=dHg*g*H1*10**-3#The inlet static pressure in kPa\n", + "dP=dw*g*dH*10**-3#The total change in static pressures at inlet and outlet in kPa\n", + "P2=P1+dP#The exit static pressure in kPa\n", + "d1=(P1*10**3)/(R*T1)#The inlet density of the air in kg/m**3\n", + "Q=m/d1#The volume flow rate of air in fan in m**3/min\n", + "\n", + "#output\n", + "print '(a)The exit static pressure of air in the fan is %3.2f kPa\\n(b)The volume flow rate of the air is %3.1f m**3/min'%(P2,Q)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The exit static pressure of air in the fan is 101.36 kPa\n", + "(b)The volume flow rate of the air is 222.4 m**3/min\n" + ] + } + ], + "prompt_number": 14 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Turbomachines_by_A._V._Arasu/Ch4.ipynb b/Turbomachines_by_A._V._Arasu/Ch4.ipynb new file mode 100644 index 00000000..0af505f8 --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/Ch4.ipynb @@ -0,0 +1,997 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4faebe859c372462cb5f17df384c957420077f8445fdcb43b3688f5924547a9e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4 - Axial Flow Compressors & Fans" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.1 Page 145" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import tan, pi\n", + "#input data\n", + "b1=60#The angle made by the relative velocity vector at exit in degree\n", + "db=30#The turning angle in degree\n", + "dCx=100#The change in the tangential velocities in m/s\n", + "DR=0.5#Degree of reaction\n", + "N=36000#The speed of the compressor in rpm\n", + "D=0.14#Mean blade diameter in m\n", + "P1=2#Inlet pressure in bar\n", + "T1=330#Inlet temperature in K\n", + "b=0.02#Blade height in m\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1.005#The specific heat of air at constant pressure in kJ/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "#calculations\n", + "b2=b1-db#The angle made by the relative velocity vector at entry in degree\n", + "a1=b2#Air flow angle at exit in degree as DR=0.5\n", + "U=(3.1415*D*N)/60#The blade mean speed in m/s\n", + "T2=((U*dCx)/(Cp*1000))+T1#The exit air temperature in K\n", + "P2=P1*(T2/T1)**(r/(r-1))#The exit air pressure in bar\n", + "dP=P2-P1#The pressure rise in bar\n", + "Ca=(2*U*DR)/(tan(b2*pi/180)+tan(b1*pi/180))#The axial velocity in m/s\n", + "A1=3.1415*D*b#The inlet flow area in m**2\n", + "d1=(P1*10**5)/(R*T1)#The inlet air density in kg/m**3\n", + "m=d1*A1*Ca#The amount of air handled in kg/s\n", + "W=m*Cp*(T2-T1)#The power developed in kW\n", + "\n", + "#output\n", + "print '(a)Air flow angle at exit is %3i degree\\n(b)The pressure rise is %3.2f bar\\n(c)The amount of air handled is %3.2f kg/s\\n(d)The power developed is %3.1f kW'%(a1,dP,m,W)\n", + "# The answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Air flow angle at exit is 30 degree\n", + "(b)The pressure rise is 0.61 bar\n", + "(c)The amount of air handled is 2.12 kg/s\n", + "(d)The power developed is 56.0 kW\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.2 Page 147" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import log10\n", + "#input data\n", + "P01=1#Atmospheric pressure at inlet in bar\n", + "T01=291#Atmospheric temperature at inlet in K\n", + "T02=438#Total head temperature in delivery pipe in K \n", + "P02=3.5#Total head pressure in delivery pipe in bar\n", + "P2=3#Staic pressure in delivery pipe in bar\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "#calculations \n", + "T02s=T01*(P02/P01)**((r-1)/r)#Total isentropic head temperature in delivery pipe in K \n", + "nc=(T02s-T01)/(T02-T01)#Total head isentropic efficiency\n", + "np=((log10(P02/P01))/((r/(r-1))*(log10(T02/T01))))#Polytropic efficiency\n", + "T2=T02*(P2/P02)**((r-1)/r)#Static temperature in delivery pipe in K\n", + "C2=(2*Cp*(T02-T2))**(1/2)#The air velocity in delivery pipe in m/s\n", + "\n", + "#output\n", + "print '(a)Total head isentropic efficiency is %0.1f %%\\n(b)Polytropic efficiency %0.1f %%\\n(c)The air velocity in delivery pipe is %3.2f m/s'%(nc*100,np*100,C2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Total head isentropic efficiency is 85.2 %\n", + "(b)Polytropic efficiency 87.5 %\n", + "(c)The air velocity in delivery pipe is 194.76 m/s\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.3 Page 148" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import atan, degrees\n", + "#input data\n", + "N=8#Number of stages\n", + "Po=6#Overall pressure ratio \n", + "T01=293#Temperature of air at inlet in K\n", + "nc=0.9#Overall isentropic efficiency\n", + "DR=0.5#Degree of reaction \n", + "U=188#Mean blade speed in m/s\n", + "Ca=100#Constant axial velocity in m/s\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "#calculations\n", + "T0n1s=T01*(Po)**((r-1)/r)#The isentropic temperature of air leaving compressor stage in K\n", + "T0n1=((T0n1s-T01)/nc)+T01#The temperature of air leaving compressor stage in K\n", + "dta2ta1=(Cp*(T0n1-T01))/(N*U*Ca)#The difference between tan angles of air exit and inlet\n", + "sta1tb1=U/Ca#The sum of tan of angles of air inlet and the angle made by the relative velocity \n", + "b1=degrees(atan((dta2ta1+sta1tb1)/2))#The angle made by the relative velocity vector at exit in degree as the DR=1 then a2=b1\n", + "a1=degrees(atan(tan(b1*pi/180)-dta2ta1))#Air flow angle at exit in degree\n", + "W=Cp*(T0n1-T01)*10**-3#Power required per kg of air/s in kW\n", + "\n", + "#output\n", + "print '(a)Power required is %3.2f kW\\n(b)\\n (1)Air flow angle at exit is %.f degree \\n (2)The angle made by the relative velocity vector at exit is %.f degree'%(W,a1,b1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Power required is 218.73 kW\n", + "(b)\n", + " (1)Air flow angle at exit is 12 degree \n", + " (2)The angle made by the relative velocity vector at exit is 59 degree\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.4 Page 149" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "W=4.5#Power absorbed by the compressor in MW\n", + "m=20#Amount of air delivered in kg/s\n", + "P01=1#Stagnation pressure of air at inlet in bar\n", + "T01=288#Stagnation temperature of air at inlet in K\n", + "np=0.9#Polytropic efficiency of compressor\n", + "dT0=20#Temperature rise in first stage in K\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1.005#The specific heat of air at constant pressure in kJ/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "\n", + "#calculations\n", + "T02=T01+dT0#Stagnation temperature of air at outlet in K\n", + "T0n1=((W*10**3)/(m*Cp))+T01#The temperature of air leaving compressor stage in K\n", + "P0n1=P01*(T0n1/T01)**((np*r)/(r-1))#Pressure at compressor outlet in bar\n", + "P1=(T02/T01)**((np*r)/(r-1))#The pressure ratio at the first stage \n", + "N=((log10(P0n1/P01)/log10(P1)))#Number of stages \n", + "T0n1T01=(P0n1/P01)**((r-1)/(np*r))#The temperature ratio at the first stage\n", + "T0n1sT01=(P0n1/P01)**((r-1)/r)#The isentropic temperature ratio at the first stage\n", + "nc=((T0n1sT01-1)/(T0n1T01-1))#The overall isentropic efficiency\n", + "\n", + "#output\n", + "print '(a)Pressure at compressor outlet is %3.2f bar\\n(b)Number of stages is %3.f\\n(c)The overall isentropic efficiency is %0.1f %%'%(P0n1,N,nc*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Pressure at compressor outlet is 6.12 bar\n", + "(b)Number of stages is 9\n", + "(c)The overall isentropic efficiency is 87.2 %\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.5 Page 151" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import log\n", + "#input data\n", + "DR=0.5#Degree of reaction\n", + "b1=44#Blade inlet angle in degree\n", + "b2=13#Blade outlet angle in degree\n", + "Po=5#The pressure ratio produced by the compressor\n", + "nc=0.87#The overall isentropic efficiency\n", + "T01=290#Inlet temperature in K\n", + "U=180#Mean blade speed in m/s\n", + "l=0.85#Work input factor\n", + "R=0.287#The universal gas constant in kJ/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "#calculations\n", + "a2=b1#Air flow angle at entry in degree as DR=0.5\n", + "a1=b2#Air flow angle at exit in degree as DR=0.5\n", + "T0n1s=T01*(Po)**((r-1)/r)#The isentropic temperature of air leaving compressor stage in K\n", + "T0n1=((T0n1s-T01)/nc)+T01#The temperature of air leaving compressor stage in K\n", + "Ca=U/(tan(b2*pi/180)+tan(b1*pi/180))#The axial velocity in m/s\n", + "N=((Cp*(T0n1-T01))/(l*U*Ca*(tan(a2*pi/180)-tan(a1*pi/180))))#The number of stages \n", + "ds=(Cp*(10**-3)*log(T0n1/T01))-(R*log(Po))#Change in entropy in kJ/kg.K\n", + "\n", + "#output\n", + "print '(a)The number of stages are %3.f\\n(b)The change in entropy is %3.3f kJ/kg-K'%(N,ds)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The number of stages are 12\n", + "(b)The change in entropy is 0.054 kJ/kg-K\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.6 Page 152" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "D=0.6#Mean diameter of compressor in m\n", + "N=15000#Running speed of the compressor in rpm\n", + "dT=30#Actual overall temperature raise in K\n", + "PR=1.3#Pressure ratio of all stages\n", + "m=57#Mass flow rate of air in kg/s\n", + "nm=0.86#Mechanical efficiency\n", + "T1=308#Initial temperature in K\n", + "T2=328#Temperature at rotor exit in K\n", + "r=1.4#The ratio of specific heats of air\n", + "Cp=1.005#The specific heat of air at constant pressure in kJ/kg.K\n", + "\n", + "#calculations\n", + "W=m*Cp*dT#Work done in kW\n", + "P=W/nm#Power required in kW\n", + "ns=((T1*((PR**((r-1)/r))-1))/(dT))#Stage efficiency\n", + "R=(T2-T1)/(dT)#Reaction ratio\n", + "\n", + "#output\n", + "print '(a)Power required to drive the compressor is %3.3f kW\\n(b)The stage efficiency is %0.2f %%\\n(c)The degree of reaction is %3.2f'%(P,ns*100,R)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Power required to drive the compressor is 1998.314 kW\n", + "(b)The stage efficiency is 79.92 %\n", + "(c)The degree of reaction is 0.67\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.7 Page 153" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Pr=2#The pressure ratio of first stage\n", + "P1=1.01#The inlet pressure in bar\n", + "T1=303#The inlet temperature in K\n", + "nc=0.83#Overall efficency of the compressor\n", + "pi=0.47#The flow coefficient\n", + "dCxCa=0.5#Ratio of change of whirl velocity to axial velocity\n", + "D=0.5#Mean diameter in m\n", + "r=1.4#The ratio of specific heats of air\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "\n", + "#calculations\n", + "dT=T1*((Pr**((r-1)/r))-1)/nc#The Actual overall temperature raise in K\n", + "dCx=dCxCa*pi#The change of whirl velocity in m/s\n", + "U=(dT*Cp/dCx)**(1/2)#The mean blade speed in m/s\n", + "N=(U*60)/(3.1415*D)#Speed at which compressor runs in rpm\n", + "Cx2=(U+(dCx*U))/2#The whirl velocity at exit in m/s\n", + "Cx1=U-Cx2#The whirl velocity at entry in m/s\n", + "Ca=pi*U#The axial velocity in m/s\n", + "C1=((Ca**2)+(Cx1**2))**(1/2)#The inlet absolute velocity of air in m/s\n", + "\n", + "#output\n", + "print '(a)The compressor speed is %3i rpm\\n(b)The absolute velocity of air is %3.2f m/s'%(N,C1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The compressor speed is 22336 rpm\n", + "(b)The absolute velocity of air is 354.34 m/s\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.8 Page 154" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import acos, asin, sin,cos, sqrt, degrees, pi, atan, tan\n", + "from __future__ import division\n", + "#input data\n", + "N=9000#The rotational speed in rpm\n", + "dT0=20#The stagnation temperature rise in K\n", + "DhDt=0.6#The hub to tip ratio\n", + "l=0.94#The work donee factor\n", + "ns=0.9#The isentropic efficiency of the stage\n", + "C1=150#Inlet velocity in m/s\n", + "P01=1#The ambient pressure in bar\n", + "T01=300#The ambient temperature in K\n", + "Mr1=0.92#Mach number relative to tip \n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in kJ/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "T1=T01-((C1**2)/(2*Cp))#The inlet temperature in K\n", + "W1=Mr1*sqrt(r*R*T1)#The relative velocity at entry in m/s\n", + "b11=degrees(acos((C1)/(W1)))#The inlet rotor angle at tip in degree\n", + "Ut=W1*sin(b11*pi/180)#Tip speed in m/s\n", + "rt=(Ut*60)/(2*3.1415*N)#The tip radius in m\n", + "b12=degrees(atan((tan(b11*pi/180)))-((Cp*dT0)/(l*Ut*C1)))#The outlet rotor angle at tip in degree\n", + "P1=P01*(T1/T01)**(r/(r-1))#The inlet pressure in bar\n", + "d1=(P1*10**5)/(R*T1)#The density of air at the entry in kg/m**3\n", + "Dt=2*rt#The tip diameter in m\n", + "Dh=DhDt*(Dt)#The hub diameter in m\n", + "A1=(3.141/4)*((Dt**2)-(Dh**2))#The area of cross section at the entry in m**2\n", + "rm=((Dt/2)+(Dh/2))/2#The mean radius in m\n", + "h=((Dt/2)-(Dh/2))#The height of the blade in m\n", + "A=2*3.1415*rm*h#The area of the cross section in m**2\n", + "m=d1*A*C1#The mass flow rate in kg/s\n", + "P03P01=(1+((ns*dT0)/T01))**(r/(r-1))#The stagnation pressure ratio \n", + "P=m*Cp*dT0*10**-3#The power required in kW\n", + "Uh=(3.1415*Dh*N)/60#The hub speed in m/s\n", + "b21=degrees(atan(Uh/C1))#The rotor air angle at entry in degree\n", + "b22=degrees(atan(tan(b21*pi/180)-((Cp*dT0)/(l*Uh*C1))))#The rotor air angle at exit in degree\n", + "\n", + "#output\n", + "print '(a)\\n (1)The tip radius is %3.3f m\\n (2)The rotor entry angle at tip section is %3.1f degree\\n (3)The rotor exit angle at tip section is %3.2f degree\\n(b)Mass flow entering the stage is %3.3f kg/s\\n(c)\\n (1)The stagnation pressure ratio is %3.3f\\n (2)The power required is %3.2f kW\\n(d)\\n (1)The rotor air angle at entry is %3.2f degree\\n (2)The rotor air angle at exit is %3.2f degree'%(rt,b11,b12,m,P03P01,P,b21,b22)\n", + "#the answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)\n", + " (1)The tip radius is 0.292 m\n", + " (2)The rotor entry angle at tip section is 61.4 degree\n", + " (3)The rotor exit angle at tip section is 31.72 degree\n", + "(b)Mass flow entering the stage is 27.152 kg/s\n", + "(c)\n", + " (1)The stagnation pressure ratio is 1.226\n", + " (2)The power required is 545.75 kW\n", + "(d)\n", + " (1)The rotor air angle at entry is 47.74 degree\n", + " (2)The rotor air angle at exit is 13.35 degree\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.9 Page 157" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Ur=150#The blade root velocity in m/s\n", + "Um=200#The mean velocity in m/s\n", + "Ut=250#The tip velocity in m/s\n", + "dT0=20#The total change in temperature in K\n", + "Ca=150#The axial velocity in m/s\n", + "l=0.93#The work done factor \n", + "Rm=0.5#Reaction at mean radius\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "#calculations\n", + "dtb1tb2=((Cp*dT0)/(l*Um*Ca))#The difference between the tangent angles of blade angles at mean\n", + "atb1tb2=((2*Rm*Um)/(Ca))#The sum of the tangent angles of blade angles at mean\n", + "b1m=degrees(atan((atb1tb2+dtb1tb2)/2))#The inlet blade angle in degree at mean\n", + "a2m=b1m#The exit air angle in degree as the Reaction at mean radius is 0.5\n", + "b2m=degrees(atan(tan(b1m*pi/180)-dtb1tb2))#The exit blade angle in degree at mean\n", + "a1m=b2m#The inlet air angle in degree as the reaction at mean radius is 0.5\n", + "rmrh=Um/Ur#The ratio of radii of mean and root velocities at hub\n", + "a1h=degrees(atan(tan(a1m*pi/180)*(rmrh)))#The inlet air angle in degree at hub\n", + "b1h=degrees(atan((Ur/Ca)-(tan(a1h*pi/180))))#The inlet blade angle in degree at hub\n", + "a2h=degrees(atan(tan(a2m*pi/180)*(rmrh)))#The outlet air angle in degree at hub\n", + "b2h=degrees(atan((Ur/Ca)-(tan(a2h*pi/180))))#The outlet blade angle in degree at hub\n", + "Rh=((Ca*(tan(b1h*pi/180)+tan(b2h*pi/180)))/(2*Ur))#The degree of reaction at the hub\n", + "rmrt=Um/Ut#The ratio of radii of mean and tip velocities at tip\n", + "a1t=degrees(atan(tan(a1m)*(rmrt)))#The inlet air angle in degree at tip\n", + "b1t=degrees(atan((Ut/Ca)-(tan(a1t*pi/180))))#The inlet blade angle in degree at tip\n", + "a2t=degrees(atan(tan(a2m)*(rmrt)))#The outlet air angle in degree at tip\n", + "b2t=degrees(atan((Ut/Ca)-(tan(a2t*pi/180))))#The outlet blade angle in degree at tip\n", + "Rt=((Ca*(tan(b1t*pi/180)+tan(b2t*pi/180)))/(2*Ut))#The degree of reaction at tip\n", + "\n", + "#output\n", + "print '(a)At the mean\\n (1)The inlet blade angle is %3.2f degree\\n (2)The inlet air angle is %3.2f degree\\n (3)The outlet blade angle is %3.2f degree\\n (4)The outlet air angle is %3.2f degree\\n (5)Degree of reaction is %3.1f \\n(b)At the root\\n (1)The inlet blade angle is %3.2f degree\\n (2)The inlet air angle is %3.2f degree\\n (3)The outlet blade angle is %3.2f degree\\n (4)The outlet air angle is %3.2f degree\\n (5)Degree of reaction is %3.3f\\n(c)At the tip\\n (1)The inlet blade angle is %3.2f degree\\n (2)The inlet air angle is %3.2f degree\\n (3)The outlet blade angle is %3.2f degree\\n (4)The outlet air angle is %3.2f degree\\n (5)Degree of reaction is %3.3f\\n'%(b1m,a1m,b2m,a2m,Rm,b1h,a1h,b2h,a2h,Rh,b1t,a1t,b2t,a2t,Rt)\n", + "#the answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)At the mean\n", + " (1)The inlet blade angle is 45.76 degree\n", + " (2)The inlet air angle is 17.04 degree\n", + " (3)The outlet blade angle is 17.04 degree\n", + " (4)The outlet air angle is 45.76 degree\n", + " (5)Degree of reaction is 0.5 \n", + "(b)At the root\n", + " (1)The inlet blade angle is 30.60 degree\n", + " (2)The inlet air angle is 22.23 degree\n", + " (3)The outlet blade angle is -20.26 degree\n", + " (4)The outlet air angle is 53.86 degree\n", + " (5)Degree of reaction is 0.111\n", + "(c)At the tip\n", + " (1)The inlet blade angle is -57.81 degree\n", + " (2)The inlet air angle is 72.92 degree\n", + " (3)The outlet blade angle is 79.66 degree\n", + " (4)The outlet air angle is -75.31 degree\n", + " (5)Degree of reaction is 1.168\n", + "\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.10 Page 160" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Uh=150#The blade root velocity in m/s\n", + "Um=200#The mean velocity in m/s\n", + "Ut=250#The tip velocity in m/s\n", + "dT0=20#The total change in temperature in K\n", + "Ca1m=150#The axial velocity in m/s\n", + "l=0.93#The work done factor \n", + "Rm=0.5#Reaction at mean radius\n", + "N=9000#Rotational speed in rpm\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "#calculations\n", + "dtb1tb2=((Cp*dT0)/(l*Um*Ca1m))#The difference between the tangent angles of blade angles at mean\n", + "atb1tb2=((2*Rm*Um)/(Ca1m))#The sum of the tangent angles of blade angles at mean\n", + "b1m=degrees(atan((atb1tb2+dtb1tb2)/2))#The inlet blade angle in degree at mean\n", + "a2m=b1m#The exit air angle in degree as the Reaction at mean radius is 0.5\n", + "b2m=degrees(atan(tan(pi/180*b1m)-dtb1tb2))#The exit blade angle in degree at mean\n", + "a1m=b2m#The inlet air angle in degree as the reaction at mean radius is 0.5\n", + "Dh=(Uh*60)/(3.141*N)#Hub diameter in m\n", + "Dm=(Um*60)/(3.141*N)#Mean diameter in m\n", + "Cx1m=Ca1m*tan(pi/180*a1m)#The whirl velocity at inlet at mean in m/s\n", + "Cx2m=Ca1m*tan(pi/180*a2m)#The whirl velocity at exit at mean in m/s\n", + "Cx1h=(Cx1m*(Dh/2)/(Dm/2))#The whirl velocity at inlet at hub in m/s\n", + "Cx2h=(Cx2m*(Dh/2)/(Dm/2))#The whirl velocity at exit at hub in m/s\n", + "K1=(Ca1m**2)+(2*(Cx1m**2))#Sectional velocity in m/s\n", + "Ca1h=((K1)-(2*(Cx1h**2)))**(1/2)#The axial velocity at hub inlet in (m/s)**2\n", + "w=(2*3.141*N)/60#Angular velocity of blade in rad/s\n", + "K2=(Ca1m**2)+(2*(Cx2m**2))-(2*((Cx2h/(Dh/2))-(Cx1m/(Dm/2))))*(w*(Dm/2)**(2))#Sectional velocity in (m/s)**2\n", + "Ca2h=(K2-(2*Cx2h**2)+(2*((Cx2h/(Dh/2))-(Cx1h/(Dh/2))))*(w*(Dh/2)**(2)))**(1/2)#Axial velocity at hub outlet in m/s\n", + "a1h=degrees(atan(Cx1h/Ca1h))#Air angle at inlet in hub in degree\n", + "b1h=degrees(atan((Uh-Cx1h)/Ca1h))#Blade angle at inlet in hub in degree\n", + "a2h=degrees(atan(Cx2h/Ca2h))#Air angle at exit in hub in degree\n", + "b2h=degrees(atan((Uh-Cx2h)/Ca2h))#Blade angle at exit in hub in degree\n", + "W1=Ca1h/cos(pi/180*b1h)#Relative velocity at entry in hub in m/s\n", + "W2=Ca2h/cos(pi/180*b2h)#Relative velocity at exit in hub in m/s\n", + "Rh=((W1**2)-(W2**2))/(2*Uh*(Cx2h-Cx1h))#The degree of reaction at hub\n", + "Dt=(Ut*60)/(3.141*N)#Tip diameter in m\n", + "Cx1t=(Cx1m*(Dt/2)/(Dm/2))#The whirl velocity at inlet at tip in m/s\n", + "Cx2t=(Cx2m*(Dt/2)/(Dm/2))#The whirl velocity at exit at tip in m/s\n", + "Ca1t=(K1-(2*Cx1t**2))**(1/2)#Axial velocity at tip inlet in m/s\n", + "Ca2t=(K2-(2*Cx2t**2)+(2*((Cx2t/(Dt/2))-(Cx1t/(Dt/2))))*(w*(Dt/2)**(2)))**(1/2)#Axial velocity at tip outlet in m/s\n", + "a1t=degrees(atan(Cx1t/Ca1t))#Air angle at inlet in tip in degree\n", + "b1t=degrees(atan((Ut-Cx1t)/Ca1t))#Blade angle at inlet in tip in degree\n", + "a2t=degrees(atan(Cx2t/Ca2t))#Air angle at exit in tip in degree\n", + "b2t=degrees(atan((Ut-Cx2t)/Ca2t))#Blade angle at exit in tip in degree\n", + "W1=Ca1t/cos(pi/180*b1t)#Relative velocity at entry in tip in m/s\n", + "W2=Ca2t/cos(pi/180*b2t)#Relative velocity at exit in tip in m/s\n", + "Rt=((W1**2)-(W2**2))/(2*Ut*(Cx2t-Cx1t))#The degree of reaction at tip\n", + "\n", + "#output\n", + "print '(a)At the mean\\n (1)The inlet blade angle is %3.2f degree\\n (2)The inlet air angle is %3.2f degree\\n (3)The outlet blade angle is %3.2f degree\\n (4)The outlet air angle is %3.2f degree\\n (5)Degree of reaction is %3.1f \\n(b)At the root\\n (1)The inlet blade angle is %3.2f degree\\n (2)The inlet air angle is %3.1f degree\\n (3)The outlet blade angle is %3.1f degree\\n (4)The outlet air angle is %3.1f degree\\n (5)Degree of reaction is %3.1f\\n(c)At the tip\\n (1)The inlet blade angle is %3.2f degree\\n (2)The inlet air angle is %3.2f degree\\n (3)The outlet blade angle is %3.2f degree\\n (4)The outlet air angle is %3.2f degree\\n (5)Degree of reaction is %3.1f\\n'%(b1m,a1m,b2m,a2m,Rm,b1h,a1h,b2h,a2h,Rh,b1t,a1t,b2t,a2t,Rt)\n", + "# the answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)At the mean\n", + " (1)The inlet blade angle is 45.76 degree\n", + " (2)The inlet air angle is 17.04 degree\n", + " (3)The outlet blade angle is 17.04 degree\n", + " (4)The outlet air angle is 45.76 degree\n", + " (5)Degree of reaction is 0.5 \n", + "(b)At the root\n", + " (1)The inlet blade angle is 36.51 degree\n", + " (2)The inlet air angle is 12.5 degree\n", + " (3)The outlet blade angle is 12.5 degree\n", + " (4)The outlet air angle is 36.5 degree\n", + " (5)Degree of reaction is 0.5\n", + "(c)At the tip\n", + " (1)The inlet blade angle is 53.62 degree\n", + " (2)The inlet air angle is 22.05 degree\n", + " (3)The outlet blade angle is 22.05 degree\n", + " (4)The outlet air angle is 53.62 degree\n", + " (5)Degree of reaction is 0.5\n", + "\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.11 Page 163" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "N=3600#Running speed of blower in rpm\n", + "Dt=0.2#The rotor tip diameter in m\n", + "Dh=0.125#The rotor hub diameter in m\n", + "P1=1.013#The atmospheric pressure in bar\n", + "T1=298#The atmospheric temperature in K\n", + "m=0.5#Mass flow rate of air in kg/s\n", + "db=20#The turning angle of the rotor in degree\n", + "b1=55#The inlet blade angle in degree \n", + "R=287#The universal gas constant in J/kg.K\n", + "nc=0.9#Total-to-total efficiency\n", + "P=0.25#Total pressure drop across the intake in cm of water\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "ns=0.75#The stator efficiency\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "d1=(P1*10**5)/(R*T1)#The density of air at inlet in kg/m**3\n", + "A=(3.141/4)*((Dt**2)-(Dh**2))#The area of flow in m**2\n", + "Ca=m/(d1*A)#The axial velocity of air in m/s\n", + "U=((3.141*(Dt+Dh)*N)/(2*60))#Mean rotor blade velocity in m/s\n", + "b2=b1-db#The outlet blade angle in degree\n", + "Cx2=U-(Ca*tan(pi/180*b2))#The whirl velocity at exit in m/s \n", + "Cx1=0#The whirl velocity at entry in m/s as flow at inlet is axial \n", + "dh0r=U*(Cx2-Cx1)#The actual total enthalpy rise across the rotor in J/kg\n", + "dh0sr=nc*dh0r#The isentropic total enthalpy rise across the rotor in J/kg\n", + "dP0r=(d1*dh0sr)*((10**-1)/(g))#The total pressure rise across the rotor in cm of water\n", + "P0=dP0r-P#Stagnation pressure at the rotor exit in cm of water\n", + "C2=((Ca**2)+(Cx2**2))**(1/2)#The absolute velocity at the exit in m/s\n", + "dPr=dP0r-((d1*((C2**2)-(Ca**2)))/2)*((10**-1)/g)#The static pressure across the rotor in cm of water\n", + "dhs=((C2**2)-(Ca**2))/2#The actual enthalpy change across the stator in J/kg\n", + "dhss=ns*dhs#The theoretical enthalpy change across the stator in J/kg\n", + "dPs=(d1*dhss)*((10**-1)/g)#The static pressure rise across the stator in cm of water\n", + "dP0s=-((dPs/((10**-1)/g))+((d1/2)*(Ca**2-C2**2)))*(10**-1/g)#The change in total pressure across the stator in cm of water\n", + "P03=P0-dP0s#Total pressure at stator inlet in cm of water\n", + "dh0ss=((dw*g*(P03/100))/d1)#Theoretical total enthalpy change across the stage in J/kg\n", + "ntt=dh0ss/dh0r#The overall total-to-total efiiciency\n", + "DR=dPr/(dPr+dPs)#The degree of reaction for the stage\n", + "\n", + "#output\n", + "print '(a)Total pressure of air exit of rotor is %3.2f cm of water\\n(b)The static pressure rise across the rotor is %3.2f cm of water\\n(c)The static pressure rise across the stator os %3.2f cm of water\\n(d)The change in total pressure across the stator is %3.2f cm of water\\n(e)The overall total-to-total efficiency is %0.1f %%\\n(f)The degree of reaction for the stage is %0.1f %%'%(P0,dPr,dPs,dP0s,ntt*100,DR*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Total pressure of air exit of rotor is 4.80 cm of water\n", + "(b)The static pressure rise across the rotor is 3.66 cm of water\n", + "(c)The static pressure rise across the stator os 1.04 cm of water\n", + "(d)The change in total pressure across the stator is 0.35 cm of water\n", + "(e)The overall total-to-total efficiency is 79.3 %\n", + "(f)The degree of reaction for the stage is 77.8 %\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.12 Page 166" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Q=2.5#The amount of air which fan takes in m**3/s\n", + "P1=1.02#The inlet pressure of air in bar\n", + "T1=315#The inlet temperature of air in K\n", + "dH=0.75#The pressure head delivered by axial flow fan in m W.G\n", + "T2=325#The delivery temperature of air in K\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1.005#The specific heat of air at constant pressure in kJ/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "d=(P1*10**5)/(R*T1)#The density of air in kg/m**3\n", + "m=d*Q#The mass flow rate of air in kg/s\n", + "W=m*Cp*(T2-T1)#Power required to drive the fan in kW\n", + "dP=((10**3)*g*dH)/(10**5)#The overall pressure difference in bar\n", + "P2=P1+(dP)#The exit pressure in bar\n", + "nf=((T1*(((P2/P1)**((r-1)/r))-1))/(T2-T1))#Static fan efficiency\n", + "\n", + "#output\n", + "print '(a)Mass flow rate through the fan is %3.2f kg/s\\n(b)Power required to drive the fan is %3.2f kW\\n(c)Static fan efficiency is %0.2f %%'%(m,W,nf*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Mass flow rate through the fan is 2.82 kg/s\n", + "(b)Power required to drive the fan is 28.35 kW\n", + "(c)Static fan efficiency is 63.31 %\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.13 Page 167" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "b2=10#Rotor blade air angle at exit in degree\n", + "Dt=0.6#The tip diameter in m\n", + "Dh=0.3#The hub diameter in m\n", + "N=960#The speed of the fan in rpm\n", + "P=1#Power required by the fan in kW\n", + "pi=0.245#The flow coefficient\n", + "P1=1.02#The inlet pressure in bar\n", + "T1=316#The inlet temperature in K\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1.005#The specific heat of air at constant pressure in kJ/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "A=(3.141/4)*((Dt**2)-(Dh**2))#Area of the fan at inlet in m**2\n", + "Dm=(Dt+Dh)/2#The mean rotor diameter in m\n", + "U=(3.141*Dm*N)/60#The mean blade speed in m/s\n", + "Ca=pi*U#The axial velocity in m/s\n", + "Q=A*Ca#The flow rate of air in m**3/s\n", + "d=(P1*10**5)/(R*T1)#Density of air in kg/m**3\n", + "dPst=((d*(U**2)*(1-((pi*tan(pi/180*b2))**2)))/2)*((10**5)/(g*(10**3)))*10**-5#Static pressure across the stage in m W.G\n", + "Wm=U*(U-(Ca*tan(pi/180*b2)))#Work done per unit mass in J/kg\n", + "m=d*Q#Mass flow rate in kg/s\n", + "W=m*Wm#Work done in W\n", + "no=W/(P*10**3)#Overall efficiency \n", + "\n", + "#output\n", + "print '(a)THe flow rate is %3.3f m**3/s\\n(b)Static pressure rise across the stage is %3.3f m W.G\\n(c)The overall efficiency is %0.2f %%'%(Q,dPst,no*100)\n", + "# the answer for last part is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)THe flow rate is 1.175 m**3/s\n", + "(b)Static pressure rise across the stage is 0.029 m W.G\n", + "(c)The overall efficiency is 67.35 %\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.14 Page 169" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "b2=10#Rotor blade air angle at exit in degree\n", + "Dt=0.6#The tip diameter in m\n", + "Dh=0.3#The hub diameter in m\n", + "N=960#The speed of the fan in rpm\n", + "P=1#Power required by the fan in kW\n", + "pi=0.245#The flow coefficient\n", + "P1=1.02#The inlet pressure in bar\n", + "T1=316#The inlet temperature in K\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1.005#The specific heat of air at constant pressure in kJ/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "A=(3.141/4)*((Dt**2)-(Dh**2))#Area of the fan at inlet in m**2\n", + "Dm=(Dt+Dh)/2#The mean rotor diameter in m\n", + "U=(3.141*Dm*N)/60#The mean blade speed in m/s\n", + "Ca=pi*U#The axial velocity in m/s\n", + "Q=A*Ca#The flow rate of air in m**3/s\n", + "d=(P1*10**5)/(R*T1)#Density of air in kg/m**3\n", + "b1=degrees(atan(U/Ca))#Rotor blade angle at entry in degree\n", + "dPst=((d*(U**2)*(1-((pi*tan(pi/180*b2))**2)))/2)#Static pressure rise across the stage in N/m**2\n", + "dPr=dPst#Static pressure rise across the rotor in N/m**2\n", + "Wm=U*(U-(Ca*tan(pi/180*b2)))#Work done per unit mass in J/kg\n", + "dP0st=d*Wm#Stagnation pressure of the stage in N/m**2\n", + "DR1=dPr/dP0st#Degree of reaction\n", + "DR2=(Ca/(2*U))*(tan(pi/180*b1)+tan(pi/180*b2))#Degree of reaction\n", + "\n", + "#output\n", + "print '(a)Rotor blade angle at entry is %3.2f degree\\n(b)Degree of reaction is %0.1f %%'%(b1,DR1*100)\n", + "# the answer for last part is not correct in the textbook." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Rotor blade angle at entry is 76.23 degree\n", + "(b)Degree of reaction is 50.2 %\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.15 Page 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "m=3#Mass flow rate of air in kg/s\n", + "P1=100*10**3#The atmospheric pressure in Pa\n", + "T1=310#The atmospheric temperature in K\n", + "nb=0.8#The efficiency of the blower\n", + "nm=0.85#The mechanical efficiency\n", + "P=30#The power input in kW\n", + "R=287#The universal gas constant in J/kg.K\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "no=nb*nm#Overall efficiency of the blower\n", + "d=(P1)/(R*T1)#The density of the air in kg/m**3\n", + "dP=((no*P*10**3)/m)*d#The pressure developed in N/m**2\n", + "dH=((dP)/(g*dw))*(10**3)#The pressure developed in mm W.G\n", + "\n", + "#output\n", + "print '(a)Overall efficiency of the blower is %3.2f\\n(b)The pressure developed is %3.2f mm W.G'%(no,dH)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Overall efficiency of the blower is 0.68\n", + "(b)The pressure developed is 779.11 mm W.G\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 4.16 Page 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "psi=0.4#Pressure coefficient \n", + "m=3.5#Mass flow rate of air in kg/s\n", + "N=750#The speed of fan in rpm\n", + "T1=308#The static temperature at the entry in K\n", + "Dh=0.26#The hub diameter in m\n", + "DhDt=1/3#The hub to tip ratio\n", + "P1=98.4*10**3#The static pressure at entry in Pa\n", + "nm=0.9#The mechanical efficiency\n", + "nf=0.79#Static fan efficiency\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1.005#The specific heat of air at constant pressure in kJ/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "no=nm*nf#Overall efficiency\n", + "Dt=Dh/DhDt#The tip diameter in m\n", + "Dm=(Dt+Dh)/2#Mean rotor diameter in m\n", + "U=(3.141*Dm*N)/60#The mean blade speed in m/s\n", + "dPd=((U**2)/2)*psi#The ratio of change in pressure to density in J/kg\n", + "Wi=dPd*m#The ideal work in W\n", + "P=Wi/nm#The power required by the fan in W\n", + "d=P1/(R*T1)#The density of the air in kg/m**3\n", + "A=(3.141/4)*((Dt**2)-(Dh**2))#Area of cross section of the fan in m**2\n", + "Ca=m/(d*A)#The axial velocity of air in m/s\n", + "pi=Ca/U#The flow coefficient\n", + "tb1tb2=psi/(2*pi)#The difference between tangent angles of rotor inlet and exit angles\n", + "b2=degrees(atan((1-(dPd/U**2))/pi))#The exit rotor angle in degree\n", + "b1=degrees(atan((tan(b2*pi/180))+(tb1tb2)))#The inlet rotor angle in degree\n", + "dP=d*dPd#The pressure developed in N/m**2\n", + "dH=(dP/(dw*g))*10**3#Pressure developed in mm of W.G\n", + "\n", + "#output\n", + "print '(a)The overall efficiency is %0.1f %%\\n(b)The power required by the fan is %3.2f W\\n(c)The flow coefficient is %3.2f\\n(d)\\n (1)The rotor inlet angle is %3.2f degree\\n (2)The rotor exit angle is %3.2f degree\\n(e)The pressure developed is %3.2f mm of W.G'%(no*100,P,pi,b1,b2,dH)\n", + "# the answer for part(d) is not correct in the textbook." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The overall efficiency is 71.1 %\n", + "(b)The power required by the fan is 324.20 W\n", + "(c)The flow coefficient is 0.36\n", + "(d)\n", + " (1)The rotor inlet angle is 34.39 degree\n", + " (2)The rotor exit angle is 65.62 degree\n", + "(e)The pressure developed is 9.46 mm of W.G\n" + ] + } + ], + "prompt_number": 16 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Turbomachines_by_A._V._Arasu/Ch5.ipynb b/Turbomachines_by_A._V._Arasu/Ch5.ipynb new file mode 100644 index 00000000..8d6309b4 --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/Ch5.ipynb @@ -0,0 +1,1195 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b3c6b5b9437eb9e3bff13119283daec451a9bdb3f3f492bbf38ecac5c3f69e9c" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5 - Axial flow steam & gas turbines" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.1 Page 211" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#input data\n", + "C1=500#Steam velocity in m/s\n", + "U=200#Blade speed in m/s\n", + "b2=(90-25)#Exit angle of moving blade measured in axial direction in degree\n", + "a1=(90-20)#Nozzle angle in axial direction in degree\n", + "m=5#Steam flow rate in kg/s\n", + "\n", + "print 'The scale of the velocity vector diagram is 1:50\\n\\nThe following values are obtained from the velocity vector diagram'\n", + "\n", + "b1=33#Moving blade inlet angle in degree\n", + "a2=56#Direction of steam at the exit in degree\n", + "C2=160#Exit velocity of the steam in m/s\n", + "Wx1=270#Inlet whirl velocity in m/s\n", + "Wx2=285#Exit whirl velocity in m/s\n", + "Ca1=175#Inlet axial velocity in m/s\n", + "Ca2=135#Exit axial velocity in m/s\n", + "\n", + "#calculations\n", + "Wm=U*(Wx1+Wx2)*10**-3#Work done per kg of steam in kW/kg\n", + "AT=m*(Ca1-Ca2)#Axial thrust in N\n", + "W=m*Wm#Power developed in kW\n", + "Ndia=((U*(Wx1+Wx2))/((C1**2)/2))#Diagram or blade efficiency \n", + "\n", + "#output\n", + "print '\\n\\n(a)Moving blade inlet angle is %3i degree\\n(b)\\n Exit velocity of the steam is %3i m/s\\n Direction of steam at the exit is %3i degree\\n(c)Work done per kg of steam is %3i kW/kg\\n(d)\\n Axial thrust is %3i N\\n Power developed is %3i kW\\n(e)Diagram or blade efficiency is %0.1f %%'%(b1,C2,a2,Wm,AT,W,Ndia*100)\n", + "# the answer in the textbook is not correct for axial thrust." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The scale of the velocity vector diagram is 1:50\n", + "\n", + "The following values are obtained from the velocity vector diagram\n", + "\n", + "\n", + "(a)Moving blade inlet angle is 33 degree\n", + "(b)\n", + " Exit velocity of the steam is 160 m/s\n", + " Direction of steam at the exit is 56 degree\n", + "(c)Work done per kg of steam is 111 kW/kg\n", + "(d)\n", + " Axial thrust is 200 N\n", + " Power developed is 555 kW\n", + "(e)Diagram or blade efficiency is 88.8 %\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.2 Page 213" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sin, pi\n", + "#input data\n", + "U=300#Blade speed in m/s\n", + "a=20#Nozzle angle in degree\n", + "dhs=473#Isentropic heat drop in kJ/kg\n", + "Nn=0.85#Nozzle efficiency\n", + "W2W1=0.7#Blade velocity coefficient\n", + "nM=0.9#Mechanical efficiency\n", + "\n", + "#initial calculations\n", + "dh=Nn*dhs#Useful heat drop converted into kinetic energy in kJ/kg\n", + "C1=(2*1000*dh)**(1/2)#Velocity of steam at exit from nozzle in m/s\n", + "\n", + "print 'The scale of the velocity vector diagram is 1:100\\n\\nThe following values are obtained from the velocity vector diagram'\n", + "\n", + "Ca1=310#Inlet axial velocity in m/s\n", + "Ca2=210#Exit axial velocity in m/s\n", + "Wx1=550#Inlet whirl velocity in m/s\n", + "Wx2=380#Exit whirl velocity in m/s\n", + "W1=620#inlet Blade velocity in m/s\n", + "\n", + "#calculations\n", + "W2=W2W1*W1#Exit bladde velocity in m/s\n", + "AT=Ca1-Ca2#Axial thrust in N/kg\n", + "Wm=U*(Wx1+Wx2)*10**-3#Work developed per kg of steam/sec in kW/(kg/s)\n", + "P=Wm*nM#Power developed per kg of steam/sec in kW/(kg/s)\n", + "m=3600/P#Steam rate per kW.hr in kg\n", + "Ndia=((U*(Wx1+Wx2))/((C1**2)/2))#Diagram or blade efficiency \n", + "MNdia=(sin((90-a)*pi/180))**(2)#Maximum blade efficiency under optimum conditions \n", + "Ns1=Wm/dhs#Stage efficiency\n", + "Ns2=Ndia*Nn#Stage efficiency in other method\n", + "E=(((W1**2)-(W2**2))/2)*10**-3#Energy loss in blade friction in kJ/kg\n", + "\n", + "#output\n", + "print '\\n\\n(a)Axial thrust is %3i N/kg\\n(b)\\n Work developed per kg of steam/sec is %3i kW/(kg/s)\\n Power developed per kg of steam/sec is %3.1f kW/(kg/s)\\n Steam rate per kW.hr is %3.1f kg\\n(c)\\n Diagram or blade efficiency is %0.1f %%\\n Maximum blade efficiency under optimum conditions is %0.1f %%\\n Stage efficiency is %0.2f %%\\n(d)Energy loss in blade friction is %3.3f kJ/kg'%(AT,Wm,P,m,Ndia*100,MNdia*100,Ns1*100,E)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The scale of the velocity vector diagram is 1:100\n", + "\n", + "The following values are obtained from the velocity vector diagram\n", + "\n", + "\n", + "(a)Axial thrust is 100 N/kg\n", + "(b)\n", + " Work developed per kg of steam/sec is 279 kW/(kg/s)\n", + " Power developed per kg of steam/sec is 251.1 kW/(kg/s)\n", + " Steam rate per kW.hr is 14.3 kg\n", + "(c)\n", + " Diagram or blade efficiency is 69.4 %\n", + " Maximum blade efficiency under optimum conditions is 88.3 %\n", + " Stage efficiency is 58.99 %\n", + "(d)Energy loss in blade friction is 98.022 kJ/kg\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.3 Page 215" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P1=5#Input pressure of steam in bar\n", + "P2=3#Exhaust pressure of steam in bar\n", + "C0=75#Carry over velocity of steam in m/s\n", + "a1=20#Nozzle angle in degree\n", + "UC1=0.4#The direction of blade rotation and blade speed ratio\n", + "b2=20#Blade exit angle in degree\n", + "m=2.5#Steam flow rate in kg/s\n", + "W=206#Power Output of the stage in kW\n", + "Nn=0.9#Efficiency of the nozzle\n", + "\n", + "print 'Assuming isentropic expansion the enthalpy drop can be found from steam table\\n\\nThe following values are obtained from steam tables'\n", + " \n", + "h1=2747.5#Enthalpy at initial pressure in kJ/kg\n", + "s1=6.819#Entropy at initial pressure in kJ/kg.K\n", + "s2=s1#Entropy at final pressure in kJ/kg.K\n", + "sfp2=1.647#Entropy of fliud at final pressure in kJ/kg.K\n", + "sfgp2=5.367#Entropy of fliud-gas mixture at final pressure in kJ/kg.K\n", + "hfg=2170.1#Enthalpy of fliud-gas mixture in kJ/kg\n", + "hf=551.5#Enthalpy of fliud in kJ/kg\n", + "\n", + "print '\\n\\nThe scale of the velocity vector diagram is 1:50\\n\\nThe following values are obtained from the velocity vector diagram'\n", + "\n", + "W1=280#Relative velocity at inlet in m/s\n", + "W2=240#Relative velocity at exit in m/s\n", + "\n", + "#calculations\n", + "x2=(s2-sfp2)/sfgp2#The percentage of wet steam \n", + "h2s=hf+(x2*hfg)#The isentropic enthalpy at the second stage in kJ/kg\n", + "dhs=h1-h2s#Isentropic heat drop in kJ/kg\n", + "C1=((2000*Nn*dhs)+(C0**2))**(1/2)#Velocity of steam at exit from nozzle in m/s\n", + "U=UC1*C1#Blade speed in m/s\n", + "Wx1Wx2=(W*10**3)/(m*U)#The sum of whirl components of velocity in m/s\n", + "Ndia=(U*Wx1Wx2)/((C1**2)/2)#Diagram efficiency \n", + "RV=W2/W1#Relative velocity ratio \n", + "E=dhs+((C0**2)/2000)#Energy supplied per kg in kJ/kg\n", + "Ns1=(U*Wx1Wx2)/(E*10**3)#Stage efficiency\n", + "Ns2=Ndia*Nn#Stage efficiency in other method\n", + "\n", + "#output\n", + "print '\\n\\n(a)Velocity of steam at exit from nozzle is %3.2f m/s\\n(b)Diagram efficiency is %0.2f\\n(c)Relative velocity ratio is %3.3f\\n(d)\\n Stage efficiency in method 1 is %0.2f\\n Stage efficiency in method 2 is %0.2f'%(C1,Ndia*100,RV,Ns1*100,Ns2*100)\n", + "# the answer in the textbook is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Assuming isentropic expansion the enthalpy drop can be found from steam table\n", + "\n", + "The following values are obtained from steam tables\n", + "\n", + "\n", + "The scale of the velocity vector diagram is 1:50\n", + "\n", + "The following values are obtained from the velocity vector diagram\n", + "\n", + "\n", + "(a)Velocity of steam at exit from nozzle is 440.65 m/s\n", + "(b)Diagram efficiency is 84.87\n", + "(c)Relative velocity ratio is 0.857\n", + "(d)\n", + " Stage efficiency in method 1 is 76.61\n", + " Stage efficiency in method 2 is 76.39\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.4 Page 218" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "C1=600#Velocity of steam at exit from nozzle in m/s\n", + "U=120#Blade speed in m/s\n", + "a1=16#Nozzle angle in degree\n", + "b2=18#Discharge angle for first moving ring in degree \n", + "a11=21#Discharge angle for the fixed ring in degree \n", + "b22=35#Discharge angle for the second moving ring in degree\n", + "Wr=0.9#Blade velocity coefficient\n", + "m=1#Mass flow rate in kg/s\n", + "\n", + "print '\\n\\nThe scale of the velocity vector diagram is 1:50\\n\\nThe following values are obtained from the velocity vector diagram'\n", + "\n", + "W1=485#Relative velocity at inlet for first stage in m/s\n", + "W2=Wr*W1#Relative velocity for first stage at exit in m/s\n", + "Wx1=460#Inlet whirl velocity for first stage in m/s\n", + "Wx2=410#Exit whirl velocity for first stage in m/s\n", + "Ca1=170#Inlet axial velocity for first stage in m/s\n", + "Ca2=135#Exit axial velocity for first stage in m/s\n", + "C2=325#Exit velocity of the steam for first stage in m/s\n", + "b1=20#Blade inlet angle for first row of moving blade in degree\n", + "C11=Wr*C2#Steam velocity at inlet to second row of moving blades in m/s\n", + "W12=190#Relative velocity at inlet for second stage in m/s\n", + "W22=Wr*W12#Relative velocity at exit for second stage in m/s\n", + "Wx11=155#Inlet whirl velocity for second stage in m/s\n", + "Wx22=140#Exit whirl velocity for second stage in m/s\n", + "Ca11=110#Inlet axial velocity for second stage in m/s\n", + "Ca22=100#Exit axial velocity for second stage in m/s\n", + "b11=35#Blade inlet angle for second row of moving blade in degree\n", + "dWx1=Wx1+Wx2#Driving force for first stage in m/s\n", + "dWx11=Wx11+Wx22#Driving force for second stage in m/s\n", + "dW=(dWx1+dWx11)*1#Total driving force for unit mass flow rate in N\n", + "AT1=Ca1-Ca2#Axial thrust for first stage in m/s\n", + "AT2=Ca11-Ca22#Axial thrust for second stage in m/s\n", + "AT=(AT1+AT2)*1#Total axial thrust for unit mass flow rate in N\n", + "DP=m*U*(dWx1+dWx11)*10**-3#Diagram power in kW\n", + "DE=(U*(dWx1+dWx11))/((C1**2)/2)#Diagram efficiency\n", + "MDE=(sin((90-a1)*pi/180))**2#Maximum diagram efficiency\n", + "\n", + "#output\n", + "print '\\n\\n(a)\\n Blade inlet angle for first row of moving blade is %3.i degree\\n Blade inlet angle for second row of moving blade is %3i degree\\n(b)\\n Driving force for first stage is %3i m/s\\n Driving force for second stage is %3i m/s\\n Total driving force for unit mass flow rate is %3i N\\nTotal axial thrust for unit mass flow rate is %3i N\\n(c)Diagram power is %3.1f kW\\n(d)Diagram efficiency is %0.1f\\n(e)Maximum diagram efficiency is %0.1f'%(b1,b11,dWx1,dWx11,dW,AT,DP,DE*100,MDE*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "\n", + "The scale of the velocity vector diagram is 1:50\n", + "\n", + "The following values are obtained from the velocity vector diagram\n", + "\n", + "\n", + "(a)\n", + " Blade inlet angle for first row of moving blade is 20 degree\n", + " Blade inlet angle for second row of moving blade is 35 degree\n", + "(b)\n", + " Driving force for first stage is 870 m/s\n", + " Driving force for second stage is 295 m/s\n", + " Total driving force for unit mass flow rate is 1165 N\n", + "Total axial thrust for unit mass flow rate is 45 N\n", + "(c)Diagram power is 139.8 kW\n", + "(d)Diagram efficiency is 77.7\n", + "(e)Maximum diagram efficiency is 92.4\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.5 Page 220" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import cos\n", + "#input data\n", + "C1=100#Velocity of steam at exit from nozzle in m/s\n", + "h=0.04#Mean blade height in m\n", + "b2=20#Exit angle of moving blade in degree\n", + "CaU=3/4#Ratio of flow velocity and blade speed at mean radius\n", + "m=10000/3600#steam flow rate in kg/s\n", + "\n", + "#calculations\n", + "a1=b2#Nozzle angle in degree\n", + "Ca=C1*cos((90-a1)*pi/180)#Flow velocity in m/s\n", + "U=Ca/CaU#Mean blade velocity in m/s\n", + "v=0.60553#Specific volume of steam from steam table at 3 bar with dry saturated steam in m**3/kg\n", + "A=(m*v)/Ca#Annulus area in m**2\n", + "D=A/(3.1415*h)#Mean blade diameter in m\n", + "N=(U*60)/(3.14*D)#Rotor speed in rpm\n", + "\n", + "print '\\n\\nThe scale of the velocity vector diagram is 1:10\\n\\nThe following values are obtained from the velocity vector diagram'\n", + "\n", + "W1=59#Relative velocity at inlet for first stage in m/s\n", + "Wx1Wx2=142#Sum of whirl components of velocity in m/s\n", + "DP=m*U*Wx1Wx2*10**-3#Diagram power in kW\n", + "Wm=U*(Wx1Wx2)#Work done per kg of steam in kJ/kg\n", + "W2=C1#Relative velocity at exit for first stage in m/s\n", + "E=((C1**2)/2)+(((W2**2)-(W1**2))/2)#Energy input per kg in kJ/kg when W2=C1\n", + "Ndia=Wm/E#Diagram efficiency \n", + "RV=(W2-W1)/W1#Percentage increase in relative velocity \n", + "dH=((W2**2)-(W1**2))/2*10**-3#Enthalpy drop in the moving blades in kJ/kg\n", + "H=2*dH#Total enthalpy drop in two stages in kJ/kg\n", + "\n", + "#output\n", + "print '\\n\\n(a)The rotor speed is %3i rpm\\n(b)The diagram power is %3.2f kW\\n(c)The diagram efficiency is %0.1f\\n(d)Percentage increase in relative velocity is %0.1f\\n(e)\\n Enthalpy drop in the moving blades is %3.3f kJ/kg\\n Total enthalpy drop in two stages is %3.3f kJ/kg'%(N,DP,Ndia*100,RV*100,dH,H)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "\n", + "The scale of the velocity vector diagram is 1:10\n", + "\n", + "The following values are obtained from the velocity vector diagram\n", + "\n", + "\n", + "(a)The rotor speed is 2226 rpm\n", + "(b)The diagram power is 17.99 kW\n", + "(c)The diagram efficiency is 78.4\n", + "(d)Percentage increase in relative velocity is 69.5\n", + "(e)\n", + " Enthalpy drop in the moving blades is 3.260 kJ/kg\n", + " Total enthalpy drop in two stages is 6.519 kJ/kg\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.6 Page 222" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "R=0.5#Degree of reaction\n", + "P1=14#Initial pressure in bar\n", + "T1=588#Initial temperature in K\n", + "P2=0.14#Final pressure in bar\n", + "Ns=0.75#Stage efficiency \n", + "RF=1.04#Reheat factor \n", + "N=20#No. of stages\n", + "W=11770#Total power output in kW\n", + "a1=20#Exit blade angle in degree\n", + "hD=1/12#Ratio of blade height to blade mean diameter \n", + "\n", + "#calculations\n", + "hs1=3080#Isentropic enthalpy at initial condition from mollier chart in kJ/kg\n", + "hs2=2270#Isentropic enthalpy at final condition from mollier chart in kJ/kg\n", + "dhs=hs1-hs2#Isentropic enthalpy change in kJ/kg\n", + "Nt=Ns*RF#Overall efficiency\n", + "dh=Nt*dhs#Actual enthalpy drop in kJ/kg\n", + "hs=dh/N#Enthalpy drop per stage in kJ/kg\n", + "m=W/dh#Mass flow rate in kg/s\n", + "C11=1.43*1#Velocity of steam at exit from nozzle in m/s in terms of U for 0.5 degree of reaction\n", + "Wm=1*((2*C11*sin((90-a1)*pi/180))-1)#Work done per mass of steam in terms of U**2 in kJ/kg\n", + "U=((hs*10**3)/Wm)**(1/2)#Mean blade velocity in m/s as work done equals enthalpy drop per stage \n", + "C1=1.43*U#Velocity of steam at exit from nozzle in m/s \n", + "Ca=C1*cos((90-a1)*pi*180)#Flow velocity in m/s\n", + "v=1.618#Specific volume of steam from steam table at 1.05 bar with dry saturated steam in m**3/kg\n", + "D=((m*v)/(hD*3.14*Ca))**(1/2)#Blade mean diameter in m\n", + "N=(U*60)/(3.14*D)#Rotor speed in rpm\n", + "\n", + "#output\n", + "print '(a)Mass flow rate of steam is %3.2f kg/s\\n(b)Mean blade velocity is %3.1f m/s \\n(c)Blade mean diameter is %3.3f m \\n(d)Rotor speed is %3i rpm'%(m,U,D,N)\n", + "# the answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Mass flow rate of steam is 18.63 kg/s\n", + "(b)Mean blade velocity is 136.8 m/s \n", + "(c)Blade mean diameter is 0.767 m \n", + "(d)Rotor speed is 3407 rpm\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.7 Page 224" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import tan, pi, degrees, atan\n", + "#input data\n", + "rh=0.225#Blade roof radius in m\n", + "rt=0.375#Blade tip radius in m\n", + "b1m=45#Inlet angle of the rotor blade at mid height in degree\n", + "a1m=76#Outlet angle of the nozzle blade at mid height in degree\n", + "b2m=75#Outlet angle of the rotor blade at mid height in degree\n", + "N=6000#Speed of turbine in rpm\n", + "\n", + "#calculations\n", + "rm=(rh+rt)/2#Mean radius in m\n", + "Um=(2*3.14*rm*N)/60#Mean blade speed at mean radius in m/s\n", + "Ca=Um/((tan(a1m*pi/180))-(tan(b1m*pi/180)))#Flow velocity in m/s\n", + "Cx1m=Ca*tan(a1m*pi/180)#Velocity of whirl at inlet at mid height in m/s\n", + "Cx2m=Ca*tan(b2m*pi/180)-Um#Velocity of whirl at inlet at mid height in m/s\n", + "Cx1h=(Cx1m*rm)/rh#Velocity of whirl at inlet at hub height in m/s\n", + "a1h=degrees(atan(Cx1h/Ca))#Inlet angle of the nozzle blade at hub height in degree\n", + "Uh=(2*3.1415*rh*N)/60#Mean blade speed at hub in m/s\n", + "b1h=degrees(atan(tan(a1h*pi/180)-(Uh/Ca)))#Inlet angle of the rotor blade at hub in degree\n", + "Cx2h=Cx2m*rm/rh#Velocity of whirl at outlet at hub in m/s\n", + "b2h=degrees(atan((Uh+Cx2h)/Ca))#Outlet angle of the rotor blade at hub in degree\n", + "Cx1t=Cx1m*rm/rt#Velocity of whirl at inlet at tip in m/s\n", + "a1t=degrees(atan(Cx1t/Ca))#Inlet angle of the nozzle blade at tip height in degree\n", + "Ut=(2*3.14*rt*N)/60#Mean blade speed at tip in m/s\n", + "b1t=degrees(atan(tan(a1t*pi/180)-(Ut/Ca)))#Inlet angle of the rotor blade at tip in degree\n", + "Cx2t=Cx2m*rm/rt#Velocity of whirl at outlet at tip in m/s\n", + "b2t=degrees(atan((Ut+Cx2t)/Ca))#Outlet angle of the rotor blade at hub in degree\n", + "Rh=(Ca/(2*Uh))*(tan(b2h*pi/180)-tan(b1h*pi/180))#Degree of reaction at hub\n", + "Rt=(Ca/(2*Ut))*(tan(b2t*pi/180)-tan(b1t*pi/180))#Degree of reaction at tip\n", + "\n", + "#output\n", + "print '(a)for hub\\n (1)Inlet angle of the nozzle blade at hub height is %3.1f degree\\n (2)Inlet angle of the rotor blade at hub is %3i degree\\n (3)Outlet angle of the rotor blade at hub is %3.2f degree\\n (4)Degree of reaction at hub is %0.2f %%\\n(b)for tip\\n (1)Inlet angle of the nozzle blade at tip height is %3.2f degree\\n (2)Inlet angle of the rotor blade at tip is %3i degree\\n (3)Outlet angle of the rotor blade at tip is %3i degree\\n (4)Degree of reaction at tip is %0.2f'%(a1h,b1h,b2h,Rh*100,a1t,b1t,b2t,Rt*100)\n", + "# Answer for degree of reaction is not correct in the textbook." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)for hub\n", + " (1)Inlet angle of the nozzle blade at hub height is 79.4 degree\n", + " (2)Inlet angle of the rotor blade at hub is 72 degree\n", + " (3)Outlet angle of the rotor blade at hub is 72.75 degree\n", + " (4)Degree of reaction at hub is 2.93 %\n", + "(b)for tip\n", + " (1)Inlet angle of the nozzle blade at tip height is 72.69 degree\n", + " (2)Inlet angle of the rotor blade at tip is -29 degree\n", + " (3)Outlet angle of the rotor blade at tip is 77 degree\n", + " (4)Degree of reaction at tip is 65.04\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.8 Page 228" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Ca=180#Air velocity at the exit of nozzle in m/s\n", + "a1=(90-27)#Nozzle inclination perpendicular to direction of rotation in degree\n", + "R=0.5#Degree of reaction\n", + "U=180#Blade speed in m/s\n", + "\n", + "#calculations\n", + "Cx1=Ca*tan(a1*pi/180)#Inlet whirl velocity in m/s\n", + "b11=degrees(atan((Cx1-U)/Ca))#Inlet angle of the rotor blade at inlet velocity triangle in degree\n", + "pi=Ca/U#Ratio of air velocity and blade velocity \n", + "b21=degrees(atan((2*R/pi))+tan(b11*pi/180))#Outlet angle of the rotor blade at inlet velocity triangle in degree\n", + "C2=Ca#Exit velocity of the steam in m/s\n", + "b22=degrees(atan(U/C2))#Outlet angle of the rotor blade at outlet velocity triangle in degree\n", + "b12=b11#Inlet angle of the rotor blade at outlet velocity triangle in degree as np change in rotor inlet conditions \n", + "R=(pi*(tan(b22*pi/180)-tan(b12*pi/180)))/2#Degree of reaction \n", + "#output\n", + "print '(a)blade angles\\n Inlet angle of the rotor blade at inlet velocity triangle is %3.1f degree\\n Outlet angle of the rotor blade at inlet velocity triangle is %3.f degree\\n(b)Degree of reaction is %3.4f\\n(c)Inlet angle of the rotor blade at outlet velocity triangle is %3.f degree\\n(d)Outlet angle of the rotor blade at outlet velocity triangle is %3.1f degree'%(b11,b21,R,b22,b12)\n", + "# Answer in the textbook is not correct for some part." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)blade angles\n", + " Inlet angle of the rotor blade at inlet velocity triangle is 43.9 degree\n", + " Outlet angle of the rotor blade at inlet velocity triangle is 59 degree\n", + "(b)Degree of reaction is 0.0032\n", + "(c)Inlet angle of the rotor blade at outlet velocity triangle is 45 degree\n", + "(d)Outlet angle of the rotor blade at outlet velocity triangle is 43.9 degree\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.9 Page 229" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import cos\n", + "#input data\n", + "U=300#Blade speed of turbine in m/s\n", + "m=2.5#Mass flow rate in kg/s\n", + "T0=773#Gas temperature at turbine inlet in K\n", + "T2=573#Gaas temperature at turbine outlet in K\n", + "a1=70#Fixed blade outlet angle in degree\n", + "Ca=200#Axial velocity in m/s\n", + "Cp=1.005#Specific heat of gas at constant pressure in kJ/kg.K\n", + "#calculations\n", + "W=m*Cp*(T0-T2)#Power developed by turbine in kW\n", + "Wm=Cp*(T0-T2)#Stage work done per unit mass flow rate in kJ/kg\n", + "Wx1Wx2=Wm*10**3/U#Sum of whirl components of velocity at inlet and outlet in m/s\n", + "Wx1=(Ca*tan(a1*pi/180))-U#Inlet whirl velocity in m/s\n", + "Wx2=Wx1Wx2-Wx1#Outlet whirl velocity in m/s\n", + "R=(Wx2-Wx1)/(2*U)#Degree of reaction\n", + "Wx2Wx1=Wm*10**3*R#Energy input due to whirl component velocity in (m/s)**2\n", + "C1=Ca/cos(a1*pi/180)#Velocity of steam at exit from nozzle in m/s \n", + "nb=(Wm*10**3)/(((C1**2)/2)+Wx2Wx1)#Blade efficiency\n", + "\n", + "#output\n", + "print '(a)Power developed by turbine is %3.1f kW\\n(b)Degree of reaction is %0.2f %%\\n(c)Blade efficiency is %0.2f %%\\n'%(W,R*100,nb*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Power developed by turbine is 502.5 kW\n", + "(b)Degree of reaction is 184.35 %\n", + "(c)Blade efficiency is 51.03 %\n", + "\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.10 Page 230" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#input data\n", + "R=0.5#Degree of reaction\n", + "P0=2.2#Inlet pressure in bar\n", + "T0=443#Inlet temperature in K\n", + "N=2400#Rotor running speed in rpm\n", + "Dm=0.5#Rotor mean diameter in m\n", + "a1=36#Rotor inlet angle in degree\n", + "a2=19#Stator exit angle in degree\n", + "ns=0.88#Stage efficiency\n", + "m=1#Mass flow rate of steam in kg/s\n", + "\n", + "#calculations\n", + "b2=a1#Outlet angle of the rotor blade in degree\n", + "b1=a2#Inlet angle of the rotor blade in degree\n", + "U=(3.1415*Dm*N)/60#Mean blade speed in m/s\n", + "Ca=(2*U*R)/(tan(b2*pi/180)-tan(b1*pi/180))#Axial velocity in m/s\n", + "W=m*U*Ca*(tan(a1*pi/180)+tan(a2*pi/180))*10**-3#Power output in kW\n", + "dh=W/ns#Stage enthalpy drop in kJ/kg\n", + "\n", + "#output\n", + "print '(a)Power output is %3.2f kW\\n(b)Stage enthalpy drop is %3.2f kJ/kg'%(W,dh)\n", + "# Answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Power output is 12.59 kW\n", + "(b)Stage enthalpy drop is 14.31 kJ/kg\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.11 Page 231" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#input data\n", + "P0=800#Inlet pressure of hot gas in kPa\n", + "T1=973#Inlet temperature of hot gas in K\n", + "P2=100#Final pressure of hot gas in kPa\n", + "a1=73#Nozzle angle in degree\n", + "m=35#Mass flow rate in kg/s\n", + "ns=0.9#Nozzle efficiency\n", + "Cp=1.005#Specific heat of gas at constant pressure in kJ/kg.K\n", + "r=1.4#Ratio of specific heats of air\n", + "\n", + "#calculations\n", + "b1=degrees(atan(tan(a1*pi/180)/2))#Inlet angle of the rotor blade in degree\n", + "b2=b1#Outlet angle of the rotor blade in degree\n", + "pi=2/tan(a1*pi/180)#Flow coefficient\n", + "psil=pi*(tan(b1*pi/180)+tan(b2*pi/180))#Blade loading coefficient\n", + "dh=ns*Cp*T1*(1-(P2/P0)**((r-1)/r))#Change in enthalpy in kJ/kg\n", + "W=m*dh*10**-3#Power developed in MW\n", + "\n", + "#output\n", + "print '(a)Rotor blade angles\\n Inlet angle of the rotor blade is %3.2f degree\\n Outlet angle of the rotor blade is %3.2f degree\\n(b)Flow coefficient is %3.3f\\n(c)Blade loading coefficient is %3.f\\n(d)Power developed is %3.1f MW'%(b1,b2,pi,psil,W)\n", + "# Answer in the textbook is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Rotor blade angles\n", + " Inlet angle of the rotor blade is 12.12 degree\n", + " Outlet angle of the rotor blade is 12.12 degree\n", + "(b)Flow coefficient is 4.658\n", + "(c)Blade loading coefficient is 3\n", + "(d)Power developed is 13.8 MW\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.12 Page 233" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sin, pi\n", + "#Ex Page\n", + "#input data\n", + "P0=100#Initial pressure of steam in bar\n", + "T0=773#Initial temperature of steam in K\n", + "D=1#Turbine diameter in m\n", + "N=3000#Speed of turbine in rpm\n", + "m=100#Mass flow rate of steam in kg/s\n", + "a1=70#Exit angle of the first stage nozzle in degree\n", + "ns1=0.78#Stage efficiency of first stage \n", + "ns2=ns1#Stage efficiency of second stage\n", + "\n", + "#calculations\n", + "U=(pi*D*N)/60#Mean blade speed in m/s\n", + "C1=(2*U)/sin(a1*pi/180)#Velocity of steam at exit from nozzle in m/s \n", + "b11=degrees(atan(tan(a1*pi/180)/2))#Inlet angle of the rotor blade in degree\n", + "b21=b11#Outlet angle of the rotor blade in degree\n", + "b12=b21#Inlet angle of the rotor blade in second stage in degree\n", + "b22=b12#Outlet angle of the rotor blade in second stage in degree\n", + "W=4*m*U**2*10**-6#Total work done in both the stages in MW\n", + "dh02=2*U**2*10**-3#Change in enthalpy in first stage of turbine in kJ/kg\n", + "dh02s=(dh02/ns1)#Change in enthalpy isentropically of turine first stage in kJ/kg\n", + "print 'The values of enthalpy and specific volume are taken from the mollier chart at inlet and exit conditions respectively'\n", + "h0=3370#Enthalpy at beginning of first stage in kJ/kg\n", + "h2=h0-dh02#Enthalpy at the end of first stage in kJ/kg\n", + "h2s=h0-dh02s#Isentropic enthalpy at the end of first stage in kJ/kg\n", + "v2=0.041#Specific volume at the end of first stage in m**3/kg\n", + "dh24=2*U**2*10**-3#Change in enthalpy in second stage of turbine in kJ/kg\n", + "dh24s=dh24/ns2#Change in enthalpy isentropically of turine second stage in kJ/kg\n", + "h4=h2-dh24#Enthalpy at beginning of second stage in kJ/kg\n", + "h4s=h2-dh24s#Isentropic enthalpy at the end of second stage in kJ/kg\n", + "v4=0.05#Specific volume at the end of second stage in m**3/kg\n", + "\n", + "Ca=C1*cos(a1*pi/180)#Axial velocity in m/s\n", + "h1r=(m*v2)/(3.1415*D*Ca)#Blade height at first stage rotor exit in m\n", + "h2r=(m*v4)/(3.1415*D*Ca)#Blade height at second stage rotor exit in m\n", + "\n", + "#output\n", + "print '\\n\\n(a)rotor blade angles\\n Inlet angle of the rotor blade is %3.2f degree\\n Outlet angle of the rotor blade is %3.2f degree\\n Inlet angle of the rotor blade in second stage is %3.2f degres\\n Outlet angle of the rotor blade in second stage is %3.2f degree\\n(b)Total work done or Power developed in both the stages is %3.2f MW\\n(c)final state of steam\\n Enthalpy at beginning of first stage is %3i kJ/kg\\n Enthalpy at the end of first stage is %3.2f kJ/kg\\n Isentropic enthalpy at the end of first stage is %3.2f kJ/kg\\n Specific volume at the end of first stage is %3.3f m**3/kg\\n Enthalpy at beginning of second stage is %3.1f kJ/kg\\n Isentropic enthalpy at the end of second stage is %3.2f kJ/kg\\n Specific volume at the end of second stage is %3.2f m**3/kg\\n(d)blade height\\n Blade height at first stage rotor exit is %3.4f m\\n Blade height at second stage rotor exit is %3.4f m'%(b11,b21,b12,b22,W,h0,h2,h2s,v2,h4,h4s,v4,h1r,h2r)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The values of enthalpy and specific volume are taken from the mollier chart at inlet and exit conditions respectively\n", + "\n", + "\n", + "(a)rotor blade angles\n", + " Inlet angle of the rotor blade is 53.95 degree\n", + " Outlet angle of the rotor blade is 53.95 degree\n", + " Inlet angle of the rotor blade in second stage is 53.95 degres\n", + " Outlet angle of the rotor blade in second stage is 53.95 degree\n", + "(b)Total work done or Power developed in both the stages is 9.87 MW\n", + "(c)final state of steam\n", + " Enthalpy at beginning of first stage is 3370 kJ/kg\n", + " Enthalpy at the end of first stage is 3320.65 kJ/kg\n", + " Isentropic enthalpy at the end of first stage is 3306.73 kJ/kg\n", + " Specific volume at the end of first stage is 0.041 m**3/kg\n", + " Enthalpy at beginning of second stage is 3271.3 kJ/kg\n", + " Isentropic enthalpy at the end of second stage is 3257.39 kJ/kg\n", + " Specific volume at the end of second stage is 0.05 m**3/kg\n", + "(d)blade height\n", + " Blade height at first stage rotor exit is 0.0114 m\n", + " Blade height at second stage rotor exit is 0.0139 m\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.13 Page 236" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P0=100#Initial pressure of steam in bar\n", + "T0=773#Initial temperature of steam in K\n", + "D=1#Turbine diameter in m\n", + "N=3000#Speed of turbine in rpm\n", + "m=100#Mass flow rate of steam in kg/s\n", + "a1=70#Exit angle of the first stage nozzle in degree\n", + "ns=0.65#Stage efficiency of first stage \n", + "\n", + "#calculations\n", + "U=(3.1415*D*N)/60#Mean blade speed in m/s\n", + "C1=(4*U)/sin(a1*pi/180)#Velocity of steam at exit from nozzle in m/s\n", + "Ca=C1*cos(a1*pi/180)#Axial velocity in m/s\n", + "Wx1=3*U#Inlet whirl velocity in m/s\n", + "b11=degrees(atan(Wx1/Ca))#Inlet angle of the rotor blade in degree\n", + "b21=b11#Outlet angle of the rotor blade in degree\n", + "C2=Ca#Velocity of steam at exit from stage in m/s\n", + "b22=degrees(atan(U/Ca))#Outlet angle of the rotor blade in degree\n", + "b12=b22#Inlet angle of the rotor blade in in degree\n", + "W=m*8*U**2*10**-6#Total work done or power developed in MW\n", + "print 'The values of enthalpy and specific volume are taken from the mollier chart at inlet and exit conditions respectively'\n", + "h0=3370#Enthalpy at beginning of stage in kJ/kg\n", + "dh04=(W*10**3)/m#Change in enthalpy of turbine in kJ/kg\n", + "dh04s=dh04/ns#Change in enthalpy isentropically of turine in kJ/kg\n", + "h4=h0-dh04#Enthalpy at beginning of stage in kJ/kg\n", + "h4s=h0-dh04s#Isentropic enthalpy at the end of stage in kJ/kg\n", + "v4=0.105#Specific volume at the end of stage in m**3/kg\n", + "h=(m*v4)/(3.1415*D*Ca)#Rotor blade height in m\n", + "\n", + "print '\\n\\n(a)rotor blade angles\\n Inlet angle of the rotor blade is %3.2f degree\\n Outlet angle of the rotor blade is %3.2f degree\\n Inlet angle of the rotor blade in second stage is %3.2f degres\\n Outlet angle of the rotor blade in second stage is %3.2f degree\\n(b)Total work done or Power developed in both the stages is %3.2f MW\\n(c)final state of steam\\n Enthalpy at beginning of first stage is %3i kJ/kg\\n Enthalpy at beginning of stage is %3.1f kJ/kg\\n Isentropic enthalpy at the end of stage is %3.2f kJ/kg\\n Specific volume at the end of stage is %3.3f m**3/kg\\n(d)rotor blade height is %3.4f m'%(b11,b21,b12,b22,W,h0,h4,h4s,v4,h)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The values of enthalpy and specific volume are taken from the mollier chart at inlet and exit conditions respectively\n", + "\n", + "\n", + "(a)rotor blade angles\n", + " Inlet angle of the rotor blade is 64.11 degree\n", + " Outlet angle of the rotor blade is 64.11 degree\n", + " Inlet angle of the rotor blade in second stage is 34.48 degres\n", + " Outlet angle of the rotor blade in second stage is 34.48 degree\n", + "(b)Total work done or Power developed in both the stages is 19.74 MW\n", + "(c)final state of steam\n", + " Enthalpy at beginning of first stage is 3370 kJ/kg\n", + " Enthalpy at beginning of stage is 3172.6 kJ/kg\n", + " Isentropic enthalpy at the end of stage is 3066.34 kJ/kg\n", + " Specific volume at the end of stage is 0.105 m**3/kg\n", + "(d)rotor blade height is 0.0146 m\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.14 Page 238" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "a1=(90-30)#Nozzle angle in axial direction in degree\n", + "Ca=180#Axial velocity in m/s\n", + "U=280#Rotor blade speed in m/s\n", + "R=0.25#Degree of reaction\n", + "\n", + "#calculations\n", + "Cx1=Ca*tan(a1*pi/180)#Velocity of whirl at inlet in m/s\n", + "b1=degrees(atan((Cx1-U)/Ca))#Blade angle at inlet in degree\n", + "b2=a1#Blade angle at exit in degree as degree of reaction is 0.5\n", + "\n", + "#output\n", + "print '(a)Blade angle at inlet is %3i degree\\n(b)Blade angle at exit is %3i degree'%(b1,b2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Blade angle at inlet is 10 degree\n", + "(b)Blade angle at exit is 60 degree\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.15 Page 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "R=0.5#Degree of reaction\n", + "ns=0.85#Stage efficiency\n", + "P0=800#Inlet pressure of hot gas in kPa\n", + "T0=900#Inlet temperature of hot gas in K\n", + "U=160#Blade speed in m/s\n", + "m=75#Mass flow rate of hot gas in kg/s\n", + "a1=70#Absolute air angle at first stage nozzle exit in degree\n", + "\n", + "#calculations\n", + "C1=U/sin(a1*pi/180)#Velocity of steam at exit from nozzle in m/s\n", + "Ca=C1*cos(a1*pi/180)#Axial velocity of hot gas in m/s\n", + "C2=Ca#Velocity of steam at exit from stage in m/s\n", + "b1=0#Blade angle at inlet in degree as Wx1=0 \n", + "a2=b1#Stator exit angle in degree as degree of reaction is 0.5\n", + "b2=a1#Blade angle at outlet in degree as degree of reaction is 0.5\n", + "Cx2=0#Velocity of whirl at outlet in m/s\n", + "Cx1=U#Velocity of whirl at inlet in m/s\n", + "W=m*U*(Cx1+Cx2)*10**-6#Power developed in MW\n", + "Wm=W*10**3/m#Work done per unit mass flow rate in kJ/kg\n", + "dhs=Wm/ns#Isentropic enthalpy drop in kJ/kg\n", + "\n", + "#output\n", + "print '(a)Rotor blade angles\\n Absolute air angle at first stage nozzle exit is %3i degree\\n Blade angle at outlet is %3i degree\\n Blade angle at inlet is %3i degree\\n Stator exit angle is %3i degree\\n(b)Power developed is %3.2f MW\\n(c)Isentropic enthalpy drop is %3.2f kJ/kg'%(a1,b2,b1,a2,W,dhs)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Rotor blade angles\n", + " Absolute air angle at first stage nozzle exit is 70 degree\n", + " Blade angle at outlet is 70 degree\n", + " Blade angle at inlet is 0 degree\n", + " Stator exit angle is 0 degree\n", + "(b)Power developed is 1.92 MW\n", + "(c)Isentropic enthalpy drop is 30.12 kJ/kg\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.16 Page 240" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import pi\n", + "#input data\n", + "b1m=46#Rotor blade angle at entry at mean section in degree\n", + "b2m=75#Rotor blade angle at exit at mean section in degree\n", + "a1m=75#Nozzle angle at exit at mean section in degree\n", + "DhDt=0.6#Hub to tip ratio\n", + "N=7500#Mean rotor speed in rpm\n", + "Dh=0.45#Hub diameter in m\n", + "\n", + "#calculations\n", + "R=0.5#Degree of reaction as a1m=b2m\n", + "a2m=b1m#Stator angle at exit at mean section in degree\n", + "Dm=(Dh+(Dh/DhDt))/2#Mean diameter of turbine at mean section in m\n", + "Um=(pi*DhDt*N)/60#Mean blade speed in m/s\n", + "Ca=Um/(tan(a1m*pi/180)-tan(b1m*pi/180))#Axial velocity in m/s\n", + "fi=Ca/Um#Flow coefficient\n", + "psil=fi*(tan(b1m*pi/180)+tan(b2m*pi/180))#Blade loading coefficient\n", + "a1h=degrees(atan(tan(a1m*pi/180)*((Dm/2)/(Dh/2))))#Nozzle angle at inlet at root section in degree\n", + "Uh=(3.14*Dh*N)/60#Blade speed at root section in m/s\n", + "b1h=degrees(atan(tan(a1h*pi/180)-(Uh/Ca)))#Rotor blade angle at entry at root section in degree\n", + "a2h=degrees(atan(tan(a2m*pi/180)*((Dm/2)/(Dh/2))))#Stator angle at exit at root section in degree\n", + "b2h=degrees(atan((Uh/Ca)+tan(a2h*pi/180)))#Rotor blade angle at exit at root section in degree\n", + "pih=Ca/Uh#Flow coefficient at root section\n", + "Rh=(pih/2)*(tan(b2h*pi/180)-tan(b1h*pi/180))#Degree of reaction at root section\n", + "psilh=pih*(tan(b1h*pi/180)+tan(b2h*pi/180))#Blade loading coefficient at root section\n", + "\n", + "#output\n", + "print 'Mean section\\n (a)Degree of reaction is %3.1f\\n (b)Blade loading coefficient is %3.2f\\nRoot section (a)Degree of reaction is %3.2f\\n (b)Blade loading coefficient is %3.2f'%(R,psil,Rh,psilh)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Mean section\n", + " (a)Degree of reaction is 0.5\n", + " (b)Blade loading coefficient is 1.77\n", + "Root section (a)Degree of reaction is 0.11\n", + " (b)Blade loading coefficient is 3.14\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.17 Page 242" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "T00=973#Total head inlet temperature in K\n", + "P00=4.5#Total head inlet pressure in bar\n", + "P2=1.6#Static head outlet pressure in bar\n", + "m=20#Gas flow rate in kg/s\n", + "a1=(90-28)#Nozzle outlet angle measured perpendicular to blade velocity in degree\n", + "Dmh=10#Mean blade diameter to blade height ratio \n", + "NLC=0.1#Nozzle loss coefficient\n", + "Cp=1155.6#Specific heat of gas at a constant pressure in kJ/kg\n", + "R=289#Gas constant in J/kg\n", + "r=1.333#Ratio of specific heats of gas \n", + "\n", + "#calculations\n", + "T2ss=T00*(P2/P00)**((r-1)/r)#Isentropic temperature at outlet in mid section in K here T00=T01\n", + "T1s=T2ss#Isentropic temperature at inlet at mid section in K\n", + "C1m=(2*Cp*(T00-T1s)/1.1)**(1/2)#Velocity of steam at exit from nozzle at mid section in m/s\n", + "T1=T00-((C1m**2)/(2*Cp))#Gas temperature at mid section in K\n", + "d=(P2*10**5)/(R*T1)#Density of gas in kg/m**3\n", + "Rg=(Cp*(r-1)/r)#Gas constant of the gas in kJ/kg\n", + "Ca=C1m*cos(a1*pi/180)#Axial velocity in m/s\n", + "h=((m/(d*Ca))*(1/(Dmh*3.1415)))**(1/2)#Hub height in m\n", + "Dm=Dmh*h#Mean blade diameter in m\n", + "Dh=Dm-h#Hub diameter in m\n", + "a1h=degrees(atan(((Dm/2)/(Dh/2))*tan(a1*pi/180)))#Discharge angle at hub in degree\n", + "C1h=Ca/cos(a1h*pi/180)#Gas velocity at hub section in m/s\n", + "T1h=T00-((C1h**2)/(2*Cp))#Gas temperature at hub in K here T01=T00\n", + "Dt=Dm+h#Tip diameter in m\n", + "a1t=degrees(atan(((Dm/2)/(Dt/2))*tan(a1*pi/180)))#Gas discharge angle at tip in degree\n", + "C1t=Ca/cos(a1t)#Gas velocity at tip in m/s\n", + "T1t=T00-((C1t**2)/(2*Cp))#Gas temperature in K here T00=T01\n", + "\n", + "#output\n", + "print '(a)At mid section\\n Gas velocity is %3.1f m/s\\n Gas temperature is %3.1f K\\n Gas discharge angle is %3i degree\\n(b)At hub section\\n Gas velocity is %3.1f m/s\\n Gas temperature is %3.2f K\\n Gas discharge angle is %3.2f degree\\n(c)At tip section\\n Gas velocity is %3.1f m/s\\n Gas temperature is %3.2f K\\n Gas discharge angle is %3.2f degree'%(C1m,T1,a1,C1h,T1h,a1h,C1t,T1t,a1t)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)At mid section\n", + " Gas velocity is 682.2 m/s\n", + " Gas temperature is 771.6 K\n", + " Gas discharge angle is 62 degree\n", + "(b)At hub section\n", + " Gas velocity is 742.0 m/s\n", + " Gas temperature is 734.80 K\n", + " Gas discharge angle is 64.43 degree\n", + "(c)At tip section\n", + " Gas velocity is -320.3 m/s\n", + " Gas temperature is 928.61 K\n", + " Gas discharge angle is 59.68 degree\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 5.18 Page 244" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sin, cos, atan, tan, pi, degrees\n", + "#input data\n", + "a1=75#Nozzle air angle in degree\n", + "Rh=0#Degree of reaction\n", + "N=6000#Running speed of hub in rpm\n", + "Dh=0.45#Hub diameter in m\n", + "Df=0.75#Tip diameter in m\n", + "\n", + "\n", + "#calculations\n", + "Uh=(3.1415*Dh*N)/60#Hub speed in m/s\n", + "C1h=Uh/((sin(a1*pi/180))/2)#Velocity of steam at exit from nozzle in hub in m/s\n", + "Cah=C1h*cos(a1*pi/180)#Axial velocity at hub in m/s\n", + "Cx1h=C1h*sin(a1*pi/180)#Whirl component of velocity at inlet in hub in m/s\n", + "b1h=degrees(atan((Cx1h-Uh)/Cah))#Rotor blade angle at entry at hub section in degree\n", + "b2h=b1h#Rotor blade angle at exit at mean section in degree as zero reaction section\n", + "sopt=sin(a1*pi/180)/2#Blade to gas speed ratio at hub\n", + "rm=((Dh/2)+(Df/2))/2#Mean radius in m\n", + "rmrh=(rm/(Dh/2))**((sin(a1*pi/180))**2)#Ratio of inlet velocity at hub and mean for constant nozzle air angle at hub section\n", + "C1m=C1h/rmrh#Velocity of steam at exit from nozzle at mean section in m/s\n", + "Cx1m=Cx1h/rmrh#Velocity of whirl at inlet at mean section in m/s\n", + "Ca1m=Cah/rmrh#Axial velocity at mean section in m/s\n", + "Um=(3.1415*2*rm*N)/60#Mean blade speed in m/s\n", + "b1m=degrees(atan((Cx1m-Um)/Ca1m))#Rotor blade angle at entry at mean section in degree\n", + "b2m=degrees(atan(Um/Ca1m))#Rotor blade angle at exit at mean section in degree for axial exit Cx2=0\n", + "s=Um/C1m#Blade to gas ratio at mean\n", + "Rm=(Ca1m/(2*Um))*(tan(b2m*pi/180)-tan(b1m*pi/180))#Degree of reaction of mean section\n", + "rmrt=((rm)/(Df/2))**((sin(a1*pi/180))**2)#Ratio of inlet velocity at tip and mean for constant nozzle air angle at tip section\n", + "C1t=C1m*rmrt#Velocity of steam at exit from nozzle at tip section in m/s\n", + "Cx1t=Cx1m*rmrt#Velocity of whirl at inlet at tip section in m/s\n", + "Ca1t=Ca1m*rmrt#Axial velocity at tip section in m/s\n", + "Ut=(3.1415*Df*N)/60#Mean tip speed in m/s\n", + "b1t=degrees(atan((Cx1t-Ut)/Ca1t))#Rotor blade angle at entry at tip section in degree\n", + "b2t=degrees(atan(Ut/Ca1t))#Rotor blade angle at exit at tip section in degree for axial exit Cx2=0\n", + "st=Ut/C1t#Blade to gas ratio at tip\n", + "Rf=(Ca1t/(2*Ut))*(tan(b2t*pi/180)-tan(b1t*pi/180))#Degree of reaction of tip section\n", + "\n", + "#output\n", + "print '(1)Hub section\\n (a)\\n Absolute air angle is %3.2f degree\\n Relative air angle is %3.2f degree\\n (b)Blade to gas speed ratio is %3.3f\\n (c)Degree of reaction is %3i\\n(2)Mean section\\n (a)\\n Absolute air angle is %3.2f degree\\n Relative air angle is %3.2f degree\\n (b)Blade to gas speed ratio is %3.3f\\n (c)Degree of reaction is %3.3f\\n(3)Tip section\\n (a)\\n Absolute air angle is %3.2f degree\\n Relative air angle is %3.2f degree\\n (b)Blade to gas speed ratio is %3.3f\\n (c)Degree of reaction is %3.3f\\n'%(b1h,b2h,sopt,Rh,b1m,b2m,s,Rm,b1t,b2t,st,Rf)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)Hub section\n", + " (a)\n", + " Absolute air angle is 61.81 degree\n", + " Relative air angle is 61.81 degree\n", + " (b)Blade to gas speed ratio is 0.483\n", + " (c)Degree of reaction is 0\n", + "(2)Mean section\n", + " (a)\n", + " Absolute air angle is 25.55 degree\n", + " Relative air angle is 72.92 degree\n", + " (b)Blade to gas speed ratio is 0.842\n", + " (c)Degree of reaction is 0.427\n", + "(3)Tip section\n", + " (a)\n", + " Absolute air angle is -51.94 degree\n", + " Relative air angle is 78.71 degree\n", + " (b)Blade to gas speed ratio is 1.296\n", + " (c)Degree of reaction is 0.627\n", + "\n" + ] + } + ], + "prompt_number": 23 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Turbomachines_by_A._V._Arasu/Ch6.ipynb b/Turbomachines_by_A._V._Arasu/Ch6.ipynb new file mode 100644 index 00000000..44de0471 --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/Ch6.ipynb @@ -0,0 +1,442 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:aae7358a1641809b7b2e92e647a38df4d3df23fcb8fc4fc8de6985e2dc22bd13" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6 - Radial Flow Gas and Steam Turbines" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 6.1 Page 266" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import atan, pi, tan, degrees, cos\n", + "#input data\n", + "P00=3#The pressure at which air is received in bar\n", + "T00=373#The temperature at which air is received in K\n", + "rt=0.5#The rotor tip diameter of turbine in m\n", + "rh=0.3#The rotor exit diameter of the turbine in m\n", + "b=0.03#The rotor blade width at entry in m\n", + "b11=60#The air angle at rotor entry in degree\n", + "a11=25#The air angle at nozzle exit in degree\n", + "Ps=2#The stage pressure ratio\n", + "nn=0.97#The nozzle efficiency\n", + "N=7200#The speed of the turbine rotation in rpm\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "#calculations\n", + "U1=(3.14*rt*N)/60#Peripheral velocity of impeller at inlet in m/s\n", + "Cr=U1/(1/tan(pi/180*a11)-1/tan(pi/180*b11))#The radial velocity at inlet in m/s\n", + "ps1=Cr/U1#Flow coefficient \n", + "sl=1+(ps1*1/tan(pi/180*b11))#Loading coefficient\n", + "DR=((1-(ps1*1/tan(pi/180*b11)))/2)#Degree of reaction\n", + "nts=((sl*U1**2)/(Cp*T00*(1-((1/Ps)**((r-1)/r)))))#Stage efficiency of the turbine\n", + "C2=Cr#Absolute velocity at the exit in m/s\n", + "U2=(3.1415*rh*N)/60#Peripheral velocity of impeller at exit in m/s\n", + "b22=degrees(atan(C2/U2))#The air angle at rotor exit in degree\n", + "dT=DR*U1*Cr*1/tan(pi/180*a11)/Cp#Total actual change in temperature in a stage turbine in K\n", + "dT0=(U1*Cr*1/tan(pi/180*a11))/Cp#The total change in temperature in turbine in K\n", + "T02=T00-dT0#The exit absolute temperature in K\n", + "T2=T02-((C2**2)/(2*Cp))#The actual exit temperature in K\n", + "T1=dT+T2#The actual inlet temperature in K\n", + "Cx1=Cr*1/tan(pi/180*a11)#Inlet absolute velocity of air in tangential direction in m/s\n", + "C1=Cx1/cos(pi/180*a11)#Absolute velocity at the inlet in m/s\n", + "dT1=(C1**2/2)/(Cp*nn)#The absolute change in temperature at the first stage in K\n", + "dP1=(1-(dT1/T00))**(r/(r-1))#The absolute pressure ratio in first stage \n", + "P1=dP1*P00#The inlet pressure in bar\n", + "d1=(P1*10**5)/(R*T1)#The inlet density in kg/m**3\n", + "A1=3.1415*rt*b#The inlet area of the turbine in m**2\n", + "m=d1*A1*Cr#The mass flow rate of air at inlet in kg/s\n", + "P2=P00/Ps#The exit pressure in bar\n", + "d2=(P2*10**5)/(R*T2)#The exit density of air in kg/m**3\n", + "bh=(m/(d2*3.1415*rh*Cr))#Rotor width at the exit in m\n", + "W=m*U1*Cx1*10**-3#The power developed by the turbine in kW\n", + "\n", + "#output\n", + "print '(a)\\n (1)The flow coefficient is %3.3f\\n (2)The loading coefficient is %3.3f\\n(b)\\n (1)The degree of reaction is %0.2f %% \\n (2)The stage efficiency of the turbine is %0.2f %% \\n(c)\\n (1)The air angle at the rotor exit is %3.2f degree\\n (2)The width at the rotor exit is %0.2f cm\\n(d)\\n (1)The mass flow rate is %3.2f kg/s\\n (2)The power developed is %3.2f kW'%(ps1,sl,DR*100,nts*100,b22,bh*100,m,W)\n", + "# answer in the textbook is not correct." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)\n", + " (1)The flow coefficient is 0.638\n", + " (2)The loading coefficient is 1.368\n", + "(b)\n", + " (1)The degree of reaction is 31.58 % \n", + " (2)The stage efficiency of the turbine is 72.12 % \n", + "(c)\n", + " (1)The air angle at the rotor exit is 46.75 degree\n", + " (2)The width at the rotor exit is 6.31 cm\n", + "(d)\n", + " (1)The mass flow rate is 11.78 kg/s\n", + " (2)The power developed is 572.01 kW\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 6.2 Page 270" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sin\n", + "#input data\n", + "P0=4#Overall stage pressure ratio \n", + "T00=557#Temperature at entry in K\n", + "P3=1#Diffuser exit pressure in bar\n", + "m=6.5#Mass flow rate of air in kg/s\n", + "ps1=0.3#Flow coefficient \n", + "N=18000#Speed of the turbine in rpm\n", + "Dt=0.42#Rotor tip diameter in m\n", + "D2m=0.21#Mean diameter at rotor exit in m\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1.005#The specific heat of air at constant pressure in kJ/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "#calculations\n", + "U1=(3.1415*Dt*N)/60#Peripheral velocity of impeller at inlet in m/s\n", + "Cr1=ps1*U1#The radial velocity at inlet in m/s\n", + "a11=degrees(atan(Cr1/U1))#The nozzle exit air angle in degree\n", + "W=m*U1**2*10**-3#Power developed by turbine in kW\n", + "dT=(1/P0)**((r-1)/r)#The total isentropic temperature ratio in entire process \n", + "T3s=dT*T00#The final isentropic temperature at exit in K\n", + "dh2=W/m#The absolute enthalpy change in the first two stages in kJ/kg\n", + "ns=dh2/(Cp*(T00-T3s))#The stage efficiency of the turbine\n", + "T02=T00-(W/(m*Cp))#The absolute temperature at the entry of second stage in K\n", + "T03=T02#The absolute temperature at exit of second stage in K\n", + "dH=Cp*(T02-T3s)#The total enthalpy loss in kJ/kg\n", + "dHn=dH/2#The enthalpy loss in the nozzle in kJ/kg\n", + "C1=Cr1/sin(pi/180*a11)#Absolute velocity at the inlet in m/s\n", + "dH0=((C1**2)/(2000*Cp))+(dHn)#The isentropic absolute enthalpy loss in nozzle in kJ/kg\n", + "dT0=dH0/Cp#The isentropic absolute temperature loss in nozzle in K\n", + "T1s=T00-dT0#The isentropic temperature at the entry in K\n", + "P1=P0*(T1s/T00)**(r/(r-1))#The pressure at the entry of turbine in bar\n", + "T1=T00-((C1**2)/(2000*Cp))#The temperature at the entry of turbine in K\n", + "d1=(P1*10**5)/(R*T1)#The density of the air at inlet in kg/m**3\n", + "b1=m/(d1*Cr1*3.141*Dt)#The width of the rotor at inlet in m\n", + "C2=Cr1#The avsolute velocity at the second stage entry in m/s\n", + "T2=T02-((C2**2)/(2000*Cp))#The temperature at the second stage entry in K\n", + "P23=(T2/T03)**(r/(r-1))#The pressure ratio at the second stage\n", + "P2=P23*P3#The pressure at the second stage in bar\n", + "d2=(P2*10**5)/(R*T2)#The density of the air at second stage in kg/m**3\n", + "C2=Cr1#The absolute velocity at the second stage in m/s\n", + "A2=m/(d2*C2)#The area of cross section at the second stage in m**2\n", + "h2=(A2/(3.14*D2m))#The rotor blade height at the exit in m\n", + "M1=C1/(r*R*T1)**(1/2)#The mach number at the nozzle\n", + "U2=(3.14*D2m*N)/60#The Peripheral velocity of impeller at exit in m/s\n", + "M2r=(((C2**2)+(U2**2))**(1/2))/(r*R*T2)**(1/2)#The mach number at the rotor exit \n", + "Ln=(dHn*10**3)/((C1**2)/2)#The nozzle loss coefficient\n", + "Lr=(dHn*10**3)/(((((C2**2)+(U2**2))**(1/2))**2)/2)#The rotor loss coefficient\n", + "\n", + "#output\n", + "print '(a)The nozzle exit air angle is %3.2f degree\\n(b)The power developed is %3.1f kW\\n(c)The stage efficiency is %0.2f %%\\n(d)The rotor width at the entry is %0.2f cm\\n(e)The rotor blade height at the exit is %0.2f cm\\n(f)\\n (1)The mach number at the nozzle exit is %3.4f\\n (2)The mach number at the rotor exit is %3.2f\\n(g)\\n (1)The nozzle loss coefficient is %3.4f\\n (2)The rotor loss coefficient is %3.3f'%(a11,W,ns*100,b1*100,h2*100,M1,M2r,Ln,Lr)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The nozzle exit air angle is 16.70 degree\n", + "(b)The power developed is 1018.4 kW\n", + "(c)The stage efficiency is 85.58 %\n", + "(d)The rotor width at the entry is 2.76 cm\n", + "(e)The rotor blade height at the exit is 9.99 cm\n", + "(f)\n", + " (1)The mach number at the nozzle exit is 0.9489\n", + " (2)The mach number at the rotor exit is 0.58\n", + "(g)\n", + " (1)The nozzle loss coefficient is 0.1546\n", + " (2)The rotor loss coefficient is 0.496\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 6.3 Page 274" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import acos\n", + "#input data\n", + "ntt=0.9#Total-to-total efficiency\n", + "P00=300#The pressure at entry to the nozzle in kPa\n", + "T00=1150#The temperature at entry to the nozzle in K\n", + "T1=1013#The static temperature at the outlet of the nozzle in K\n", + "P03=100#The pressure at the outlet of the diffuser in kPa\n", + "R=284.5#The universal gas constant in J/kg.K\n", + "Cp=1.147#The specific heat of air at constant pressure in kJ/kg.K\n", + "r=1.33#The ratio of specific heats of given gas\n", + "\n", + "#calculations\n", + "U1=(ntt*Cp*1000*T00*(1-((P03/P00)**((r-1)/r))))**(1/2)#The impeller tip speed in m/s\n", + "T01=T00#The absolute temperature at the entry in K\n", + "C1=(2000*Cp*(T01-T1))**(1/2)#The absolute velocity at the inletof turbine in m/s\n", + "a11=acos(pi/180*U1/C1)#The flow angle at the nozzle oulet in degree\n", + "M1=C1/(r*R*T1)**(1/2)#The mach number at the nozzle outlet \n", + "\n", + "#output\n", + "print '(a)The impeller tip speed is %3.1f m/s\\n(b)The flow angle at the nozzle oulet is %3.2f degrees\\n(c)The mach number at the nozzle outlet is %3.2f'%(U1,a11,M1)\n", + "# answer in the textbook is not correct fot part(b)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The impeller tip speed is 532.2 m/s\n", + "(b)The flow angle at the nozzle oulet is 1.55 degrees\n", + "(c)The mach number at the nozzle outlet is 0.91\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 6.4 Page 275" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "D1=0.09#Rotor inlet tip diameter in m\n", + "D2t=0.062#Rotor outlet tip diameter in m\n", + "D2h=0.025#Rotor outlet hub diameter in m\n", + "N=30000#Blade speed in rpm\n", + "d2=1.8#Density of exhaust gases at impeller exit in kg/m**3\n", + "C2s=0.447#Ratio of absolute velocity and isentropic velocity at exit\n", + "U1Cs=0.707#Ratio of impeller tip velocity and isentropic velocity\n", + "\n", + "#calculations\n", + "U1=(3.1415*D1*N)/60#The impeller tip speed in m/s\n", + "Cs=U1/U1Cs#Isentropic velocity in m/s\n", + "C2=C2s*Cs#Absolute velocity at the exit in m/s\n", + "A2=(3.141/4)*((D2t**2)-(D2h**2))#Area at the exit in m**2\n", + "Q2=A2*C2#Volume flow rate at the impeller exit in m**3/s\n", + "M=d2*Q2#Mass flow rate in kg/s\n", + "W=M*U1**2#Power developed in W\n", + "\n", + "#output\n", + "print '(a)Volume flow rate at the impeller exit is %3.3f m**3/s\\n(b)Power developed is %0.3f kW'%(Q2,W/1000)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Volume flow rate at the impeller exit is 0.226 m**3/s\n", + "(b)Power developed is 8.127 kW\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 6.5 Page 276" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P00=3.5#Total-to-static pressure ratio\n", + "P2=1#Exit pressure in bar\n", + "T00=923#Inlet total temperature in K\n", + "U1Cs=0.66#Blade to isentropic speed ratio\n", + "D=0.45#Rotor diameter ratio\n", + "N=16000#Speed from nozzle in rpm\n", + "a11=20#Nozzle exit angle in degree\n", + "nn=0.95#Nozzle efficiency\n", + "b1=0.05#Rotor width at inlet in m\n", + "R=287#The universal gas constant in J/kg.K\n", + "Cp=1005#The specific heat of air at constant pressure in J/kg.K\n", + "r=1.4#The ratio of specific heats of air\n", + "\n", + "\n", + "#Calculations\n", + "T2s=T00*(1/P00)**((r-1)/r)#Isentropic temperature at the exit in K\n", + "Cs=(2*Cp*(T00-T2s))**(1/2)#The isentropic velocity in m/s\n", + "U1=U1Cs*Cs#The impeller tip speed in m/s\n", + "D1=(U1*60)/(3.14*N)#Rotor inlet diameter in m\n", + "D2=D*D1#Rotor outlet diameter in m\n", + "Cr2=U1*tan(pi/180*a11)#The relative velocity at the exit in m/s\n", + "U2=(3.1415*D2*N)/60#Peripheral velocity of impeller at exit in m/s\n", + "b22=degrees(atan(Cr2/U2))#The air angle at rotor exit in degree\n", + "T02=T00-((U1**2)/(Cp))#The absolute temperature at the exit in K\n", + "T2=T02-((Cr2**2)/(2*Cp))#The temperature at the exit of turbine in K\n", + "T1=T2+((U1**2)/(2*Cp))#The temperature at the entry of turbine in K\n", + "T1s=T00-((T00-T1)/nn)#Isentropic temperature at the entry in K\n", + "P1=P00*(T1s/T00)**(r/(r-1))#The pressure at the entry stage in bar\n", + "d1=(P1*10**5)/(R*T1)#The density of the air at the inlet in kg/m**3\n", + "A1=3.1415*D1*b1#The area at the inlet in m**2\n", + "Cr1=Cr2#The relative velocity at the entry in m/s\n", + "m=d1*A1*Cr1#The mass flow rate for a 90degree IFR turbine Degree of Reaction is 0.5 in kg/s\n", + "W=(m*U1**2)*10**-6#Power developed in MW\n", + "d2=(P2*10**5)/(R*T2)#The density of the air at the exit in kg/m**3\n", + "b2=m/(d2*3.141*D2*Cr2)#Rotor width at the exit in m\n", + "D2h=D2-b2#Hub diameter at the exit in m\n", + "D2t=D2+b2#Tip diameter at the exit in m\n", + "nts=(W*10**6)/(m*Cp*(T00-T2s))#Total-to-static efficiency\n", + "C1=U1/cos(pi/180*a11)#Absolute velocity at the entry in m/s\n", + "Ln=(Cp*(T1-T1s))/((C1**2)/2)#Nozzle enthalpy loss coefficient\n", + "W2=((U2**2)+(Cr2**2))**(1/2)#Resultant relative velocity at the exit in m/s\n", + "T2s=T1*(P2/P1)**((r-1)/r)#Isentropic temperature at the exit in K\n", + "Lr=(Cp*(T2-T2s))/((W2**2)/2)#Rotor enthalpy loss coefficient\n", + "\n", + "#output\n", + "print '(a)\\n (1)Rotor inlet diameter is %3.2f m\\n (2)Rotor outlet diameter is %3.3f m\\n(b)The air angle at rotor exit is %3.2f degree\\n(c)The mass flow rate for a 90degree IFR turbine Degree of Reaction is 0.5 is %3.2f kg/s\\n(d)Power developed is %3.3f MW\\n(e)\\n (1)Hub diameter at the exit is %3.4f m\\n (2)Tip diameter at the exit is %3.4f m\\n(f)Total-to-static efficiency is %3.4f\\n(g)Nozzle enthalpy loss coefficient is %3.4f\\n(h)Rotor enthalpy loss coefficient is %3.4f'%(D1,D2,b22,m,W,D2h,D2t,nts,Ln,Lr)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)\n", + " (1)Rotor inlet diameter is 0.59 m\n", + " (2)Rotor outlet diameter is 0.265 m\n", + "(b)The air angle at rotor exit is 38.95 degree\n", + "(c)The mass flow rate for a 90degree IFR turbine Degree of Reaction is 0.5 is 14.21 kg/s\n", + "(d)Power developed is 3.456 MW\n", + "(e)\n", + " (1)Hub diameter at the exit is 0.0834 m\n", + " (2)Tip diameter at the exit is 0.4466 m\n", + "(f)Total-to-static efficiency is 0.8712\n", + "(g)Nozzle enthalpy loss coefficient is 0.0526\n", + "(h)Rotor enthalpy loss coefficient is 0.3396\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 6.6 Page 280" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P00=700#Total-to-static pressure ratio\n", + "T00=1145#Inlet total temperature in K\n", + "P1=527#The pressure at the entry stage in bar\n", + "T1=1029#The temperature at the entry of turbine in K\n", + "P2=385#The pressure at the second stage in bar\n", + "T2=915#The temperature at the second stage entry in K\n", + "T02=925#The absolute temperature at the exit in K\n", + "D2mD1=0.49#The ratio of rotor exit mean diameter to rotor inlet diameter\n", + "N=24000#Blade speed in rpm\n", + "R1=8.314#The gas constant of given gas in kJ/kg.K\n", + "r=1.67#The ratio of specific heats of the gas\n", + "m=39.94#Molecular weight of a gas \n", + "\n", + "#calculations\n", + "R=R1/m#The universal gas constant in kJ/kg.K\n", + "Cp=(r*R)/(r-1)#The specific heat of air at constant pressure in kJ/kg.K\n", + "T2ss=T00*(P2/P00)**((r-1)/r)#Isentropic stage temperature at the exit in K\n", + "nts=(T00-T02)/(T00-T2ss)#Total-to-static efficiency of the turbine\n", + "U1=(Cp*1000*(T00-T02))**(1/2)#The impeller tip speed in m/s\n", + "D1=(U1*60)/(3.1415*N)#Rotor inlet diameter in m\n", + "D2m=D1*D2mD1#Rotor exit mean diameter in m\n", + "C1=(2*Cp*(T00-T1))**(1/2)#Absolute velocity at the entry in m/s\n", + "T1s=T00*(P1/P00)**((r-1)/r)#Isentropic temperature at the entry in K\n", + "Ln=(Cp*(T1-T1s))/((C1**2)/2)#Nozzle enthalpy loss coefficient\n", + "C2=(2*Cp*1000*(T02-T2))**(1/2)#The temperature at the exit of turbine in K\n", + "U2=(3.14*D2m*N)/(60)#Peripheral velocity of impeller at exit in m/s\n", + "W2=((C2**2)+(U2**2))**(1/2)#Resultant relative velocity at the exit in m/s\n", + "T2s=T1*(P2/P1)**((r-1)/r)#stage temperature at the exit in K\n", + "Lr=(Cp*1000*(T2-T2s))/((W2**2)/2)#Rotor enthalpy loss coefficient\n", + "ntt=1/((1/nts)-((C2**2)/(2*U1**2)))#Total-to-total efficiency\n", + "\n", + "#output\n", + "print '(a)Total-to-static efficiency of the turbine is %0.1f %%\\n(b)\\n (1)Rotor inlet diameter is %3.3f m\\n (2)Rotor exit mean diameter is %3.3f m\\n(c)\\n (1)Nozzle enthalpy loss coefficient is %3.4f\\n (2)Rotor enthalpy loss coefficient is %3.4f\\n(d)Total-to-total efficiency is %0.2f %%'%(nts*100,D1,D2m,Ln,Lr,ntt*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Total-to-static efficiency of the turbine is 90.1 %\n", + "(b)\n", + " (1)Rotor inlet diameter is 0.269 m\n", + " (2)Rotor exit mean diameter is 0.132 m\n", + "(c)\n", + " (1)Nozzle enthalpy loss coefficient is 0.0625\n", + " (2)Rotor enthalpy loss coefficient is 0.2138\n", + "(d)Total-to-total efficiency is 93.95 %\n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Turbomachines_by_A._V._Arasu/Ch7.ipynb b/Turbomachines_by_A._V._Arasu/Ch7.ipynb new file mode 100644 index 00000000..901a931e --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/Ch7.ipynb @@ -0,0 +1,429 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f827c11afa624e3e81bfed710ad978d27a2bfba89c05ec909ef7162ba7b3cadb" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 7 - Dimensional and Modal Analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 7.5 Page 312" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#input data\n", + "Nm=1000#Speed of the model in rpm\n", + "Hm=8#Head of the model in m\n", + "Pm=30#Power of the model in kW\n", + "Hp=25#Head of the prototype in m\n", + "DmDp=1/5#The scale of the model to original\n", + "\n", + "#calculations\n", + "Np=((Hp/Hm)**(1/2))*(DmDp)*(Nm)#Speed of the prototype in rpm\n", + "Pp=(Pm)*((1/DmDp)**(5))*(Np/Nm)**(3)#Power developed by the prototype in kW\n", + "QpQm=((1/DmDp)**(3))*(Np/Nm)#Ratio of the flow rates of two pump(model and prototype)\n", + "\n", + "#output\n", + "print '(1)Speed of prototype pump is %3.1f rpm\\n(2)Power developed by the prototype pump is %3i kW\\n(3)Ratio of the flow rates of two pumps is %3.4f'%(Np,Pp,QpQm)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)Speed of prototype pump is 353.6 rpm\n", + "(2)Power developed by the prototype pump is 4143 kW\n", + "(3)Ratio of the flow rates of two pumps is 44.1942\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 7.6 Page 313" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Hp=85#Head of the prototype in m\n", + "Qp=(20000/3600)#Flow rate of the prototype in m**3/s\n", + "Np=1490#Speed of the prototype in rpm\n", + "Dp=1.2#Diameter of the prototype in m\n", + "dp=714#Density of the prototype fluid in kg/m**3\n", + "Pp=4#Power of the prototype in MW\n", + "Pm=500*10**-3#Power of the model in MW\n", + "Qm=0.5#Flow rate of the prototype in m**3/s\n", + "dm=1000#Density of the model fluid (water) in kg/m**3\n", + "\n", + "#calculations\n", + "NpNm=(Qp/Qm)#Ratio of the speeds of the prototype and the model in terms of (Dm/Dp)**(3)\n", + "DmDp=1/(((NpNm)**(3))*(dp/dm)*(Pm/Pp))**(1/4)#The ratio of the diameters of model and the prototype or the scale ratio \n", + "NmNp=1/(NpNm*((DmDp)**(3)))#The speed ratio or the ratio of speeds of the model and the prototype\n", + "HmHp=((1/NmNp)**(2))*((1/DmDp)**(2))#The head ratio or the ratio of heads of the model and the prototype \n", + "\n", + "#output\n", + "print '(1)The head ratio of the model is %3.1f\\n(2)The speed ratio of the model is %3.1f\\n(3)The scale ratio of the model is %3.1f'%(HmHp,NmNp,DmDp)\n", + "# Answer in the textbook is wrong" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)The head ratio of the model is 1.0\n", + "(2)The speed ratio of the model is 3.3\n", + "(3)The scale ratio of the model is 0.3\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 7.7 Page 315" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Np=400#The speed of the prototype in rpm\n", + "Qp=1.7#The discharge of the prototype in m**3/s\n", + "Hp=36.5#The head of the prototype in m\n", + "Pp=720#The power input of the prototype in kW\n", + "Hm=9#The head of the model in m\n", + "DmDp=1/6#The scale of model to prototype \n", + "\n", + "#calculations\n", + "Nm=((Hm/Hp)**(1/2))*(1/DmDp)*Np#Speed of the model in rpm\n", + "Qm=((DmDp)**(3))*(Nm/Np)*(Qp)#Discharge of the model in m**3/s\n", + "Pm=((DmDp)**(5))*((Nm/Np)**(3))*Pp#Power required by the model in kW\n", + "\n", + "#output\n", + "print '(a)Speed of the model is %3.2f rpm\\n(b)Discharge of the model is %3.4f m**3/s\\n(c)Power required by the model is %3.2f kW'%(Nm,Qm,Pm)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Speed of the model is 1191.75 rpm\n", + "(b)Discharge of the model is 0.0234 m**3/s\n", + "(c)Power required by the model is 2.45 kW\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 7.8 Page 316" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "N1=1000#The running speed of the pump-1 in rpm\n", + "D1=0.3#The impeller diameter of pump-1 in m\n", + "Q1=0.02#The discharge of pump-1 in m**3/s\n", + "H1=15#The head developed by the pump-1 in m\n", + "N2=1000#The running speed of the pump-2 in rpm\n", + "Q2=0.01#The discharge of pump-2 in m**3/s\n", + "\n", + "#calculations\n", + "D2=(((Q2/Q1)*(N1/N2))**(1/3))*(D1)#Impeller diameter of the pump-2 in m\n", + "H2=(((D2/D1)*(N2/N1))**(2))*(H1)#Head developed by the pump-2 in m\n", + "\n", + "#output\n", + "print '(a)Impeller diameter of the pump-2 is %3.3f m\\n(b)Head developed by the pump-2 is %3.2f m'%(D2,H2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Impeller diameter of the pump-2 is 0.238 m\n", + "(b)Head developed by the pump-2 is 9.45 m\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 7.9 Page 316" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "DmDp=1/10#The model ratio to prototype \n", + "Pm=1.84#Power developed by the model in kW\n", + "Hm=5#Head developed by the model in m\n", + "Nm=480#Speed of the model in rpm\n", + "Hp=40#Head developed by the prototype in m\n", + "\n", + "#calculations\n", + "Np=((Hp/Hm)**(1/2))*(DmDp)*(Nm)#Speed of the prototype in rpm\n", + "Pp=((1/DmDp)**(5))*((Np/Nm)**(3))*Pm#Power developed by the prototype in kW\n", + "Nsp=((Np*((Pp)**(1/2)))/((Hp)**(5/4)))#Specific speed of the prototype\n", + "Nsm=((Nm*((Pm)**(1/2)))/((Hm)**(5/4)))#Specific speed of the prototype\n", + "\n", + "#output\n", + "print '(a)Power developed by the prototype is %3i kW\\n(b)Speed of the prototype is %3.2f rpm\\n(c)Specific speed of the prototype is %3.1f\\n(d)Specific speed of the model is %3.1f\\n Thus the specific speed of the model is equal to the prototype and thus it is verified'%(Pp,Np,Nsp,Nsm)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Power developed by the prototype is 4163 kW\n", + "(b)Speed of the prototype is 135.76 rpm\n", + "(c)Specific speed of the prototype is 87.1\n", + "(d)Specific speed of the model is 87.1\n", + " Thus the specific speed of the model is equal to the prototype and thus it is verified\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 7.10 Page 317" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "#input data\n", + "DmDp=1/10#The model ratio to prototype\n", + "Hm=5#The head developed by the model in m\n", + "Hp=8.5#The head developed by the prototype in m\n", + "Pp=8000*10**3#The power developed by the prototype in W\n", + "Np=120#The speed of running of the prototype in rpm\n", + "d=1000#density of the water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "n0=0.85#Overall efficiency of the prototype\n", + "\n", + "#calculations\n", + "Nm=((Hm/Hp)**(1/2))*(1/DmDp)*(Np)#Speed of the mpdel in rpm\n", + "Qp=Pp/(d*g*n0*Hp)#Discharge from the prototype in m**3/s\n", + "Qm=((DmDp)**(3))*(Nm/Np)*(Qp)#Discharge from the model in m**3/s\n", + "Pm=((DmDp)**(5))*((Nm/Np)**(3))*(Pp)*10**-3#Power of the model in kW\n", + "\n", + "#output\n", + "print '(a)Speed of the model is %3.1f rpm\\n(b)Discharge from the model is %3.3f m**3/s\\n(c)Power of the model is %3.1f kW'%(Nm,Qm,Pm)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Speed of the model is 920.4 rpm\n", + "(b)Discharge from the model is 0.866 m**3/s\n", + "(c)Power of the model is 36.1 kW\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 7.11 Page 318" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P1=6600#Initial power developed by the turbine in kW\n", + "N1=100#Initial speed of the turbine in rpm\n", + "H1=30#Initial head of the turbine in m\n", + "H2=18#Final head of the turbine in m\n", + "\n", + "#calculations\n", + "N2=N1*((H2/H1)**(1/2))#The final speed of the turbine in rpm\n", + "P2=P1*((H2/H1)**(3/2))#The final power developed by the turbine in kW\n", + "\n", + "#output\n", + "print '(1)The final speed of the turbine is %3.2f rpm\\n(2)The final power developed by the turbine is %3i kW'%(N2,P2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)The final speed of the turbine is 77.46 rpm\n", + "(2)The final power developed by the turbine is 3067 kW\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 7.12 Page 319" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "H1=25#The initial head on the turbine in m\n", + "N1=200#The initial speed of the turbine in rpm \n", + "Q1=9#The initial discharge of the turbine in m**3/s\n", + "n0=0.9#Overall efficiency of the turbine \n", + "H2=20#The final head on the turbine in m\n", + "d=1000#density of the water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "N2=N1*((H2/H1)**(1/2))#The final speed of the turbine in rpm\n", + "Q2=Q1*((H2/H1)**(1/2))#The final discharge of the turbine in m**3/s\n", + "P1=n0*d*g*Q1*H1*10**-3#Power produced by the turbine initially in kW\n", + "P2=P1*((H2/H1)**(3/2))#Power produced by the turbine finally in kW\n", + "\n", + "#output\n", + "print '(a)The final speed of the turbine is %3.2f rpm\\n(b)The final discharge of the turbine is %3.2f m**3/s\\n(c)Power produced by the turbine initially is %3.3f kW\\n(d)Power produced by the turbine finally is %3.2f kW'%(N2,Q2,P1,P2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The final speed of the turbine is 178.89 rpm\n", + "(b)The final discharge of the turbine is 8.05 m**3/s\n", + "(c)Power produced by the turbine initially is 1986.525 kW\n", + "(d)Power produced by the turbine finally is 1421.44 kW\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 7.13 Page 320" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P1=5000*10**3#The initial power produced in W\n", + "H1=250#The initial head produced in m\n", + "N1=210#The initial speed of turbine in rpm\n", + "n0=0.85#Overall efficiency of the turbine \n", + "H2=160#The final head produced in m\n", + "d=1000#density of the water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "\n", + "#calculations\n", + "Nu=N1/((H1)**(1/2))#The unit speed of the turbine \n", + "Pu=P1/((H1)**(3/2))*10**-3#The unit power of the turbine \n", + "Q1=P1/(d*g*n0*H1)#The initial discharge of the turbine in m**3/s\n", + "Qu=Q1/((H1)**(1/2))#The unit discharge of the turbine \n", + "Q2=Qu*((H2)**(1/2))#The final discharge of the turbine in m**3/s\n", + "N2=Nu*((H2)**(1/2))#The final speed of the turbine in rpm\n", + "P2=Pu*((H2)**(3/2))#The final power of the turbine in kW\n", + "Ns=(N2*((P2)**(1/2)))/((H2)**(5/4))#The specific speed of the turbine\n", + "\n", + "#output\n", + "print '(a)The unit speed of the turbine is %3.2f\\n(b)The unit power of the turbine is %3.3f\\n(c)The unit discharge of the turbine is %3.3f\\n(d)The final discharge of the turbine is %3.2f m**3/s\\n(e)The final speed of the turbine is %3.2f rpm\\n(f)The final power of the turbine is %3.1f kW\\n(g)The specific speed of the turbine is %3.2f'%(Nu,Pu,Qu,Q2,N2,P2,Ns)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The unit speed of the turbine is 13.28\n", + "(b)The unit power of the turbine is 1.265\n", + "(c)The unit discharge of the turbine is 0.152\n", + "(d)The final discharge of the turbine is 1.92 m**3/s\n", + "(e)The final speed of the turbine is 168.00 rpm\n", + "(f)The final power of the turbine is 2560.0 kW\n", + "(g)The specific speed of the turbine is 14.94\n" + ] + } + ], + "prompt_number": 9 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Turbomachines_by_A._V._Arasu/Ch8.ipynb b/Turbomachines_by_A._V._Arasu/Ch8.ipynb new file mode 100644 index 00000000..76640a4f --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/Ch8.ipynb @@ -0,0 +1,1122 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4917afa3531ad5b8b88974bc3a67730d6fe85dd6094df74e9d2ebeeb54dc0430" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter8 - Hydraulic pumps" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.1 Page 354" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import pi, tan\n", + "#input data\n", + "D=1.3#Diameter of the pump in m\n", + "Q=3.5/60#Discharge of water by pump in m**3/s\n", + "U2=10#Tip speed of pump in m/s\n", + "Cr2=1.6#Flow velocity of water in pump in m/s\n", + "b2=30#Outlet blade angle tangent to impeller periphery in degree\n", + "Cx1=0#Whirl velocity at inlet in m/s\n", + "U=10#Tip speed of pump in m/s\n", + "d=1000#Density of water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "Wx2=Cr2/tan(b2*pi/180)#Exit relative velocity in m/s\n", + "E=(U2/g)*(U2-(Wx2))#Euler head in m or W/(N/S)\n", + "m=d*Q#Mass flow rate of water in kg/s\n", + "W=E*m*g#Power delivered in W\n", + "r=D/2#Radius of the pump in m\n", + "T=W/(U/r)#Torque delivered in Nm\n", + "\n", + "#output\n", + "print 'Torque delivered by the impeller is %3.1f Nm'%(T)\n", + "# Answer in the textbook is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Torque delivered by the impeller is 274.1 Nm\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.2 Page 355" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sin, tan\n", + "#input data\n", + "b2=30#Impeller blade angle to the tangent at impeller outlet in degree\n", + "d=0.02#Blade depth in m\n", + "D=0.25#Blade diameter in m\n", + "N=1450#Pump rotation speed in rpm\n", + "Q=0.028#FLow rate of the pump in m**3/s\n", + "sf=0.77#Slip factor \n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "A=3.1415*d*D#Flow area in m**2\n", + "Cr2=Q/A#Flow velocity in m/s\n", + "Wx2=Cr2/tan(b2*pi/180)#Exit relative velocity in m/s\n", + "U2=(3.14*D*N)/60#Tip speed of pump in m/s\n", + "Cx2=U2-Wx2#Absolute whirl component at exit in m/s\n", + "E=(U2*Cx2)/g#Euler head with no whirl at inlet in m\n", + "Cx21=sf*Cx2#Actual value of component of absolute value in tangential direction in m/s\n", + "Es=sf*E#Theoretical head with slip in m\n", + "Z=(3.145*sin(b2*pi/180))/((1-sf)*(1-((Cr2/U2)/tan(b2*pi/180))))#Number of blades required based on stodola slip factor\n", + "\n", + "#output\n", + "print '(a)Theoretical head with slip is %3.2f m\\n(b)Number of blades required is %3.f'%(Es,Z)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Theoretical head with slip is 23.65 m\n", + "(b)Number of blades required is 8\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.3 Page 356" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "D2=0.4#Outer diameter of impeller in m\n", + "b2=0.05#Outlet width of impeller in m\n", + "N=800#Running speed of pump in rpm\n", + "Hm=16#Working head of pump in m\n", + "b22=40#Vane angle at outlet in degree\n", + "nm=0.75#Manometric efficiency \n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "U2=(3.1415*D2*N)/60#Impeller tip speed in m/s\n", + "Cx2=(g*Hm)/(U2*nm)#Absolute whirl component at exit in m/s\n", + "Wx2=U2-Cx2#Exit relative velocity in m/s\n", + "Cr2=Wx2*tan(b22*pi/180)#Flow velocity of water in pump in m/s\n", + "A=3.14*D2*b2#Area of flow in m**2\n", + "Q=A*Cr2#Discharge of the pump in m**3/s\n", + "\n", + "#output\n", + "print 'The discharge of the pump is %3.4f m**3/s'%(Q)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The discharge of the pump is 0.2247 m**3/s\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.4 Page 357" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import tan, atan, degrees\n", + "#input data\n", + "D2D1=2#The ratio of outer and inner diameter \n", + "N=1200#The running speed of pump in rpm\n", + "Hm=75#Total head producing work in m\n", + "Cr1=3#Flow velocity through impeller at inlet in m/s\n", + "Cr2=Cr1#Flow velocity through impeller at outlet in m/s\n", + "b22=30#Vanes set back angle at outlet in degree\n", + "D2=0.6#Outlet diameter of impeller in m\n", + "d=1000#Density of water in kg/m**3\n", + "b2=0.05#Width of impeller at outlet in m\n", + "g=9.81#Acceleartion due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "D1=D2/D2D1#Inlet diameter of impeller in m\n", + "U1=(3.1415*D1*N)/60#Impeller tip speed at inlet in m/s\n", + "b11=degrees(atan(Cr1/U1))#Vane angle at inlet in degree\n", + "U2=(3.1415*D2*N)/60#Impeller tip speed at exit in m/s\n", + "A=3.1415*D2*b2#Area of flow in m**2\n", + "Q=A*Cr2#Discharge of the pump in m**/s\n", + "m=d*Q#Mass flow rate of water in kg/s\n", + "Wx2=Cr2/tan(b22*pi/180)#Exit relative velocity in m/s\n", + "Cx2=U2-Wx2#Absolute whirl component at exit in m/s\n", + "W=m*U2*Cx2*10**-3#Work done per second in kW\n", + "nm=Hm/((U2*Cx2)/g)#Manometric efficiency \n", + "\n", + "#output\n", + "print '(a)Vane angle at inlet is %3.3f degree\\n(b)Work done per second is %3.2f kW\\n(c)Manometric efficiency is %0.2f %%'%(b11,W,nm*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Vane angle at inlet is 9.043 degree\n", + "(b)Work done per second is 346.42 kW\n", + "(c)Manometric efficiency is 60.05 %\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.5 Page 358" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Q=75#Discharge from the pump in l/s\n", + "D1=0.1#Inlet diameter of the pump in m\n", + "D2=0.29#Outlet diameter of the pump in m \n", + "Hm=30#Total head producing work in m\n", + "N=1750#Speed of the pump in rpm\n", + "b1=0.025#Width of impeller at inlet per side in m\n", + "b2=0.023#Width of impeller at outlet in total in m\n", + "a11=90#The angle made by the entering fluid to impeller in degree\n", + "b22=27#Vanes set back angle at outlet in degree\n", + "Qloss=2.25#Leakage loss in l/s\n", + "ml=1.04#Mechanical loss in kW\n", + "cf=0.87#Contraction factor due to vane thickness \n", + "n0=0.55#Overall efficiency\n", + "d=1000#Density of water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "U1=(3.1415*D1*N)/60#Blade inlet speed in m/s\n", + "A1=3.1415*D1*b1*cf*10**3#Area of flow at inlet in m**2\n", + "Qt=Q+Qloss#Total quantity of water handled by pump in l/s\n", + "Qts=Qt/2#Total quantity of water handled by pump per side in l/s\n", + "Cr1=(Qts*10**-3)/(A1*10**-3)#Flow velocity through impeller at inlet in m/s\n", + "b11=degrees(atan(Cr1/U1))#Inlet vane angle in degree\n", + "A2=3.1415*D2*(b2/2)*cf*10**3#Area of flow at outlet in m**2 here b2 is calculated per side\n", + "Cr2=Qts/A2#Velocity of flow at outlet in m/s\n", + "U2=(3.1415*D2*N)/60#Peripheral speed at outlet in m/s\n", + "Wx2=Cr2/tan(b22*pi/180)#Exit relative velocity in m/s\n", + "Cx2=U2-Wx2#Absolute whirl component at exit in m/s\n", + "a22=degrees(atan(Cr2/Cx2))#The absolute water angle at outlet in degree\n", + "C2=Cr2/sin(a22*pi/180)#Absolute velocity of water at exit in m/s\n", + "nh=Hm/((U2*Cx2)/g)#Manometric efficiency \n", + "nv=Q/Qt#Volumetric efficiency \n", + "SP=(d*g*(Q*10**-3/2)*Hm)/n0*10**-3#Shaft power in kW\n", + "nm=(SP-ml)/SP#Mechanical efficiency \n", + "\n", + "#output\n", + "print '(a)Inlet vane angle is %3.2f degree\\n(b)The absolute water angle is %3.2f degree\\n(c)Absolute velocity of water at exit is %3.2f m/s\\n(d)Manometric efficiency is %0.1f %%\\n(e)Volumetric efficiency is %0.2f %%\\n(f)Mechanical efficiency is %0.1f %%'%(b11,a22,C2,nh*100,nv*100,nm*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Inlet vane angle is 31.67 degree\n", + "(b)The absolute water angle is 13.07 degree\n", + "(c)Absolute velocity of water at exit is 18.74 m/s\n", + "(d)Manometric efficiency is 60.7 %\n", + "(e)Volumetric efficiency is 97.09 %\n", + "(f)Mechanical efficiency is 94.8 %\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.6 Page 360" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Hi=0.25#Vaccum gauge reading in m of Hg vaccum\n", + "P0=1.5#Pressure gauge reading in bar\n", + "Z01=0.5#Effective height between gauges in m\n", + "P=22#Power of electric motor in kW\n", + "Di=0.15#Inlet diameter in m\n", + "Do=0.15#Outlet diameter in m\n", + "Q=0.1#Discharge of pump in m**3/s\n", + "dHg=13600#Density of mercury in kg/m**3\n", + "dw=1000#Density of water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "Pi=dHg*g*Hi#Inlet pressure in N/m**2 vaccum\n", + "Po=P0*10**5#Outlet pressure in N/m**2\n", + "V0=Q/((3.1415*Do**2)/4)#Velocity of water in delivery pipe in m/s\n", + "Vi=V0#vleocity of water in suction pipe in m/s\n", + "Hm=((Po+Pi)/(dw*g))+((V0**2-Vi**2)/(2*g))+(Z01)#Manometric head in m\n", + "n0=(dw*g*Q*Hm)/(P*10**3)#Overall efficiency \n", + "\n", + "#output\n", + "print '(a)Manometric head is %3.2f m\\n(b)Overall efficiency is %0.1f %%'%(Hm,n0*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Manometric head is 19.19 m\n", + "(b)Overall efficiency is 85.6 %\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.7 Page 361" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Hm=20#Head against which work is produced in pump in m\n", + "b22=45#Vanes set back angle at outlet in degree\n", + "N=600#Rotating speed of pump in rpm\n", + "Cr1=2#Flow velocity through impeller at inlet in m/s\n", + "Cr2=Cr1#Flow velocity through impeller at outlet in m/s\n", + "g=9.81#acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "Wx2=Cr2/tan(b22*pi/180)#Exit relative velocity in m/s\n", + "U2=(4+(16+(4*3*792.8))**(1/2))/(2*3)# Blade outlet speed in m/s\n", + " #The above equation is obtained by solving \n", + " #Cx2=U2-Wx2 #Absolute whirl component at exit in m/s\n", + " #C2=(Cx2**2+Cr2**2)**(1/2) #Absolute velocity of water at exit in m/s\n", + " #Hm=(U2*Cx2/g)-((C2**2)/(4*g)) #Total head producing work in m\n", + " #3*(U2**2)-(4*U2)-792.8=0 \n", + "D2=(60*U2)/(3.1415*N)#Impeller diameter in m\n", + "\n", + "#output\n", + "print 'The impeller diameter is %3.4f m'%(D2)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The impeller diameter is 0.5391 m\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.8 Page 362" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "n0=0.7#Overall efficiency\n", + "Q=0.025#Discharge of water by the pump in m**3/s\n", + "H=20#Height of supplied by the pump in m\n", + "D=0.1#Diameter of the pump in m\n", + "L=100#Length of the pipe in m\n", + "f=0.012#Friction coefficient \n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "d=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "V0=Q/((3.1415/4)*D**2)#Velocity of water in the pipe in m/s\n", + "hf0=(4*f*L*V0**2)/(2*g*D)#Loss of head due to friction in pipe in m\n", + "Hm=H+hf0+(V0**2/(2*g))#Manometric head in m\n", + "P=(d*g*Q*Hm)/(n0)*10**-3#Power required to drive the pump in kW\n", + "\n", + "#output\n", + "print 'Power required to drive the pump is %3.2f kW'%(P)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power required to drive the pump is 15.87 kW\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.9 Page 363" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Q=0.015#Discharge of water in pump in m**3/s\n", + "D1=0.2#Internal diameter of the impeller in m\n", + "D2=0.4#External diameter of the impeller in m\n", + "b1=0.016#Width of impeller at inlet in m\n", + "b2=0.008#Width of impeller at outlet in m\n", + "N=1200#Running speed of the pump in rpm\n", + "b22=30#Impeller vane angle at outlet in degree\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "d=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "print 'From velocity triangles the following values have been deduced'\n", + "a11=90#The absolute water angle at inlet in degree\n", + "Cx1=0#Absolute whirl component at inlet in m/s\n", + "A1=3.1415*D1*b1#Area of flow at inlet in m**2\n", + "Cr1=Q/A1#Flow velocity through impeller at inlet in m/s\n", + "C1=Cr1#Absolute velocity at inlet in m/s\n", + "A2=3.1415*D2*b2#Area of flow at outlet in m**2\n", + "Cr2=Q/A2#Flow velocity through impeller at outlet in m/s\n", + "U2=(3.1415*D2*N)/60#Blade outlet speed in m/s\n", + "Cx2=U2-(Cr2/tan(b22*pi/180))#Absolute whirl component at outlet in m/s\n", + "C2=(Cx2**2+Cr2**2)**(1/2)#Velocity at impeller exit in m/s\n", + "Ihl=((Cx2*U2)/g)-((C2**2)/(2*g))+((C1**2)/(2*g))#Pressure rise in impeller in m\n", + "\n", + "#output\n", + "print '\\n\\nThe rise in pressure in the impeller is %3.3f m'%(Ihl)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "From velocity triangles the following values have been deduced\n", + "\n", + "\n", + "The rise in pressure in the impeller is 31.852 m\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.10 Page 365" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Ihl=3#Head loss in impeller in m\n", + "Cr2=4.64#Flow velocity through impeller at outlet in m/s\n", + "U2=30#Blade outlet speed in m/s\n", + "dPi=35.3#Difference in pressure gauge readings at impeller inlet and outlet in m of water\n", + "Pg=4.7#Pressure gain in the casing in m of water \n", + "n=0.385#Part of absolute kinetic energy converted into pressure gain\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "d=1000#Density of water in kg/m**3\n", + "ss=0.85#Slip coefficient\n", + "\n", + "#calculations\n", + "Kei=Pg/n#Kinetic energy at impeller exit in m/s\n", + "C2=((Kei)*2*g)**(1/2)#Velocity at impeller exit in m/s\n", + "Cx22=(C2**2-Cr2**2)**(1/2)#Absolute whirl component at outlet with fliud slip in m/s\n", + "Cx2=Cx22/ss#Ideal absolute whirl velocity in m/s\n", + "b22=degrees(atan(Cr2/(U2-Cx2)))#Blade angle at exit in degree\n", + "Wm=ss*U2*Cx2#Euler work input in J/kg\n", + "nm=dPi/(U2*Cx22/g)#Manometric efficiency\n", + "dP=(U2*Cx22/g)-(Ihl)-(C2**2/(2*g))#Pressure rise in impeller in m\n", + "\n", + "#output\n", + "print '(a)\\n Exit blade angle is %3.2f degree\\n Euler work input is %3.2f J/kg\\n(b)Manometric efficiency is %0.2f %%\\n(c)Pressure rise in the impeller is %3.3f m'%(b22,Wm,nm*100,dP)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)\n", + " Exit blade angle is 20.17 degree\n", + " Euler work input is 442.93 J/kg\n", + "(b)Manometric efficiency is 78.18 %\n", + "(c)Pressure rise in the impeller is 29.943 m\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.11 Page 366" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "r1=0.051#Eye radius of the impeller in m\n", + "D2=0.406#Outer diameter of the impeller in m\n", + "b11=(90-75)#Inlet blade angle measured from tangential flow direction in degree\n", + "b22=(90-83)#Outlet blade angle measured from tangential flow direction in degree\n", + "b=0.064#Blade depth in m\n", + "Cx1=0#Inlet whirl velocity in m/s\n", + "nh=0.89#Hydraulic efficiency \n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "d=1000#Density of water in kg/m**3\n", + "N=900#Rotating speed of impeller in rpm\n", + "\n", + "#calculations\n", + "w=(2*3.1415*N)/60#Angular velocity at inlet in rad/s\n", + "U1=(w*r1)#Inlet tangential impeller velocity in m/s\n", + "C1=U1*tan(b11*pi/180)#Velocity at impeller inlet in m/s\n", + "A=2*3.1415*r1*b#Area of flow through the pump in m**2\n", + "Cr1=C1#Flow velocity through impeller at inlet in m/s\n", + "Q=A*Cr1#Volume flow through the pump in m**3/s\n", + "r2=D2/2#Outer radius of the impeller in m\n", + "Cr2=(r1*Cr1)/r2#Flow velocity through impeller at outlet in m/s\n", + "U2=w*r2#Outlet tangential impeller velocity in m/s\n", + "Wx2=Cr2/tan(b22*pi/180)#Exit relative velocity in m/s\n", + "E=(U2/g)*(U2-Wx2)#Theoretical head developed in m\n", + "Hm=nh*E#Total stagnation head developed by the pump in m\n", + "dP021=Hm*d*g*10**-3#Total pressure head coefficient in kPa\n", + "Cx2=U2-(Cr2/tan(b22*pi/180))#Absolute whirl velocity in m/s\n", + "C2=(Cr2**2+Cx2**2)**(1/2)#Velocity at impeller exit in m/s\n", + "dP21=(Hm-(((C2**2)-(C1**2))/(2*g)))*d*g*10**-3#The static pressure head in kPa\n", + "P=d*g*Q*Hm*10**-3#Power given to the fluid in kW\n", + "Ps=P/nh#Input power to impeller in kW\n", + "\n", + "#output\n", + "print '(a)Volume flow rate through the impeller is %3.4f m**3/s\\n(b)\\n stagnation pressure rise across the impeller is %3.1f kPa\\n Static pressure rise across the impeller is %3.1f kPa\\n(c)Power given to fluid is %3.2f kW\\n(d)Input power to impeller is %3.2f kW'%(Q,dP021,dP21,P,Ps)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Volume flow rate through the impeller is 0.0264 m**3/s\n", + "(b)\n", + " stagnation pressure rise across the impeller is 280.9 kPa\n", + " Static pressure rise across the impeller is 145.6 kPa\n", + "(c)Power given to fluid is 7.42 kW\n", + "(d)Input power to impeller is 8.34 kW\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.12 Page 368" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import pi, tan\n", + "from __future__ import division\n", + "#input data\n", + "Q=0.04#Discharge of the pump design in m**3/s\n", + "Ns=0.075#Specific speed in rev\n", + "b22=(180-120)#Outlet angle with the normal in degree\n", + "H=35#Distance to which pumping of water is done in m\n", + "Dp=0.15#Diameter of suction and delivery pipes in m\n", + "L=40#Combined length of suction and delivery pipes in m\n", + "WD=1/10#Width to diameter ratio at outlet of impeller \n", + "f=0.005#Friction factor \n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "nh=0.76#Hydraulic effficiency neglecting the slip\n", + "n=0.06#Percentage occupied by blades on circumference area\n", + "\n", + "#calculations\n", + "A=(pi/4)*(Dp**2)#Area of flow in pipe in m**2\n", + "V=Q/A#Velocity in the pipes in m/s\n", + "OL=3*V**2/(2*g)#Other loses in the pipes in m\n", + "TL=(4*f*L*V**2/(2*g*Dp))+(OL)#Total loses in a pipe in m\n", + "TH=TL+H#Total required head in m\n", + "N=(Ns*((g*TH)**(3/4)))/((Q)**(1/2))#The speed of the pump in rev/s\n", + "from sympy import symbols, solve\n", + "from sympy import N as NN\n", + "D = symbols('D')\n", + "Ao=pi*WD*(1-n)*D**2#Flow area perpendicular to impeller outlet periphery \n", + "Cr2=Q/Ao#Flow velocity through impeller at outlet in m/s\n", + "U2=pi*D*N#Outlet tangential impeller velocity in m/s\n", + "Cx2=(g*TH)/(U2*nh)#Absolute whirl velocity in m/s\n", + "expr = tan(b22*pi/180)-(Cr2/(Cx2-U2)) # polynomial of D\n", + "D = solve(expr, D) # discarding -ve values \n", + "D = D[2] # Now discard imaginary part as negligible(in powers of e**-23)\n", + "D = NN(abs(D),3) # in meters # rounding off\n", + "#output\n", + "print 'The pump impeller diameter is %3.3f m'%(D)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The pump impeller diameter is 0.214 m\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.13 Page 370" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "N=2875#Speed of the pump in rpm \n", + "Q=57.2/3600#Discharge of the pump in m**3/s\n", + "Hm=42.1#Total head developed by the pump in m\n", + "d=1000#Density of the water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "n=0.76#Efficiency of the pump\n", + "\n", + "#calculations\n", + "Ns=(N*Q**(1/2))/(Hm**(3/4))#Specific speed of the pump \n", + "P=((d*g*Q*Hm)/n)*10**-3#Power input in kW\n", + "\n", + "#calculations\n", + "print '(a)Specific speed of the pump is %3.f\\n(b)Power input is %3.3f kW'%(Ns,P)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Specific speed of the pump is 22\n", + "(b)Power input is 8.634 kW\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.14 Page 371" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import ceil\n", + "#input data\n", + "D1=0.6#Inlet impeller diameter in m\n", + "D2=1.2#Outlet impeller diameter in m\n", + "Cr2=2.5#Radial flow velocity in m/s\n", + "N=200#Running speed of the pump in rpm\n", + "Q=1.88#Discharge of the pump in m**3/s\n", + "Hm=6#Head which the pump has to overcome in m\n", + "b22=26#Vane angle at exit at tangent to impeller in degree\n", + "d=1000#Density of the water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "U2=(3.1415*D2*N)/60#Outlet tangential impeller velocity in m/s\n", + "Wx2=Cr2/tan(b22*pi/180)#Exit relative velocity in m/s\n", + "Cx2=U2-Wx2#Absolute whirl velocity in m/s\n", + "nm=(Hm/(U2*Cx2/g))#Manometric efficiency \n", + "Nls=((2*g*Hm*60**2)/((3.1415**2)*((1.2**2)-(0.6**2))))**(1/2)#Least starting speed of the pump in rpm\n", + "\n", + "#output\n", + "print '(1)Manometric efficiency is %0.1f %%\\n(2)Least speed to start the pump is %3.2f rpm, rounding off = %0.f rpm'%(nm*100,Nls, ceil(Nls))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)Manometric efficiency is 63.0 %\n", + "(2)Least speed to start the pump is 199.40 rpm, rounding off = 200 rpm\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.15 Page 372" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "D2=1.25#External diameter of the impeller in m\n", + "D1=0.5#Internal diameter of the impeller in m\n", + "Q=2#Discharge of the pump in m**3/s\n", + "Hm=16#Head over which pump has to operate in m\n", + "N=300#Running speed of the pump in rpm\n", + "b22=30#Angle at which vanes are curved back in degree\n", + "Cr1=2.5#Flow velocity through impeller at inlet in m/s\n", + "Cr2=Cr1#Flow velocity through impeller at outlet in m/s\n", + "d=1000#Density of the water in kg/m**3\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "U2=(3.1415*D2*N)/60#Outlet tangential impeller velocity in m/s\n", + "Wx2=Cr2/tan(b22*pi/180)#Exit relative velocity in m/s\n", + "Cx2=U2-Wx2#Absolute whirl velocity in m/s\n", + "nm=(Hm*g)/(U2*Cx2)#Manometric or hydraulic efficiency\n", + "m=d*Q#Mass flow rate of water in kg/s\n", + "W=m*U2*Cx2*10**-3#Fluid power developed by the impeller in kW\n", + "Ps=W#Power required by the pump in kW neglecting mechanical loses\n", + "Nls=((2*g*Hm)/(((3.1415/60)**2)*(D2**2-D1**2)))**(1/2)#Minimum starting speed of the pump in rpm\n", + "\n", + "#output\n", + "print '(a)Manometric or hydraulic efficiency is %0.1f %% \\n(b)Power required by the pump is %3.2f kW\\n(c)Minimum starting speed of the pump is %3.1f rpm'%(nm*100,Ps,Nls)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Manometric or hydraulic efficiency is 52.2 % \n", + "(b)Power required by the pump is 600.98 kW\n", + "(c)Minimum starting speed of the pump is 295.4 rpm\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.16 Page 373" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "n=3#Number of stages \n", + "D2=0.4#Outlet impeller diameter in m\n", + "b2=0.02#Outlet impeller width in m\n", + "b22=45#Backward vanes angle at outlet in degree\n", + "dA=0.1#Reduction in circumferential area\n", + "nm=0.9#Manometric efficiency of the pump\n", + "Q=0.05#Discharge of the pump in m**3/s\n", + "N=1000#Running speed of the pump in rpm\n", + "n0=0.8#Overall efficiency of the pump\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "d=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "A2=(1-dA)*3.1415*D2*b2#Area of flow at outlet in m**2\n", + "Cr2=Q/A2#Flow velocity through impeller at outlet in m/s\n", + "U2=(3.1415*D2*N)/60#Outlet impeller tangential velocity in m/s\n", + "Wx2=Cr2#Exit relative velocity in m/s as tand(b22)=1\n", + "Cx2=U2-Wx2#Absolute whirl velocity in m/s\n", + "Hm=(nm*U2*Cx2)/g#Head over which pump has to operate in m\n", + "H=n*Hm#Total head generated by the pump in m\n", + "P=d*g*Q*Hm*n#Power output from the pump in W\n", + "Ps=P/n0*10**-3#Shaft power input in kW\n", + "\n", + "#output\n", + "print '(1)The head generated by the pump is %3.2f m\\n(2)Shaft power input is %3.3f kW'%(H,Ps)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)The head generated by the pump is 107.98 m\n", + "(2)Shaft power input is 66.205 kW\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.17 Page 374" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "H=156#Total head operated by the pumps in m\n", + "N=1000#Running speed of the pump in rpm\n", + "Ns=20#Specific speed of each pump \n", + "Q=0.150#Discharge of the pump in m**3/s\n", + "\n", + "#calculations\n", + "Hm=((N*(Q)**(1/2))/(Ns))**(4/3)#Head developed by each pump in m\n", + "n=H/Hm#Number of pumps\n", + "\n", + "#output\n", + "print 'The number of pumps are %3.f'%(n)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The number of pumps are 3\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.18 Page 375" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Q1=120#Discharge of each of the multi stage pump in parallel in first case in m**3/s\n", + "Q2=450#Discharge of the multi stage pump in second case in m**3/s\n", + "H1=16#Head of each stage in first case in m\n", + "D1=0.15#Diameter of impeller in first case in m\n", + "H=140#Total head developed by all pumps in second case in m\n", + "N1=1500#Running speed of the pump in rpm in first case\n", + "N2=1200#Running speed of the pump in rpm in second case\n", + "#calculations\n", + "H2=H1*((Q2/Q1)*((N2/N1)**2))**(4/6)#Head of each stage in second case in m\n", + "n=H/H2#Number of stages in second case \n", + "D2=D1*(((N1/N2)**(2))*(H2/H1))**(1/2)#Diameter of impeller in second case in m\n", + "\n", + "#output\n", + "print '(a)number of stages required is %3.f\\n(b)Diameter of impeller in the second case is %3.2f m or %0.f mm'%(n,D2, D2*1000)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)number of stages required is 5\n", + "(b)Diameter of impeller in the second case is 0.25 m or 251 mm\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.19 Page 376" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "H=36#Initial total head of the pump in m\n", + "Q1=0.05#Initial discharge of the pump in m**3/s\n", + "H2=3.5#Sum of static pressure and velocity head at inlet in m\n", + "P01=0.75#Atmospheric pressure initially in m of Hg\n", + "Pvap1=1.8*10**3#Vapour pressure of water initially in Pa\n", + "Pvap2=830#Vapour pressure of water finanlly in Pa\n", + "P02=0.62#Atmospheric pressure finally in m of Hg\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dW=1000#Density of water in kg/m**3\n", + "dHg=13.6#Density of mercury in kg/m**3\n", + "\n", + "#calculations\n", + "NPSH=H2-((Pvap1)/(dW*g))#Net positive suction head in m\n", + "s=NPSH/H#Cavitation parameter when pump dvelops same total head and discharge \n", + "dH1=(P01*dHg)-(s*H)-(Pvap1/(dW*g))#The height reduced in initial condition above supply in m\n", + "dH2=(P02*dHg)-(s*H)-(Pvap2/(dW*g))#The height reduced in final condition above supply in m\n", + "Z=dH1-dH2#The total height which the pump must be lowered at new location in m\n", + "\n", + "#output\n", + "print '(a)The cavitation parameter is %3.4f\\n(b)\\n The height reduced in initial condition above supply is %3.1f m\\n The height reduced in final condition above supply is %3.2f m\\n The total height which the pump must be lowered at new location is %3.2f m'%(s,dH1,dH2,Z)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The cavitation parameter is 0.0921\n", + "(b)\n", + " The height reduced in initial condition above supply is 6.7 m\n", + " The height reduced in final condition above supply is 5.03 m\n", + " The total height which the pump must be lowered at new location is 1.67 m\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.20 Page 377" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import degrees, atan\n", + "#input data\n", + "Dt=1#Impeller outlet diameter in m\n", + "Dh=0.5#Diameter of the boss in m\n", + "Ns=38#Specific speed of the pump \n", + "Ca=2#Velocity of the flow in m/s\n", + "H=6#Head which the pump has to drive in m\n", + "\n", + "#calculations\n", + "A=(3.1415/4)*(Dt**2-Dh**2)#Area of flow in m**2\n", + "Q=A*Ca#Discharge of the pump in m**3/s\n", + "N=(Ns*H**(3/4))/(Q**(1/2))#Pump speed in rpm\n", + "U1=(3.1415*Dh*N)/60#Blade inlet speed in m/s\n", + "b1=degrees(atan(Ca/U1))#Vane angle at the entry of the pump when the flow is axial at inlet in degree\n", + "\n", + "#output\n", + "print '(a)Pump speed is %0.2f rpm\\n(b)Vane angle at the entry of the pump when the flow is axial at inlet is %3.2f degree'%(N,b1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Pump speed is 134.22 rpm\n", + "(b)Vane angle at the entry of the pump when the flow is axial at inlet is 29.65 degree\n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.21 Page 378" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Q=0.180#Discharge of the pump in m**3/s\n", + "H=2#Head developed by the pump in m\n", + "Ns=250#Specific speed of the pump \n", + "SR=2.4#Speed ratio of the pump\n", + "FR=0.5#Flow ratio of the pump\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "\n", + "#calculations\n", + "N=(Ns*(H**(3/4)))/(Q**(1/2))#Pump speed in rpm\n", + "U=SR*(2*g*H)**(1/2)#Peripheral velocity in m/s\n", + "D=(60*U)/(3.1415*N)#Runner diameter of the pump in m\n", + "Ca=FR*(2*g*H)**(1/2)#Velocity of flow in m/s\n", + "Dh=((D**2)-(Q*4/(Ca*3.14)))**(1/2)#Boss diameter of the pump in m\n", + "\n", + "#output\n", + "print '(a)Pump speed is %3.i rpm\\n(b)Runner diameter of the pump is %3.2f m\\n(c)Boss diameter of the pump is %3.2f m\\n'%(N,D,Dh)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Pump speed is 991 rpm\n", + "(b)Runner diameter of the pump is 0.29 m\n", + "(c)Boss diameter of the pump is 0.10 m\n", + "\n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 8.22 Page 379" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "Hs=2.5#Height of the pipe above suction reservoir in m\n", + "H1=18#Height of the pipe below supply reservoir in m\n", + "H=2.7#Total height through which the pump lifts water in m\n", + "Q1=2.75#Discharge of water used from supply reservoir in l/s\n", + "Qt=7.51#Discharge of water totally delivered in l/s\n", + "\n", + "#calculations\n", + "Hd=H-Hs#Height of the pipe from discharge reservoir in m\n", + "Qs=Qt-Q1#Discharge of water in delivery reservoir in l/s\n", + "nj=(Qs/Q1)*((Hs+Hd)/(H1-Hd))#Jet pump efficiency \n", + "\n", + "#output\n", + "print 'The efficiency of the jet pump is %0.1f'%(nj*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The efficiency of the jet pump is 26.3\n" + ] + } + ], + "prompt_number": 22 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Turbomachines_by_A._V._Arasu/Ch9.ipynb b/Turbomachines_by_A._V._Arasu/Ch9.ipynb new file mode 100644 index 00000000..9ea40cea --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/Ch9.ipynb @@ -0,0 +1,1077 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:52c2219fbd43444e9f10668aa35432419392cd1b075ad84ee07b92a8e31571e1" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9 - Hydraulic Turbines" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.1 Page 406" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "\n", + "#input data\n", + "H=91.5#Head of the pelton wheel at inlet in m\n", + "Q=0.04#Discharge of the pelton wheel in m**3/s\n", + "N=720#Rotating speed of the wheel in rpm\n", + "Cv=0.98#Velocity coefficient of the nozzle \n", + "n0=0.8#Efficiency of the wheel\n", + "UC1=0.46#Ratio of bucket speed to jet speed\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "P=dw*g*H*Q*n0*10**-3#Power developed in kw\n", + "C1=Cv*(2*g*H)**(1/2)#Jet speed in m/s\n", + "U=UC1*C1#Wheel speed in m/s\n", + "w=(2*3.1415*N)/60#Angular velocity of the wheel in rad/s\n", + "D=(2*U)/w#Diameter of the wheel in m\n", + "A=Q/C1#Jet area in m**2\n", + "d=((4*A)/3.1415)**(1/2)#Jet diameter in m\n", + "Dd=D/d#Wheel to jet diameter ratio at centre line of the buckets\n", + "Nsp=((1/(g*H))**(5/4))*(((P*10**3)/dw)**(1/2))*(N/60)*2*3.1415#Dimensionless power specific speed in rad\n", + "\n", + "#output\n", + "print '(a)Wheel-to-jet diameter ratio at the centre line of the buckets is %3.1f \\n(b)\\n The jet speed of the wheel is %3.2f m/s\\n Wheel speed is %3.1f m/s\\n(c)Dimensionless power specific speed is %3.3f rad'%(Dd,C1,U,Nsp)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Wheel-to-jet diameter ratio at the centre line of the buckets is 14.5 \n", + "(b)\n", + " The jet speed of the wheel is 41.52 m/s\n", + " Wheel speed is 19.1 m/s\n", + "(c)Dimensionless power specific speed is 0.082 rad\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.2 Page 407" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "H=500#Head over which pelton wheel works in m\n", + "P=13000#Power which pelton wheel produces in kW\n", + "N=430#Speed of operation of pelton wheel in rpm\n", + "n0=0.85#Efficiency of the wheel \n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "Cv=0.98#Veloity coefficient\n", + "UC=0.46#Speed ratio\n", + "\n", + "#calculations\n", + "Q=(P*10**3)/(dw*g*H*n0)#Discharge of the turbine in m**3/s\n", + "C=Cv*(2*g*H)**(1/2)#Jet speed in m/s\n", + "U=UC*C#Wheel speed in m/s\n", + "D=(U*60)/(3.1415*N)#Wheel diameter in m\n", + "d=((Q/C)*(4/3.1415))**(1/2)#Diameter of the nozzle in m\n", + "\n", + "#output\n", + "print '(a)Discharge of the turbine is %3.2f m**3/s\\n(b)Diameter of the wheel is %3.2f m\\n(c)Diameter of the nozzle is %3.3f m'%(Q,D,d)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Discharge of the turbine is 3.12 m**3/s\n", + "(b)Diameter of the wheel is 1.98 m\n", + "(c)Diameter of the nozzle is 0.202 m\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.3 Page 409" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import pi, cos\n", + "#input data\n", + "D=0.8#Mean diameter of the bucket in m\n", + "N=1000#Running speed of the wheel in rpm\n", + "H=400#Net head on the pelton wheel in m\n", + "Q=0.150#Discharge through the nozzle in m**3/s\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "UC1=0.46#Ratio of bucket speed to jet speed\n", + "dw=1000#Density of water in kg/m**3\n", + "a=15#Side clearance angle in degree\n", + "\n", + "#calculations\n", + "m=dw*Q#Mass flow rate through the nozzle in kg/s\n", + "U=(3.1415*D*N)/60#Wheel speed in m/s\n", + "C1=U/UC1#Jet speed in m/s\n", + "P=(1/2)*m*C1**2*(10**-3)#Power available at the nozzle in kW\n", + "W1=C1-U#Relative inlet fluid velocity in m/s\n", + "W2=W1#Relative exit fluid velocity in m/s assuming no loss of relative velocity\n", + "Wx2=W2*cos(a*pi/180)#Exit whirl velocity component in m/s\n", + "Cx2=Wx2-U#Absolute exit whirl velocity in m/s\n", + "Cx1=C1#Absolute inlet whirl velocity in m/s\n", + "Wm=U*(Cx1+Cx2)#Work done per unit mass flow rate in W/(kg/s)\n", + "nH=(Wm/g)/((C1**2/2)/g)#Hydrualic effciency \n", + "\n", + "#output\n", + "print '(a)Power available at the nozzle is %3.3f kW\\n(b)Hydraulic efficiency is %.1f %%'%(P,nH*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Power available at the nozzle is 621.867 kW\n", + "(b)Hydraulic efficiency is 97.7 %\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.4 Page 409" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "n=2#Number of jets \n", + "SP=20000*0.736#Shaft power of the wheel in kW\n", + "D=0.15#Diameter of each jet in m\n", + "H=500#Net head on the turbine in m\n", + "Cv=1.0#Velocity coefficient\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "d=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "C1=Cv*(2*g*H)**(1/2)#Velocity of each jet in m/s\n", + "A=(3.1415/4)*D**2#Area of each jet in m**2\n", + "Qj=A*C1#Discharge of each jet in m**3/s\n", + "Q=2*Qj#Total discharge in m**3/s\n", + "P=d*g*Q*H*10**-3#Power at turbine inlet in kW\n", + "no=SP/P#Overall efficiency\n", + "\n", + "#output\n", + "print 'The overall efficiency of the turbine is %0.1f %%'%(no*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The overall efficiency of the turbine is 85.7 %\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.5 Page 410" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "a=170#Jet deflection angle in degree\n", + "K=1-0.12#Percentage of effective relative velocity after considering friction\n", + "UC1=0.47#Ratio of bucket speed to jet speed\n", + "GH=600#Gross head on the wheel in m\n", + "P=1250#Actual power developed by the wheel in kW\n", + "Hl=48#Head loss in nozzle due to pipe friction in m\n", + "D=0.9#Bucket circle diameter of the wheel in m\n", + "ATnH=0.9#The ratio between actual and calculated hydraulic efficiency\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "Cv=0.98#Velocity coefficient\n", + "\n", + "#calculations\n", + "H=GH-Hl#Net head after loses at entry to nozzle in m\n", + "C1=Cv*(2*g*H)**(1/2)#Jet speed in m/s\n", + "U=UC1*C1#Wheel bucket speed in m/s\n", + "N=(U*60)/(3.1415*D)#Wheel rotational speed in rpm\n", + "Wm=U*((C1-U)*(1-(K*cos(a*pi/180))))#Work done per unit mass flow rate in W/(kg/s)\n", + "Tnh=Wm/(C1**2/2)#Theoretical hydraulic efficiency \n", + "Anh=ATnH*Tnh#Actual hydrualic effficiency\n", + "m2=(P*10**3)/(Anh*(1/2)*C1**2)#Mass flow rate for both the nozzles in kg/s\n", + "m=m2/2#Mass flow rate of each nozzle in kg/s\n", + "d=((4*m)/(dw*C1*3.1415))**(1/2)#Nozzle diameter in m\n", + "\n", + "#output\n", + "print '(a)theoretical hydraulic efficiency is %3.2f \\n(b)Wheel rotational speed is %3.f rpm\\n(c)diameter of the nozzle is %0.1f mm'%(Tnh,N,d*1000)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)theoretical hydraulic efficiency is 0.93 \n", + "(b)Wheel rotational speed is 1017 rpm\n", + "(c)diameter of the nozzle is 42.3 mm\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.6 Page 413" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "H=60#Head on the pelton wheel in m\n", + "N=200#Speed of the pelton wheel in rpm\n", + "P=100#Power developed by the pelton wheel in kW\n", + "Cv=0.98#Velocity coefficient\n", + "UC1=0.45#Speed ratio \n", + "n0=0.85#Overall efficiency of the wheel\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "C1=Cv*(2*g*H)**(1/2)#Velocity of the jet in m/s\n", + "U=UC1*(2*g*H)**(1/2)#Velocity of the buckets in m/s\n", + "D=(60*U)/(3.1415*N)#Diameter of the wheel in m\n", + "Q=(P*10**3)/(dw*g*H*n0)#Discharge of the wheel in m**3/s\n", + "d=((4*Q)/(3.1415*C1))**(1/2)#Diameter of the jet in m\n", + "Z=15+(D/(2*d))+1#Number of buckets rounding off to nearest decimal as the final answer has a decimal value less than 0.5\n", + "w=5*d#Width of the buckets in m\n", + "de=1.2*d#Depth of the buckets in m\n", + "\n", + "#output\n", + "print '(a)Diameter of the wheel is %3.2f m\\n(b)Diameter of the jet is %3.3f m\\n(c)Number of buckets is %3.f\\n(d)Size of the buckets is \\n width of the bucket is %3.3f m\\n Depth of the bucket is %3.3f m'%(D,d,Z,w,de)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Diameter of the wheel is 1.47 m\n", + "(b)Diameter of the jet is 0.087 m\n", + "(c)Number of buckets is 24\n", + "(d)Size of the buckets is \n", + " width of the bucket is 0.435 m\n", + " Depth of the bucket is 0.104 m\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.7 Page 414" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "N=300#Running speed of the wheel in rpm\n", + "H=150#OPerating head of the wheel in m\n", + "dD=1/12#Ratio of nozzle diameter to wheel diameter\n", + "Cv=0.98#Velocity coefficient\n", + "UC1=0.46#Speed ratio\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "n0=0.84#Overall efficiency\n", + "\n", + "#calculations\n", + "C1=Cv*(2*g*H)**(1/2)#Velocity of jet in m/s\n", + "U=UC1*(2*g*H)**(1/2)#Velocity of the wheel in m/s\n", + "D=(60*U)/(3.14*N)#Diameter of the wheel in m\n", + "d=D*dD#Diameter of the jet in m\n", + "Q=(3.1415/4)*(d**2)*C1#Quantity of water required in m**3/s\n", + "Pa=dw*g*Q*H#Power available at the nozzle in kW\n", + "P=n0*Pa*10**-3#Power developed in kW\n", + "#output\n", + "print '(a)Diameter of the wheel is %3.2f m\\n(b)Diameter of the jet is %3.3f m\\n(c)Quantity of water required is %3.3f m**3/s\\n(d)Power developed is %3.1f kW'%(D,d,Q,P)\n", + "# Answer in the textbook is wrong." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Diameter of the wheel is 1.59 m\n", + "(b)Diameter of the jet is 0.132 m\n", + "(c)Quantity of water required is 0.733 m**3/s\n", + "(d)Power developed is 905.5 kW\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.8 Page 415" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import tan, pi\n", + "#input data\n", + "N=1260#Rotational speed of the francis turbine in rpm\n", + "H=124#The net head in m\n", + "Q=0.5#Volume flow rate of the turbine in m**3/s\n", + "r1=0.6#Radius of the runner in m\n", + "b1=0.03#Height of the runner vanes at inlet in m\n", + "b11=72#Angle of inlet guide vanes in radial direction in degree\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "Cx2=0#Absolute exit whirl velocity in m/s as flow is radial at outlet\n", + "\n", + "#calculations\n", + "m=dw*Q#Mass flow rate in kg/s\n", + "T1=-m*r1#Torque by the turbine in Nm in terms of Cx1\n", + "A=2*3.1415*r1*b1#Area at inlet in m**2\n", + "Cr1=Q/A#Inlet flow velocity in m/s\n", + "Cx1=Cr1*tan(b11*pi/180)#Absolute inlet whirl velocity in m/s\n", + "T=-T1*Cx1#Torque by water on the runner in Nm\n", + "w=(2*3.1415*N)/60#Angular velocity of the turbine in rad/s\n", + "W=T*w*10**-3#Power exerted in kW\n", + "nH=W*10**3/(dw*g*Q*H)#Hydraulic efficiency \n", + "\n", + "#output\n", + "print '(a)Torque by water on the runner is -%3.f Nm\\n(b)Power exerted is %3i kW\\n(c)Hydraulic efficiency is %0.1f %%'%(T,W,nH*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Torque by water on the runner is -4082 Nm\n", + "(b)Power exerted is 538 kW\n", + "(c)Hydraulic efficiency is 88.6 %\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.9 Page 416" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import atan, degrees\n", + "#input data\n", + "n0=0.74#Overall efficiency\n", + "H=5.5#Net head across the turbine in m\n", + "P=125#Required Power output in kW\n", + "N=230#Speed of the runner in rpm\n", + "nH=(1-0.18)#Hydraulic efficiency\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "U1=0.97*(2*g*H)**(1/2)#Runner tangential velocity in m/s\n", + "Cr1=0.4*(2*g*H)**(1/2)#Flow velocity in m/s\n", + "\n", + "#calculations\n", + "Cx1=(nH*g*H)/U1#Absolute inlet whirl velocity in m/s as flow is radial at outlet Cx2=0 in m/s\n", + "a11=degrees(atan(Cr1/Cx1))#Inlet guide vane angle in degree\n", + "b11=180+degrees(atan(Cr1/(Cx1-U1)))#Angle of inlet guide vanes in radial direction in degree\n", + "D1=(U1*60)/(3.1415*N)#Runner inlet diameter in m\n", + "Q=(P*10**3)/(n0*dw*g*H)#Flow rate in m**3/s\n", + "b1=Q/(3.1415*D1*Cr1)#Height of runner in m\n", + "\n", + "#output\n", + "print '(a)Inlet guide vane angle is %3.1f degree\\n(b)Angle of inlet guide vanes in radial direction is %3.1f degree\\n(c)Runner inlet diameter is %3.3f m\\n(d)Height of runner is %3.3f m'%(a11,b11,D1,b1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Inlet guide vane angle is 43.4 degree\n", + "(b)Angle of inlet guide vanes in radial direction is 143.8 degree\n", + "(c)Runner inlet diameter is 0.837 m\n", + "(d)Height of runner is 0.287 m\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.10 Page 418" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "D=1.4#Diameter of the turbine in m\n", + "N=430#Speed of the turbine in rpm\n", + "Cr1=9.5#Flow velocity without shock at runner in m/s\n", + "C2=7#Absolute velocity at the exit without whirl in /s\n", + "dSPH=62#Difference between the sum of static and potential heads at entrance to runner and at exit from runner in m\n", + "W=12250#Power given to runner in kW\n", + "Q=12#Flow rate of water from the turbine in m**3/s\n", + "H=115#Net head from the turbine in m\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "U1=(3.1415*D*N)/60#Runner tip speed in m/s\n", + "Cx1=(W*10**3)/(dw*Q*U1)#Absolute inlet velocity in m/s as flow is radial at outlet Cx2=0 in m/s as Cx2=0 as zero whirl at outlet\n", + "a1=degrees(atan(Cr1/Cx1))#Guide vane angle in degree\n", + "C1=(Cr1**2+Cx1**2)**(1/2)#Inlet velocity in m/s\n", + "b1=degrees(atan(Cr1/(Cx1-U1)))#Runner blade entry angle in degree\n", + "dHr=dSPH+(((C1**2)-(C2**2))/(2*g))-(U1*Cx1/g)#Loss of head in the runner in m\n", + "\n", + "#output\n", + "print '(a)\\n (1)Guide vane angle at inlet is %3.1f degree\\n (2)Inlet absolute velocity of water at entry to runner is %3.1f m/s\\n(b)Runner blade entry angle is %3.1f degree\\n(c)Total Loss of head in the runner is %3.2f m'%(a1,C1,b1,dHr)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)\n", + " (1)Guide vane angle at inlet is 16.3 degree\n", + " (2)Inlet absolute velocity of water at entry to runner is 33.8 m/s\n", + "(b)Runner blade entry angle is 84.8 degree\n", + "(c)Total Loss of head in the runner is 13.50 m\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.11 Page 420" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sin, tan, degrees\n", + "#input data\n", + "D1=0.9#External diameter of the turbine in m\n", + "D2=0.45#Internal diameter of the turbine in m\n", + "N=200#Speed of turbine running in rpm\n", + "b1=0.2#Width of turbine at inlet in m\n", + "Cr1=1.8#Velocity of flow through runner at inlet in m/s\n", + "Cr2=Cr1#Velocity of flow through runner at outlet in m/s\n", + "a11=10#Guide blade angle to the tangent of the wheel in degree\n", + "a22=90#Discharge angle at outlet of turbine in degree\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "C1=Cr1/sin(a11*pi/180)#Absolute velocity of water at inlet of runner in m/s\n", + "Cx1=Cr1/tan(a11*pi/180)#Velocity of whirl at inlet in m/s\n", + "U1=(3.1415*D1*N)/60#Runner tip speed at inlet in m/s\n", + "Wx1=Cx1-U1#Inlet whirl velocity component in m/s\n", + "W1=(Wx1**2+Cr1**2)**(1/2)#Relative velocity at inlet in m/s\n", + "b11=degrees(atan(Cr1/Wx1))#Runner blade entry angle in degree\n", + "U2=(3.1415*D2*N)/60#Runner tip speed at exit in m/s\n", + "b22=degrees(atan(Cr2/U2))#Runner blade exit angle in degree\n", + "b2=D1*b1/D2#Width of runner at outlet in m\n", + "Q=3.1415*D1*b1*Cr1#Discharge of water in turbine in m**3/s\n", + "m=dw*Q#Mass of water flowing through runner per second in kg/s\n", + "V2=Cr2#Velocity of water at exit in m/s \n", + "H=(U1*Cx1/g)+(V2**2/(2*g))#Head at the turbine inlet in m\n", + "W=m*U1*Cx1*10**-3#Power developed in kW\n", + "nH=(U1*Cx1/(g*H))#Hydraulic efficiency\n", + "\n", + "#output\n", + "print '(a)Absolute velocity of water at inlet of runner is %3.3f m/s\\n(b)Velocity of whirl at inlet is %3.3f m/s\\n(c)Relative velocity at inlet is %3.3f m/s\\n(d)\\n Runner blade entry angle is %3.2f degree\\n Runner blade exit angle is %3.2f degree\\n(e)Width of runner at outlet is %3.1f m\\n(f)Mass of water flowing through runner per second is %3.f kg/s\\n(g)Head at the turbine inlet is %3.3f m\\n(h)Power developed is %3.3f kW\\n(i)Hydraulic efficiency is %0.2f %%'%(C1,Cx1,W1,b11,b22,b2,m,H,W,nH*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Absolute velocity of water at inlet of runner is 10.366 m/s\n", + "(b)Velocity of whirl at inlet is 10.208 m/s\n", + "(c)Relative velocity at inlet is 1.963 m/s\n", + "(d)\n", + " Runner blade entry angle is 66.47 degree\n", + " Runner blade exit angle is 20.91 degree\n", + "(e)Width of runner at outlet is 0.4 m\n", + "(f)Mass of water flowing through runner per second is 1018 kg/s\n", + "(g)Head at the turbine inlet is 9.972 m\n", + "(h)Power developed is 97.925 kW\n", + "(i)Hydraulic efficiency is 98.34 %\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.12 Page 423" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P=330#Power output from the turbine is kW\n", + "H=70#Head of operating turbine in m\n", + "N=750#Speed of the turbine in rpm\n", + "nH=0.94#Hydraulic efficiency\n", + "n0=0.85#Overall efficiency\n", + "FR=0.15#Flow ratio \n", + "BR=0.1#Breadth ratio\n", + "D1D2=2#Ratio inner and outer diameter of runner\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "Cr1=FR*(2*g*H)**(1/2)#Flow velocity at inlet in m/s\n", + "Q=(P*10**3)/(dw*g*H*n0)#Discharge at outlet in m**3/s\n", + "D1=(Q/(nH*3.1415*BR*Cr1))**(1/2)#Runner inlet diameter in m\n", + "b1=BR*D1#Height of the runner vanes at inlet in m\n", + "U1=(3.1415*D1*N)/60#Runner tip speed at inlet in m/s\n", + "Cx1=(nH*g*H)/(U1)#Velocity of whirl at inlet in m/s\n", + "a11=degrees(atan(Cr1/Cx1))#Guide blade angle in degree\n", + "b11=degrees(atan(Cr1/(Cx1-U1)))#Runner vane angle at inlet in degree\n", + "D2=D1/D1D2#Runner outlet diameter in m\n", + "U2=(3.1415*D2*N)/60#Runner tip speed at outlet in m/s\n", + "Cr2=Cr1#Flow velocity at outlet in m/s\n", + "b22=degrees(atan(Cr2/U2))#Runner vane angle at outlet in degree\n", + "b2=D1*b1/D2#Width at outlet in m\n", + "\n", + "#output\n", + "print '(a)Flow velocity at inlet is %3.2f m/s\\n(b)Discharge at outlet is %3.3f m**3/s\\n(c)Runner inlet diameter is %3.3f m\\n(d)Height of the runner vanes at inlet is %3.4f m\\n(e)Guide blade angle is %3.2f degree\\n(f) Runner vane angle at inlet is %3.2f degree\\n Runner vane angle at outlet is %3.2f degree\\n(g)Runner outlet diameter is %3.4f m\\n(h)Width at outlet is %3.4f m\\n(i)Runner tip speed at inlet is %3.2f m/s\\n(j)Velocity of whirl at inlet is %3.f m/s'%(Cr1,Q,D1,b1,a11,b11,b22,D2,b2,U1,Cx1)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Flow velocity at inlet is 5.56 m/s\n", + "(b)Discharge at outlet is 0.565 m**3/s\n", + "(c)Runner inlet diameter is 0.587 m\n", + "(d)Height of the runner vanes at inlet is 0.0587 m\n", + "(e)Guide blade angle is 11.23 degree\n", + "(f) Runner vane angle at inlet is 48.23 degree\n", + " Runner vane angle at outlet is 25.75 degree\n", + "(g)Runner outlet diameter is 0.2934 m\n", + "(h)Width at outlet is 0.1174 m\n", + "(i)Runner tip speed at inlet is 23.05 m/s\n", + "(j)Velocity of whirl at inlet is 28 m/s\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.13 Page 424" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "H=30#Working head of the turbine in m\n", + "D1=1.2#Inlet wheel diameter in m\n", + "D2=0.6#Outlet wheel diameter in m\n", + "b11=90#Vane angle at entrance in degree\n", + "a11=15#Guide blade angle in degree\n", + "Cx2=0#Velocity of whirl at inlet in m/s\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "U11=1/tan(a11*pi/180)#Runner tip speed at inlet in m/s in terms of Cr1\n", + "Cr1=(H/((U11**2/g)+(1/(2*g))))**(1/2)#Flow velocity at inlet in m/s\n", + "Cr2=Cr1#Flow velocity at outlet in m/s\n", + "U1=Cr1*U11#Runner tip speed at inlet in m/s \n", + "N=(60*U1)/(3.1415*D1)#Speed of the wheel in rpm\n", + "U2=(3.1415*D2*N)/60#Runner tip speed at inlet in m/s \n", + "b22=degrees(atan(Cr2/U2))#Vane angle at exit in degree\n", + "\n", + "#output\n", + "print '(a)Speed of the wheel is %3.2f rpm\\n(b)Vane angle at exit is %3.2f degree'%(N,b22)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Speed of the wheel is 268.27 rpm\n", + "(b)Vane angle at exit is 28.19 degree\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.14 Page 425" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "D1=0.6#Internal runner diameter in m\n", + "D2=1.2#External runner diameter in m\n", + "a11=15#Guide blade angle in degree\n", + "Cr1=4#Flow velocity at inlet in m/s\n", + "Cr2=Cr1#Flow velocity at outlet in m/s\n", + "N=200#Speed of the turbine in rpm\n", + "H=10#Head of the turbine in m\n", + "a22=90#Discharge angle at outlet in degree\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "U1=(3.1415*D1*N)/60#Runner tip speed at inlet in m/s \n", + "U2=(3.1415*D2*N)/60#Runner tip speed at outlet in m/s \n", + "Cx1=Cr1/tan(a11*pi/180)#Velocity of whirl at inlet in m/s\n", + "Wx1=Cx1-U1#Inlet whirl velocity component in m/s\n", + "b11=degrees(atan(Cr1/Wx1))#Vane angle at entrance in degree\n", + "b22=degrees(atan(Cr2/U2))#Vane angle at exit in degree\n", + "Wm=U1*Cx1#Work one per unit mass flow rate in W/(kg/s) as Cx2=0 in m/s\n", + "nH=(U1*Cx1/(g*H))#Hydraulic efficiency \n", + "\n", + "#output\n", + "print '(a)\\n Inlet vane angle is %3.2f degree\\n Outlet vane angle is %3.2f degree\\n(b)Work done by the water on the runner per kg of water is %3.2f W/(kg/s)\\n(c)Hydraulic efficiency is %0.2f %%'%(b11,b22,Wm,nH*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)\n", + " Inlet vane angle is 24.83 degree\n", + " Outlet vane angle is 17.66 degree\n", + "(b)Work done by the water on the runner per kg of water is 93.79 W/(kg/s)\n", + "(c)Hydraulic efficiency is 95.61 %\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.15 Page 427" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "H=23#Net head across the turbine in m\n", + "N=150#Speed of the turbine in rpm\n", + "P=23#Power developed by the turbine in MW\n", + "D=4.75#Blade tip diameter in m\n", + "d=2#Blade hub diameter in m\n", + "nH=0.93#Hydraulic efficiency\n", + "n0=0.85#Overall efficiency\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "dm=(D+d)/2#Mean diameter of the turbine in m\n", + "Pa=(P*10**6)/n0#Power available in MW\n", + "Q=(Pa/(dw*g*H))#Flow rate in the turbine in m**3/s\n", + "Um=(3.1415*dm*N)/60#Rotor speed at mean diameter in m/s\n", + "Pr=Pa*nH*10**-6#Power given to runner in MW\n", + "Cx1=Pr*10**6/(dw*Q*Um)#Velocity of whirl at inlet in m/s as Cx2=0 in m/s\n", + "Ca=Q/((3.1415/4)*(D**2-d**2))#Axial velocity in m/s\n", + "b11=180-degrees(atan(Ca/(Um-Cx1)))#Inlet blade angle in degree\n", + "Wx2=Um#Outlet whirl velocity component in m/s\n", + "b22=degrees(atan(Ca/Wx2))#Outlet blade angle in degree\n", + "\n", + "#output\n", + "print '(a)The inlet blade angle at mean radius is %3.1f degree\\n(b)The outlet blade angle at mean radius is %3.1f degree'%(b11,b22)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)The inlet blade angle at mean radius is 156.1 degree\n", + "(b)The outlet blade angle at mean radius is 17.2 degree\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.16 Page 429" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P=9100#Power developed by the turbine in kW\n", + "H=5.6#Net head available at the turbine in m\n", + "SR=2.09#Speed ratio\n", + "FR=0.68#Flow ratio\n", + "n0=0.86#Overall effiiciency of the turbine\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "DbD=1/3#Ratio of diameter of the boss to diameter of the runner\n", + "\n", + "#calculations\n", + "U1=SR*(2*g*H)**(1/2)#Runner tip speed at inlet in m/s\n", + "Cr1=FR*(2*g*H)**(1/2)#Flow velocity at inlet in m/s\n", + "Q=(P*10**3)/(n0*dw*g*H)#Discharge through the turbine in m**3/s\n", + "D=(Q*4/(3.1415*Cr1*((1**2)-(DbD**2))))**(1/2)#Diameter of the runner in m\n", + "N=(U1*60)/(3.1415*D)#Speed of the the turbine in rpm\n", + "Ns=(N*(P)**(1/2))/(H)**(5/4)#Specific speed \n", + "#output\n", + "print '(a)Diameter of the runner of the turbine is %3.2f m\\n(b)Speed of the turbine is %3.1f rpm\\n(c)The specific speed is %3.2f'%(D,N,Ns)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Diameter of the runner of the turbine is 6.22 m\n", + "(b)Speed of the turbine is 67.3 rpm\n", + "(c)The specific speed is 744.71\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.17 Page 430" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "H=20#Head developed over the turbine in m\n", + "P=11800#Power developed by turbine in kW\n", + "D=3.5#Outer diameter of the runner in m\n", + "Db=1.75#Hub diameter in m\n", + "a11=35#Guide blade angle in degree \n", + "nH=0.88#Hydraulic efficiency \n", + "n0=0.84#Overall efficiency\n", + "Cx2=0#Velocity of whirl at outlet in m/s\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "Q=(P*10**3)/(n0*g*H*dw)#Discharge of turbine in m**3/s\n", + "Cr1=Q/((3.1415/4)*(D**2-Db**2))#Flow velocity at inlet in m/s\n", + "Cx1=Cr1/tan(a11*pi/180)#Velocity of whirl at inlet in m/s\n", + "U1=(nH*H*g)/(Cx1)#Runner tip speed at inlet in m/s\n", + "Wx1=U1-Cx1#Inlet whirl velocity component in m/s\n", + "b11=180-degrees(atan(Cr1/-Wx1))#Runner inlet angle in degree\n", + "Cr2=Cr1#Flow velocity at outlet in m/s for a kaplan turbine\n", + "U2=U1#Runner tip speed at outlet in m/s for a kaplan turbine\n", + "b22=degrees(atan(Cr2/U2))#Runner outlet angle in degree \n", + "N=(U1*60)/(3.1415*D)#The speed of the turbine in rpm\n", + "\n", + "#output\n", + "print '(1)\\n (a)The runner inlet angle is %3.2f degree\\n (b)The runner outlet angle is %3.1f degree\\n(2)The speed of the turbine is %3.2f rpm'%(b11,b22,N)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(1)\n", + " (a)The runner inlet angle is 101.33 degree\n", + " (b)The runner outlet angle is 39.2 degree\n", + "(2)The speed of the turbine is 66.49 rpm\n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.18 Page 432" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "N=50#Speed of the turbine in rpm\n", + "d=6#Runner diameter of the turbine in m\n", + "Ae=20#Effective area of flow in m**2\n", + "b11=150#The angle of the runner blades at inlet in degree\n", + "b22=20#The angle of the runner blade at outlet in degree\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "U1=(3.141*d*N)/60#Runner tip speed at inlet in m/s\n", + "U2=U1#Runner tip speed at outlet in m/s\n", + "Cr2=U2*tan(b22*pi/180)#Flow velocity at outlet in m/s\n", + "Cr1=Cr2#Flow velocity at inlet in m/s\n", + "Q=Ae*Cr1#Discharge by the turbine in m**3/s\n", + "Cx1=U1-(Cr1/(tan((180-b11)*pi/180)))#Velocity of whirl at inlet in m/s\n", + "P=dw*g*Q*(U1*Cx1/g)*10**-3#Theoretical Power developed in kW\n", + "C2=Cr2#Absolute outlet velocity in m/s\n", + "H=(U1*Cx1/g)+(C2**2/(2*g))#Net head across the turbine in m\n", + "nH=(U1*Cx1/g)/(H)#Hydraulic efficiency\n", + "\n", + "#output\n", + "print '(a)Discharge of the turbine is %3.1f m**3/s\\n(b)Theoretical Power developed is %3.2f kW\\n(c)Hydraulic efficiency is %0.2f %%'%(Q,P,nH*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Discharge of the turbine is 114.3 m**3/s\n", + "(b)Theoretical Power developed is 10421.35 kW\n", + "(c)Hydraulic efficiency is 84.80 %\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.19 Page 433" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "D=8#Outer diameter of the turbine in m\n", + "Db=3#Inner diameter of the turbine in m\n", + "P=30000#Power developed by the turbine in kW\n", + "nH=0.95#Hydraulic efficiency\n", + "N=80#Speed of the turbine in rpm\n", + "H=12#Head operated by the turbine in m\n", + "Q=300#Discharge through the runner in m**3/s\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "U1=(3.1415*D*N)/60#Runner tip speed at inlet in m/s\n", + "U2=U1#Runner tip speed at outlet in m/s as flow is axial\n", + "Cr1=Q/((3.1415/4)*(D**2-Db**2))#Flow velocity at inlet in m/s\n", + "Cr2=Cr1#Flow velocity at outlet in m/s as flow is axial\n", + "b22=degrees(atan(Cr2/U2))#The angle of the runner blade at outlet in degree\n", + "Cx1=(nH*g*H)/U1#Velocity of whirl at inlet in m/s\n", + "b11=180-degrees(atan(Cr1/(U1-Cx1)))#The angle of the runner blade at inlet in degree\n", + "nM=(P*10**3)/(dw*g*Q*(Cx1*U1/g))#Mechanical efficiency\n", + "n0=nM*nH#Overall efficiency\n", + "\n", + "#output\n", + "print '(a)Blade angle at\\n inlet is %3.2f degree\\n outlet is %3.2f degree\\n(b)Mechanical efficiency is %0.1f %%\\n(c)Overall efficiency is %0.1f %%'%(b11,b22,nM*100,n0*100)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Blade angle at\n", + " inlet is 167.04 degree\n", + " outlet is 11.71 degree\n", + "(b)Mechanical efficiency is 89.4 %\n", + "(c)Overall efficiency is 84.9 %\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Ex 9.20 Page 434" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#input data\n", + "P=11500#Rated power of the turbine in kW\n", + "H=4.3#Average head of the turbine in m\n", + "n0=0.91#Overall efficiency of the turbine \n", + "DbD=0.3#Ratio of Diameters of runner boss and runner\n", + "SR=2#Speed ratio\n", + "FR=0.65#Flow ratio\n", + "g=9.81#Acceleration due to gravity in m/s**2\n", + "dw=1000#Density of water in kg/m**3\n", + "\n", + "#calculations\n", + "U=SR*(2*g*H)**(1/2)#Runner tip speed in m/s\n", + "Cr=FR*(2*g*H)**(1/2)#Flow velocity in m/s\n", + "Q=(P*10**3)/(n0*dw*g*H)#Discharge of the turbine in m**3/s\n", + "D=((4*Q)/(Cr*3.1415*(1**2-DbD**2)))**(1/2)#Runner diameter in \n", + "N=(60*U)/(3.1415*D)#Speed of the turbine in rpm \n", + "\n", + "#output\n", + "print '(a)Runner diameter of the turbine is %3.2f m\\n(b)Operating speed of the turbine is %3.1f rpm'%(D,N)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a)Runner diameter of the turbine is 8.38 m\n", + "(b)Operating speed of the turbine is 41.9 rpm\n" + ] + } + ], + "prompt_number": 20 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Turbomachines_by_A._V._Arasu/screenshots/Ch3BladeAngPowAndPress.png b/Turbomachines_by_A._V._Arasu/screenshots/Ch3BladeAngPowAndPress.png Binary files differnew file mode 100644 index 00000000..b67e1166 --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/screenshots/Ch3BladeAngPowAndPress.png diff --git a/Turbomachines_by_A._V._Arasu/screenshots/Ch4EffPress.png b/Turbomachines_by_A._V._Arasu/screenshots/Ch4EffPress.png Binary files differnew file mode 100644 index 00000000..db3785bb --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/screenshots/Ch4EffPress.png diff --git a/Turbomachines_by_A._V._Arasu/screenshots/Ch5DegofReacNBladeCoeff.png b/Turbomachines_by_A._V._Arasu/screenshots/Ch5DegofReacNBladeCoeff.png Binary files differnew file mode 100644 index 00000000..ea3fea1f --- /dev/null +++ b/Turbomachines_by_A._V._Arasu/screenshots/Ch5DegofReacNBladeCoeff.png diff --git a/sample_notebooks/ApurvaBhushan/Chapter_1.ipynb b/sample_notebooks/ApurvaBhushan/Chapter_1.ipynb new file mode 100644 index 00000000..f669826b --- /dev/null +++ b/sample_notebooks/ApurvaBhushan/Chapter_1.ipynb @@ -0,0 +1,325 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Chapter 1: Definitions and Basic Relations"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "###Example 1.1, Internal Energy and Enthalpy, Page No. 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Enthalpy = 301.500000 kJ/kg\n",
+ " Internal Energy = 215.400000 kJ/kg\n",
+ "\n",
+ " Diameter = 46.824337 cm\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import pi;\n",
+ "from math import sqrt;\n",
+ "#variable declaration\n",
+ "R=0.287; #in kJ.kg K\n",
+ "c_p=1.005; #in kJ.kg K\n",
+ "m=3; #in kg/s\n",
+ "T=300; #in K\n",
+ "p=1.5; #in bar\n",
+ "c=10; #in m/s\n",
+ "p=p*10**5; #converts bar into Pa\n",
+ "\n",
+ "#calculation\n",
+ "c_v=c_p-R;\n",
+ "h=c_p*T;\n",
+ "u=c_v*T;\n",
+ "rho=p/(R*T*1000);\n",
+ "D=sqrt((4*m)/(pi*c*rho));\n",
+ "D=D*100; #converts m into cm\n",
+ "\n",
+ "#result\n",
+ "print('\\n Enthalpy = %f kJ/kg\\n Internal Energy = %f kJ/kg')%(h,u);\n",
+ "print '\\n Diameter = %f cm' %(D);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "###Example 1.2, Flow and Non-Flow Work, Page No. 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Final Temperature = 382.397541 K\n",
+ " Enthalpy Drop = 88.473301 kJ/kg\n",
+ " Change in Internal Energy = 71.349436 kJ/kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "R=0.189; #in kJ/kg K\n",
+ "gamma_1=1.24; #no unit\n",
+ "T1=473; #in K\n",
+ "p1=3.0; #in bar\n",
+ "p2=1.0; #in bar\n",
+ "\n",
+ "#calculation\n",
+ "c_p=(gamma_1*R)/(gamma_1-1);\n",
+ "c_v=c_p/gamma_1;\n",
+ "ratio=(p2/p1)**((gamma_1-1)/gamma_1);\n",
+ "T2=ratio*T1;\n",
+ "h=c_p*(T1-T2);\n",
+ "u=c_v*(T1-T2);\n",
+ "\n",
+ "#result\n",
+ "print('\\n Final Temperature = %f K\\n Enthalpy Drop = %f kJ/kg\\n Change in Internal Energy = %f kJ/kg')%(T2,h,u);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "###Example 1.3, Change of Entropy in a Polytropic Process, Page No. 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Change in Entropy = 0.165932\n",
+ "\n",
+ "\n",
+ "Note : There are computational problems in the book of this example\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "from math import log;\n",
+ "gamma_1=1.3; #no unit\n",
+ "T1=650; #in K\n",
+ "n=1.2; #no unit\n",
+ "p1=10.0; #in bar\n",
+ "p2=3.0; #in bar\n",
+ "c_p=2.15; #in kJ/kg K\n",
+ "\n",
+ "#cslculation\n",
+ "c_v=c_p/gamma_1;\n",
+ "ratio_p=p2/p1;\n",
+ "ratio_v=(1/ratio_p)**(1/n);\n",
+ "s=c_v*log(ratio_p)+c_p*log(ratio_v);\n",
+ "\n",
+ "#result\n",
+ "print('\\nChange in Entropy = %f')%(s);\n",
+ "print('\\n\\nNote : There are computational problems in the book of this example')\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "###Example 1.4, Fanning's Coefficient, Page No. 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Pressure at the exit of duct = 2.925336 bar\n",
+ "\n",
+ "\n",
+ "Note : There are computational problems in the book of this example\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "L=100; #in m\n",
+ "R=287; #in kJ/kg K\n",
+ "D=0.5; #in m\n",
+ "T=315; #in K\n",
+ "p=3.0; #in bar\n",
+ "c=15; #in m/s\n",
+ "f=0.025; #no unit\n",
+ "\n",
+ "#calculation\n",
+ "rho=p/(R*T);\n",
+ "delta_p=4*f*L*rho*c**2/(2*D)\n",
+ "p2=p-delta_p;\n",
+ "\n",
+ "#result\n",
+ "print('\\nPressure at the exit of duct = %f bar')%(p2);\n",
+ "print('\\n\\nNote : There are computational problems in the book of this example')\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "###Example 1.5, Adiabatic Bulk Modulus of a Gas, Page No. 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ " Bulk Modulus of Elasticity = 31295.652174 bar\n",
+ "\n",
+ " More Accurate Value of Bulk Modulus of Elasticity = 29459.521175 bar\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "p1=1; #in bar\n",
+ "p2=3600; #in bar\n",
+ "v1=1; #in m^3\n",
+ "v2=0.885 #in m^3\n",
+ "\n",
+ "#calculation & result\n",
+ "K_t=-v1*(p2-p1)/(v2-v1);\n",
+ "print('\\n Bulk Modulus of Elasticity = %f bar')%(K_t);\n",
+ "K_t=(p2-p1)/log(v1/v2);\n",
+ "print('\\n More Accurate Value of Bulk Modulus of Elasticity = %f bar')%(K_t)\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "###Example 1.6, Conditions at altitudes, Page No. 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "At Z=10000m\n",
+ "Temperature = 223.200000 K\n",
+ "Pressure = 0.264259 bar\n",
+ "Density = 0.412528 kg/m**3\n",
+ "Viscosity = 0.0000148 kg/ms\n",
+ "\n",
+ "At Z=15000m\n",
+ "Temperature = 216.500000 K\n",
+ "Pressure = 0.120714 bar\n",
+ "Density = 0.194276 kg/m**3\n",
+ "Viscosity = 0.0000142 kg/ms\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "from math import exp;\n",
+ "p0=1.0133; #in bar\n",
+ "#p0=p0*10**5; #conversion to Pa\n",
+ "T0=288.2; # in K\n",
+ "Tt=216.5; # in K\n",
+ "u0=1.79*10**-5; #in kg/ms\n",
+ "ut=1.42*10**-5; #in kg/ms\n",
+ "pt=0.227; #in bar\n",
+ "Z1=10000; #in m\n",
+ "Z2=15000; #in m\n",
+ "Zt=11000; #in m\n",
+ "R=287; #in J/kg K\n",
+ "a1=6.5/1000; #in deg C/m\n",
+ "g=9.81; #in m/s**2\n",
+ "\n",
+ "#calculation\n",
+ "rho0=p0/(R*T0);\n",
+ "T=T0-a1*Z1;\n",
+ "p=p0*(T/T0)**(g/(a1*R));\n",
+ "rho=p*10**5/(R*T);\n",
+ "u=u0*(T/T0)**0.75;\n",
+ "p1=pt*exp(-g*(Z2-Zt)/(R*Tt));\n",
+ "rho1=p1*10**5/(R*Tt);\n",
+ "\n",
+ "#result\n",
+ "print('\\nAt Z=10000m\\nTemperature = %f K\\nPressure = %f bar\\nDensity = %f kg/m**3\\nViscosity = %.7f kg/ms\\n\\nAt Z=15000m\\nTemperature = %f K\\nPressure = %f bar\\nDensity = %f kg/m**3\\nViscosity = %.7f kg/ms')%(T,p,rho,u,Tt,p1,rho1,ut);\n",
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/ManchukondaLalitha Pujitha/Chpater_1_Gravity.ipynb b/sample_notebooks/ManchukondaLalitha Pujitha/Chpater_1_Gravity.ipynb new file mode 100644 index 00000000..a5fe0aae --- /dev/null +++ b/sample_notebooks/ManchukondaLalitha Pujitha/Chpater_1_Gravity.ipynb @@ -0,0 +1,176 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: Gravity"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 pgno:10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Time period of the pendulum is sec 1.00303620705\n"
+ ]
+ }
+ ],
+ "source": [
+ "#INPUT DATA\n",
+ "L=1;#Length of the bar in m\n",
+ "l=0.25;#Length of the pemdulum in m\n",
+ "from math import sqrt\n",
+ "#CALCULATIONS\n",
+ "k=sqrt((L**2)/12);#Radius of gyration m\n",
+ "T=sqrt(((k**2/l)+l)/9.8)*2*3.14;#Time period of pendulum in s\n",
+ "\n",
+ "#OUTPUT\n",
+ "print'Time period of the pendulum is sec',T\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 pgno:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The acceleration due to gravity is m s^-2 9.8002855276\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#INPUT DATA\n",
+ "T=2.223;#Time taken for 1 oscillation in sec\n",
+ "L=1.228;#Length of the pendulum in m\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "g=((4*3.14**2*L)/(T**2));#Acceleration due to gravity in m.s^-2\n",
+ "\n",
+ "#OUTPUT\n",
+ "print'The acceleration due to gravity is m s^-2',g\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 pgno:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The time period of pendulum is s\n",
+ "Distance of another point from centre of gravity on bar with same time period is m 1.79428571429 0.2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#INPUT DATA\n",
+ "l=1.2;#Length of of bar in m\n",
+ "from math import sqrt\n",
+ "#CALCULATIONS\n",
+ "k=sqrt(l**2/12);#Radius of gyration in m\n",
+ "T=sqrt(((k**2/(l/2))+(l/2))/9.8)*2*3.14;#Time period of the pendulum in s\n",
+ "L=((9.8*T**2)/(4*3.14**2));#Length in m\n",
+ "D=L-(l/2);#Another point where pendulum has same timeperiod in m\n",
+ "\n",
+ "#OUTPUT\n",
+ "print'The time period of pendulum is s\\nDistance of another point from centre of gravity on bar with same time period is m',T,D\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 pgno:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The minimum time period is obtained at cm -28.9035753267\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "#INPUT DATA\n",
+ "L=1;#Length of pendulum in m\n",
+ "B=0.05;#Width of pendulum in m\n",
+ "from math import sqrt\n",
+ "#CALCULATIONS\n",
+ "k=sqrt((L**2+B**2)/12);#Radius of gyration in m\n",
+ "D=((L/2)-k)*100;#distance of point of minimum time period from one end in cm\n",
+ "\n",
+ "#OUTPUT\n",
+ "print'The minimum time period is obtained at cm',D\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
|