{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter7 Inverter Circuits"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.1,Pg.no.20"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "value of w= 24494.9 rad/sec\n",
      "value of the Output Frequency=F= 3047.0 Hertz\n",
      "value of the Attenuation Factor=AF= 0.0014\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from math import pi,sqrt,exp\n",
    "L=10*10**-3   #Inductance of s e r i e s inverter cir cui t in Henry\n",
    "C=0.1*10**-6   #Capacitance of s e r i e s inverter ci rcu it in Farads\n",
    "R=400          #Load Resistance in Ohms\n",
    "Toff=0.2*10**-3         #Off time of Duty cycle in sec\n",
    "w=sqrt((1/(L*C))-(R**2/(4*L**2)))         #Angular Frequency in rad/ sec\n",
    "w=round(w,1)\n",
    "print 'value of w=',w,'rad/sec'\n",
    "F=w/(3.14+(w*Toff))     #Output Frequency in Hertz\n",
    "F=round(F,1)\n",
    "print 'value of the Output Frequency=F=',F,'Hertz'\n",
    "T=1/F                   #Time period of Output in sec\n",
    "AF=exp((-R/(2*L))*T)     #Attenuation Factor\n",
    "AF=round(AF,4)\n",
    "print 'value of the Attenuation Factor=AF=',AF"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.2,Pg.no.21"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "value of Inductance at resonance=L= 0.04 Henry\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "C=1*10**-6         #Capacitance of series inverter circuit in Farads\n",
    "f=5*10**3          #operating Frequency of series Inverter in Hertz\n",
    "L=1/(C*(f**2))     #value of Inductance under Resonance condition in Henry\n",
    "print 'value of Inductance at resonance=L=',L,'Henry'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.3,Pg.no.21"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "value of resistance=R1= -12401.01 Ohms\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from math import sqrt\n",
    "L=5*10**-3             #Inductance of series inverter circuit in Henry\n",
    "C=1*10**-6             #Capacitance of series inverter circuit in Farads\n",
    "Rl=400                 #Load Resistance in Ohms\n",
    "R2=10**4               #value of the second resistance in Ohms\n",
    "DF=0.7                 #Damping Factor value of LC filter\n",
    "R1=(2*(DF)*(sqrt(L/C)))-R2 -(1/(Rl*C))            #value of the first resistance in Ohms\n",
    "R1=round(R1,2)\n",
    "print 'value of resistance=R1=',R1,'Ohms'"
   ]
  }
 ],
 "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.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
