{
 "metadata": {
  "name": "",
  "signature": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter6 - Oscilltions"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 6.1 - page 412"
     ]
    },
    {
     "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": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 6.3 - page 416"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import pi\n",
      "# Given data\n",
      "f=2 # in kHz\n",
      "f=f*10**3 # in Hz\n",
      "# Let\n",
      "R= 10 # in kohm   (As R should be greater than 1 kohm)\n",
      "R=R*10**3 # in ohm\n",
      "# Formula f= 1/(2*pi*R*C)\n",
      "C= 1/(2*pi*f*R) # in F\n",
      "C= C*10**9 # in nF\n",
      "# For Bita to be 1/3, Choose\n",
      "R4= R # in ohm\n",
      "R3= 2*R4 # in ohm\n",
      "print \"Value of C = %0.2f nF\" %C\n",
      "print \"Value of R3 = %0.f kohm\" %(R3*10**-3)\n",
      "print \"Value of R4 = %0.f kohm\" %(R4*10**-3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of C = 7.96 nF\n",
        "Value of R3 = 20 kohm\n",
        "Value of R4 = 10 kohm\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 6.4 - page 417"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# 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": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 6.5 - page 417"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# 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": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 6.7 - page 448"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# 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": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 6.8 - page 449"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "L= 0.8 # in H\n",
      "\n",
      "C= .08 # in pF\n",
      "C= C*10**-12 # in F\n",
      "C_M= 1.9 # in pF\n",
      "C_M= C_M*10**-12 # in F\n",
      "C_T= C*C_M/(C+C_M) # in F\n",
      "R=5 # in kohm\n",
      "f_s= 1/(2*pi*sqrt(L*C)) # in Hz\n",
      "print \"Series resonant frequency = %0.f kHz\" %(f_s*10**-3)\n",
      "# (ii)\n",
      "f_p= 1/(2*pi*sqrt(L*C_T)) # in Hz\n",
      "print \"Parallel resonant frequency = %0.f kHz\" %(f_p*10**-3)\n",
      "# Note: Calculation to find the value of parallel resonant frequency in the book is wrong, so answer in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Series resonant frequency = 629 kHz\n",
        "Parallel resonant frequency = 642 kHz\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 6.9 - page 450"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# 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": 11
    }
   ],
   "metadata": {}
  }
 ]
}