{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 9 : Silicon Controlled Rectifier"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.1, Page No. 238 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# average voltage\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Vm=200.0           #in V\n",
      "theta=30.0         #firing angle in degree\n",
      "\n",
      "#Calculations\n",
      "vdc=((Vm/math.pi)*(1+math.cos(theta*math.pi/180)))\n",
      "\n",
      "#Result\n",
      "print(\"average value of voltage is ,(V)= %.f\"%(round(vdc)))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "average value of voltage is ,(V)= 119\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.2, Page No. 238"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# dc load current rms load current amd power dissipiated\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Va=300.0                 # in V\n",
      "Vm=300.0*math.sqrt(2)    # in V\n",
      "Rl=50.0                  #in ohm\n",
      "theta1=90.0              #firing angle in degree\n",
      "\n",
      "#Calculations\n",
      "idc=((Vm/(2*math.pi*Rl))*(1+math.cos(theta1*math.pi/180)))\n",
      "irms=Va/(2*Rl)\n",
      "P=irms**2*Rl\n",
      "\n",
      "#Result\n",
      "print(\"(i)   The dc load current is ,(A)             = %.2f\"%idc)\n",
      "print(\"(ii)  The rms load current is ,(A)            = %.f\"%(round(irms)))\n",
      "print(\"(iii) The power dissipated by the load is ,(W)= %.f\"%(round(P)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i)   The dc load current is ,(A)             = 1.35\n",
        "(ii)  The rms load current is ,(A)            = 3\n",
        "(iii) The power dissipated by the load is ,(W)= 450\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.3, Page No. 239"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# firing angle conducting angle and average current\n",
      "\n",
      "import math\n",
      "#Variable declaration\n",
      "Ih=0.0                        #in A\n",
      "Vi=100.0                      #in V\n",
      "Vm=200.0                      #in V\n",
      "Rl=100.0                      #in ohm\n",
      "\n",
      "#Calculations\n",
      "theta1=(180/math.pi)*math.asin(Vi/Vm) #firing angle in degree\n",
      "ca=180-theta1                         #conducting angle in dehree\n",
      "av=((Vm/(2*math.pi))*(1+math.cos(theta1*math.pi/180)))\n",
      "ac=av/Rl               \n",
      "\n",
      "#Result \n",
      "print(\"(i)   firing angle is ,(degree)     = %.f\u00b0\"%(theta1))\n",
      "print(\"(ii)  conducting angle is ,(degree) = %.f\u00b0\"%ca)\n",
      "print(\"(iii) average current is ,(A)       = %.4f\"%ac)\n",
      "#average current is wrong in the textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i)   firing angle is ,(degree)     = 30\u00b0\n",
        "(ii)  conducting angle is ,(degree) = 150\u00b0\n",
        "(iii) average current is ,(A)       = 0.5940\n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}