{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 3 : Power Parameter Calculations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.1,Page 109"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ramp current is 450.0 kAt/s\n",
      "current at 5 micro sec is 2.25 A\n"
     ]
    }
   ],
   "source": [
    "#finding ramp current and current at 5 micro sec\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Ip=3.0;\n",
    "f=150000.0;\n",
    "t=5.0e-6;\n",
    "\n",
    "#calculation\n",
    "T=1/f;\n",
    "It=Ip/T;\n",
    "I5=It*t;\n",
    "\n",
    "#result\n",
    "print \"ramp current is\",round(It/1000,3), \"kAt/s\"\n",
    "print \"current at 5 micro sec is\",round(I5,3), \"A\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.2,Page 110"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "current in time 0<=t<800ns is 3.575 A\n",
      "current in time 800ns<=t<2 microsec is 0.0 A\n",
      "current in time 400ns is 1.85 A\n",
      "current in time 1 microsec is 0.0 A\n"
     ]
    }
   ],
   "source": [
    "#finding current at different time\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Ip=2.0;\n",
    "f=500000.0;\n",
    "Ir=.3;\n",
    "Cd=.4#duty cycle\n",
    "t1=4.0e-7;\n",
    "t2=1.0e-6;\n",
    "I1=0;\n",
    "\n",
    "#calculation\n",
    "T=1/f;\n",
    "Im=Ip-Ir;\n",
    "I4=(Ip-Im)*t1/(Cd*T)+Im;\n",
    "It=(Ip-Im)*t/(Cd*T)+Im;\n",
    "It1=0\n",
    "\n",
    "#resilt\n",
    "print \"current in time 0<=t<800ns is\",round(It,3),\"A\"\n",
    "print \"current in time 800ns<=t<2 microsec is\",round(It1,2), \"A\"\n",
    "print \"current in time 400ns is\",round(I4,2), \"A\"\n",
    "print \"current in time 1 microsec is\",round(I1,2), \"A\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.3,Page 115"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "average voltage is 54.02 V\n"
     ]
    }
   ],
   "source": [
    "#finding average voltage\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vr=120;\n",
    "\n",
    "#calculation\n",
    "V=(Vr*2**.5)/pi;\n",
    "\n",
    "#result\n",
    "print \"average voltage is\",round(V,2), \"V\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.4,Page 119"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "average current is 0.98 A\n"
     ]
    }
   ],
   "source": [
    "#finding average current\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "f=100000.0;\n",
    "Cd=.35#duty cycle\n",
    "Ip=3.0;\n",
    "Ir=.4;\n",
    "\n",
    "#calculation\n",
    "Im=Ip-Ir;\n",
    "T=1/f;\n",
    "I=Cd*((Ip-Im)/2+Im)\n",
    "\n",
    "#result\n",
    "print \"average current is\",round(I,2), \"A\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.5,Page 124"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "rms voltage is 8.87 V\n"
     ]
    }
   ],
   "source": [
    "#finding rms voltage\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vp=15.0;\n",
    "Cd=.35;\n",
    "f=100000.0;\n",
    "\n",
    "#calculation\n",
    "V=Vp*Cd**.5;\n",
    "\n",
    "#result\n",
    "print \"rms voltage is\",round(V,2), \"V\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.6,Page 127"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "rms current is 1.73 A\n"
     ]
    }
   ],
   "source": [
    "#finding rms current\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Ip=3.0;\n",
    "f=100000.0;\n",
    "\n",
    "#calculation\n",
    "I=Ip/3**.5;\n",
    "\n",
    "#result\n",
    "print \"rms current is\",round(I,2), \"A\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.7,Page 133"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "rms voltage is 85.0 V\n"
     ]
    }
   ],
   "source": [
    "#finding rms voltage\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vp=170.0;\n",
    "f=60.0;\n",
    "\n",
    "#calculation\n",
    "Vr=Vp/2;\n",
    "\n",
    "#result\n",
    "print \"rms voltage is\",round(Vr,2), \"V\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.8,Page 140"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "power required is 2.42 hp\n",
      "Pick a 5HP motor\n",
      "current required is 18.84 amp\n"
     ]
    }
   ],
   "source": [
    "#finding current and power\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "M=1000.0;\n",
    "H=40.0;\n",
    "T=30.0;\n",
    "E1=.9;\n",
    "E2=.5;\n",
    "V=220.0;\n",
    "P1=5.0;\n",
    "\n",
    "#calculation\n",
    "W=M*H;\n",
    "P=(W)/(T*550);\n",
    "Pe=P1/E1;\n",
    "I=(Pe*746)/V;\n",
    "\n",
    "#result\n",
    "print \"power required is\",round(P,2), \"hp\"\n",
    "print('Pick a 5HP motor')\n",
    "print \"current required is\",round(I,2), \"amp\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.9,Page 145"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "power delivered to the load is 6.36 Watt\n",
      "power provided by each supply is 7.23 Watt\n"
     ]
    }
   ],
   "source": [
    "#finding power\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "Vin=1.0;\n",
    "Ri=1100.0;\n",
    "Rf=10000.0;\n",
    "Rl=8.0;\n",
    "Vs=18.0;\n",
    "\n",
    "#calculation\n",
    "Ir=Vin/Ri;\n",
    "Vl=Ir*(Ri+Rf);\n",
    "Ip=Vl/Rl;\n",
    "Pl=(Vl*Ip)/2;\n",
    "Ps=(Vs*Ip)/pi;\n",
    "\n",
    "#result\n",
    "print \"power delivered to the load is\",round(Pl,2),\"Watt\"\n",
    "print \"power provided by each supply is\",round(Ps,2), \"Watt\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.10,Page 149"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "power delivered is 141.67 Watt\n"
     ]
    }
   ],
   "source": [
    "#finding power\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "V=170.0;\n",
    "R=51.0;\n",
    "\n",
    "#calculation\n",
    "I=V/R;\n",
    "P=(V*I)/4;\n",
    "\n",
    "#result\n",
    "print \"power delivered is\",round(P,2), \"Watt\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Example 3.11,Page 151"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "power dissipated is 7.05 watt\n",
      "power dissipated when transistor resistance is 0.2 hm is 0.35 watt\n"
     ]
    }
   ],
   "source": [
    "#finding power\n",
    "\n",
    "#initialisation of variable\n",
    "from math import pi,tan,sqrt,sin,cos,acos,atan\n",
    "V=7.2;\n",
    "Rq=.2;\n",
    "Rl=4;\n",
    "D=.6;\n",
    "\n",
    "#calculation\n",
    "Ip=V/(Rq+Rl);\n",
    "Vl=Ip*Rl;\n",
    "P=D*Vl*Ip;\n",
    "Vq=Ip*Rq;\n",
    "Pq=D*Vq*Ip;\n",
    "\n",
    "#result\n",
    "print \"power dissipated is\",round(P,2), \"watt\"\n",
    "print \"power dissipated when transistor resistance is 0.2 hm is\",round(Pq,2), \"watt\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}