{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#6: Dielectric Materials"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 6.1, Page number 6.34"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "insulation resistance is 0.85 *10**18 ohm\n",
      "answer varies due to rounding off errors\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "rho=5*10**16;   #resistivity(ohm m)\n",
    "l=5*10**-2;    #thickness(m)\n",
    "b=8*10**-2;    #length(m)\n",
    "w=3*10**-2;    #width(m)\n",
    "\n",
    "#Calculation\n",
    "A=b*w;    #area(m**2)\n",
    "Rv=rho*l/A;    \n",
    "X=l+b;      #length(m)\n",
    "Y=w;      #perpendicular(m)\n",
    "Rs=Rv*X/Y;    \n",
    "Ri=Rs*Rv/(Rs+Rv);       #insulation resistance(ohm)\n",
    "\n",
    "#Result\n",
    "print \"insulation resistance is\",round(Ri/10**18,2),\"*10**18 ohm\"\n",
    "print \"answer varies due to rounding off errors\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 6.2, Page number 6.34"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DC dielectric loss is 1 *10**-3 watt\n",
      "AC dielectric loss is 22.22 *10**-3 watt\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "rho=10**10;   #resistivity(ohm m)\n",
    "d=10**-3;    #thickness(m)\n",
    "A=10**4*10**-6;    #area(m**2)\n",
    "V=10**3;    #voltage(V)\n",
    "f=50;     #power frequency(Hz)\n",
    "epsilonr=8;\n",
    "epsilon0=8.84*10**-12;\n",
    "tan_delta=0.1;\n",
    "\n",
    "#Calculation\n",
    "Rv=rho*d/A; \n",
    "dl_DC=V**2/Rv;      #DC dielectric loss(watt)\n",
    "C=A*epsilon0*epsilonr/d;\n",
    "dl_AC=V**2*2*math.pi*f*C*tan_delta;     #AC dielectric loss(watt)\n",
    "\n",
    "#Result\n",
    "print \"DC dielectric loss is\",int(dl_DC*10**3),\"*10**-3 watt\"\n",
    "print \"AC dielectric loss is\",round(dl_AC*10**3,2),\"*10**-3 watt\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 6.3, Page number 6.35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "polarisability of He is 0.185 *10**-40 farad m**2\n",
      "relative permittivity is 1.000056\n",
      "answer varies due to rounding off errors\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "epsilon0=8.84*10**-12;\n",
    "R=0.55*10**-10;    #radius(m)\n",
    "N=2.7*10**25;      #number of atoms\n",
    "\n",
    "#Calculation\n",
    "alpha_e=4*math.pi*epsilon0*R**3;    #polarisability of He(farad m**2)\n",
    "epsilonr=1+(N*alpha_e/epsilon0);      #relative permittivity\n",
    "\n",
    "#Result\n",
    "print \"polarisability of He is\",round(alpha_e*10**40,3),\"*10**-40 farad m**2\"\n",
    "print \"relative permittivity is\",round(epsilonr,6)\n",
    "print \"answer varies due to rounding off errors\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 6.4, Page number 6.35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "field strength is 3.535 *10**7 V/m\n",
      "total dipole moment is 33.4 *10**-12 Cm\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "A=360*10**-4;    #area(m**2)\n",
    "V=15;    #voltage(V)\n",
    "C=6*10**-6;     #capacitance(farad)\n",
    "epsilonr=8;\n",
    "epsilon0=8.84*10**-12;\n",
    "\n",
    "#Calculation\n",
    "E=V*C/(epsilon0*epsilonr*A);     #field strength(V/m)\n",
    "dm=epsilon0*(epsilonr-1)*V*A;    #total dipole moment(Cm)\n",
    "\n",
    "#Result\n",
    "print \"field strength is\",round(E/10**7,3),\"*10**7 V/m\"\n",
    "print \"total dipole moment is\",round(dm*10**12,1),\"*10**-12 Cm\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 6.5, Page number 6.36"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "capacitance is 226.3 *10**-12 farad\n",
      "parallel loss resistance is 10 mega ohm\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "d=0.08*10**-3;    #thickness(m)\n",
    "A=8*10**-4;    #area(m**2)\n",
    "epsilonr=2.56;\n",
    "epsilon0=8.84*10**-12;\n",
    "tan_delta=0.7*10**-4;\n",
    "new=10**6;    #frequency(Hz)\n",
    "\n",
    "#Calculation\n",
    "C=A*epsilon0*epsilonr/d;     #capacitance(farad)\n",
    "epsilonrdash=tan_delta*epsilonr;\n",
    "omega=2*math.pi*new;\n",
    "R=d/(epsilon0*epsilonrdash*omega*A);     #parallel loss resistance(ohm)\n",
    "\n",
    "#Result\n",
    "print \"capacitance is\",round(C*10**12,1),\"*10**-12 farad\"\n",
    "print \"parallel loss resistance is\",int(R/10**6),\"mega ohm\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 6.6, Page number 6.36"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the complex polarizability is (3.50379335033-0.0600074383321j) *10**-40 F-m**2\n",
      "answer cant be rouned off to 2 decimals as given in the textbook. Since it is a complex number and complex cant be converted to float\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "epsilonr=4.36;      #dielectric constant\n",
    "t=2.8*10**-2;       #loss tangent(t)\n",
    "N=4*10**28;         #number of electrons\n",
    "epsilon0=8.84*10**-12;      \n",
    "\n",
    "#Calculation\n",
    "epsilon_r = epsilonr*t;\n",
    "epsilonstar = (complex(epsilonr,-epsilon_r));\n",
    "alphastar = (epsilonstar-1)/(epsilonstar+2);\n",
    "alpha_star = 3*epsilon0*alphastar/N;             #complex polarizability(Fm**2)\n",
    "\n",
    "#Result\n",
    "print \"the complex polarizability is\",alpha_star*10**40,\"*10**-40 F-m**2\"\n",
    "print \"answer cant be rouned off to 2 decimals as given in the textbook. Since it is a complex number and complex cant be converted to float\""
   ]
  }
 ],
 "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}