{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 15 : Operational amplifier frequency\n",
      "Response and compensation"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.2, Page No 648"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "R2=1.0*10**6\n",
      "Acl=4.5\n",
      "\n",
      "#Calculations\n",
      "R1=R2/Acl\n",
      "R1=220*10**3#use standard value\n",
      "R3=(R1*R2)/(R1+R2)\n",
      "Cf=((R1*30*10**-12)/(R1+R2))*10**12\n",
      "\n",
      "#Results\n",
      "print(\" suitable value of capacitor is %.2fpF \" %Cf)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " suitable value of capacitor is 5.41pF \n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.3, Page No 649"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "\n",
      "f=35.0*10**3\n",
      "Rf=68.0*10**3\n",
      "\n",
      "#Calculations\n",
      "Cf=(1.0/(2*3.14*f*Rf))*10**12\n",
      "\n",
      "#Results\n",
      "print(\" suitable miller effect capacitor is %.2f pF \" %Cf)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " suitable miller effect capacitor is 66.91 pF \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.5 Page No 652"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "\n",
      "Acl=100.0\n",
      "Av=10.0\n",
      "print(\" for Cf=30pF\")\n",
      "GBW=800.0*10**3\n",
      "\n",
      "#Calculations\n",
      "F2=GBW/Acl\n",
      "print(\" for Cf=3pF\")\n",
      "GBW=(800*10**3)*Av\n",
      "f2=GBW/Acl\n",
      "\n",
      "#Results\n",
      "print(\" The value of f2 is %.2f pF \" %(f2/1000))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " for Cf=30pF\n",
        " for Cf=3pF\n",
        " The value of f2 is 80.00 pF \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.6, Page No 654"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "Vip=1.0\n",
      "R2=39.0*10**3\n",
      "R3=4.7*10**3\n",
      "SR=250.0/10**-6\n",
      "f=100.0*10**3\n",
      "\n",
      "#Calculations\n",
      "print(\" for the AD843\")\n",
      "Vop=((R2+R3)/R3)*Vip\n",
      "fp=SR/(2*3.14*Vop)\n",
      "print(\"full power bandwidth is %dHz \" %fp)\n",
      "print(\" for a 741\")\n",
      "SR=0.5/10**-6\n",
      "Vp=SR/(2*3.14*f)\n",
      "\n",
      "#Results\n",
      "print(\" maximum peak output voltage is %3.2fV \" %Vp)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " for the AD843\n",
        "full power bandwidth is 4281508Hz \n",
        " for a 741\n",
        " maximum peak output voltage is 0.80V \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.7 Page No 656"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "rs=600.0\n",
      "R1=1.0*10**3\n",
      "R2=10.0*10**3\n",
      "f=800.0*10**3\n",
      "\n",
      "#Calculations\n",
      "print(\" stray capacitance\")\n",
      "Cs=1/(2*3.14*f*10*(((rs+R1)*R2)/(rs+R1+R2)))\n",
      "print(\"compensation capacitor\")\n",
      "C2=((Cs*(rs+R1))/R2)*10**12\n",
      "\n",
      "#Results\n",
      "print(\"compensation capacitor is %.2fpF \" %C2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " stray capacitance\n",
        "compensation capacitor\n",
        "compensation capacitor is 2.31pF \n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15.8 Page No 659"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "ro=25.0\n",
      "f=2.0*10**6\n",
      "R2=10.0*10**3\n",
      "Rx=25.0\n",
      "\n",
      "#Calculations\n",
      "Cl=(1.0/(2.0*3.14*f*(10*ro)))*10**+12\n",
      "print(\" load capacitance is %3.2fpF \" %Cl)\n",
      "Cl=0.1*10**-6\n",
      "C2=((Cl*(ro+Rx))/R2)*10**12\n",
      "\n",
      "#Results\n",
      "print(\" compensation capacitance is %.2f pF \" %C2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " load capacitance is 318.47pF \n",
        " compensation capacitance is 500.00 pF \n"
       ]
      }
     ],
     "prompt_number": 14
    }
   ],
   "metadata": {}
  }
 ]
}