{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 05 : Thyristor Commutation Techniques"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1, Page No 252"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "L=5.0*10**-3            #mH\n",
      "C=20.0*10**-6           #\u00b5F\n",
      "V_s=200                 #V\n",
      "\n",
      "#Calculations\n",
      "w_o=math.sqrt(1/(L*C))    #rad/s\n",
      "t_o=math.pi/w_o           #ms\n",
      "\n",
      "#Results\n",
      "print('conduction time of thyristor = %.2f ms' %(t_o*1000))\n",
      "print('voltage across thyristor=%.0f V' %V_s)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "conduction time of thyristor = 0.99 ms\n",
        "voltage across thyristor=200 V\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2, Page No 255"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "C=20.0*10**-6         #\u00b5F\n",
      "L=5.0*10**-6          #\u00b5H\n",
      "V_s=230.0             #V\n",
      "\n",
      "#Calculations\n",
      "I_p=V_s*math.sqrt(C/L)      #A\n",
      "w_o=math.sqrt(1/(L*C))      #rad/sec\n",
      "t_o=math.pi/w_o             #\u00b5S\n",
      "I_o=300               \n",
      "a = math.degrees(math.asin(I_o/(2*V_s)))   \n",
      "V_ab = V_s*math.cos(math.radians(a))      #V \n",
      "t_c=C*V_ab/I_o     #\u00b5s\n",
      "\n",
      "#Calculations\n",
      "print(\"conduction time of auxillery thyristor=%.2f us\" %(t_o*10**6))\n",
      "print(\"voltage across main thyristor=%.2f V\" %V_ab)\n",
      "print(\"ckt turn off time=%.2f us\" %(t_c*10**6))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "conduction time of auxillery thyristor=31.42 us\n",
        "voltage across main thyristor=174.36 V\n",
        "ckt turn off time=11.62 us\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3 Page No 258"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "V_s=200.0           #V\n",
      "R1=10.0             #\u2126\n",
      "R2=100.0            #\u2126\n",
      "C=0                 #  value of capacitor\n",
      "\n",
      "#Calculations\n",
      "I1=V_s*(1/R1+2/R2)    #A\n",
      "I2=V_s*(2/R1+1/R2)    #A\n",
      "t_c1=40*10**-6\n",
      "fos=2    #factor of safety\n",
      "C1=t_c1*fos/(R1*math.log(2))\n",
      "C2=t_c1*fos/(R2*math.log(2))\n",
      "if C1 > C2 :\n",
      "    C = C1*10**6\n",
      "else :\n",
      "    C = C2*10**6\n",
      "\n",
      "\n",
      "#Results\n",
      "print(\"peak value of current through SCR1=%.2f A\" %I1); \n",
      "print(\"Peak value of current through SCR2=%.2f A\" %I2);\n",
      "print(\"Value of capacitor=%.2f uF\" %C);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "peak value of current through SCR1=24.00 A\n",
        "Peak value of current through SCR2=42.00 A\n",
        "Value of capacitor=11.54 uF\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4, Page No 260"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "V_s=230.0             #V\n",
      "L=20*10**-6           #\u00b5H\n",
      "C=40*10**-6           #\u00b5F\n",
      "I_o=120.0             #A\n",
      "\n",
      "#Calculations\n",
      "I_p=V_s*math.sqrt(C/L)   #A\n",
      "t_c=C*V_s/I_o            #\u00b5s\n",
      "w_o=math.sqrt(1/(L*C))  \n",
      "t_c1=math.pi/(2*w_o)     #\u00b5s\n",
      "\n",
      "#Results\n",
      "print(\"current through main thyristor=%.2f A\"  %(I_o+I_p))\n",
      "print(\"Current through auxillery thyristor=%.2f A\" %I_o)\n",
      "print(\"Circuit turn off time for main thyristor=%.2f us\" %(t_c*10**6))\n",
      "print(\"Circuit turn off time for auxillery thyristor=%.2f us\" %(t_c1*10**6))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "current through main thyristor=445.27 A\n",
        "Current through auxillery thyristor=120.00 A\n",
        "Circuit turn off time for main thyristor=76.67 us\n",
        "Circuit turn off time for auxillery thyristor=44.43 us\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5 Page No 263"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "C_j=25*10**-12      #pF\n",
      "I_c=5*10**-3        #charging current\n",
      "V_s=200.0           #V\n",
      "R=50.0              #\u2126\n",
      "\n",
      "#Calculations\n",
      "C=(C_j*V_s)/(I_c*R)\n",
      "\n",
      "\n",
      "#RESULTS\n",
      "print(\"Value of C=%.2f  \u00b5F\" %(C*10**6))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of C=0.02  \u00b5F\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6 Page No 263"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "V_s=200.0         #V\n",
      "R=5.0             #\u2126\n",
      "\n",
      "#Calculations\n",
      "C=10.0*10**-6\n",
      "#for turn off V_s*(1-2*exp(-t/(R*C)))=0,    so after solving\n",
      "t_c=R*C*math.log(2.0)\n",
      "\n",
      "#Results\n",
      "print(\"circuit turn off time=%.2f us\" %(t_c*10**6))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "circuit turn off time=34.66 us\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7, Page No 264 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "R=1.0                   #\u2126\n",
      "L=20*10**-6             #\u00b5H\n",
      "C=40*10**-6             #\u00b5F\n",
      "\n",
      "#Calculations\n",
      "w_r=math.sqrt((1/(L*C))-(R/(2*L))**2)\n",
      "t_1=math.pi/w_r\n",
      "\n",
      "#Results\n",
      "print(\"conduction time of thyristor=%.3f us\" %(t_1*10**6))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "conduction time of thyristor=125.664 us\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8 Page No 265"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#initialisation of variables\n",
      "dv=400*10.0**-6       #dv=dv_T/dt(V/s)\n",
      "V_s=200.0             #v\n",
      "R=20.0                #\u2126\n",
      "\n",
      "#Calculations\n",
      "C=V_s/(R*dv)         \n",
      "C_j=.025*10**-12\n",
      "C_s=C-C_j\n",
      "I_T=40;\n",
      "R_s=1/((I_T/V_s)-(1/R)) \n",
      "#value of R_s in book is wrongly calculated\n",
      "\n",
      "#Results\n",
      "print(\"R_s=%.2f ohm\" %R_s)\n",
      "print(\"C_s=%.3f uF\" %(C_s/10**6))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R_s=6.67 ohm\n",
        "C_s=0.025 uF\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.9 Page No 265"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "V_s=200.0          #V\n",
      "C=20.0*10**-6      #\u00b5H   \n",
      "L=0.2*10**-3       #\u00b5F\n",
      "i_c=10.0\n",
      "\n",
      "#Calculations\n",
      "i=V_s*math.sqrt(C/L)\n",
      "w_o=1.0/math.sqrt(L*C)\n",
      "t_1 = (1/w_o)*math.degrees(math.asin(i_c/i))\n",
      "t_o=math.pi/w_o\n",
      "t_c=t_o-2*t_1    \n",
      "\n",
      "#Results\n",
      "print(\"reqd time=%.2f us\" %(t_1*10**6))\n",
      "print(\"ckt turn off time=%.2f us\" %(t_c*10**6))\n",
      "print(\"ckt turn off time=%.5f us\" %t_1)\n",
      "#solution in book wrong, as wrong values are selected while filling the formuleas"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "reqd time=575.37 us\n",
        "ckt turn off time=-952.05 us\n",
        "ckt turn off time=0.00058 us\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.11 Page No 268 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "L=1.0              #\u00b5H\n",
      "R=50.0             #\u2126\n",
      "V_s=200.0          #V\n",
      "t=0.01             #sec\n",
      "Vd=0.7\n",
      "\n",
      "#Calculations\n",
      "tau=L/R\n",
      "i=(V_s/R)*(1-math.exp(-t/tau))\n",
      "t=8*10**-3\n",
      "i1=i-t*Vd  \n",
      "\n",
      "\n",
      "#Results\n",
      "print(\"current through L = %.2f A\" %i1)\n",
      "i_R=0                  #current in R at t=.008s\n",
      "print(\"Current through R = %.2f A\" %i_R)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "current through L = 1.57 A\n",
        "Current through R = 0.00 A\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.12, Page No 269"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#initialisation of variables\n",
      "\n",
      "#initialisation of variables\n",
      "L=1.0                      #H\n",
      "R=50.0                   #ohm\n",
      "V_s=200.0                #V\n",
      "\n",
      "#Calculations\n",
      "tau=L/R\n",
      "t=0.01                 #s\n",
      "i=(V_s/R)*(1-math.exp(-t/tau))\n",
      "C=1*10**-6            #F\n",
      "V_c=math.sqrt(L/C)*i\n",
      "\n",
      "#Results\n",
      "print(\"current in R,L=%.2f A\" %i)\n",
      "print(\"voltage across C=%.2f kV\" %(V_c/1000))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "current in R,L=1.57 A\n",
        "voltage across C=1.57 kV\n"
       ]
      }
     ],
     "prompt_number": 22
    }
   ],
   "metadata": {}
  }
 ]
}