summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter10_2.ipynb478
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter11_2.ipynb1248
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter12_2.ipynb390
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter13_2.ipynb561
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter1_2.ipynb939
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter2_2.ipynb775
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter3_2.ipynb1246
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter4_2.ipynb1279
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter5_2.ipynb752
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter6_2.ipynb907
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter7_2.ipynb658
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter8_2.ipynb1044
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter9_2.ipynb394
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Frequency_2.pngbin0 -> 24090 bytes
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Saturation_2.pngbin0 -> 28821 bytes
-rw-r--r--Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Step_2.pngbin0 -> 30559 bytes
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_1.ipynb3397
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_12.ipynb300
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_2_.ipynb1765
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_7.ipynb967
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_8.ipynb113
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/Chapter_5.ipynb168
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/Chapter_6.ipynb659
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k.rajput12_3.pngbin0 -> 149728 bytes
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k_rajput_3.pngbin0 -> 158014 bytes
-rw-r--r--Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.krajput_3.pngbin0 -> 173255 bytes
-rw-r--r--Heat_and_Thermodynamics_by__Brijlal_and_N._Subrahmanyam/README.txt10
-rw-r--r--Optoelectronics:_An_Introduction_by_John_Wilson_&_John_Hawkes/README.txt10
-rw-r--r--sample_notebooks/SachinNaik/ch8.ipynb356
-rw-r--r--sample_notebooks/VinayBadhan/Samplenotebook.ipynb63
-rw-r--r--sample_notebooks/kapiljain/chapter16.ipynb76
31 files changed, 18555 insertions, 0 deletions
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter10_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter10_2.ipynb
new file mode 100644
index 00000000..78ac4a48
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter10_2.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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter11_2.ipynb
new file mode 100644
index 00000000..92b0ee0a
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter11_2.ipynb
@@ -0,0 +1,1248 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11 : Voltage References 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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter12_2.ipynb
new file mode 100644
index 00000000..bd4cedfd
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter12_2.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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter13_2.ipynb
new file mode 100644
index 00000000..f52cabb2
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter13_2.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/chapter1_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter1_2.ipynb
new file mode 100644
index 00000000..93af3eb9
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter1_2.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+C0HJ8dBAxNW35VVbuq6j7Av4BfBusLnkSjqquA\nicBxDez6BBt/j1OC9Q0S3MgPUdVXU6cGTlPVLsADwG2hRa//fIongZ/l+flCzpOiUbYAEBEBzgX+\nFiz/Avgx8CNV/SGwH/ApsFmWzxbz/70aOEFEWmQ5z97An4EzVXUPVe0K/B2oyLJvsyJqMiLCHIW/\nPAsck3oyFJEKYHtVfQ24FegZPKldnOWzJwIj05YlOIYAWwGfp68Ptg0VkRPSlr9Ke3+5iLwVtE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jPs42qNpRd1zC8wByFYaQhIk/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_by_Sergio_Franco/chapter2_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter2_2.ipynb
new file mode 100644
index 00000000..f1e38f40
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter2_2.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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter3_2.ipynb
new file mode 100644
index 00000000..7a4f9b2e
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter3_2.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": 46,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "<matplotlib.text.Text at 0xc964780>"
+ ]
+ },
+ "execution_count": 46,
+ "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+f9IEvR4A3Aw8DTgFuEhS\nX4v1jgOOBQaBPYGdgM/Xzy2o/31y3ceaCV7PShcRvvnWczfgNuDdTcuHAT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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 0xb4daf98>"
+ ]
+ },
+ "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": 47,
+ "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": 48,
+ "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 degrees,atan\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": 49,
+ "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": 50,
+ "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": 51,
+ "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": 52,
+ "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": 53,
+ "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": 54,
+ "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": 55,
+ "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=math.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": 56,
+ "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*math.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": 57,
+ "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": 58,
+ "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": 59,
+ "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": 60,
+ "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": 61,
+ "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": 62,
+ "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": 63,
+ "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": 64,
+ "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": 65,
+ "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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter4_2.ipynb
new file mode 100644
index 00000000..0c08dc86
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter4_2.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": 1,
+ "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": 2,
+ "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": 3,
+ "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": 4,
+ "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": 5,
+ "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": 6,
+ "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": 7,
+ "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": 8,
+ "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": 9,
+ "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": 10,
+ "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": 11,
+ "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": 12,
+ "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": 13,
+ "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": 14,
+ "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": 15,
+ "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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter5_2.ipynb
new file mode 100644
index 00000000..14a0b58a
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter5_2.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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter6_2.ipynb
new file mode 100644
index 00000000..f389f963
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter6_2.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, Page 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",
+ "#answer\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 0x9f84be0>"
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEeCAYAAABlggnIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4VGX2wPHvSQGEBAICoYlRLICyBAUUAYkICBZQQBCV\nJaDu2lBXXcG2iP5UsKxr2V07ARVQBBEFRRYMUlQQCbIKwipFUEKvkZrz++PeZIaQhJSZuTOZ83me\n+2RumXvPHC5z5r7vLaKqGGOMMQAxXgdgjDEmfFhRMMYYk8+KgjHGmHxWFIwxxuSzomCMMSafFQVj\njDH5rCgYY4zJZ0UhConIWhHJEZE97rBbROp5HVcoiUiKiOT65WCtiDzsdVyhICJniMgkEdkiIjtF\nZJmI/EVE7PvAWFGIUgpcrqqJ7lBdVTf5LyAicR7FFmo1VDUR6AMME5FLvQ4om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nCEiv4jIYFU9DOTdLO8HnB7zCn+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 0x40bcba8>"
+ ]
+ },
+ "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 0x3b323c8>"
+ ]
+ },
+ "execution_count": 6,
+ "metadata": {},
+ "output_type": "execute_result"
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAAEZCAYAAAC0HgObAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8lGX9//HXRwRRMdCUxA3KxC0VURa/Zp3Mb25p9nVP\ng4OYmLgkWW75EyuTcklJzKUQl1LRcg1z5eSWmLK64JIiIIqKsrixfn5/XPeB4XCWOceZueaaeT8f\nj3kw99z33Pd77nOYz7mv67rv29wdERGRQlkrdgAREaksKiwiIlJQKiwiIlJQKiwiIlJQKiwiIlJQ\nKiwiIlJQKiwiEZnZtmY22cwWmtnJeb5nhZl9pdjZsm2NM7MfFmG9Z5vZdYVer5QHFZYqY2ZfN7On\nzGy+mc0zsyfMbPdsXq2ZPV7EbdeZ2admtsjM3jezu81si2JtLxE/Bx5x9y+4+5UNZ2b7bHCxNm5m\nHcxsuJm9YmYfmdkbZvZnM+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Xa\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 0x9f52358>"
+ ]
+ },
+ "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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter7_2.ipynb
new file mode 100644
index 00000000..e6f65e29
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter7_2.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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter8_2.ipynb
new file mode 100644
index 00000000..e3c2bc19
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter8_2.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": 1,
+ "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": 2,
+ "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": 3,
+ "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": 4,
+ "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": 5,
+ "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": 6,
+ "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": 7,
+ "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": 8,
+ "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": 9,
+ "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": 10,
+ "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": 11,
+ "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": 12,
+ "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": 13,
+ "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": 14,
+ "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": 15,
+ "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": 16,
+ "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": 17,
+ "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_2.ipynb b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter9_2.ipynb
new file mode 100644
index 00000000..d2938b5e
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/chapter9_2.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_2.png b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Frequency_2.png
new file mode 100644
index 00000000..621fc69c
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Frequency_2.png
Binary files differ
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Saturation_2.png b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Saturation_2.png
new file mode 100644
index 00000000..aedbe6f3
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Saturation_2.png
Binary files differ
diff --git a/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Step_2.png b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Step_2.png
new file mode 100644
index 00000000..29a0f380
--- /dev/null
+++ b/Design_With_Operational_Amplifiers_And_Analog_Integrated_Circuits_by_Sergio_Franco/screenshots/Step_2.png
Binary files differ
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_1.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_1.ipynb
new file mode 100644
index 00000000..16ce1c97
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_1.ipynb
@@ -0,0 +1,3397 @@
+{
+ "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": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "loading error 24 %\n",
+ "loading error 0.040 %\n",
+ "When voltmeter with high internal resistance is connectedd across two points in a high resistance circuit ,\n",
+ "the loading effect is appreciable and, therefore, the voltmeter gives misleading voltage reading\n",
+ "\n",
+ "The saame voltmeter has a negligible loading error when connected across a low resistance circuit and\n",
+ "it gives more reliable voltage reading\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'loading error %3.0f'%pe,'%';\n",
+ "print'loading error %3.3f'%pe1,'%';\n",
+ "print'When voltmeter with high internal resistance is connectedd across two points in a high resistance circuit ,'\n",
+ "print'the loading effect is appreciable and, therefore, the voltmeter gives misleading voltage reading\\n'\n",
+ "print'The saame voltmeter has a negligible loading error when connected across a low resistance circuit and'\n",
+ "print'it gives more reliable voltage reading'\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": 6,
+ "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",
+ "After a time interval equivalent to five times constants, the thermometer reaches the equivaence condition\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",
+ "print'After a time interval equivalent to five times constants, the thermometer reaches the equivaence condition'\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/CHAPTER_12.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_12.ipynb
new file mode 100644
index 00000000..553bfea3
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_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/CHAPTER_2_.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_2_.ipynb
new file mode 100644
index 00000000..d2b818c6
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_2_.ipynb
@@ -0,0 +1,1765 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2:Electronics Instruments"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1,Page no:158"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "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); #print'currentt through the PMMC meter(mA)\n",
+ "\n",
+ "\n",
+ "#result\n",
+ "print'currentt through the PMMC meter is %3.1f'%(i*10**3),'mA';\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.2,Page no:164"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "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": 46,
+ "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,'%';\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.4,Page no:186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "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": 49,
+ "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": 50,
+ "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": 51,
+ "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": 52,
+ "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": 53,
+ "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": 54,
+ "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": 55,
+ "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": 56,
+ "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": 57,
+ "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": 58,
+ "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": 59,
+ "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": 60,
+ "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": 61,
+ "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": 62,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 3000 kΩ\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,'kΩ';\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": 63,
+ "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",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.21,Page no:235"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "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": 65,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance of specimen 8.34 Ω\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),'Ω';\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": 66,
+ "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": 67,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "equivalent resistance 11.20 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.2f'%(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": 68,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "resistance 26.82\n",
+ "inductance 52.60 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.2f'%L1,'mH';\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.26,Page no:246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 69,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R4 = 34.311470 Ω\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 = %03f'%(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": 70,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R4 = 373.348520 Ω\n",
+ "capacitance 0.18 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 = %05f'%(Z4.real),'Ω';\n",
+ "print'capacitance %3.2f'%(C4*10**6),'uF';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.28,Page no:248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 71,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R4 = 166.666667 Ω\n",
+ "inductance 0.10 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 = %05f'%(Z4.real),'Ω';\n",
+ "print'inductance %3.2f'%L,'H';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2.29,Page no:249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 72,
+ "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": 73,
+ "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": 74,
+ "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\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": 75,
+ "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": 76,
+ "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",
+ "\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": 77,
+ "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": 78,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "inductance 719.61 uH\n",
+ "resistance 15.641626 Ω\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 %f'%Rcoil,'Ω';"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.36,Page no:271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 79,
+ "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": 80,
+ "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'calculation mistake in textbook assuming approximate values'"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.38,Page no:272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 83,
+ "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": 82,
+ "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/CHAPTER_7.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_7.ipynb
new file mode 100644
index 00000000..03a57d64
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_7.ipynb
@@ -0,0 +1,967 @@
+{
+ "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": 3,
+ "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/L; #ratio of change in inductance to the original inductance\n",
+ "dd = r/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",
+ "\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.5,Page No:409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "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": 5,
+ "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",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.7,Page No:413"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "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": 7,
+ "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": 8,
+ "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",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.10,Page No:417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "strain = 0.00000\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'%e;\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": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "hall angle 1.55 °(Equal to 1 minute 4 seconds)\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,'°(Equal to 1 minute 4 seconds)';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.12,Page No:421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "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": 12,
+ "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": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "change in resistance = 48.00 mΩ\n",
+ "Note: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: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": 14,
+ "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": 15,
+ "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": 16,
+ "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": 17,
+ "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": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "modulus of elasticity = 147.6 N/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; #load in kN\n",
+ "ex = 1540; #strain values in axial direction\n",
+ "ey = -420; #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'modulus of elasticity = %3.1f'%E,'N/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": 9,
+ "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 = 16.845034 °\n",
+ "location of principle planes = 106.845034 °\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 =(theta*180)/float(math.pi);\n",
+ "theta2 =theta1+180;\n",
+ "theta11 = (theta1)/float(2);\n",
+ "theta22 = (theta2)/float(2);\n",
+ "\n",
+ "\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 = %f'%theta11,'°';\n",
+ "print'location of principle planes = %f'%theta22,'°';\n",
+ " \n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:7.22,Page No:454"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "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/CHAPTER_8.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_8.ipynb
new file mode 100644
index 00000000..afd03593
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/CHAPTER_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/Chapter_5.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/Chapter_5.ipynb
new file mode 100644
index 00000000..6cfaef42
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/Chapter_5.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 Hz\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/Chapter_6.ipynb b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/Chapter_6.ipynb
new file mode 100644
index 00000000..3361cca7
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/Chapter_6.ipynb
@@ -0,0 +1,659 @@
+{
+ "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": 19,
+ "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",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:6.2,Page No:368"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio error at full load = -0.0450 %\n",
+ "phase angle = 5.116677 degrees(equal to (3 minutes 4 seconds))\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'ratio error at full load = %3.4f'%r,'%';\n",
+ "print'phase angle = %f'%(theta*100),'degrees(equal to (3 minutes 4 seconds))';\n",
+ "\n",
+ "\n",
+ " "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example:6.3,Page No:369"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "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": 22,
+ "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": 23,
+ "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": 24,
+ "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": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio error -0.86 %\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'%er,'%';\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": 27,
+ "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": 6,
+ "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 A\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 A'\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Example:6.11,Page No:383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "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/screenshots/r.k.rajput12_3.png b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k.rajput12_3.png
new file mode 100644
index 00000000..2cc93e75
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k.rajput12_3.png
Binary files differ
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k_rajput_3.png b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k_rajput_3.png
new file mode 100644
index 00000000..22f87a95
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.k_rajput_3.png
Binary files differ
diff --git a/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.krajput_3.png b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.krajput_3.png
new file mode 100644
index 00000000..60b16536
--- /dev/null
+++ b/Electronic_Measurements_and_Instrumentation_by_Er.R.K.Rajput/screenshots/r.krajput_3.png
Binary files differ
diff --git a/Heat_and_Thermodynamics_by__Brijlal_and_N._Subrahmanyam/README.txt b/Heat_and_Thermodynamics_by__Brijlal_and_N._Subrahmanyam/README.txt
new file mode 100644
index 00000000..51701967
--- /dev/null
+++ b/Heat_and_Thermodynamics_by__Brijlal_and_N._Subrahmanyam/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Anand Mandali
+Course: mca
+College/Institute/Organization: ITI- Govt. Employee
+Department/Designation: ITI
+Book Title: Heat and Thermodynamics
+Author: Brijlal and N. Subrahmanyam
+Publisher: S. Chanda & Company, New Delhi
+Year of publication: 2001
+Isbn: 81-219-0417-X
+Edition: 8 \ No newline at end of file
diff --git a/Optoelectronics:_An_Introduction_by_John_Wilson_&_John_Hawkes/README.txt b/Optoelectronics:_An_Introduction_by_John_Wilson_&_John_Hawkes/README.txt
new file mode 100644
index 00000000..f4bec146
--- /dev/null
+++ b/Optoelectronics:_An_Introduction_by_John_Wilson_&_John_Hawkes/README.txt
@@ -0,0 +1,10 @@
+Contributed By: Ashish Kumar Singh
+Course: btech
+College/Institute/Organization: LNM Institute Of Information Technology
+Department/Designation: ECE
+Book Title: Optoelectronics: An Introduction
+Author: John Wilson & John Hawkes
+Publisher: Prentice Hall,Europe
+Year of publication: 1998
+Isbn: 978-0131039612
+Edition: 3rd \ No newline at end of file
diff --git a/sample_notebooks/SachinNaik/ch8.ipynb b/sample_notebooks/SachinNaik/ch8.ipynb
new file mode 100644
index 00000000..4459e9a8
--- /dev/null
+++ b/sample_notebooks/SachinNaik/ch8.ipynb
@@ -0,0 +1,356 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8: Brakes and Dynamometers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1, Page 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "dia=12#in\n",
+ "r=dia/2\n",
+ "CQ=7#in\n",
+ "OC=6#in\n",
+ "OH=15#in\n",
+ "u=0.3\n",
+ "P=100#lb\n",
+ "\n",
+ "#Calculations\n",
+ "phi=math.atan(u)\n",
+ "x=r*math.sin(phi)#in inches;radius of friction circle\n",
+ "a=5.82#from figure\n",
+ "Tb=P*OH*x/a#braking torque\n",
+ "\n",
+ "#Result\n",
+ "print \"The braking torque of the drum Tb= %.f lb\"%Tb"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The braking torque of the drum Tb= 444 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2, Page 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "OH=15#in\n",
+ "l=OH\n",
+ "u=0.3\n",
+ "P=100#lb\n",
+ "dia=12#in\n",
+ "r=dia/2\n",
+ "\n",
+ "#Calculations\n",
+ "phi=math.atan(u)\n",
+ "#according to fig 170(b)\n",
+ "#for clockwise rotation\n",
+ "a=6#from figure\n",
+ "x=r*math.sin(phi)#in inches;radius of friction circle\n",
+ "Tb=P*l*x/a#braking torque on the drum\n",
+ "#for counter clockwise rotation\n",
+ "a1=5.5#in\n",
+ "Tb1=P*l*x/a1#braking torque on the drum\n",
+ "#according to figure 172(a)\n",
+ "#for clockwise rotation\n",
+ "a2=6.48#from figure\n",
+ "x=r*math.sin(phi)#in inches;radius of friction circle\n",
+ "Tb2=P*l*x/a2#braking torque on the drum\n",
+ "#for counter clockwise rotation\n",
+ "a3=6.38#in\n",
+ "Tb3=P*l*x/a3#braking torque on the drum\n",
+ "T1=math.ceil(Tb1)\n",
+ "T2=math.ceil(Tb2)\n",
+ "T3=math.ceil(Tb3)\n",
+ "\n",
+ "#Result\n",
+ "print \"Braking torque on drum:\\nWhen dimensions are measured from fig 170(b)\\nFor clockwise rotation= %.f lb in\"\\\n",
+ "\"\\nFor counter clockwise rotation= %.f lb in\"%(Tb,T1)\n",
+ "print \"\\nWhen dimensions are measured from fig 171(a)\\nFor clockwise rotation= %.f lb in\"\\\n",
+ "\"\\nFor counter clockwise rotation= %.f lb\"%(T2,T3)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Braking torque on drum:\n",
+ "When dimensions are measured from fig 170(b)\n",
+ "For clockwise rotation= 431 lb in\n",
+ "For counter clockwise rotation= 471 lb in\n",
+ "\n",
+ "When dimensions are measured from fig 171(a)\n",
+ "For clockwise rotation= 400 lb in\n",
+ "For counter clockwise rotation= 406 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3, Page 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "u=.35\n",
+ "Tb=500#lb.ft\n",
+ "rd=10#in\n",
+ "\n",
+ "#Calculations\n",
+ "phi=math.atan(u)\n",
+ "x=rd*math.sin(phi)\n",
+ "#F*OD=R*a=R1*a\n",
+ "#R=R1\n",
+ "#2*R*x=Tb\n",
+ "OD=24#in\n",
+ "a=11.5#inches; From figure\n",
+ "F=Tb*a*12/(OD*2*x)\n",
+ "#from figure\n",
+ "HG=4#in\n",
+ "GK=12#in\n",
+ "HL=12.22#in\n",
+ "P=F*HG/GK\n",
+ "Fhd=HL*P/HG\n",
+ "\n",
+ "#Results\n",
+ "print \"a) Magnitude of P = %.f lb\"%P\n",
+ "print \"b) Magnitude of Fhd = %.f lb\"%Fhd"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "a) Magnitude of P = 145 lb\n",
+ "b) Magnitude of Fhd = 443 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 4, Page 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "u=.3\n",
+ "theta=270*math.pi/180\n",
+ "l=18#in\n",
+ "a=4#in\n",
+ "Di=15#in\n",
+ "Do=21#in\n",
+ "w=.5#tons\n",
+ "\n",
+ "#Calculations\n",
+ "W=w*2204#lb\n",
+ "Q=W*Di/Do#required tangential braking force on the drum\n",
+ "k=math.e**(u*theta)#k=T1/T2\n",
+ "p=Q*a/(l*(k-1))\n",
+ "\n",
+ "#Result\n",
+ "print \"Least force required, P = %.f lb\"%p"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Least force required, P = 56 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5, Page 264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n=12\n",
+ "u=.28\n",
+ "a=4.5#in\n",
+ "b=1#in\n",
+ "l=21#in\n",
+ "r=15#in\n",
+ "Tb=4000#lb\n",
+ "\n",
+ "#Calculations\n",
+ "theta=10*math.pi/180\n",
+ "#k=Tn/To\n",
+ "k=((1+u*math.tan(theta))/(1-u*math.tan(theta)))**n\n",
+ "Q=Tb*(12./r)\n",
+ "P=Q*(a-b*k)/(l*(k-1))#from combining 8.6 with k=e^u*theta\n",
+ "\n",
+ "#Result\n",
+ "print \"The least effort required = P = %.1f lb\"%P"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The least effort required = P = 82.2 lb\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6, Page 274"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Variable declaration\n",
+ "w=9.5 #ft\n",
+ "h= 2. #ft\n",
+ "x=4. #ft\n",
+ "v=30.#mph\n",
+ "\n",
+ "#Calculations\n",
+ "V=1.46667*v#ft/s\n",
+ "u1=.1\n",
+ "u2=.6\n",
+ "g=32.2#ft/s**2\n",
+ "#a) rear wheels braked\n",
+ "fa1=(u1*(w-x)*g)/(w+u1*h)\n",
+ "fa2=(u2*(w-x)*g)/(w+u2*h)\n",
+ "sa1=V**2/(2*fa1)\n",
+ "sa2=V**2/(2*fa2)\n",
+ "#b) front wheels braked\n",
+ "fb1=u1*x*g/(w-u1*h)\n",
+ "fb2=u2*x*g/(w-u2*h)\n",
+ "sb1=V**2/(2*fb1)\n",
+ "sb2=V**2/(2*fb2)\n",
+ "#c) All wheels braked\n",
+ "fc1=u1*g\n",
+ "fc2=u2*g\n",
+ "sc1=V**2/(2*fc1)\n",
+ "sc2=V**2/(2*fc2)\n",
+ "k1=(x+u1*h)/(w-x-u1*h)#Na/Nb\n",
+ "k2=(x+u2*h)/(w-x-u2*h)#Na/Nb\n",
+ "\n",
+ "#Results\n",
+ "print \"Coefficient of friction = 0.1\\na) Minimum distance in which car may be stopped when the rear brakes are\"\\\n",
+ "\"applied = %.f ft\\nb) Minimum distance in which car may be stopped when the front brakes are applied = %.f ft\"\\\n",
+ "\"\\nc) Minimum distance in which car may be stopped when all brakes are applied = %.f ft\"%(sa1,sb1,sc1)\n",
+ "print \"\\nCoefficient of friction = 0.6\\na) Minimum distance in which car may be stopped when the rear brakes are \"\\\n",
+ "\"applied = %.1f ft\\nb) Minimum distance in which car may be stopped when the front brakes are applied = %.f ft\"\\\n",
+ "\"\\nc) Minimum distance in which car may be stopped when all brakes are applied = %.1f ft\"%(sa2,sb2,sc2)\n",
+ "print \"\\nRequired ration of Na/Nb\\nFor u1 = 0.1 -> %.3f\\nFor u2 = 0.6 -> %.2f\"%(k1,k2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Coefficient of friction = 0.1\n",
+ "a) Minimum distance in which car may be stopped when the rear brakes areapplied = 530 ft\n",
+ "b) Minimum distance in which car may be stopped when the front brakes are applied = 699 ft\n",
+ "c) Minimum distance in which car may be stopped when all brakes are applied = 301 ft\n",
+ "\n",
+ "Coefficient of friction = 0.6\n",
+ "a) Minimum distance in which car may be stopped when the rear brakes are applied = 97.5 ft\n",
+ "b) Minimum distance in which car may be stopped when the front brakes are applied = 104 ft\n",
+ "c) Minimum distance in which car may be stopped when all brakes are applied = 50.1 ft\n",
+ "\n",
+ "Required ration of Na/Nb\n",
+ "For u1 = 0.1 -> 0.792\n",
+ "For u2 = 0.6 -> 1.21\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file
diff --git a/sample_notebooks/VinayBadhan/Samplenotebook.ipynb b/sample_notebooks/VinayBadhan/Samplenotebook.ipynb
new file mode 100644
index 00000000..b90a0762
--- /dev/null
+++ b/sample_notebooks/VinayBadhan/Samplenotebook.ipynb
@@ -0,0 +1,63 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3 , Electricity and Ohm's Law\n",
+ " "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Terminal voltage of a battery is 1.5 V.\n"
+ ]
+ }
+ ],
+ "source": [
+ "#Example 3.1 , Page Number 23\n",
+ "\n",
+ "import math \n",
+ "\n",
+ "W = 75.0 #Work done (in Joules)\n",
+ "Q = 50.0 #Charge produced (in Coulomb)\n",
+ "\n",
+ "#Calculation\n",
+ "V = W/Q #Voltage between battery terminals (in Volts)\n",
+ "\n",
+ "#Result\n",
+ "print \"Terminal voltage of a battery is \",V,\" V.\""
+ ]
+ }
+ ],
+ "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.5"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/kapiljain/chapter16.ipynb b/sample_notebooks/kapiljain/chapter16.ipynb
new file mode 100644
index 00000000..933b83a2
--- /dev/null
+++ b/sample_notebooks/kapiljain/chapter16.ipynb
@@ -0,0 +1,76 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 16 : MAGNETIC MATERIALS"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example number 1, Page number 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Intensity of Magnetization= 5.0 ampere/m\n",
+ "Flux density in the material= 1.257 weber/m^2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "H=10**6 #Magnetic Field Strength in ampere/m\n",
+ "x=0.5*10**-5 #Magnetic susceptibility \n",
+ "mu_0=4*math.pi*10**-7\n",
+ "\n",
+ "#Calculatiions\n",
+ "M=x*H\n",
+ "B=mu_0*(M+H)\n",
+ "\n",
+ "#Result\n",
+ "print\"Intensity of Magnetization=\",M,\"ampere/m\"\n",
+ "print\"Flux density in the material=\",round(B,3),\"weber/m^2\"\n",
+ "\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
+}