{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 12: Superconductivity"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.1, Page 373"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import pi\n",
      "\n",
      "#Variable declaration\n",
      "Tc=7.26;#critical tempreture in kelvin\n",
      "H0=8*1e5/(4*pi);#magnetic field at 0K\n",
      "T=5;#tempreture in kelvin\n",
      "\n",
      "#Calculation\n",
      "Hc=H0*(1-(T/Tc)**2);#megnrtic field at 5K\n",
      "\n",
      "#Result\n",
      "print 'magnrtic field at 5K tempreture =%.2f*10^4 A/m'%(Hc/1e4)\n",
      "#Incorrect answer in the textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "magnrtic field at 5K tempreture =3.35*10^4 A/m\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.2, Page 373"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log\n",
      "\n",
      "#Variable declaration\n",
      "Tc=0.3;#given tempareture in kelvin\n",
      "thetad=300;\n",
      "\n",
      "#Calculations&Results\n",
      "#part a\n",
      "N0g=-1./(log(Tc/thetad));\n",
      "print 'the value of N0g is %.2f'%N0g\n",
      "#part b\n",
      "kB=1.38*1e-23;#boltzmann constant\n",
      "Eg=3.5*kB*Tc;#energy\n",
      "print 'energy is= %.2f*10^-23 J'%(Eg/1e-23)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the value of N0g is 0.14\n",
        "energy is= 1.45*10^-23 J\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.3, Page 374"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "H0=0.0306;#given constant characteristic of lead material\n",
      "Tc=3.7;#given tempareture in kelvin\n",
      "T=2;#given tempareture in kelvin\n",
      "\n",
      "#Calculations\n",
      "x=(T/Tc)*(T/Tc);\n",
      "Hc=H0*(1-x);#value of magnetic field at 2K temp\n",
      "\n",
      "#Result\n",
      "print 'value of magnetic field at 2K temp = %.4f T'%Hc\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of magnetic field at 2K temp = 0.0217 T\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.4, Page 374"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt,pi\n",
      "\n",
      "#Variable declaration\n",
      "HcT=2*1e5/(4*pi);#magnetic field intensity at T K\n",
      "Hc0=3*1e5/(4*pi);#magnetic field intensity at T=0K\n",
      "Tc=3.69;#given temperature in K\n",
      "\n",
      "#Calculation\n",
      "T=sqrt(1-(HcT/Hc0))*Tc;#tempreture in K\n",
      "\n",
      "#Result\n",
      "print 'temperature of superconducture is= %.2f K'%T\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "temperature of superconducture is= 2.13 K\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.5, Page 374"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import pi\n",
      "\n",
      "#Variable declaration\n",
      "H0=6.5*1e4;#given constant characteristic of lead material\n",
      "Tc=7.18;#given temprature in kelvin\n",
      "T=4.2;#given temprature in kelvin\n",
      "\n",
      "#Calculations&Results\n",
      "#part a\n",
      "x=(T/Tc)*(T/Tc);\n",
      "Hc=H0*(1-x);#value of magnetic field at 4.2K temp\n",
      "print 'value of magnetic field at 4.2K temp= %.2f*10^4 A/M'%(Hc/1e4)\n",
      "#part b\n",
      "r=1e-3;#given radius\n",
      "Ic=2*pi*r*Hc;#critical current\n",
      "print 'critical current is = %.1f A'%Ic  #Incorrect answer in the textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "value of magnetic field at 4.2K temp= 4.28*10^4 A/M\n",
        "critical current is = 268.7 A\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.6, Page 375"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "\n",
      "#Variable declaration\n",
      "lemdaT=750;#given penetration depth at T=3.5K\n",
      "Tc=4.22;#given critical tempreture\n",
      "T=3.5;##given temperature\n",
      "\n",
      "#Calculations&Results\n",
      "#part a\n",
      "x=(T/Tc)**4;#temporary variable\n",
      "lemda0=lemdaT/sqrt(1-x);#penetration depth at T=0K\n",
      "print 'penetration depth at T=0K is %.fA'%lemda0\n",
      "#part b\n",
      "N=6.02*1e26;#given\n",
      "alpha=13.55*1e3;#given\n",
      "M=200.6;#given\n",
      "n0=N*alpha/M;\n",
      "print 'molecular density = %.3f*10^28 /m^3'%(n0/1e28)\n",
      "ns=n0*(1-(T/Tc)**4);#superconducting electron density\n",
      "print 'superconducting electron density = %.3f*10^28 /m^3'%(ns/1e28)#Answer differs due to rounding-off values\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "penetration depth at T=0K is 1033A\n",
        "molecular density = 4.066*10^28 /m^3\n",
        "superconducting electron density = 2.142*10^28 /m^3\n"
       ]
      }
     ],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}