summaryrefslogtreecommitdiff
path: root/sample_notebooks/TanveerAhmad
diff options
context:
space:
mode:
Diffstat (limited to 'sample_notebooks/TanveerAhmad')
-rw-r--r--sample_notebooks/TanveerAhmad/Chapter6.ipynb369
1 files changed, 369 insertions, 0 deletions
diff --git a/sample_notebooks/TanveerAhmad/Chapter6.ipynb b/sample_notebooks/TanveerAhmad/Chapter6.ipynb
new file mode 100644
index 00000000..7ed20e47
--- /dev/null
+++ b/sample_notebooks/TanveerAhmad/Chapter6.ipynb
@@ -0,0 +1,369 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6 - Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.1 - page 438"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Vf= 0.0125 # in volt\n",
+ "Vo= 0.5 # in volt\n",
+ "Beta= Vf/Vo \n",
+ "# For oscillator A*Beta= 1\n",
+ "A= 1/Beta \n",
+ "print \"Amplifier Should have a minimum gain of\",A,\"to provide oscillation\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amplifier Should have a minimum gain of 40.0 to provide oscillation\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.2 - page 439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi, sqrt\n",
+ "# Given data\n",
+ "R1= 50 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "R2=R1 # in ohm\n",
+ "R3=R2 # in ohm\n",
+ "C1= 60 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2=C1 # in F\n",
+ "C3=C2 # in F\n",
+ "f= 1/(2*pi*R1*C1*sqrt(6)) \n",
+ "print \"Frequency of oscilltions = %0.2f kHz\" %( f*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 21.66 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.3 - page 445"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi\n",
+ "# Given data\n",
+ "R1= 200 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "R2=R1 # in ohm\n",
+ "C1= 200 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2=C1 # in F\n",
+ "f= 1/(2*pi*R1*C1) # in Hz\n",
+ "print \"Frequency of oscilltions = %0.2f kHz\" %(f*10**-3)\n",
+ "\n",
+ "# Note: Calculation to find the value of f in the book is wrong, so answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 3.98 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.4 - page 460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi, sqrt\n",
+ "# Given data\n",
+ "L= 100 # in \u00b5H\n",
+ "L= L*10**-6 # in H\n",
+ "C1= .001 # in \u00b5F\n",
+ "C1= C1*10**-6 # in F\n",
+ "C2= .01 # in \u00b5F\n",
+ "C2= C2*10**-6 # in F\n",
+ "C= C1*C2/(C1+C2) # in F\n",
+ "# (i)\n",
+ "f= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Operating frequency = %0.f kHz\" %(round(f*10**-3))\n",
+ "# (ii)\n",
+ "Beta= C1/C2 \n",
+ "print \"Feedback fraction = %0.1f \" %Beta\n",
+ "# (iii)\n",
+ "# A*Bita >=1, so Amin*Bita= 1\n",
+ "Amin= 1/Beta \n",
+ "print \"Minimum gain to substain oscillations is\",Amin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Operating frequency = 528 kHz\n",
+ "Feedback fraction = 0.1 \n",
+ "Minimum gain to substain oscillations is 10.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.5 - page 460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi, sqrt\n",
+ "# Given data\n",
+ "L= 15 # in \u00b5H\n",
+ "L= L*10**-6 # in H\n",
+ "C1= .004 # in \u00b5F\n",
+ "C1= C1*10**-6 # in F\n",
+ "C2= .04 # in \u00b5F\n",
+ "C2= C2*10**-6 # in F\n",
+ "C= C1*C2/(C1+C2) # in F\n",
+ "f= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Frequency of oscilltions = %0.1f kHz\" %(f*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 681.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.6 - page 461"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi, sqrt\n",
+ "# Given data\n",
+ "L= 0.01 # in H\n",
+ "C= 10 # in pF\n",
+ "C= C*10**-12 # in F\n",
+ "f= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Frequency of oscilltions = %0.2f kHz\" %(f*10**-3)\n",
+ "# Note: Calculation to find the value of f in the book is wrong, so answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 503.29 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.7 - page 466"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi\n",
+ "# Given data\n",
+ "R1= 220 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "R2=R1 # in ohm\n",
+ "C1= 250 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2=C1 # in F\n",
+ "f= 1/(2*pi*R1*C1) \n",
+ "print \"Frequency of oscilltions = %0.2f Hz\" %f"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 2893.73 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.8 - page 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi\n",
+ "from math import tan\n",
+ "# Given data\n",
+ "R= 10 # in kohm\n",
+ "R=R*10**3 # in ohm\n",
+ "f=1000 \n",
+ "fie= 60 # in \u00b0\n",
+ "# The impedence of given circuit , Z= R+j*1/(omega*C)\n",
+ "# the phase shift, tan(fie)= imaginary part/ Real part\n",
+ "# tand(fie) = 1/(omega*R*C)\n",
+ "C= 1/(2*pi*R*tan(fie*pi/180)) \n",
+ "print \"The value of C = %0.2f \u00b5F\" %(C*10**6)\n",
+ "# Note : There is an calculation error to evaluate the value of C, So the answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of C = 9.19 \u00b5F\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.9 - page 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi, sqrt\n",
+ "# Given data\n",
+ "L= 50 # in \u00b5H\n",
+ "L= L*10**-6 # in H\n",
+ "C1= 300 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2= 100 # in pF\n",
+ "C2= C2*10**-12 # in F\n",
+ "C_eq= C1*C2/(C1+C2) # in F\n",
+ "f= 1/(2*pi*sqrt(L*C_eq)) # in Hz\n",
+ "print \"Frequency of oscillations = %0.1f MHz\" %(f*10**-6)\n",
+ "Beta= C2/C1 \n",
+ "# (iii)\n",
+ "# A*Beta >=1, so A*Bita= 1 (for sustained oscillations)\n",
+ "Amin= 1/Beta \n",
+ "print \"Minimum gain to substain oscillations is\",Amin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscillations = 2.6 MHz\n",
+ "Minimum gain to substain oscillations is 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file