{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "CHAPTER 15 Thyristors"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15-1, Page 521"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "VB=10          #breakover voltage(V)\n",
      "Vin=15         #input voltage(V)\n",
      "R=100.0        #resistance (Ohm)\n",
      "\n",
      "I1=1000*Vin/R        #diode current ideally(mA)\n",
      "I2=1000*(Vin-0.7)/R  #diode current with second approx.(mA)\n",
      "I3=1000*(Vin-0.9)/R  #diode current more accurately(mA)\n",
      "\n",
      "print 'Diode current ideally ID1 = ',I1,'mA'\n",
      "print 'Diode current with second approx. ID2 = ',I2,'mA'\n",
      "print 'Diode current more accurately ID3 = ',I3,'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diode current ideally ID1 =  150.0 mA\n",
        "Diode current with second approx. ID2 =  143.0 mA\n",
        "Diode current more accurately ID3 =  141.0 mA\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15-2, Page 525"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Ih=4*10**-3             #holding current(mA)\n",
      "R=100.0                 #resistance (Ohm)\n",
      "Vs=15                   #input voltage (V)\n",
      "\n",
      "Vin=0.7+(Ih*R)          #new input voltage(V)\n",
      "\n",
      "print 'New input voltage Vin = ',Vin,'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "New input voltage Vin =  1.1 V\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15-3, Page 525"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "R=2.0*10**3                    #resistance (Ohm)\n",
      "C=0.02*10**-6                  #capacitance (F)\n",
      "VB=10                          #breakdown voltage(V)\n",
      "\n",
      "RC=R*C                         #Time constant(s)\n",
      "T=0.2*RC                       #period (s)\n",
      "f=T**-1                        #frequency(Hz) \n",
      "\n",
      "print 'time constant RC = ',RC*10**6,'us'\n",
      "print 'Period T = ',T*10**6,'us'\n",
      "print 'Frequency = ',f/1000,'KHz'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "time constant RC =  40.0 us\n",
        "Period T =  8.0 us\n",
        "Frequency =  125.0 KHz\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15-4, Page 531"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "It=7*10**-3             #trigger current(mA)\n",
      "R1=100.0                #resistance (Ohm)\n",
      "R2=1*10**3              #resistance (Ohm)\n",
      "Vt=0.75                 #trigger voltage (V)\n",
      "Ih=6*10**-3             #holding current(mA)\n",
      "\n",
      "Vin=Vt+(It*R2)           #minimum input voltage(V)\n",
      "VCC=0.7+(Ih*R1)          #supply voltage for turning of SCR(V)\n",
      "\n",
      "print 'Minimum input voltage Vin = ',Vin,'V'\n",
      "print 'supply voltage for turning of SCR VCC = ',VCC,'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum input voltage Vin =  7.75 V\n",
        "supply voltage for turning of SCR VCC =  1.3 V\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15-5, Page 532"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "IGT=200*10**-6          #trigger current(mA)\n",
      "VGT=1                   #trigger voltage(V) \n",
      "R1=900.0                #resistance (Ohm)\n",
      "R2=100.0                #resistance (Ohm)\n",
      "C=0.2*10**-6            #capacitance (F)\n",
      "Vt=0.75                 #trigger voltage (V)\n",
      "Ih=6*10**-3             #holding current(mA)\n",
      "R=1*10**3               #Resistance (Ohm)              \n",
      "\n",
      "RTH=R1*R2/(R1+R2)       #Thevenin resistance (Ohm)\n",
      "Vin=VGT+(IGT*RTH)       #input voltage needed to trigger(V)\n",
      "Vp=10*Vin               #Output voltage at SCR firing point(V)\n",
      "RC=C*(R/2)              #time constant (s)\n",
      "T=RC*0.2                #period (s)\n",
      "f=1/T                   #frequency (Hz)\n",
      "\n",
      "print 'peak output voltage Vpeak = ',Vp,'V'\n",
      "print 'time constant RC = ',RC*10**6,'us'\n",
      "print 'Period T = ',T*10**6,'us'\n",
      "print 'Frequency = ',f/1000,'KHz'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "peak output voltage Vpeak =  10.18 V\n",
        "time constant RC =  100.0 us\n",
        "Period T =  20.0 us\n",
        "Frequency =  50.0 KHz\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15-6, Page 536"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Vz=5.6                      #breakdown voltage(V)\n",
      "VGT1=0.75                   #trigger voltage (V)  \n",
      "VGT2=1.5                    #worst case maximum trigger voltage(V) \n",
      "Vz2=6.16                    #break down voltage with 10% tolerance (V)\n",
      "\n",
      "VCC1=Vz+VGT1                  #supply voltage(V) \n",
      "VCC2=VGT2+Vz2                 #Over voltage (V)\n",
      "\n",
      "print 'supply voltage VCC1 = ',VCC1,'V'\n",
      "print 'supply over voltage VCC2 = ',VCC2,'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "supply voltage VCC1 =  6.35 V\n",
        "supply over voltage VCC2 =  7.66 V\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15-7, Page 539"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math   # This will import math module\n",
      "\n",
      "C=0.1*10**-6            #capacitance (F)\n",
      "f=60                    #frequency (Hz)\n",
      "R=26*10**3              #resistance(KOhm)\n",
      "Vm=120                  #input ac voltage(V)\n",
      "\n",
      "XC=(2*math.pi*f*C)**-1                 #capacitive reactance(Ohm)\n",
      "ZT=((R**2)+(XC**2))**0.5               #impedance (Ohm)\n",
      "thetaz=math.atan2(-XC,R)*180/math.pi   #angle (deg)\n",
      "IC=Vm/ZT                               #Current through C(A)\n",
      "VC=IC*XC                               #voltage across C(V)\n",
      "thetac=180+thetaz                      #conduction angle(deg)\n",
      "\n",
      "print 'Capacitor reactance XC = ',round((XC/1000),2),'KOhm'\n",
      "print 'impedance ZT = ',round((ZT/1000),2),'KOhm'\n",
      "print 'firing angle = ',round(thetaz,2),'deg'\n",
      "print 'Current through C, IC = ',round((IC*1000),2),'mA'\n",
      "print 'voltage across C, VC = ',round(VC,2),'V'\n",
      "print 'conduction angle = ',round(thetac,2),'deg'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Capacitor reactance XC =  26.53 KOhm\n",
        "impedance ZT =  37.14 KOhm\n",
        "firing angle =  -45.57 deg\n",
        "Current through C, IC =  3.23 mA\n",
        "voltage across C, VC =  85.7 V\n",
        "conduction angle =  134.43 deg\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15-8, Page 546"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "C=1*10**-6               #capacitance (F)\n",
      "R1=22.0                  #resistance (Ohm)\n",
      "R2=82*10**3              #resistance(KOhm)\n",
      "Vs=75                    #input voltage(V)\n",
      "\n",
      "I=Vs/R1                  #current through 22Ohm resistor (A)\n",
      "\n",
      "print 'current through 22Ohm resistor I = ',round(I,2),'A'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "current through 22Ohm resistor I =  3.41 A\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15-9, Page 547"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "Vdb=32.0                    #diac break down voltage (V)\n",
      "VTT=1                       #triac trigger voltage(V)\n",
      "\n",
      "Vin=VTT+Vdb                 #input voltage for triggering triac\n",
      "\n",
      "print 'input voltage for triggering triac vin = ',Vin,'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "input voltage for triggering triac vin =  33.0 V\n"
       ]
      }
     ],
     "prompt_number": 27
    }
   ],
   "metadata": {}
  }
 ]
}