{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 25 : Resonance"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_1 Page No.  775"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The resonant frequency = 12.58 Hertz\n",
      "approx 12.6 Hertz\n"
     ]
    }
   ],
   "source": [
    "from math import pi,sqrt\n",
    "# Calculate the resonant frequency for an 8-H inductance and a 20-u\u0003F capacitance.\n",
    "\n",
    "# Given data\n",
    "\n",
    "L = 8.#              # L=8 Henry\n",
    "C = 20.*10**-6#       # C=20 uFarad\n",
    "\n",
    "fr = 1./(2.*pi*sqrt(L*C))#\n",
    "print 'The resonant frequency = %0.2f Hertz'%fr\n",
    "print 'approx 12.6 Hertz'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_2 Page No.  776"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The resonant frequency = 65007689.56 Hertz\n",
      "i.e 65 MHz\n"
     ]
    }
   ],
   "source": [
    "# Calculate the resonant frequency for a 2-uH inductance and a 3-pF capacitance.\n",
    "\n",
    "# Given data\n",
    "\n",
    "L = 2.*10**-6#       # Inductor=2 uHenry\n",
    "C = 3.*10**-12#      # Capacitor=3 pFarad\n",
    "pi = 3.14#\n",
    "\n",
    "fr = 1./(2.*pi*sqrt(L*C))#\n",
    "print 'The resonant frequency = %0.2f Hertz'%fr\n",
    "print 'i.e 65 MHz'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_3 Page No.  778"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of Capacitor = 1.06e-10 Farads\n",
      "i.e 106 pF\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "# What value of C resonates with a 239-u\u0003H L at 1000 kHz?\n",
    "\n",
    "# Given data\n",
    "\n",
    "L = 239.*10**-6#      # Inductor=239 uHenry\n",
    "fr = 1000.*10**3#     # Resonant frequency=1000 kHertz\n",
    "\n",
    "A = pi*pi#          # pi square\n",
    "B = fr*fr#          # Resonant frequency square\n",
    "\n",
    "C = 1./(4.*A*B*L)#\n",
    "print 'The value of Capacitor = %0.2e Farads'%C\n",
    "print 'i.e 106 pF'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_4 Page No. 781"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The value of Inductor = 2.39e-04 Henry\n",
      "i.e 239 uF\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "# What value of L resonates with a 106-pF C at 1000 kHz, equal to 1 MHz?\n",
    "\n",
    "# Given data\n",
    "\n",
    "C = 106.*10**-12#     # Capacitor=106 pFarad\n",
    "fr = 1.*10**6#        # Resonant frequency=1 MHertz\n",
    "\n",
    "A = pi*pi#          # pi square\n",
    "B = fr*fr#          # Resonant frequency square\n",
    "\n",
    "C = 1./(4*A*B*C)#\n",
    "print 'The value of Inductor = %.2e Henry'%C\n",
    "print 'i.e 239 uF'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_5 Page No. 782"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Magnification factor Q =50.00\n"
     ]
    }
   ],
   "source": [
    "# A series circuit resonant at 0.4 MHz develops 100 mV across a 250-u\u0003H L with a 2-mV input. Calculate Q .\n",
    "\n",
    "# Given data\n",
    "\n",
    "Vo = 100.*10**-3#     # Output voltage=100 mVolts\n",
    "Vi = 2*10**-3#       # Input voltage=2 mVolts\n",
    "L = 250*10**-6#      # Inductor=250 uHenry\n",
    "f = 0.4*10**6#       # Frequency=0.4 MHertz\n",
    "\n",
    "Q = Vo/Vi#\n",
    "print 'The Magnification factor Q =%0.2f'%Q"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_6 Page No.  784"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Ac Resistance of Coil = 12.57 Ohms\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "# What is the ac resistance of the coil in A series circuit resonant at 0.4 MHz develops 100 mV across a 250-u\u0003H L with a 2-mV input.\n",
    "\n",
    "# Given data\n",
    "\n",
    "Vo = 100.*10**-3#     # Output voltage=100 mVolts\n",
    "Vi = 2.0*10**-3#       # Input voltage=2 mVolts\n",
    "L = 250.0*10**-6#      # Inductor=250 uHenry\n",
    "f = 0.4*10**6#       # Frequency=0.4 MHertz\n",
    "\n",
    "Q = Vo/Vi#\n",
    "Xl = 2*pi*f*L#\n",
    "\n",
    "rs = Xl/Q#\n",
    "print 'The Ac Resistance of Coil = %0.2f Ohms'%rs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_7 Page No.  785"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Because they divide Vt equally\n",
      "The Equivalent Impedence = 225000 Ohms\n",
      "i.e 225 kOhms\n",
      "The Q =150.00\n"
     ]
    }
   ],
   "source": [
    "# In Fig. 25–9, assume that with a 4-mVac input signal for VT, the voltage across R1 is 2 mV when R1 is 225-kOhms\u0003. Determine Zeq and Q.\n",
    "\n",
    "# Given data\n",
    "\n",
    "vin = 4.*10**-3#      # Input AC signal=4 mVac\n",
    "R1 = 225.*10**3#      # Resistance1=225 kOhms\n",
    "vR1 = 2.*10**-3#      # Voltage across Resistor1=2 mVac\n",
    "xl = 1.5*10**3#      # Inductive Reactance=1.5 kOhms\n",
    "\n",
    "print 'Because they divide Vt equally'\n",
    "\n",
    "Zeq = R1#\n",
    "print 'The Equivalent Impedence = %0.f Ohms'%Zeq\n",
    "print 'i.e 225 kOhms'\n",
    "\n",
    "Q = Zeq/xl#\n",
    "print 'The Q =%0.2f'%Q"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_8 Page No.  786"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Magnification factor Q = 40.02\n"
     ]
    }
   ],
   "source": [
    "from math import pi\n",
    "# A parallel LC circuit tuned to 200 kHz with a 350-u\u0003H L has a measured ZEQ of 17,600. Calculate Q.\n",
    "\n",
    "# Given data\n",
    "\n",
    "L = 350.*10**-6#      # Inductor=350 uHenry\n",
    "f = 200.*10**3#       # Frequency=200 kHertz\n",
    "Zeq = 17600.#        # Equivalent Impedence=17600 Ohms\n",
    "\n",
    "Xl = 2*pi*f*L#\n",
    "\n",
    "Q = Zeq/Xl#\n",
    "print 'The Magnification factor Q = %0.2f'%Q"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_9 Page No.  788"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Bandwidth BW or Delta f = 20000 Hertz\n",
      "i.e 20 kHz\n",
      "The Edge Frequency f1 = 1990000 Hertz\n",
      "i.e 1990 kHz\n",
      "The Edge Frequency f2 = 2010000 Hertz\n",
      "i.e 2010 kHz\n"
     ]
    }
   ],
   "source": [
    "# An LC circuit resonant at 2000 kHz has a Q of 100. Find the total bandwidth delta f and the edge frequencies f1 and f2.\n",
    "\n",
    "# Given data\n",
    "\n",
    "fr = 2000.*10**3#         # Resonant frequency=2000 kHertz\n",
    "Q = 100.#                # Magnification factor=100\n",
    "\n",
    "Bw = fr/Q#\n",
    "print 'The Bandwidth BW or Delta f = %0.f Hertz'%Bw\n",
    "print 'i.e 20 kHz'\n",
    "\n",
    "f1 = fr-Bw/2#\n",
    "print 'The Edge Frequency f1 = %0.f Hertz'%f1\n",
    "print 'i.e 1990 kHz'\n",
    "\n",
    "f2 = fr+Bw/2#\n",
    "print 'The Edge Frequency f2 = %0.f Hertz'%f2\n",
    "print 'i.e 2010 kHz'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example No. 25_10 Page No.  789"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Bandwidth BW or Delta f = 60000 Hertz\n",
      "i.e 60 kHz\n",
      "The Edge Frequency f1 = 5970000 Hertz\n",
      "i.e 5970 kHz\n",
      "The Edge Frequency f2 = 6030000 Hertz\n",
      "i.e 6030 kHz\n"
     ]
    }
   ],
   "source": [
    "# An LC circuit resonant at 6000 kHz has a Q of 100. Find the total bandwidth delta f and the edge frequencies f1 and f2.\n",
    "\n",
    "# Given data\n",
    "\n",
    "fr = 6000.*10**3#         # Resonant frequency=6000 kHertz\n",
    "Q = 100.#                # Magnification factor=100\n",
    "\n",
    "Bw = fr/Q#\n",
    "print 'The Bandwidth BW or Delta f = %0.f Hertz'%Bw\n",
    "print 'i.e 60 kHz'\n",
    "\n",
    "f1 = fr-Bw/2#\n",
    "print 'The Edge Frequency f1 = %0.f Hertz'%f1\n",
    "print 'i.e 5970 kHz'\n",
    "\n",
    "f2 = fr+Bw/2.0#\n",
    "print 'The Edge Frequency f2 = %0.f Hertz'%f2\n",
    "print 'i.e 6030 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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}