summaryrefslogtreecommitdiff
path: root/Electronic_Principles_/Chapter_22_New.ipynb
diff options
context:
space:
mode:
authorJovina Dsouza2014-06-18 12:43:07 +0530
committerJovina Dsouza2014-06-18 12:43:07 +0530
commit206d0358703aa05d5d7315900fe1d054c2817ddc (patch)
treef2403e29f3aded0caf7a2434ea50dd507f6545e2 /Electronic_Principles_/Chapter_22_New.ipynb
parentc6f0d6aeb95beaf41e4b679e78bb42c4ffe45a40 (diff)
downloadPython-Textbook-Companions-206d0358703aa05d5d7315900fe1d054c2817ddc.tar.gz
Python-Textbook-Companions-206d0358703aa05d5d7315900fe1d054c2817ddc.tar.bz2
Python-Textbook-Companions-206d0358703aa05d5d7315900fe1d054c2817ddc.zip
adding book
Diffstat (limited to 'Electronic_Principles_/Chapter_22_New.ipynb')
-rw-r--r--Electronic_Principles_/Chapter_22_New.ipynb421
1 files changed, 421 insertions, 0 deletions
diff --git a/Electronic_Principles_/Chapter_22_New.ipynb b/Electronic_Principles_/Chapter_22_New.ipynb
new file mode 100644
index 00000000..789ac110
--- /dev/null
+++ b/Electronic_Principles_/Chapter_22_New.ipynb
@@ -0,0 +1,421 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER 22 NONLINEAR OP-AMP CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-4, Page 854"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.4.py\n",
+ "#Input voltage is a sine wave with a peak value of 10V. what is the trip point & cutoff frequency of bypass circuit?\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vin=10 #ac input(V)\n",
+ "Vs=15 #non-inverting input voltage(V)\n",
+ "R1=200.0*10**3 #non-inverting input resistance R1(Ohm)\n",
+ "R2=100.0*10**3 #non-inverting input resistance R2(Ohm)\n",
+ "C=10*10**-6 #capacitance at non-inverting input(F)\n",
+ "\n",
+ "#Calculation\n",
+ "Vref=Vs/3 #reference voltage at trip point(V)\n",
+ "fc=(2*math.pi*((R1**-1+R2**-1)**-1)*C)**-1 #cutoff frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'trip point voltage Vref = ',Vref,'V'\n",
+ "print 'cutoff frequency of bypass circuit fc = ',round(fc,2),'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "trip point voltage Vref = 5 V\n",
+ "cutoff frequency of bypass circuit fc = 0.24 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-5, Page 855"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.5.py\n",
+ "#what is the duty cycle of output waveform in figure 22-15b?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vp=10.0 #sine peak(V)\n",
+ "Vin=5.0 #input voltage(V) \n",
+ "\n",
+ "#Calculation\n",
+ "#1st solution\n",
+ "theta=math.ceil((math.asin(Vin/Vp))*180/math.pi) #angle theta (deg)\n",
+ "#2nd solution\n",
+ "D=(150-theta)/360.0 #duty cycle\n",
+ "\n",
+ "#Result\n",
+ "print 'theta = ',theta,'degrees'\n",
+ "print 'duty cycle D = ',round((D*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "theta = 31.0 degrees\n",
+ "duty cycle D = 33.06 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-6, Page 860"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.6.py\n",
+ "#If Vsat=13.5V, what are the trip points & hysteresis in figure 22-21?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1.0 #non-inverting input resistance R1(KOhm)\n",
+ "R2=47.0 #feedback path resistance R2(KOhm)\n",
+ "Vsat=13.5 #saturation voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "B=R1/(R1+R2) #feedback fraction\n",
+ "UTP=B*Vsat #upper trip point\n",
+ "LTP=-B*Vsat #lower trip point\n",
+ "H=UTP-LTP #hysteresis\n",
+ "\n",
+ "#Result\n",
+ "print 'lower trip point LTP = ',round(LTP,2),'V'\n",
+ "print 'upper trip point LTP = ',round(UTP,2),'V'\n",
+ "print 'hysteresis is ',round(H,2),'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "lower trip point LTP = -0.28 V\n",
+ "upper trip point LTP = 0.28 V\n",
+ "hysteresis is 0.56 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-7, Page 865"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.7.py\n",
+ "#what is the output voltage at end of input pulse & closed loop time constant of integrator? \n",
+ "#open loop voltage gain of 100,000.\n",
+ "\n",
+ "#Variable declaration\n",
+ "R=2 #inverting input resistance R1(KOhm)\n",
+ "C=1*10**-6 #feedback path capacitance (F)\n",
+ "T=1*10**-3 #time period(s)\n",
+ "Vin=8 #input pulse voltage(V)\n",
+ "AVOL=100000 #open loop voltage gain\n",
+ "\n",
+ "#Calculation\n",
+ "V=Vin*T/(R*C)/1000 #output voltage(V)\n",
+ "t=R*C*(AVOL+1)*1000 #time constant(s)\n",
+ "\n",
+ "#Result\n",
+ "print 'Magnitude of negative output voltage at end of the pulse = ',V,'V'\n",
+ "print 'closed loop time constant = ',t,'s'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of negative output voltage at end of the pulse = 4.0 V\n",
+ "closed loop time constant = 200.002 s\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-8, Page 868"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.5.py\n",
+ "#what is the output voltage in figure 22-30 if the input frequency is 1 KHz?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1*10**3 #inverting input resistance R1(Ohm)\n",
+ "R2=10*10**3 #feedback path resistance R2(Ohm)\n",
+ "C=10*10**-6 #feedback path capacitance (F)\n",
+ "Vin=5 #input pulse voltage(V)\n",
+ "f=1*10**3 #input frequency(Hz)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Vin/(2*f*R1*C) #output voltage(V)\n",
+ "\n",
+ "#Result\n",
+ "print 'peak to peak output voltage = ',Vout,'Vpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "peak to peak output voltage = 0.25 Vpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-9, Page 868"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.9.py\n",
+ "#The variable resistance has a maximum value of 10 KOhm. \n",
+ "#what is duty cyale when wiper is at middle of its range for traingular input frequency = 1KHz.\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vs=15.0 #non-inverting input voltage(V)\n",
+ "Rw=5.0*10**3 #inverting input wiper resistance(Ohm)\n",
+ "R1=10.0*10**3 #inverting input resistance R1(Ohm)\n",
+ "f=1.0 #input frequency(KHz) \n",
+ "\n",
+ "#Calculation\n",
+ "Vref=Vs*(Rw/(Rw+R1)) #reference voltage(V)\n",
+ "T=1/f #period of signal(s)\n",
+ "#As per geometry in 22-31b\n",
+ "W=2*(T/2)*((Vs/2)-Vref)/Vs #output pulse width\n",
+ "D=W/T #duty cycle\n",
+ "\n",
+ "#Result\n",
+ "print 'duty cycle D = ',round((D*100),2),'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "duty cycle D = 16.67 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-10, Page 871"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.10.py\n",
+ "#In figure 22-34, what is the frequency of output signal?\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=18.0 #non-inverting input resistance R1(KOhm)\n",
+ "R2=2.0 #feedback path resistance R2(KOhm)\n",
+ "R=1.0 #feedback path resistance R(KOhm)\n",
+ "C=0.1*10**-6 #feedback path capacitance (F)\n",
+ "\n",
+ "#Calculation\n",
+ "B=R1/(R1+R2) #feedback fraction\n",
+ "T=10**9*2*R*C*math.log((1+B)/(1-B)) #period of output(us)\n",
+ "f=1000*1/T #frequency(KHz)\n",
+ "\n",
+ "#Result\n",
+ "print 'period T = ',round(T,2),'us'\n",
+ "print 'frequency f = ',round(f,2),'KHz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "period T = 588.89 us\n",
+ "frequency f = 1.7 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-11, Page 871"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.11.py\n",
+ "#In figure 22-33 peak outout voltage is 13.5V. R4=10KOhm,C2=10uF,\n",
+ "#what is the peak to peak value of triangular output wave?\n",
+ "\n",
+ "#Variable declaration\n",
+ "Vsat=13.5 #saturation voltage given(V)\n",
+ "R4=10*10**3 #given resistance R4(Ohm)\n",
+ "C2=10*10**-6 #given capacitance C2(F)\n",
+ "T=589*10**-6 #period from preceding example(s)\n",
+ "\n",
+ "#Calculation\n",
+ "Vout=Vsat*T/(2*R4*C2) #output voltage (V) \n",
+ "\n",
+ "#Result\n",
+ "print 'Output voltage = ',round((Vout*1000),2),'mVpp'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = 39.76 mVpp\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 22-12, Page 873"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Example 22.12.py\n",
+ "#In figure 22-35a R1=1KOhm, R2=100KOhm, R3=10KOhm, R4=100KOhm and C=10uF.\n",
+ "#what is peak to peak output if Vsat =13V? what is frequency of triangular wave?\n",
+ "\n",
+ "#Variable declaration\n",
+ "R1=1*10**3 #resistance R1(Ohm)\n",
+ "R2=100*10**3 #resistance R2(Ohm)\n",
+ "R3=10*10**3 #resistance R3(Ohm)\n",
+ "C=10*10**-6 #capacitance (F)\n",
+ "\n",
+ "#Calculation\n",
+ "UTP=Vsat*R1/R2 #UTP value (V)\n",
+ "Vout=2*UTP #output voltage/hysteresis (V)\n",
+ "f=R2/(4*R1*R3*C) #frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print 'Vout = H = ',Vout,'V'\n",
+ "print 'frequency f = ',f,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = H = 0.27 V\n",
+ "frequency f = 250.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file