{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# chapter8 :Superconductivity"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.1;page no:331"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.1,page no:331\n",
      "Magnetic Field at K in tesla: 0.0217\n",
      "Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\n"
     ]
    }
   ],
   "source": [
    "#cal of Magnetic field\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "H_c_0=  0.0306# Critical Field in tesla\n",
    "T_c = 3.7 # Critical temperature in kelvin\n",
    "T = 2 # Temperature in kelvin\n",
    "print(\"Example 8.1,page no:331\")\n",
    "H_c = H_c_0*(1-(T/T_c)**2) # Calculation of critical field\n",
    "print(\"Magnetic Field at K in tesla:\"),round(H_c,4)\n",
    "print(\"Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 8.2;page no:331"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.2,page no:331\n",
      "Magnetic Field at K in A/m: 63737.7049\n",
      "Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\n"
     ]
    }
   ],
   "source": [
    "#cal of Magnetic field\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "H_c=  3.3e4 # # Magnetic field in A/m\n",
    "T_c = 7.2 # Critical temperature in kelvin\n",
    "T = 5 # Temperature in kelvin\n",
    "print(\"Example 8.2,page no:331\")\n",
    "H_c_0 = H_c*(1-(T/T_c)**2)**(-1) # Calculation of critical field\n",
    "print(\"Magnetic Field at K in A/m:\"),round(H_c_0,4)\n",
    "print(\"Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# example 8.3;page no:332"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.3,page no:332\n",
      "Required temperature in K: 6.83\n",
      "Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\n"
     ]
    }
   ],
   "source": [
    "#cal of Required temperature\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "H_c_0= 1 # Let \n",
    "H_c= 0.1 * H_c_0 # Magnetic field in A/m\n",
    "T_c = 7.2 # Critical temperature in kelvin\n",
    "print(\"Example 8.3,page no:332\")\n",
    "T = T_c*math.sqrt(1- (H_c/H_c_0)) # Calculation of Temperature\n",
    "print(\"Required temperature in K:\"),round(T,2)\n",
    "print(\"Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 8.4;page no:332"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.4,page no:332\n",
      "Magnetic Field at  K in tesla: 0.053\n",
      "Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\n"
     ]
    }
   ],
   "source": [
    "#cal of magnetic field\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "H_c_0=  0.0803# Critical Field in tesla\n",
    "T_c = 7.2 # Critical temperature in kelvin\n",
    "T = 4.2 # Temperature in kelvin\n",
    "print(\"Example 8.4,page no:332\")\n",
    "H_c = H_c_0*(1-(T/T_c)**2) # Calculation of critical field\n",
    "print(\"Magnetic Field at  K in tesla:\"),round(H_c,4)\n",
    "print(\"Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\")\n",
    "# Answer in book is 0.0548 tesla"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 8.5;page no:333"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.5,page no:333\n",
      "Required temperature in K: 5.04\n",
      "Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\n"
     ]
    }
   ],
   "source": [
    "#cal of Required temperature\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "H_c_0= 1.5e5# Critical field in A/m \n",
    "H_c= 1.05e5 # Magnetic field in A/m\n",
    "T_c = 9.2 # Critical temperature in kelvin\n",
    "print (\"Example 8.5,page no:333\")\n",
    "T = T_c*math.sqrt(1- (H_c/H_c_0)) # Calculation of Temperature\n",
    "print(\"Required temperature in K:\"),round(T,2)\n",
    "print(\"Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 8.6;page no:333"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.6,page no:333\n",
      "Required temperature in K: 11.3\n",
      "Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\n"
     ]
    }
   ],
   "source": [
    "#cal of Required temperature\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "H_c_0= 2e5# Critical field in A/m \n",
    "H_c= 1e5 # Magnetic field in A/m\n",
    "T_c = 8 # Critical temperature  in kelvin\n",
    "print(\"Example 8.6,page no:333\")\n",
    "T = T_c/math.sqrt(1- (H_c/H_c_0)) # Calculation of Temperature\n",
    "print(\"Required temperature in K:\"),round(T,1)\n",
    "print(\"Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 8.7;page no:334"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.7,page no:334\n",
      "Required temperature in K: 7.08\n",
      "Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\n"
     ]
    }
   ],
   "source": [
    "#cal of Required temperature\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "H_c_0= 8e5# Critical field in A/m \n",
    "H_c= 4e4 # Magnetic field in A/m\n",
    "T_c = 7.26 # Critical temperature in kelvin\n",
    "print(\"Example 8.7,page no:334\")\n",
    "T = T_c*math.sqrt(1- (H_c/H_c_0)) # Calculation of Temperature\n",
    "print(\"Required temperature in K:\"),round(T,2)\n",
    "print(\"Standard formula used H_c = H_c_0*(1-(T/T_c)^2).\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 8.8;page no:335"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.8,page no:335\n",
      "Transition temperature in K: 14.5\n",
      "Critical field at K in T: 4.2 2.731\n",
      "Critical field at 0 K is T:\n",
      "Standard formula used Hc_T = H_c_0*(1-(T/T_c)^2)= 2.5\n"
     ]
    }
   ],
   "source": [
    "#cal of Critical field \n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "T1 = 14. # Temp in K\n",
    "T2 = 13. # Temp in K\n",
    "T = 4.2 # Temp in K\n",
    "Hc_T1 = 0.176 # Critical field at Temp T1\n",
    "Hc_T2 = 0.528 # Critical field at Temp T2\n",
    "print(\"Example 8.8,page no:335\")\n",
    "T_c = math.sqrt((T1**2*(Hc_T2/Hc_T1)- T2**2) /(Hc_T2/Hc_T1 - 1)) # Calculation of transition temperature\n",
    "t_c = (T_c*10)/10 # Rounding off two two decimal places\n",
    "Hc_0 = Hc_T1/(1-(T1/t_c)**2) # Calculation of critical field\n",
    "Hc_T = Hc_0*(1-(T/t_c)**2) # Calculation of critical field \n",
    "print(\"Transition temperature in K:\"),round(t_c,1)\n",
    "print(\"Critical field at K in T:\"),round(T,1),round(Hc_0,3)\n",
    "print(\"Critical field at 0 K is T:\")\n",
    "print(\"Standard formula used Hc_T = H_c_0*(1-(T/T_c)^2)=\"),round(Hc_T,2)\n",
    "# Answer in book is 2.588 T for 0 K and 2.37 for 4.2 K"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 8.9;page no:343"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.9,page no:343\n",
      "Penetration depth at K in angestrom: 532.0\n",
      "Penetration depth at  K in angestrom: 535.31\n",
      "Standard formula used lambda_0 = sqrt(m_0/(mu_0*eta_s*e**2)).\n"
     ]
    }
   ],
   "source": [
    "#cal of Penetration depth\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "m_0 = 9.1e-31 # Mass of electron in kg\n",
    "mu_0 = 12.56e-7# SI\n",
    "e = 1.6e-19 # Charge on electron in coulomb\n",
    "eta_s = 1e28 # superelectron density in  no. per cube\n",
    "T_1 = 0. # First temp in kelvin\n",
    "T_2 = 1. # Second temp in kelvin\n",
    "T_c = 3. # Critical temp in kelvin\n",
    "print(\"Example 8.9,page no:343\")\n",
    "lamda_0 = math.sqrt(m_0/(mu_0*eta_s*e**2))# Calculation of penetration depth at 0K\n",
    "lamda_t = lamda_0/math.sqrt(1-(T_2/T_c)**4) # Calculation of penetration depth at 2K\n",
    "print(\"Penetration depth at K in angestrom:\"),round(lamda_0*1e10,0)\n",
    "print(\"Penetration depth at  K in angestrom:\"),round(lamda_t*1e10,2)\n",
    "print(\"Standard formula used lambda_0 = sqrt(m_0/(mu_0*eta_s*e**2)).\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## example 8.10;page no:344"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 8.10,page no:344\n",
      "Penetration depth at 0 K in angstrom: 527.96\n",
      "Standard formula used lamda_0 = lamda_t*sqrt(1-(T_1/T_c)**4).\n"
     ]
    }
   ],
   "source": [
    "#cal of Penetration depth\n",
    "#intiation of all variables \n",
    "#Given that\n",
    "import math\n",
    "T_1 = 3.5 # Temperature in kelvin\n",
    "T_c = 4.153 # Critical temp in kelvin\n",
    "lamda_t = 750 # Penetration depth at T_1 in angstrom\n",
    "print(\"Example 8.10,page no:344\")\n",
    "lamda_0 = lamda_t*math.sqrt(1-(T_1/T_c)**4) # Calculation of penetration depth at 3.5K\n",
    "print(\"Penetration depth at 0 K in angstrom:\"),round(lamda_0,2)\n",
    "print(\"Standard formula used lamda_0 = lamda_t*sqrt(1-(T_1/T_c)**4).\")"
   ]
  }
 ],
 "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.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
