{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter : 6 - Sinusoidal Oscillators"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.3 : Page No - 272"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import pi\n",
      "#Given data\n",
      "R3 = 6 # in k ohm\n",
      "R4 = 2 # in k ohm\n",
      "A = 1+(R3/R4) \n",
      "if A>3 :\n",
      "    print \"The circuit will work as the oscillator\"\n",
      "R = 5.1 # in k ohm\n",
      "R = R * 10**3 # in ohm\n",
      "C = 0.001 # in \u00b5F\n",
      "C = C * 10**-6 # in F\n",
      "f = 1/(2*pi*R*C) # in Hz\n",
      "f = f * 10**-3 # in kHz\n",
      "print \"The frequency of oscillations = %0.4f kHz\" %f"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The circuit will work as the oscillator\n",
        "The frequency of oscillations = 31.2069 kHz\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6.4 : Page No - 272\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given data\n",
      "C = 0.05 # in \u00b5F\n",
      "C = C * 10**-6 # in F\n",
      "f = 1 # in kHz\n",
      "f = f * 10**3 # in Hz\n",
      "R = 1/(2*pi*f*C) # in ohm\n",
      "R = R * 10**-3 # in k ohm\n",
      "print \"The value of R1 = R2 = %0.3f k\u03a9\" %R \n",
      "R4 = 10 # in k ohm\n",
      "print \"The value of R3 = %0.f k\u03a9\" %R4 \n",
      "R3 = 2*R4 # in k ohm\n",
      "print \"The value of R4 = %0.f k\u03a9\" %R3"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of R1 = R2 = 3.183 k\u03a9\n",
        "The value of R3 = 10 k\u03a9\n",
        "The value of R4 = 20 k\u03a9\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}