{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 6 Phase Equilibria"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6_1 pgno:385"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "From Equation (a) 2 mol of CuSO4.5H2O liberates 1 mol of I2,i.e. 2 equivalents.\n",
      "Hence the equlivalent weight of CuSO4.5H2O=mol.wt/1.\n",
      "\n",
      "From equation (b) the equivalent weight of CuSO4.5H2O is mol.wt/2 since 1mol of CuSO4.5H2O reacts with 2 mol of OH-,i.e 2 equivalents.\n",
      "\n",
      "Weight of CuSO4.5H2O in a litre of the solution=W=grams. 1.248\n",
      "\n",
      "Normality of the solution for (a)=Na= 0.005\n",
      "\n",
      "Normality of the solution for (b)=Nb= 0.01\n",
      "\n",
      "In the first case 1ml of the solution contains 5*10^-3equivalents or 5 equivalents of CuSO4.5H2O,\n",
      "and in the second case 1ml of the solution will contain 10m eq of CuSO4.5H2O.\n"
     ]
    }
   ],
   "source": [
    "MW=249.6;#molecular weight of CuSO4.5H2O in grams#\n",
    "w=0.3120;#weight of CuSO4.5H2O in grams#\n",
    "V=0.25;#volume of the solution in litres#\n",
    "print'From Equation (a) 2 mol of CuSO4.5H2O liberates 1 mol of I2,i.e. 2 equivalents.\\nHence the equlivalent weight of CuSO4.5H2O=mol.wt/1.'\n",
    "print'\\nFrom equation (b) the equivalent weight of CuSO4.5H2O is mol.wt/2 since 1mol of CuSO4.5H2O reacts with 2 mol of OH-,i.e 2 equivalents.'\n",
    "W=w/V;#weight of CuSO4.5H2O in one litre solution in grams#\n",
    "print'\\nWeight of CuSO4.5H2O in a litre of the solution=W=grams.',W\n",
    "Na=W/MW;#Normality of the solution for (a)#\n",
    "print'\\nNormality of the solution for (a)=Na=',Na\n",
    "Nb=W*2/MW;#Normality of the solution for (b)#\n",
    "print'\\nNormality of the solution for (b)=Nb=',Nb\n",
    "print'\\nIn the first case 1ml of the solution contains 5*10^-3equivalents or 5 equivalents of CuSO4.5H2O,\\nand in the second case 1ml of the solution will contain 10m eq of CuSO4.5H2O.'\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6_2 pgno:386"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Noramality or Strength of the Conc. acid=N=N 36.7222222222\n",
      "\n",
      "1 eq.per litre=0.5mol per litre in the case of H2SO4 since the eq.wt=0.5 the mol.wt.\n",
      "\n",
      " 6.6N soln=6.61 eq per litre=3.305mol per litre.\n",
      " Strength of the diluted solution=3.305M\n",
      "\n",
      "Wt of 180ml of conc.H2SO4=w=grams. 331.2\n",
      "\n",
      "This actually contains 6.61*49grams of H2SO4.\n",
      " percentage of H2SO4 by weight=97.8\n",
      "\n",
      "Wt of 1 litre of the diluted solution=W=grams  1198.0\n",
      "\n",
      "therefore Weight of water=WH2O=grams. 1529.2\n",
      "\n",
      "If the percent of H2SO4 by wt in the diluted solution is y.\n",
      "Wt of H2SO4 in 1litre of the diluted solution=49*6.61grams.so y value comes as 27.04percent\n",
      "\n",
      "Molality of the solution=M= 2.16126078996\n",
      "\n",
      "Mol of sulphuric acid is 329.9/98=3.305.\n",
      "Mol of water=874.1/18=48.561.\n",
      "Mol fraction of H2SO4=0.064.\n",
      "\n",
      "Mole fraction of water=mfH2O= 0.936\n"
     ]
    }
   ],
   "source": [
    "v=180.;#volume of conc. H2SO4 in ml#\n",
    "n=6.61;#Normality of the solution#\n",
    "N=1000*n/v;\n",
    "print'The Noramality or Strength of the Conc. acid=N=N',N\n",
    "print'\\n1 eq.per litre=0.5mol per litre in the case of H2SO4 since the eq.wt=0.5 the mol.wt.'\n",
    "print'\\n 6.6N soln=6.61 eq per litre=3.305mol per litre.\\n Strength of the diluted solution=3.305M'\n",
    "SG=1.84;#super gravity of Conc. H2SO4#\n",
    "w=SG*v;#weight of 180ml of conc. H2SO4 in grams#\n",
    "print'\\nWt of 180ml of conc.H2SO4=w=grams.',w\n",
    "print'\\nThis actually contains 6.61*49grams of H2SO4.\\n percentage of H2SO4 by weight=97.8'\n",
    "sg=1.198;#specific gravity of the diluted solution#\n",
    "V=1000;#volume of the diluted solution in ml#\n",
    "W=sg*V;#weight of one litre of the diluted solution in grams#\n",
    "print'\\nWt of 1 litre of the diluted solution=W=grams ',W\n",
    "WH2O=w+W;#weight of water in grams#\n",
    "print'\\ntherefore Weight of water=WH2O=grams.',WH2O\n",
    "print'\\nIf the percent of H2SO4 by wt in the diluted solution is y.\\nWt of H2SO4 in 1litre of the diluted solution=49*6.61grams.so y value comes as 27.04percent'\n",
    "M=3.305*1000/WH2O;#molality of the solution#\n",
    "print'\\nMolality of the solution=M=',M\n",
    "mf=0.064;#mole fraction of H2SO4#\n",
    "mfH2O=1-mf;#mole fraction of water#\n",
    "print'\\nMol of sulphuric acid is 329.9/98=3.305.\\nMol of water=874.1/18=48.561.\\nMol fraction of H2SO4=0.064.'\n",
    "print'\\nMole fraction of water=mfH2O=',mfH2O\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6_3 pgno:388"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Weight percent of N2 in air=b= 76.93\n",
      "\n",
      "Weight percent of O2 in air=a= 23.07\n"
     ]
    }
   ],
   "source": [
    "N2=79.2;#percentage of Nitrogen in air#\n",
    "O2=20.8;#percentage of Oxygen in air#\n",
    "b=76.93;#Weight percent of N2 in air#\n",
    "print'Weight percent of N2 in air=b=',b\n",
    "a=100-b;#weight percent of O2 in air#\n",
    "print'\\nWeight percent of O2 in air=a=',a\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6_4 pgno:390"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Absorption coefficient being the solubility of the gas at partial pressure of 1atm of the gas,\n",
      "The solubilities in mol per litre of the two gases are\n",
      "\n",
      "Solubility of N2=SN2==5.29*10^-4mol per litre. 0.000529017857143\n",
      "\n",
      "Solubility of O2=SO2==2.625*10^-4mol per litre 0.0002625\n",
      "\n",
      "The mole or Volume percent of O2= 33.16\n",
      "\n",
      "The mole or volume percent of N2= 66.84\n"
     ]
    }
   ],
   "source": [
    "N2=0.79;#partial pressure of Nitrogen in air#\n",
    "O2=0.21;#partial pressure of Oxygen in air#\n",
    "AN2=0.015;#Absorption coefficient of N2#\n",
    "AO2=0.028;#Absorption coefficient of O2#\n",
    "l=22.4;\n",
    "print'Absorption coefficient being the solubility of the gas at partial pressure of 1atm of the gas,\\nThe solubilities in mol per litre of the two gases are'\n",
    "SN2=N2*AN2/l;#solubility of N2#\n",
    "SO2=O2*AO2/l;#solubility of O2#\n",
    "print'\\nSolubility of N2=SN2==5.29*10^-4mol per litre.',SN2\n",
    "print'\\nSolubility of O2=SO2==2.625*10^-4mol per litre',SO2\n",
    "VO2=(SO2*100)/(SN2+SO2);\n",
    "print'\\nThe mole or Volume percent of O2=',round(VO2,2)\n",
    "VN2=100-VO2;\n",
    "print'\\nThe mole or volume percent of N2=',round(VN2,2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6_5 pgno:393"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Upon solving the equations PA=0.9atm,PB=0.3atm\n",
      "\n",
      "Composition of Vapour A in the mixture=yA= 0.6\n",
      "\n",
      "Composition of Vapour B in the mixture=yB= 0.4\n",
      "\n",
      "Total vapour pressure of the mixture=VP= 0.66\n"
     ]
    }
   ],
   "source": [
    "print'Upon solving the equations PA=0.9atm,PB=0.3atm'\n",
    "PA=0.9;#vapour pressure of A#\n",
    "PB=0.3;#Vapour pressure of B#\n",
    "xA=0.33;\n",
    "xB=0.66;\n",
    "yA=(xA*PA)/(xA*PA+xB*PB);\n",
    "print'\\nComposition of Vapour A in the mixture=yA=',yA\n",
    "yB=1-yA;\n",
    "print'\\nComposition of Vapour B in the mixture=yB=',yB\n",
    "VP=yA*PA+yB*PB;#total vapour pressure of the mixture#\n",
    "print'\\nTotal vapour pressure of the mixture=VP=',VP\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6_6 pgno:393"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Let PA and PB represent the vapour pressures of pure A and pure B respectively.\n",
      "\n",
      "From 1 mol of solution after distillation,we get 0.5mol of distillate and 0.5mol of residue.\n",
      "\n",
      "Vapour pressure of substance A=PA=900.00000mm of Hg\n",
      "\n",
      "Vapour pressure of substance B=PB=400.00000mm of Hg\n"
     ]
    }
   ],
   "source": [
    "yA=0.60;\n",
    "xA1=0.40;\n",
    "xA=0.5*yA+0.5*xA1;\n",
    "print'Let PA and PB represent the vapour pressures of pure A and pure B respectively.'\n",
    "print'\\nFrom 1 mol of solution after distillation,we get 0.5mol of distillate and 0.5mol of residue.'\n",
    "print'\\nVapour pressure of substance A=PA=900.00000mm of Hg'\n",
    "print'\\nVapour pressure of substance B=PB=400.00000mm of Hg'\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6_7 pgno:402"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Even though the boiling part of A might be higher,it distills out at a low temperature 95.3degrees.\n",
      "\n",
      "If A were to distill at 95.3degrees,the distillation will have to be carried out at a reduced pressure of about 119mm of mercury\n",
      "\n",
      "Molecular weight of A=MA=grams 157.071932773\n"
     ]
    }
   ],
   "source": [
    "wA=162.;\n",
    "wB=100.;\n",
    "VPB=641.;#vapour pressure of water#\n",
    "VPA=119.;#vapour pressure of oraganic substance#\n",
    "MB=18.;#Molecular weight of H2O#\n",
    "print'Even though the boiling part of A might be higher,it distills out at a low temperature 95.3degrees.'\n",
    "print'\\nIf A were to distill at 95.3degrees,the distillation will have to be carried out at a reduced pressure of about 119mm of mercury'\n",
    "MA=(wA*MB*VPB)/(wB*VPA);\n",
    "print'\\nMolecular weight of A=MA=grams',round(MA)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6_8 pgno:404"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wn=grams 1.563\n",
      "\n",
      "w0=grams 8.333\n",
      "\n",
      "It is seen that the first process leaves only 1.563grams of A with the aq. layer,\n",
      "whereas the secondone using all available solvent in a single lot leaves 8.333grams in aqueous layer.\n",
      "In the process (a)96.88percent of A is extracted,whereas in (b) only 83.67percent A is extracted.\n"
     ]
    }
   ],
   "source": [
    "w=50.;#weight of acid A in grams#\n",
    "x=1.;\n",
    "y=0.2;\n",
    "K=5.;\n",
    "n=5.;\n",
    "wn=w*(x/(x+K*y))**n;\n",
    "print'wn=grams',round(wn,3)\n",
    "y1=1;\n",
    "w0=w*(x/(x+K*y1));\n",
    "print'\\nw0=grams',round(w0,3)\n",
    "print'\\nIt is seen that the first process leaves only 1.563grams of A with the aq. layer,\\nwhereas the secondone using all available solvent in a single lot leaves 8.333grams in aqueous layer.\\nIn the process (a)96.88percent of A is extracted,whereas in (b) only 83.67percent A is extracted.'\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6_9 pgno:405"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Strength of NH3 in aq. layer=AS=N. 0.12768\n",
      "\n",
      "Strength of NH3 in org. layer=OS=N. 0.005005\n",
      "\n",
      "Equilibrium constant=K= 25.5104895105\n",
      "\n",
      "Normality of NH3 in aq. layer=AN1=N. 0.384\n",
      "\n",
      "Normality of NH3 in org. layer=ON1=N. 0.0112\n",
      "\n",
      "In the aq.layer NH3 includes the free ammonia(uncombined).\n",
      "NH3t and that which has combined with Cu2+ to form the complex ion NH3.\n",
      "\n",
      "NH3aq=NH3t+NH3combined.\n",
      "The value of NH3t can be obtained from the value of K.\n",
      "K=25.49=NH3t/NH3combined.\n",
      "\n",
      "Since nernsts law holds good for the same species present in both phases.\n",
      "NH3t==0.2855N. 0.285717482517\n",
      "\n",
      "NH3c=0.0985N 0.0982825174825\n",
      "\n",
      "0.025mol per litre of Cu2+ combines with 0.0985mol per litre of NH3.\n",
      "1 mol per litre of Cu2+ combines with 0.0985/0.025=3.936mol per litre of NH3.\n",
      "\n",
      "or 1mol of Cu2+ combines with 4mol of NH3,i.e the value of x is 4.\n",
      "The formula of the complex ion is thus (Cu(NH3)4)2+\n"
     ]
    }
   ],
   "source": [
    "AN=0.096;#normality of H2SO4 in aqua layer#\n",
    "ON=0.014;#normality of H2SO4 in org. layer#\n",
    "AV=13.3;#amount of H2SO4 required in aq. layer for neutralization#\n",
    "OV=7.15;#amount of H2SO4 requred in org. layer for neutralization#\n",
    "AS=AN*AV/10;#strength of NH3 in aq. layer#\n",
    "print'Strength of NH3 in aq. layer=AS=N.',AS\n",
    "OS=ON*OV/20;#strength of NH3 in org. layer#\n",
    "print'\\nStrength of NH3 in org. layer=OS=N.',OS\n",
    "K=AS/OS;#equilibrium constant#\n",
    "print'\\nEquilibrium constant=K=',K\n",
    "AV1=20.0;#amount of H2SO4 required in aq. layer at equilibrium#\n",
    "OV1=8.0;#amount of H2SO4 required in org. layer at equilibrium#\n",
    "AN1=AV1*AN/5;#Normality of NH3 in aq. layer#\n",
    "print'\\nNormality of NH3 in aq. layer=AN1=N.',AN1\n",
    "ON1=OV1*ON/10;#Normality of NH3 in org. layer#\n",
    "print'\\nNormality of NH3 in org. layer=ON1=N.',ON1\n",
    "print'\\nIn the aq.layer NH3 includes the free ammonia(uncombined).\\nNH3t and that which has combined with Cu2+ to form the complex ion NH3.'\n",
    "print'\\nNH3aq=NH3t+NH3combined.\\nThe value of NH3t can be obtained from the value of K.\\nK=25.49=NH3t/NH3combined.'\n",
    "NH3t=K*ON1;\n",
    "print'\\nSince nernsts law holds good for the same species present in both phases.\\nNH3t==0.2855N.',NH3t\n",
    "NH3c=AN1-NH3t\n",
    "print'\\nNH3c=0.0985N',NH3c\n",
    "print'\\n0.025mol per litre of Cu2+ combines with 0.0985mol per litre of NH3.\\n1 mol per litre of Cu2+ combines with 0.0985/0.025=3.936mol per litre of NH3.'\n",
    "print'\\nor 1mol of Cu2+ combines with 4mol of NH3,i.e the value of x is 4.\\nThe formula of the complex ion is thus (Cu(NH3)4)2+'\n"
   ]
  }
 ],
 "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
}
