diff options
author | Trupti Kini | 2016-06-18 23:30:31 +0600 |
---|---|---|
committer | Trupti Kini | 2016-06-18 23:30:31 +0600 |
commit | 35e76350164a52f6ca9654e60b9e6fcc9e843293 (patch) | |
tree | 56346e5ae6ad964650bb868ac3118ca02101aab9 | |
parent | 567954f0f9089a76901da46619e67bcaa8eaf0d4 (diff) | |
download | Python-Textbook-Companions-35e76350164a52f6ca9654e60b9e6fcc9e843293.tar.gz Python-Textbook-Companions-35e76350164a52f6ca9654e60b9e6fcc9e843293.tar.bz2 Python-Textbook-Companions-35e76350164a52f6ca9654e60b9e6fcc9e843293.zip |
Added(A)/Deleted(D) following books
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter10.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter11.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter12.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter13.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter14.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter15.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter16.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter2.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter3.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter4.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter5.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter6.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter7.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter8.ipynb
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2correlationCoeff.png
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2expansionofSignal.png
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2timeInvertedsignal.png
A PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-2-Molecular_Diffusion_-_Principles_of_Mass_Transfer_and_Separation_Process_by_Binay_K_Dutta_1.ipynb
A PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-3-Convective_Mass_Transfer_and_Mass_Transfer_Coefficient_1.ipynb
A PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-4-Interphase_Mass_Transfer_1.ipynb
A PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-5-Gas-Liquid_Contacting_Equipment_1.ipynb
A PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter2_example_2.3_plot_1.png
A PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter2_example_2.4_plot_1.png
A PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter4_example_4.5_plot_1.png
A "sample_notebooks/PRAVEENKUMAR C/CHAPTER_1.ipynb"
25 files changed, 5014 insertions, 0 deletions
diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter10.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter10.ipynb new file mode 100644 index 00000000..50dcaed0 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter10.ipynb @@ -0,0 +1,386 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10 : Introduction to theory of probability" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 437 Ex 10.1" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability of each outcome=0.12\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# referred to fig 10.1 on the page no. 435\n", + "# the occurance of each outcome is essumed to be equal.\n", + "n=8 # number of outcomes\n", + "p=1/n#\n", + "print \"probability of each outcome=%0.2f\"%p" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 438 Ex no 10.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability = 0.1667\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "m=6 # enter the number of faces \n", + "n=2# enter the number of dice \n", + "l=m**n ## total number of outcomes = 36\n", + "a=7 #\"enter the number which is to be obtained as the sum of dice\n", + "c=0 # # counter value for favorable outcome\n", + "for i in range(1,7):\n", + " for j in range(1,7):\n", + " if (i+j==a):\n", + " c=c+1#\n", + " else :\n", + " continue\n", + " \n", + " \n", + "\n", + "p=c/l#\n", + "print \"probability = %0.4f\"%p\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 438 Ex no 10.4" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability = 0.4075\n" + ] + } + ], + "source": [ + "from numpy.random import gamma\n", + "from __future__ import division\n", + "m=2# the number of faces \n", + "n=4 #the number of tosses\n", + "l=m**n ## l is total number of outcomes = 16\n", + "a=2 #exact no of heads\n", + "p=gamma (n+1)/(gamma(n+1-a) * gamma (a+1))## to find combination\n", + "print \"probability = %0.4f\"%(p/l)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 440 Ex no 10.5" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "total probability = 0.0023\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "a=52# # total no of cards in a deck\n", + "b=6# the no of cards to be drawn\n", + "pA1= b/a## probability of getting first red ace =pA1\n", + "#the cards are drawn in succession without replacement, therefore the probability that the 2nd card will be the red ace = pA2\n", + "pA2=1/(a-1)#\n", + "p= pA1*pA2\n", + "print \"total probability = %0.4f\"%p" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 441 Ex no 10.6" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability = 1.04e-10\n" + ] + } + ], + "source": [ + "from numpy.random import gamma\n", + "from __future__ import division\n", + "\n", + "# This problem is based on Bernoulli Trials formula which is P( k successes in n trials ) = n!*p**k *(1-p)**(n-k)/k!*(n-k)!22\n", + "# hence the probability of finding 2 digits wrong in a sequence of 8 digits is\n", + "\n", + "k=2 # no. of successes\n", + "p= 1e-5# probability of success\n", + "n=8 #\"no. of trials\n", + "A=gamma (n+1)* (p**k)*((1-p)**(n-k))/(gamma(k)*gamma(n+1-k))#\n", + "print \"probability = %0.2e\"%A" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 446 Ex no 10.9" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability = 0.0231\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "m=6 # enter the number of faces\n", + "n=3 # enter the number of dice\n", + "l=m**n ## l is total number of outcomes \n", + "a=8# the number which is to be obtained as the sum of dice\n", + "c=0 # # counter value for favorable outcome\n", + "for i in range(1,7):\n", + " for j in range(1,7):\n", + " if(i+j==a):\n", + " c=c+1\n", + " else :\n", + " continue\n", + " \n", + "p=c/l#\n", + "print \"probability = %.4f\"%p\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 447 Ex no 10.10" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Py(1) = 0.5924\n", + "Py0=0.4076\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "Pe=0.6898 # error probability\n", + "Q= 0.2567 # the probability of transmitting 1 #Hence probability of transmitting zero is 1-Q = P\n", + "P=1-Q#\n", + "Px_1=Q#\n", + "Px0=P#\n", + "# If x and y are transmitted digit and received digit then for BSC P(y=0/x=1) = P(y=1/x=0) = Pe , P(y=0/x=10) = P(y=1/x=1) = 1-Pe\n", + "# to find the probability of receiving 1 is Py(1) = Px(0)*P(y=1/x=0) + Px(1)*P(y=1/x=1)\n", + "Py_1= ((1-Q)* Pe) + (Q *(1-Pe))#\n", + "print \"Py(1) = %0.4f\"%Py_1\n", + "Py0=((1-Q)*(1-Pe)) + (Q*Pe)\n", + "print \"Py0=%.4f\"%Py0" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 448 Ex 10.11" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability of error = 6.04e-05\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "Px0=.4\n", + "Px1=.6 \n", + "PE0=10**-6 \n", + "PE1=10**-4 ## given\n", + "PE=(Px0*PE0) + (Px1*PE1)# formula for probability of error\n", + "print \"probability of error = %.2e\"%PE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 472 Ex no 10.20" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "width or spread of Gaussian PDF = 0.986\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import pi,sqrt,exp\n", + "#Gaussian PDF: Q(x)= %e**((-x**2)/2)/ (x*sqrt(2*pi))\n", + "x=2.5 # input for the function Q \n", + "Q_x = (exp(-(x**2)/2))/ (x*sqrt(2*pi))\n", + "P=1-(2*Q_x)#\n", + "print \"width or spread of Gaussian PDF = %.3f\"%P\n", + "## P gives the width or spread of Gaussian PDF" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 479 Ex no 10.21" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SNR improvement = 12.90 dB\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log\n", + "# formula for estimate error E is E = mk** - mk = a1* mk-1 +a2* mk-2 -mk\n", + "#given: various values of correlation (mk*mk)'= (m**2)',(mk*mk-1)'= .825* (m**2)',(mk*mk-2)'= .562*(m**2)',(mk*mk-3)'= .825*(m**2)' , R02=.562(m**2)', a1=1.1314, a2= -0.3714\n", + "# mean square error is given by I=(E**2)'=[1-((.825*a1)+(.562*a2))]*(m**2)'= .2753*(m**2)'\n", + "\n", + "m=1#\n", + "I=.2753*(m**2)#\n", + "S=10*log ((m**2)/I)#\n", + "print \"SNR improvement = %0.2f dB\"%S" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter11.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter11.ipynb new file mode 100644 index 00000000..397d0367 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter11.ipynb @@ -0,0 +1,202 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11 : Random Processes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 500 Example 11.2" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "enter the value of T : 0.245\n", + "mean square value of the signal is 0.9995 Watt\n" + ] + } + ], + "source": [ + "from math import pi,sin\n", + "#given signal is Sx=(N/2)*rect(w/4(pi)B)\n", + "N=1#\n", + "B=1#\n", + "T=input(\"enter the value of T : \")\n", + "Rx=(N*B)*(sin(2*(pi)*B*T))#\n", + "print \"mean square value of the signal is %0.4f\"%Rx,\"Watt\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 501 Example 11.3" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "enter the value of wct : .165\n", + "mean square value of the process is 1.9728 Watt\n" + ] + } + ], + "source": [ + "from math import cos\n", + "# autocorrelation function of given signal is A**2/2 * cos(wct)\n", + "A=2#\n", + "wct=input(\"enter the value of wct : \")\n", + "Rx=((A**2)/2)* cos(wct)#\n", + "print \"mean square value of the process is %.4f\"%Rx,\"Watt\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 506 Example 11.7" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "enter prob of symbol 1 : .75\n", + "enter prob of symbol -1 : .21\n", + "mean is 0.54\n", + "mean square is 0.96\n" + ] + } + ], + "source": [ + "P1=input(\"enter prob of symbol 1 : \")\n", + "P2=input(\"enter prob of symbol -1 : \")\n", + "ak=(1)*P1+(-1)*P2#\n", + "print \"mean is\",ak\n", + "Ro=(1**2)*P1+((-1)**2)*P2#\n", + "print \"mean square is\",Ro" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 507 Example 11.8a " + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "enter prob of symbol 1 : 0.215\n", + "enter prob of symbol 0 : .314\n", + "mean is 0.215\n", + "mean square is 0.215\n" + ] + } + ], + "source": [ + "P1=input(\"enter prob of symbol 1 : \")\n", + "P0=input(\"enter prob of symbol 0 : \")\n", + "ak=(1)*P1+(0)*P2#\n", + "print \"mean is\",ak\n", + "Ro=(1**2)*P1+((0)**2)*P2#\n", + "print \"mean square is\",Ro" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 508 Example 11.8b" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "enter prob of symbol 0 : .25\n", + "enter prob of symbol 1 : .35\n", + "enter prob of symbol -1 : .45\n", + "mean is -0.1\n", + "mean square is 0.8\n" + ] + } + ], + "source": [ + "# bipolar signalling\n", + "P0=input(\"enter prob of symbol 0 : \")\n", + "P1=input(\"enter prob of symbol 1 : \")\n", + "P2=input(\"enter prob of symbol -1 : \")\n", + "ak=(0)*P0+(1)*P1+(-1)*P2#\n", + "print \"mean is\",ak\n", + "Ro=(0**2)*P0+(1**2)*P1+((-1)**2)*P2#\n", + "print \"mean square is\",Ro" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter12.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter12.ipynb new file mode 100644 index 00000000..2b302a6e --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter12.ipynb @@ -0,0 +1,406 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12 : Behaviour of analog systems in the presence of noise " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 536 Example 12.1" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "output SNR = 78.36 dB\n" + ] + } + ], + "source": [ + "from math import pi,log\n", + "from sympy.mpmath import quad\n", + "# Let the received signal be km(t)cos(wct) , demodulator input is [km(t)+nc(t)]cos(wct)+[ns(t)sin(wct)]. When this is multiplied by 2coswct and low pass filtered the output is s0(t)+n0(t)=km(t)+nc(t).\n", + "# Hence So=k**2*m**2' , No=nc**2'. But the power of the received signal km(t)cos(wct)= 1uW. Hence k**2*m**2'/2=10**-6\n", + "So=2*10**-6#\n", + "# to compute nc: (nc**2)'=(n**2)'=x\n", + "t0=496000.#\n", + "t1=504000. #\n", + "a=10**6 * pi#\n", + "y=quad (lambda t:1/((t**2)+(a**2)),[t0,t1])\n", + "# to compute output SNR\n", + "SNR=So/y#\n", + "val=(10.*(log (SNR)))#\n", + "print \"output SNR = %0.2f dB\"%val" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 540 Problem 12.2" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gamma threshold : 13.8155\n" + ] + } + ], + "source": [ + "from math import log,exp\n", + "#as En=sqrt(nc**2+ns**2),where both nc and ns are gaussian with variance 6n**2,according to the following eqn P(En>=A)=integrate(En/6n**2)*e**(-En**2/2*6n**2)dEn#\n", + "# the value of this integral is the probability of which is 0.01\n", + "#hence e**(-A**2/2*6n**2)=0.01\n", + "#let g=A**2/(2*6n**2)#\n", + "g=-(log(0.01)/log(exp(1)))#\n", + "# the variance 6n**2 of the bandpass noise of PSD N/2 and the bandwidth 2B is 2NB.Hence at the onset of the threshold\n", + "# therefore A**2/(2*6n**2)=A**2/(4NB)=g\n", + "#for tone modulation\n", + "#Si=A**2+m'**2/2#\n", + "#Si=3*A**2/4#\n", + "gma_th=3*(g)## gma_th=Si/NB=3*A**2/(4NB)#\n", + "print 'gamma threshold : %0.4f'%gma_th" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 547 Problem 12.3" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SIGNAL TO NOISE RATIO : 0.0053\n" + ] + } + ], + "source": [ + "# for a gaussian m(t),mp will be assumed as 36m\n", + "Sg=3##assumed\n", + "Mbar=(Sg**2)#\n", + "MP=((3.*Sg)**2)#\n", + "B=0.2##ASSUMED\n", + "gma=0.4##assumed\n", + "SNR=3.*B**2*(Mbar/MP)*gma#\n", + "print 'SIGNAL TO NOISE RATIO : %0.4f'%SNR" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 550 Problem 12.4" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of Bm : 8.3333\n" + ] + } + ], + "source": [ + "from sympy.mpmath import quad\n", + "t0=-5#\n", + "t1=5#\n", + "y=quad(lambda t:t**2,[t0,t1])#\n", + "f=quad(lambda t:1,[t0,t1])\n", + "Bm=y/f#\n", + "print 'value of Bm : %0.4f'%Bm" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 550 Problem 12.5" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Bm2 : 3.0\n" + ] + } + ], + "source": [ + "from sympy.mpmath import quad\n", + "from math import exp\n", + "# Sm(w)=k*e**(-w2/26**2) this is given\n", + "# let us the assume the value of constant 6**2/4(pi**2) =3\n", + "# thus the variance can be calculated as\n", + "f0=0#\n", + "f1=15#\n", + "y=quad(lambda f:(f**2)*(exp(-(f**2)/6)),[f0,f1])\n", + "g=quad(lambda f:exp(-(f**2)/6),[f0,f1])#\n", + "v=y/g#\n", + "print 'Bm2 : ',v" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 552 Prob 12.6" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "factor of superiority of PM over FM : 3.0\n" + ] + } + ], + "source": [ + "from sympy.mpmath import quad\n", + "from math import exp,pi\n", + "#for the same transmission bandwidth variance of PM and FM systems is same\n", + "#hence the ratio of SNR of PM to FM is B**2/(3Bm'**2)\n", + "#assuming 6=1\n", + "B=3/(2*pi)##because W=2*pi*B\n", + "#variance is Bm2\n", + "f0=0#\n", + "f1=15.#\n", + "y=quad(lambda f:(f**2)*(exp(-(f**2)*2*(pi**2))),[f0,f1])\n", + "g=quad(lambda f:exp(-(f**2)*2*(pi**2)),[f0,f1])\n", + "Bm2=y/g#\n", + "l=(B**2)/(3*(Bm2))#\n", + "print 'factor of superiority of PM over FM : ',l" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 555 Example 12.7" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "threshold SNR = 300.00 \n", + "Threshold SNR = -104.68 dB \n", + "system is not in threshold\n" + ] + } + ], + "source": [ + "from math import log\n", + "B=4# SNR=20.5# # given\n", + "r=20*(B+1)##as B=4\n", + "#output SNR is given as So/No=3*B**2*r*(m**2'/mp**2)\n", + "m=4.# m=mp/6m is given\n", + "SNRt=3*(B**2)*r*(1/m)**2#\n", + "print \"threshold SNR = %0.2f \"%SNRt\n", + "# to calculate output SNR in dB\n", + "SNRdB=20*log(SNR)#\n", + "print \"Threshold SNR = %0.2f dB \"%SNRdB\n", + "if 20.5<SNRdB:\n", + " print \"system is in threshold\"\n", + "else: \n", + " print 'system is not in threshold'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 561 Prob 12.8" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SNR is equal : 21845.33\n", + "SNR = 43.394 dB\n" + ] + } + ], + "source": [ + "from math import log10\n", + "#for a gausssian signal,mp=infinity(00),but we may assume 36 loading,thus mp=3*6,\n", + "Sgm=3.#\n", + "m2=(Sgm**2)#\n", + "mp2=((3*Sgm)**2)#\n", + "y=(m2)/(mp2)#\n", + "# to calculate SNR,we have SNR=3(2**n)*((m**2)/(mp**2)) \n", + "n=8##given\n", + "l=3*(2**(2*n))*y##by formula\n", + "print 'SNR is equal : %0.2f'%l\n", + "print 'SNR = %0.3f dB'%(10*(log10(l)))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 567 Prob 12.10" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "value of |m| : 0.80\n" + ] + } + ], + "source": [ + "from math import pi,sqrt,exp\n", + "from sympy.mpmath import quad\n", + "# to calculate |m|\n", + "m0=0#\n", + "m1=50.#\n", + "m=quad(lambda m:(m*(exp(-(m**2)/2.))),[m0,m1])##assuming 6m=1\n", + "print 'value of |m| : %0.2f'%(sqrt(2/pi)*m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 569 Prob 12.11" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "transmitted power : 1.01e-04\n", + "SNR without pre-emphasis and de-emphasis : 2.53e-08\n", + "S is 2.44e+00\n", + "SNR at the output : 3.31e-08\n", + "Improvement factor in SNR with pre-emphasis and de-emphasis : 1.31\n" + ] + } + ], + "source": [ + "from math import pi,sqrt\n", + "from sympy.mpmath import quad\n", + "a=1400.*pi##given\n", + "c=1.##assumed\n", + "w0=0\n", + "w1=8000.*pi#\n", + "S=quad(lambda w:1/((w**2)+(a**2)),[w0,w1])\n", + "So=S/pi#\n", + "print 'transmitted power : %0.2e'%So##assuming G=1,hence St=So\n", + "#assuming N=1\n", + "No=4000.##because No=N*B\n", + "SNR=So/No#\n", + "print 'SNR without pre-emphasis and de-emphasis : %0.2e'%SNR\n", + "S=quad(lambda w:1/(sqrt((w**2)+(a**2))),[w0,w1])#\n", + "print 'S is %0.2e'%S\n", + "SNRo=(10**-8)*4*(pi**2)/(2*(S**2))#\n", + "print 'SNR at the output : %0.2e'%SNRo\n", + "print 'Improvement factor in SNR with pre-emphasis and de-emphasis : %0.2f'%(SNRo/SNR)" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter13.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter13.ipynb new file mode 100644 index 00000000..35729415 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter13.ipynb @@ -0,0 +1,102 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 13 : Behaviour of digital communication systems in the presence of noise " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 620 prob no 13.1" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "signal power required at the receiver = 0.47 Watts\n", + "Bandwidth is = 2080000.00 Hertz\n", + "signal power required at the receiver= 10.38 Watts\n", + "Bandwidth is = 520000.00 Hertz\n", + "signal power required at the receiver = 2.87 Watts\n", + "Bandwidth is = 1040000.00 Hertz\n" + ] + } + ], + "source": [ + "from math import log\n", + "\n", + "def log2(x):\n", + " y=log(x,2)\n", + " return y\n", + "\n", + "#Determinaion of the transmission bandwidth and the signal power required at the receiver input for i)Binary ii)16-ary ASK iii)16-ary PSK\n", + "#given Rb=2.08*10**6,Pb<=10**-6\n", + "\n", + "#i)for BINARY we have to consider Pb=Pe=10**-6=Q(sqrt(2Eb/N)). This yields Eb/N=11.35. \n", + "#SIgnal power is given by Si=Eb*Rb=11.35*N*Rb\n", + "N=2*10**-8##for binary. Channel noise PSD=10**-8\n", + "Rb=2.08*10**6#\n", + "Si1=11.35*N*Rb#\n", + "print \"signal power required at the receiver = %0.2f Watts\"%Si1\n", + "Bt1=Rb## Bandwidth for baseband pulses\n", + "print \"Bandwidth is = %0.2f Hertz\"%Bt1\n", + "\n", + "#ii)for 16-ary ASK we have to consider Pb=10**-6=Pem/log2(16)\n", + "# therefore Pem is given as Pem=Pb*log2(16)\n", + "Pb=10**-6#\n", + "Pem=Pb*log2(16)#\n", + "#'Pem' is also given as Pem=2(M-1/M)*Q*sqrt(6Eb*log2(16)/(N(M**2-1)))\n", + "M=16## for 16-array ASk\n", + "# By using above formula for 'Pem' , we can calculate the value of Eb,which is come out to be equal to 0.499*10**-5#\n", + "Eb=0.499*10**-5## if the M-ary pulse rate is RM =Rb/4 then\n", + "RM =Rb/4# \n", + "Si2=Eb*(log2(M))*RM#\n", + "print \"signal power required at the receiver= %0.2f Watts\"%Si2\n", + "Bt2=RM##transmission bandwith\n", + "print \"Bandwidth is = %0.2f Hertz\"%Bt2\n", + "\n", + "#iii) for 16-array PSK we have to consider Pem=4*Pb. This is approximately equal to 2*Q(sqrt(2*pi**2*Eb*log2(16))/256*N). This yields \n", + "Eb= 137.8*10**-8#\n", + "Si3=Eb*log2(16)*RM#\n", + "print \"signal power required at the receiver = %0.2f Watts\"%Si3\n", + "Bt3=RM##normally \n", + "#But for PSK, as it is a modulated signal the required bandwidth is 2Bt3.\n", + "Bpsk=2*(Bt3)#\n", + "print \"Bandwidth is = %0.2f Hertz\"%Bpsk" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter14.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter14.ipynb new file mode 100644 index 00000000..897627d8 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter14.ipynb @@ -0,0 +1,158 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14 : Optimum signal detection" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 631 Prob 14.1" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEZCAYAAABrUHmEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHEFJREFUeJzt3Xu4XXV54PHvCwS5ymWAREG5KLYQhgRQ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+forvl7rOkYYkqTTXNCRJpZk0JEmlmTQkSaWZNCRJpZk0JEmlmTQkSaWZ\nNCRJpZk0JEml/X8INyw9vPLgcwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7f06e3c30650>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "from numpy import arange\n", + "%matplotlib inline\n", + "from matplotlib.pyplot import plot,show,title,xlabel,ylabel\n", + "\n", + "# the co-ordinates of the vectors are \n", + "# s1(1,-0.5),s2=(-0.5,1),s3=(0,-1),s4=(0.5,1)\n", + "x4=arange(0,0.6,0.1)\n", + "y4=[]\n", + "for x in x4:y4.append(2*x)\n", + "\n", + "plot(x4,y4) # blue line\n", + "x1=arange(0,1.1,0.1)\n", + "y1=[]\n", + "for x in x1:y1.append(-0.5*x)\n", + "plot(x1,y1) #green line\n", + "title(\"x4 Vs y4 & x1 Vs y1\")\n", + "xlabel(\"x --->\")\n", + "ylabel(\"y --->\")\n", + "show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no. 650 problem no. 14.2" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability of symbol m1 is 0.168\n", + "probability of symbol m2 is0.245\n", + "the threshold is= 0.08 \n" + ] + } + ], + "source": [ + "from math import sqrt,log\n", + "\n", + "# the two symbols to be transmitted are m1 and m2,the probabilities of which are not equal\n", + "# To design the optimum receiver we need to decide the threshold say d\n", + "# N be the given noise PSD,E the energy of the signal, assume N =1, E=1.5\n", + "Pm1=input(\"probability of symbol m1 is \")\n", + "Pm2=input(\"probability of symbol m2 is\")\n", + "#d is calculated as follows\n", + "N=1#\n", + "E=1.5#\n", + "d=(N/(4*sqrt(E)))*log(Pm2/Pm1)#\n", + "print \"the threshold is= %0.2f \"%d" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 665 Problem 14.7" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability of symbol m1 is0.25\n", + "probability of symbol m2 is0.35\n", + "mean energy of the first signal is 0.125000 units\n", + "mean energy of the second signal is 0.087500 units\n" + ] + } + ], + "source": [ + "# we know k1P(m1)=k2P(m2), where k1 and k2 are the distances of the signals s1 and s2 resp.,hence k1+k2=d\n", + "Pm1=input(\"probability of symbol m1 is\")\n", + "Pm2=input(\"probability of symbol m2 is\")\n", + "#assume d=1\n", + "d=1#\n", + "E1=(((Pm1)*((d**2)/2.))+((Pm2)*((d**2)/2)))#\n", + "print \"mean energy of the first signal is %f units\"%E1\n", + "E2=Pm1*Pm2*(d**2)#\n", + "print \"mean energy of the second signal is %f units\"%E2\n", + "if(E1==E2):\n", + " print \"signals are equiprobable\"#\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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter15.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter15.ipynb new file mode 100644 index 00000000..36b75c4e --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter15.ipynb @@ -0,0 +1,232 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 15 : Introduction to information theory" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 687 prob no 15.1" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "enter the length of probability vector p, n is4\n", + "Length = 0.94 4-ary digits\n", + "Entropy of source is, H = 0.72 4-ary units\n", + "Efficiency of code, N = 0.76 \n" + ] + } + ], + "source": [ + "from math import log\n", + "# Here we have given six messages. For 4-ary Huffman code, we need to add one dummy variable to satisfy the required condition of r+k(r-1) messages.Probabilities are given as p(1)=0.3# p(2)=0.25# p(3)=0.15# p(4)=0.12# p(5)=0.1# p(6)=0.08# p(7)=0.\n", + "\n", + "#The length L of this code is calculated as\n", + " \n", + "n=input(\"enter the length of probability vector p, n is\")\n", + "p=[.3, .25, .15, .12, .1, .08, 0]## enter probabilities in descending order\n", + "l=[1, 1, 1 ,2 ,2 ,2, 2]## code length of individual message according to order\n", + "L=0#\n", + "for i in range(0,n):\n", + " L=L+(p[(i)]*l[(i)])\n", + "\n", + "print \"Length = %0.2f \"%L,'4-ary digits'\n", + "\n", + "# Entropy of source is calculated as\n", + "H=0#\n", + "for i in range(0,n-1):#since the value of log(1/0) for the last entry is infinite which when multiply by 0 gives result as 0\n", + " H=H+(p[(i)]*log(1.0/p[(i)]))#\n", + "\n", + "H1=H/log(4)\n", + "print \"Entropy of source is, H = %0.2f \"%H1,'4-ary units'\n", + "\n", + "# Efficiency of code is given as \n", + "N=H1/L#\n", + "print \"Efficiency of code, N = %0.2f \"%N" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 688 Example no. 15.2" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Length = 1.00 \n", + "Entropy of source is, H = 0.72 bit\n", + "Efficiency of code, N = 0.72 \n", + "Length = 0.78 \n", + "Efficiency of code, N = 0.93 \n", + "Length = 0.73 \n", + "Efficiency of code, N = 0.99 \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# N=1\n", + "#Here we have given two messages with probabilities m1=0.8 and m2=0.2 . Therefore, Huffman code for the source is simply 0 and 1.\n", + "\n", + "#The length L of this code is calculated as\n", + "N=1#\n", + "p=[.8, .2]##enter probabilities in descending order\n", + "n=len(p)\n", + "l=[1, 1]##code length of individual message according to order\n", + "L=0#\n", + "for i in range(0,n):\n", + " L=L+(p[(i)]*l[(i)])#\n", + "\n", + "print \"Length = %0.2f \"%L\n", + "\n", + "# Entropy of source is calculated as\n", + "H=0#\n", + "for i in range(0,n):\n", + " H=H+(p[(i)]*log(1/p[(i)],2))\n", + "\n", + "print \"Entropy of source is, H = %0.2f bit\"%H\n", + "\n", + "# Efficiency of code is given as \n", + "N1=H/L#\n", + "print \"Efficiency of code, N = %0.2f \"%N1\n", + "\n", + "#for N=2\n", + "#There are four (2**N) combinations and their probabilities obtained by multiplying individuals probability.\n", + "#The length L of this code is calculated as\n", + "N=2#\n", + "p=[0.64, 0.16, 0.16, 0.04]##enter probabilities in descending order\n", + "n=len(p)#\n", + "l=[1 ,2 ,3 ,3]##code length of individual message according to order\n", + "L1=0#\n", + "for i in range(0,n):\n", + " L1=L1+(p[(i)]*l[(i)])#\n", + "\n", + "L=L1/N## word length per message\n", + "print \"Length = %0.2f \"%L\n", + "\n", + "# Efficiency of code is given as \n", + "N2=H/L#\n", + "print \"Efficiency of code, N = %0.2f \"%N2\n", + "\n", + "\n", + "#for N=3\n", + "#There are eight (2**N)combinations and their probabilities obtained by multiplying individuals probability\n", + "#The length L of this code is calculated as\n", + "N=3#\n", + "p=[.512, .128, .128, .128, .032, .032, .032, .008]##enter probabilities in descending order\n", + "n=len(p)#\n", + "l=[1, 3 ,3 ,3, 5, 5 ,5 ,5]##code length of individual message according to order\n", + "L1=0\n", + "for i in range(0,n):\n", + " L1=L1+(p[(i)]*l[(i)])#\n", + "\n", + "L=L1/N## word length per message\n", + "print \"Length = %0.2f \"%L\n", + "\n", + "# Efficiency of code is given as \n", + "N3=H/L#\n", + "print \"Efficiency of code, N = %0.2f \"%N3" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 702 prob no 15.4" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "entropy = 1.00 bits\n", + "entropy = 2.00 bits\n", + " if x and y have equal absolute entropies,their relative (differential) entropies must differ by 1 bit \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log\n", + "from sympy.mpmath import quad\n", + "\n", + "\n", + "x0=(-1)#\n", + "x1=1##given\n", + "y0=(-2)#\n", + "y1=2##given\n", + "G=2##gain of amplifier\n", + "#the probbilities are given as P(x)=1/2 for |x|<1 & P(y)=1/4 for |y<2| otherwise P(x)=P(y)=0.\n", + "#P(x<1 & -x<1)=1/2#\n", + "#P(y<2 & -y<2)=1/4#\n", + "# hence entropies are given as\n", + "g1=(1./2)*log(2,2)#\n", + "g2=(1./4)*log(4,2)# \n", + "X=quad(lambda x:g1*1,[x0,x1])\n", + "Y=quad(lambda y:g2*1,[y0,y1])\n", + "print \"entropy = %0.2f bits\"%X\n", + "print \"entropy = %0.2f bits\"%Y\n", + "#Here the entropy of random variable 'y' is twice that of the 'x'.This results may come as a surprise,since a knowledge of 'x' uniquely determines 'y' and vice versa , since y=2x.Hence , the average uncertainty of x and y should be identical.\n", + "# The reference entropy R1 for x is -log dx ,and The reference entropy R2 for y is -log dy (in the limit as dx,dy->0 ).\n", + "# R1= lim (dx->0) -log dx\n", + "#R2= lim (dy->0) -log dy\n", + "#and R1-R2 = lim(dx,dy->0) log(dx/dy) = log (dy/dx) = log2 2 =1 bit\n", + "#Therefore,the reference entropy of x is higher than the reference entropy for y. Hence we conclude that \n", + "print \" if x and y have equal absolute entropies,their relative (differential) entropies must differ by 1 bit \"" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter16.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter16.ipynb new file mode 100644 index 00000000..572bf36e --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter16.ipynb @@ -0,0 +1,136 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter16 : Error correcting codes" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 732 Example no 16.1" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "code words are given as\n", + "[[1 1 1 0 0 0]]\n", + "[[1 1 0 1 1 0]]\n", + "[[1 0 1 0 1 1]]\n", + "[[1 0 0 1 0 1]]\n", + "[[0 1 1 1 0 1]]\n", + "[[0 1 0 0 1 1]]\n", + "[[0 0 1 1 1 0]]\n", + "[[0 0 0 0 0 0]]\n" + ] + } + ], + "source": [ + "from numpy import mat,shape\n", + "\n", + "#here generator matrix is given\n", + "G=mat([[1, 0, 0, 1 ,0 ,1],[0, 1, 0, 0, 1, 1],[0, 0, 1, 1, 1, 0]])\n", + "d1=mat([[1, 1, 1]])\n", + "d2=mat([[1, 1, 0]])\n", + "d3=mat([[1, 0, 1]])\n", + "d4=mat([[1, 0, 0]])\n", + "d5=mat([[0, 1, 1]])\n", + "d6=mat([[0, 1, 0]])\n", + "d7=mat([[0, 0, 1]])\n", + "d8=mat([[0, 0 ,0]])\n", + "c1=d1*G\n", + "\n", + "for i in range(0,6):\n", + " if c1[0,i]==2:\n", + " c1[0,i]=0\n", + " \n", + "\n", + "c2=d2*G#\n", + "for i in range(0,6):\n", + " if c2[0,i]==2:\n", + " c2[0,i]=0\n", + " \n", + "\n", + "c3=d3*G#\n", + "for i in range(0,6):\n", + " if c3[0,i]==2:\n", + " c3[0,i]=0\n", + " \n", + " \n", + "c4=d4*G#\n", + "for i in range(0,6):\n", + " if c4[0,i]==2:\n", + " c4[0,i]=0\n", + " \n", + "\n", + "c5=d5*G#\n", + "for i in range(0,6):\n", + " if c5[0,i]==2:\n", + " c5[0,i]=0#\n", + " \n", + "\n", + "c6=d6*G#\n", + "for i in range(0,6):\n", + " if c6[0,i]==2:\n", + " c6[0,i]=0#\n", + " \n", + "\n", + "c7=d7*G#\n", + "for i in range(0,6):\n", + " if c7[0,i]==2:\n", + " c7[0,i]=0#\n", + " \n", + "\n", + "c8=d8*G#\n", + "for i in range(0,6):\n", + " if c8[0,i]==2:\n", + " c8[0,i]=0#\n", + " \n", + "\n", + "print \"code words are given as\"\n", + "print c1\n", + "print c2\n", + "\n", + "print c3\n", + "print c4\n", + "print c5\n", + "print c6\n", + "print c7\n", + "print c8" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter2.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter2.ipynb new file mode 100644 index 00000000..b45b8a06 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter2.ipynb @@ -0,0 +1,498 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter2 : Introduction to signals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 17 Prob 2.1 b" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "power of signal: 0.333 Watt\n" + ] + } + ], + "source": [ + "from sympy.mpmath import quad\n", + "\n", + "t0=-1\n", + "t1=1\n", + "y=quad(lambda t:t**2,[t0,t1])\n", + "print 'power of signal: %0.3f'%(y/2),\"Watt\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no.26 Exa no.2.3b" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAACQCAYAAADtPxvDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHIpJREFUeJztnXvUHFWVt59fIAmXACEDBEIikTGRRLzAMElEkVfyjRMC\nSQaXF4gMBFGz+JAZHQeQASYBxg9QGYHhfhFBkKiATAKBEYF4WUoYxlzABCEfRkgiQSRkgDhczJ4/\n6nRS6bcv1V3V3dXV+1nrXW931zn77Kr+nd2nTu2qIzPDcRzHKSYDOu2A4ziO0zo8yDuO4xQYD/KO\n4zgFxoO84zhOgfEg7ziOU2A8yDuO4xQYD/IZIOlqSedkXbaOndGSNktq6DuUdJak69O2n6CdWZJ+\n2up2nHzSLp1VaPcYSc9JekXSexuol0m/TNDOXEnfbnU727TpefLdiaTRwDPA9ma2ubPe9EfSLOBk\nMzus0744vYOk/w98wcwWdNqXSkiaA7zDzP62XW36SD4ljY6kHcdpDZIEvA1Y0WlfaqB2N+gBqgKS\nxklaJGmDpCckTYtt+1Y4tVso6VXgw+GzC2JlzpC0TtIaSZ8J0yr7x+pfEF73hTL/IGl9qDMrZuco\nSUskbZT0bBgFJN2HM4Pt/5b0pKQjwufbnC5KOkHSbyW9KOkcSavLyn5P0s3BzhOS/iJW98uSVoVt\nv5L0N80cbycZkkZIulPSC5KekXRa+HxYmKI4OrwfEr6X48P7b0m6RtIPw3e1SNLbYnYvC/raKOkx\nSR+MbaungaQ6mx40skHSw5IOiG1bLelL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10a9fteAD41QV6ftQtJA4E7gVjPrdx9GI5jZRkn3AocAi8q3dyq7Zkzs7QxgSYVijwFjJI2WNAj4\nJNFNKiUbU4DTgRlm9j9V2ql5w0oSG/X8KG+yGT+S2EjgR7M38NyXYP/mAyeEepOAl2NTQ0l8Q9Jw\nhegiaQJR+m4jwbWeD3XJwIdmuRs4IrQ7FhhUHuDrEX64SxxDgzdemdkTZjbczN5uZm8nCm4Hlwf4\nBH4k6bv1bCTpd4nNNVC2kb7cMoIGbwRWmNmlTdrYozRlJ2lHoovZlb+LRq/oZvFHdIryONHV7TuB\nvcLnI4B7Y+WOJLryvAo4q8zG08Bvw44tAa4qt0F0Srw0/D3RjI0EfhxDNBXzR+B54L4m/KhrI4Ef\nw4AfAU8BPwSGJvWjkl1gNjA7Zv+KsH0ZFTIa6tkATg1tLgV+Dkwqq387sA54IxyLTzfhQ00b9Xxo\nod4HAt8m0vx/ET2euFEbtwDLw77fTXQNJo1Pz9Bcdk3FvtugjYr9roH6FftLwrpV+1DC+iWNvR58\nOKkJGx8ENodjWDoGUxq08W6i6celQRenVyvrN0M5juMUGF/+z3Ecp8B4kHccxykwHuQdx3EKjAd5\nx3GcAuNB3nEcp8B4kHccxykwHuQdx3EKzP8CU1P2ESBZ26sAAAAASUVORK5CYII=\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7fc60b2ab310>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "%matplotlib inline\n", + "from matplotlib.pyplot import plot,subplot,show,title\n", + "\n", + "from numpy import arange\n", + "\n", + "t=arange(-3,1.0082,.0082)\n", + "m1=(0-1)/(-3-(-1))##slope for -3<t<-1\n", + "c1=(0-m1*(-3))##intercept for pt(-3,0)\n", + "u=[]\n", + "for tt in t:\n", + " if tt<=-1:\n", + " u.append(((m1*tt)+c1))\n", + " else:\n", + " break\n", + "m2=(1-0)/(-1-1)##slope for -1<t<1\n", + "c2=(0-m2*1)#intercept for pt(1,0)\n", + "\n", + "for tt in t:\n", + " if tt>-1:\n", + " u.append(((m2*tt)+c2))\n", + "subplot(221)\n", + "plot(t,u)\n", + "title('original signal')\n", + "subplot(222)\n", + "plot([2*tt for tt in t],u)\n", + "title('expansion of signal')\n", + "show()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page27 Problem 2.4" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAANkAAACfCAYAAAB0v3wHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFU1JREFUeJztnXu4VXWZxz9fUTBFRaNAAvXRDDTREjUZS1GnAg20bKaw\npjRDaxS84AVyRkDHJ3lQ8zEjR7QywxwVBzGFQJQGDUVL7hdFEVMQEfECJdd3/vitA4vtPmevffZe\nZ629z/t5nvWwLr/fu76bs9+9fpd3vT+ZGY7jpMcuWQtwnHrHncxxUsadzHFSxp3McVLGncxxUsad\nzHFSxp0sB0j6paT/qHbZEnYOkrRNUlnfAUnDJY2r9P4J7nOOpJlp36cl2DVrAfWEJAGXA4OArsAa\nYDww0sw2NVbPzH6c9B7llE0DM/tplvevRfxJVl1uJTjYvwHtgX7AqcD9jVUo90ni1B7+B64Skg4F\nfgycbWbPmtk2M1sEnAX0ldQnKvebqMn3mKT1wMnRuetitq6UtFLS65J+GDXrDo7Vvy7a7xOVuUzS\n6qjOOTE7p0t6QdJ7kl6TNKKMz3NVZPt9SUsknRKdHynpnli570laIeltSf8h6dWCsvdLujuys0BS\nr1jdYZKWRdcWSjqzGf/1ucedrHqcCvzNzJ6PnzSz14FngK/ETg8ErjOz9sBTgEUbkvoCl0b2DgX6\nFNxne9mITsDeQBfgPOAXkvaJrq0Hvmtm+wCnAz+WdEapDyKpO3AhcIyZ7R1pfzV2/4ZyhwO/iD7P\n/sA+kY44/YHfR9cmAbfFri0DvhjdYxTwO0mdSumrNdzJqkdH4M1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l+UapZ8lhA6dCxwPfC+mR0NzCJKaATc\nAQw2s2OAK4CxKWltNaSZEs7JH0+a2QZgg6R3CXkvIcQ3HqmwdPA/AQ9I2x+IbVteZn3hTta62Bjb\n3xY73kb4LuwCrDOzzxdWdJqPNxfri+YmexVsT1ewXNI3ARQ4slriWivuZPWF8dF+mTVyrXC/4fg7\nwHmSGl4LGZCCzlaFD+E7Tsr4k8xxUsadzHFSxp3McVLGncxxUsadzHFSxp3McVLGncxxUub/AURm\nKN+9q7T7AAAAAElFTkSuQmCC\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7fcc37584190>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAANkAAACfCAYAAAB0v3wHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFkhJREFUeJztnXn0ndO5xz/fmIfUUCSCSM1cQVHD1abRViWGUJZlqOsa\nqtqL1FAEd5HIdcsy11ik2lqCS1SNadBGQxEUEb9EJTSGKBFBxJThuX/sfX7enJ7zO+/5nfOe95zz\nez5rveu8w97Pfs7wnD09+9kyMxzHyY5eeSvgOO2OG5njZIwbmeNkjBuZ42SMG5njZIwbmeNkjBtZ\nBSTNlzSgAeVcK+m/sy4nCyRNlHRMlXn6x89WWemVKGuJpI2yLqccy+ZVcDMgqT/wUuLWKsAnQGHy\ncIiZ9W6ELmb200aUU0z8A3kVWNbMlnRTjPHlZ5Yug9nrQEM+27zp0UZW/EVLWgJsY2av5qdV45CU\n/P4zr1F6Kt5crECyqSHpN5KukfRAbOpMktRX0hWS5kmaJmm7RN5+ksZJelfSq5JO7KKc30gaHc8H\nS3pT0imS3pE0W9KR8dnOkt5ONrMk/UDSC/G8l6QRkmZIek/S7ZLWiM8GxPdztKRZwCPAo1HMB/E9\n7RzTHi2pQ9L7ksbHWr9Q3h6Spkv6QNKVBAMtaaSSdpL0jKQPJf1T0iVFuvSK11+T9BdJH0l6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7stLoVaK8/sDUFJ/Fv+iVVlY1egFH\nAo8DK6b8jsrqVUlWtZ9XJSOr5vOqYGTVf4+1/NAbfRT+jeL5ycDYEmmWjf9SA4DlSdExpfxgxcrE\nwQNglfij+H43ZaXSC9g0cX4icHN39UopK61eQ4CXgLW6eO9p9Uojq6rvMRrGDrXolVJW9b+vRhpJ\nrQfwO2AK8AJwN9An3u8H3J9INxR4mTAKdGYKua8WDCMpC9gofojPA1NrkZVWL+BOQvPleWAcsUbs\njl5pZFWh1yvALOC5eFxTg14VZVWh1w8ITclPgX8CD9agV0VZ3fl9+WS042RMK44uOk5L4UbmOBnj\nRuY4GeNG5jgZ40bmOBnjRuY4GeNG1kZIOqvo+vG8dHG+xOfJ2ghJ882sd956OEvjNVmbIOkCYKW4\nKPHmeO/j+DpY0qOS7pY0U9IFkv5D0uS4kHGjmG5tSXfG+5Ml/XuOb6lt8JqsjSiuyQrXkgYDvycs\nSpxH8K+8wcxGShoOfM3MTpY0FrjazB6X1J/gCLtVDm+lrcgyJJzTXDxtcS/uGLjoj/H+VGD3eP49\nYEupc21jb0krm9knDdW0zXAj6zl8njhfkrhewpe/AwE7m9kXjVSs3fE+WXuxUFItf5wTgOGFC0nb\n1a6S40bWXlwPTCkMfBCW3FPinKL7hWfDgR1jeIeXCDvtODXiAx+OkzFekzlOxriROU7GuJE5Tsa4\nkTlOxriROU7GuJE5Tsa4kTlOxvw/vZVGRZwhCAsAAAAASUVORK5CYII=\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7fcc37462890>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "from math import exp\n", + "%matplotlib inline\n", + "from matplotlib.pyplot import plot,subplot,show,title,xlabel,ylabel\n", + "\n", + "t=range(-5,0)#\n", + "y=[]\n", + "for tt in t:y.append(exp(tt/2))\n", + "subplot(221)\n", + "plot(t,y)\n", + "title ( \" Original signal \" )\n", + "xlabel( \" Time \")\n", + "ylabel(\"g(t) \" )\n", + "show()\n", + "t_inv=[]\n", + "for tt in t:t_inv.append(-tt)\n", + "y=[] \n", + "for tt in t_inv:y.append(exp(-tt/2)) \n", + "subplot(222)\n", + "plot(t,y)#\n", + "title ( \" Time inverted signal\")\n", + "xlabel( \" time \")\n", + "ylabel(\"g(-t)\" )\n", + "show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 33 Exa 2.5a" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of sine signal= 3.14 Joule\n", + "value of c= 1.27 \n" + ] + } + ], + "source": [ + "from numpy import arange,pi\n", + "from sympy.mpmath import quad,sin\n", + "\n", + "#Assuming SI units for all quantities\n", + "\n", + "#approximation of square signal to sine signal with minimum energy\n", + "t=arange(0,2*pi+.1,0.1)\n", + "t0=0#\n", + "t1=2*pi#\n", + "y=quad(lambda t:(sin(t))**2,[t0,t1])\n", + "print 'energy of sine signal= %.2f Joule'%y\n", + "#to calculate value of c\n", + "t2=0#\n", + "t3=pi#\n", + "g=quad(lambda t:sin(t),[t2,t3])\n", + "t4=pi#\n", + "t5=2*pi#\n", + "h=quad(lambda t:-sin(t),[t4,t5])\n", + "print \"value of c= %0.2f \"%((g+h)/pi)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 33 Exa 2.6a" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of signal x(t)=5.00 J\n", + "energy of signal=5.00 J\n", + "correlation coefficient=1\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from numpy import arange,pi,sqrt\n", + "from sympy.mpmath import quad,sin\n", + "#Assuming SI units for all quantities\n", + "#given signal is x(t)=1\n", + "#energy of signal x(t)\n", + "t0=0#\n", + "t1=5\n", + "x=1\n", + "y=quad(lambda t:x**2,[t0,t1])\n", + "print 'energy of signal x(t)=%.2f J'%y\n", + "#to find correlation coefficient we have to calculate the energies of different given signals\n", + "#1st signal g1(t)=1\n", + "g1=1\n", + "e1=quad(lambda t:g1**2,[t0,t1])\n", + "print 'energy of signal=%.2f J'%e1\n", + "#correltion coefficient \n", + "c1=quad(lambda t:g1*x,[t0,t1])\n", + "print 'correlation coefficient=%.f'%(c1/sqrt(y*e1))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 33 Exa 2.6b" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of signal x(t)=5.00 J\n", + "energy of signal=1.25 J\n", + "correlation coefficient=1.00\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from numpy import arange,pi,sqrt\n", + "from sympy.mpmath import quad,sin\n", + "\n", + "#Assuming SI units for all quantities\n", + "#given signal is x(t)=1\n", + "#energy of signal x(t)\n", + "t0=0#\n", + "t1=5\n", + "x=1\n", + "y=quad(lambda t:x**2,[t0,t1])\n", + "print 'energy of signal x(t)=%.2f J'%y\n", + "#to find correlation coefficient we have to calculate the energies of different given signals\n", + "g2=.5\n", + "e2=quad(lambda t:g2**2,[t0,t1])\n", + "print 'energy of signal=%.2f J'%e2\n", + "#correltion coefficient \n", + "c2=quad(lambda t:g2*x,[t0,t1])\n", + "print 'correlation coefficient=%.2f'%(c2/sqrt(y*e2))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 33 Exa 2.6c" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of signal x(t)=5.00 J\n", + "energy of signal=5.00 J\n", + "correlation coefficient=-1.00\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from numpy import arange,pi,sqrt\n", + "from sympy.mpmath import quad,sin\n", + "\n", + "#Assuming SI units for all quantities\n", + "#given signal is x(t)=1\n", + "#energy of signal x(t)\n", + "t0=0#\n", + "t1=5\n", + "x=1\n", + "y=quad(lambda t:x**2,[t0,t1])\n", + "print 'energy of signal x(t)=%.2f J'%y\n", + "#to find correlation coefficient we have to calculate the energies of different given signals\n", + "g3=-1\n", + "e3=quad(lambda t:g3**2,[t0,t1])\n", + "print 'energy of signal=%0.2f J'%e3\n", + "#correltion coefficient \n", + "c3=quad(lambda t:g3*x,[t0,t1])\n", + "print 'correlation coefficient=%.2f'%(c3/sqrt(y*e3))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 33 Exa 2.6d" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of signal x(t)=5.00 J\n", + "energy of signal=2.16 J\n", + "correlation coefficient=0.96\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from numpy import arange,pi,sqrt\n", + "from sympy.mpmath import quad,sin,exp\n", + "\n", + "#Assuming SI units for all quantities\n", + "#given signal is x(t)=1\n", + "#energy of signal x(t)\n", + "t0=0#\n", + "t1=5\n", + "x=1\n", + "y=quad(lambda t:x**2,[t0,t1])\n", + "print 'energy of signal x(t)=%.2f J'%y\n", + "#to find correlation coefficient we have to calculate the energies of different given signals\n", + "e4=quad(lambda t:(exp(-t/5))**2,[t0,t1])\n", + "print 'energy of signal=%.2f J'%e4\n", + "\n", + "#correltion coefficient \n", + "c4=quad(lambda t:(exp(-t/5))*x,[t0,t1])\n", + "print 'correlation coefficient=%.2f'%(c4/sqrt(y*e4))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 33 Exa 2.6e" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of signal x(t)=5.00 J\n", + "energy of signal=0.50 J\n", + "correlation coefficient=0.63\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from numpy import arange,pi,sqrt\n", + "from sympy.mpmath import quad,sin,exp\n", + "\n", + "#Assuming SI units for all quantities\n", + "#given signal is x(t)=1\n", + "#energy of signal x(t)\n", + "t0=0#\n", + "t1=5\n", + "x=1\n", + "y=quad(lambda t:x**2,[t0,t1])\n", + "print 'energy of signal x(t)=%.2f J'%y\n", + "#to find correlation coefficient we have to calculate the energies of different given signals\n", + "e5=quad(lambda t:(exp(-t))**2,[t0,t1])\n", + "print 'energy of signal=%.2f J'%e5\n", + "#correltion coefficient \n", + "c5=quad(lambda t:(exp(-t))*x,[t0,t1])\n", + "print 'correlation coefficient=%.2f'%(c5/sqrt(y*e5))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 33 Exa 2.6f" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of signal x(t)=5.00 J\n", + "energy of signal=2.50 J\n", + "correlation coefficient=0.71\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from numpy import arange,pi,sqrt\n", + "from sympy.mpmath import quad,sin,exp\n", + "\n", + "#Assuming SI units for all quantities\n", + "#given signal is x(t)=1\n", + "#energy of signal x(t)\n", + "t0=0#\n", + "t1=5\n", + "x=1\n", + "y=quad(lambda t:x**2,[t0,t1])\n", + "print 'energy of signal x(t)=%.2f J'%y\n", + "#to find correlation coefficient we have to calculate the energies of different given signals\n", + "e6=quad(lambda t:(sin(2*pi*t))**2,[t0,t1])\n", + "print 'energy of signal=%.2f J'%e6\n", + "#correltion coefficient \n", + "c6=quad(lambda t:((sin(2*pi*t))**2)*x,[t0,t1])\n", + "print 'correlation coefficient=%.2f'%(c6/sqrt(y*e6))" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter3.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter3.ipynb new file mode 100644 index 00000000..d82be350 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter3.ipynb @@ -0,0 +1,182 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3 : Analysis and transmission of signals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 75 Prob 3.1" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fourier transform of x(t)=:\n", + "[ 1.58195029+0.j 1.33722176-0.38516024j 1.02105993-0.4033185j\n", + " 0.84862839-0.29364174j 0.76732853-0.17191927j 0.73478625-0.05628763j\n", + " 0.73478625+0.05628763j 0.76732853+0.17191927j 0.84862839+0.29364174j\n", + " 1.02105993+0.4033185j 1.33722176+0.38516024j]\n" + ] + } + ], + "source": [ + "from scipy.fftpack import fft\n", + "from math import exp\n", + "# given signal is x(t)= e**(-at) * u(t)\n", + "#unity function u(t)=1 for 0 to infinity \n", + "#therefore\n", + "x=1#\n", + "#here we consider 'infinity' value as 10 and the value of 'a' is 1\n", + "t= range(0,11)\n", + "a=1## a >0\n", + "z=[]\n", + "for tt in t:z.append((exp(-a*tt) * x))\n", + "y=fft(z)#\n", + "print 'fourier transform of x(t)=:\\n',y" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 81 Prob 3.2" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fourier transform of x(t)=:\n", + "[ 1.+0.j]\n" + ] + } + ], + "source": [ + "from scipy.fftpack import fft\n", + "\n", + "#given signal is x(t) = rect(t/T)\n", + "#rect(t/T) = 1 for |t| < T/2 and \n", + "# = 0 for |t| > T/2\n", + "# therefore we have to find out fourier transform of x(t)= 1 for |t| < T/2 thus,\n", + "x=[1]#\n", + "T= 200# # consider \n", + "t= range(-T/2,T/2+1)##range for fourer transform\n", + "y=fft(x)#\n", + "print 'fourier transform of x(t)=:\\n',y" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 82 Prob 3.3" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fourier transform of x(t)=:\n", + "[ 1.+0.j]\n" + ] + } + ], + "source": [ + "from scipy.fftpack import fft\n", + "\n", + "# given signal is x(t)= unit impulse d(t) \n", + "#it is defined as d(t) = 1 for t=0\n", + "#therefore \n", + "x=1#\n", + "y=fft([x])#\n", + "print 'fourier transform of x(t)=:\\n',y" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 84 problem 3.7" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fourier transform of signum funcion is : \n", + "[ 0.00000000 +0.j -1.98883083+13.19503037j -0.04442719 +0.14402943j\n", + " -1.90096887 +3.94740253j -0.17376123 +0.25486091j -1.73305187 +1.86778571j\n", + " -0.37651020 +0.30025686j -1.50000000 +0.8660254j -0.63465898 +0.24908529j\n", + " -1.22252093 +0.27903243j -0.92526991 +0.06933939j -0.92526991 -0.06933939j\n", + " -1.22252093 -0.27903243j -0.63465898 -0.24908529j -1.50000000 -0.8660254j\n", + " -0.37651020 -0.30025686j -1.73305187 -1.86778571j -0.17376123 -0.25486091j\n", + " -1.90096887 -3.94740253j -0.04442719 -0.14402943j -1.98883083-13.19503037j]\n" + ] + } + ], + "source": [ + "from numpy import sign\n", + "t=range(-10,11)#\n", + "y=sign(t)#\n", + "g=fft(y)#\n", + "print \"fourier transform of signum funcion is : \\n\",g" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter4.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter4.ipynb new file mode 100644 index 00000000..2847c250 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter4.ipynb @@ -0,0 +1,70 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4 : Amplitude(Linear) Modulation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 166 Problem 4.5" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "efficiency in % is 11.111\n", + "efficiency in % is 4.306\n" + ] + } + ], + "source": [ + "# we have given 1)u=.5 and 2)u=.3\n", + "# efficiency n is calculated by using formula n= (u**2) / (2+u**2) *100 %\n", + "#for u=0.5\n", + "u1=0.5#\n", + "n1= (u1**2) / (2+u1**2) *100 #\n", + "print 'efficiency in % is',round(n1,3)\n", + "# Hence only 11.1111% of total power is in sidebands.\n", + "#for u=0.3\n", + "u2=0.3#\n", + "n2= (u2**2) / (2+u2**2) *100#\n", + "print 'efficiency in % is',round(n2,3)\n", + "# Hence only 4.3062% of the total power is the useful power (power in sidebands)" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter5.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter5.ipynb new file mode 100644 index 00000000..535073ef --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter5.ipynb @@ -0,0 +1,332 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5 : Angle(exponential) Modulation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 212 Problem 5.1" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Minimum frequency = 99.90 MHz\n", + "Maximum frequency = 100.10 MHz\n", + "Minimum frequency = 99.90 MHz\n", + "Maximum frequency = 100.10 MHz\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "# The values of constsnts Kf and Kp are given as Kf= 2*pi*10**5 and Kp=10*pi, and carrier frequency fc=100MHz\n", + "\n", + "# For FM :\n", + "#fi= fc + Kf*m(t)/2*pi\n", + "# Minimum value of m(t) = -1 and Maximum value of m(t)= +1\n", + "Kf= 2*pi*10**5 #\n", + "Kp=10*pi#\n", + "fc=100*10**6 ## in Hz\n", + "Mmin = -1 # \n", + "Mmax=1#\n", + "fimin1= fc + Kf*Mmin/(2*pi)#\n", + "print 'Minimum frequency = %0.2f MHz'%(fimin1/10**6)\n", + "fimax1= fc + Kf*Mmax/(2*pi)#\n", + "print 'Maximum frequency = %0.2f MHz'%(fimax1/10**6)\n", + "\n", + "#For PM :\n", + "#fi= fc + Kp*m(t)'/2*pi\n", + "# Minimum value of m(t)' = -20,000 and Maximum value of m(t)'= +20,000\n", + "Mmin1=-20000 # \n", + "Mmax1=20000#\n", + "fimin2= fc + Kp*Mmin1/(2*pi)#\n", + "print 'Minimum frequency = %.2f MHz'%(fimin2/10**6)\n", + "fimax2= fc + Kp*Mmax1/(2*pi)#\n", + "print 'Maximum frequency = %.2f MHz'%(fimax2/10**6)\n", + "\n", + "# Since m(t) is increases and decreases linearly with time, the instantaneous frequency increases linearly from fimin to fimax" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 213 Problem 5.2" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Minimum frequency = 99.90 MHz\n", + "Maximum frequency = 100.10 MHz\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "# The values of constsnts Kf and Kp are given as Kf= 2*pi*10**5 and Kp=pi/2, and carrier frequency fc=100MHz\n", + "# For FM :\n", + "#fi= fc + Kf*m(t)/2*pi\n", + "# Minimum value of m(t) = -1 and Maximum value of m(t)= +1\n", + "Kf= 2*pi*10**5 #\n", + "Kp=pi/2#\n", + "fc=100*10**6 ## in Hz\n", + "Mmin = -1 #\n", + "Mmax=1#\n", + "fimin1= fc + Kf*Mmin/(2*pi)#\n", + "print 'Minimum frequency = %.2f MHz'%(fimin1/10**6)\n", + "fimax1= fc + Kf*Mmax/(2*pi)#\n", + "print 'Maximum frequency = %.2f MHz'%(fimax1/10**6)\n", + "# Since m(t) is increases and decreases linearly with time, the instantaneous frequency increases linearly from fimin to fimax" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 222 Problem 5.3.a" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Bfm = 230.00 kHz\n", + "Bpm = 130.00 kHz\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "# refer fig from page no. 212 Fig.5.4a\n", + "# The values of constsnts Kf and Kp are given as Kf= 2*pi*10**5 and Kp=5*pi .\n", + "# Here we are assuming the Bandwidth B of m(t) as the frequency of the third harmonic, i.e. 3(10**4/2)Hz= 15kHz\n", + "B=15## in kHz\n", + "# For FM:\n", + "# Here peak amplitude of m(t) is mp=1\n", + "mp=1#\n", + "# df=kf*mp/2*pi\n", + "Kf= 2*pi*10**5# \n", + "Kp=5*pi#\n", + "df= (Kf*mp)/(2*pi)## in Hz\n", + "df=df/10**3## in KHz\n", + "Bfm=2*(df+B)#\n", + "print 'Bfm = %.2f kHz'%(Bfm)\n", + "# For PM:\n", + "#Here peak amplitude of m(t)' is mp=20000\n", + "mp=20000#\n", + "# df=kp*mp/2*pi\n", + "df= (Kp*mp)/(2*pi)## in Hz\n", + "df=df/10**3## in KHz\n", + "Bpm=2*(df+B)#\n", + "print 'Bpm = %.2f kHz'%Bpm" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 222 Problem 5.3.b" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Bfm = 430.00 kHz\n", + "Bpm = 230.00 kHz\n" + ] + } + ], + "source": [ + "from math import pi\n", + "# The values of constsnts Kf and Kp are given as Kf= 2*pi*10**5 and Kp=5*pi .\n", + "# Here we are assuming the Bandwidth B of m(t) as the frequency of the third harmonic, i.e. 3(10**4/2)Hz= 15kHz\n", + "B=15## in kHz\n", + "# For FM:\n", + "# Here peak amplitude of m(t) is doubled ,mp=2\n", + "mp=2#\n", + "# df=kf*mp/2*pi\n", + "Kf= 2*pi*10**5#\n", + "Kp=5*pi#\n", + "df= (Kf*mp)/(2*pi)## in Hz\n", + "df=df/10**3## in KHz\n", + "Bfm=2*(df+B)#\n", + "print 'Bfm = %.2f kHz'%Bfm\n", + "# For PM:\n", + "#Here peak amplitude of m(t)' is doubled mp=40000\n", + "mp=40000#\n", + "# df=kp*mp/2*pi\n", + "df= (Kp*mp)/(2*pi)## in Hz\n", + "df=df/10**3## in KHz\n", + "Bpm=2*(df+B)#\n", + "print 'Bpm = %.2f kHz'%Bpm\n", + "# doubling the signal amplitude roughly doubles the bandwidth of both FM and PM waveform" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 224 Problem 5.4" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Bfm = 215.00 kHz\n", + "Bpm = 65.00 kHz\n" + ] + } + ], + "source": [ + "from math import pi\n", + "\n", + "# Repeat example 5.3 with m(t) expanded by a factor of 2 i.e. if the period of m(t) is 4*10**-4\n", + "# The values of constsnts Kf and Kp are given as Kf= 2*pi*10**5 and Kp=5*pi .\n", + "# we know that time expansion by a factor 2 reduces the signal spectrum width by a factor 2\n", + "# Therefore bandwidth is half the previous bandwidth\n", + "B=7.5# # im KHz\n", + "# For FM:\n", + "# Time expansion does not affect the peak amplitude so that mp=1.\n", + "mp=1#\n", + "# df=kf*mp/2*pi\n", + "Kf= 2*pi*10**5# \n", + "Kp=5*pi#\n", + "df= (Kf*mp)/(2*pi)## in Hz\n", + "df=df/10**3## in KHz\n", + "Bfm=2*(df+B)#\n", + "print 'Bfm = %.2f kHz'%Bfm\n", + "# For PM:\n", + "#mp is halved i.e. mp=10000\n", + "mp=10000#\n", + "# df=kp*mp/2*pi\n", + "df= (Kp*mp)/(2*pi)## in Hz\n", + "df=df/10**3## in KHz\n", + "Bpm=2*(df+B)#\n", + "print 'Bpm = %.2f kHz'%Bpm\n", + "# Time expansion of m(t) has very little effect on the FM bandwidth, but it halves the PM bandwidth" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page 225 Problem 5.5" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a) The carrier power is : 50.00 Watt\n", + "b) The frequency deviation = 12387.32 Hz\n", + "c) The deviation ratio is: 12.39 \n", + "d)The phase deviation = 15.00 rad\n", + "e)Bandwidth is : 26774.65 Hz\n" + ] + } + ], + "source": [ + "from math import pi\n", + "#Assuming SI unit for all quantities\n", + "\n", + "# An angle modulated signal with carrier frequency wc = 2*pi*10**5 is described by the equation Qem= 10cos(@(t)) where @(t)=wct+5sin3000t+10sin2000pi*t\n", + "B=2000*pi/(2*pi)##signal bandwidthis the highest frequency in m(t)\n", + "Ac=10##carrier amplitude\n", + "P=Ac**2/2## carrier power\n", + "print 'a) The carrier power is : %.2f Watt'%P\n", + "# to find frequency derivative df, e find instantaneous freq. w as\n", + "# wi=d/dt(@(t))= wc+15000cos3000t+20000pi*cos2000pi*t#\n", + "# The carrier derivative is 15000cos3000t+20000pi*cos2000pi*t. The two sinusoids will add in phase at some point and the maximum value of the expression is dW=15000+20000pi\n", + "dW=15000+20000*pi#\n", + "df=dW/(2*pi)#\n", + "print 'b) The frequency deviation = %.2f Hz'%df\n", + "# The deviation ratio B1 is given as\n", + "B1=df/B#\n", + "print 'c) The deviation ratio is: %.2f '%B1\n", + "#The phase deviation is the maximum value of the angle @(t) and is given b d@\n", + "d=5+10#\n", + "print 'd)The phase deviation = %.2f rad'%d\n", + "Bem=2*(df+B)#\n", + "print 'e)Bandwidth is : %.2f Hz'%Bem" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter6.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter6.ipynb new file mode 100644 index 00000000..72f6d5c3 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter6.ipynb @@ -0,0 +1,121 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Sampling and pulse code modulation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 271 prob no. 6.2" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter the band limited freq in hertz is 1100\n", + "minimum transmission bandwidth = 8800.00 Hertz\n", + "enter the no of signal to be multiplexed 25\n", + "minimum transmission bandwidth = 220000.00 Hertz\n" + ] + } + ], + "source": [ + "from math import log\n", + "fm=input(\"Enter the band limited freq in hertz is \")\n", + "Rn=2*fm# # Nyquist sampling rate\n", + "Ra=Rn*(4/3)## actual Nyquist sampling rate\n", + "# here the maximum quantization error(E) is 0.5% of the peak amplitide mp. Hence, E=mp/L=0.5*mp/100*L\n", + "mp=1##we assume peak amplitude is unity\n", + "L=(mp*100)/(0.5*mp)#\n", + "for i in range(0,11):\n", + " j=2**i\n", + " if(j>=L):\n", + " L1=j#\n", + " break#\n", + " \n", + "n=log(L1,2)## bits per sample\n", + "c=n*Ra## total no of bits transmitted\n", + "# Beause we can transmit up to 2bits/per hertz of bandwidth,we require minimum transmission bandwidth Bt=c/2\n", + "Bt=c/2#\n", + "print \"minimum transmission bandwidth = %.2f Hertz\"%Bt\n", + "s=input(\"enter the no of signal to be multiplexed \")\n", + "Cm=s*c##total no of bits of 's' signal\n", + "c1=Cm/2## minimum transmission bandwidth\n", + "print \"minimum transmission bandwidth = %.2f Hertz\"%c1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 273 prob no 6.3" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "enter the value of L = 12\n", + "enter the bandwidth of signal in hertz350\n", + "SNR ratio is = 13.00 \n" + ] + } + ], + "source": [ + "from math import log,log10\n", + "# from the expresion given on the page no 272# (So/No)=(a+6n) dB where a=10log[3/[ln(1+u)]**2]\n", + "#check the ollowing code for L=64 and L=256\n", + "L=input(\"enter the value of L = \")\n", + "B=input(\"enter the bandwidth of signal in hertz : \")\n", + "n=log(L,2)#\n", + "Bt=n*B#\n", + "u=100##given\n", + "a=10*log10(3/(log(1+u))**2)\n", + "SNR=(a+(6*n))#\n", + "print \"SNR ratio is = %0.2f \"%SNR\n", + "# Here the SNR ratio for the two cases are found out. The difference between the two SNRs is 12dB which is the ratio of 16. Thus the SNR for L=256 is 16 times the SNR for L=64. The former requires just about 33% more bandwidth compared to the later." + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter7.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter7.ipynb new file mode 100644 index 00000000..5f7a2321 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter7.ipynb @@ -0,0 +1,155 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7 : Principles of digital data transmission" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 314 prob no 7.1" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "transmission rate = 32000\n" + ] + } + ], + "source": [ + "#The transmission bandwidth is given by the equation Bt=(1+r)Rb/2 and hence transmission rate is given by Rb=2Bt/(1+r)#where r=roll-off factor and 0<=r<=1. Since 'r' can take value in between 0 and 1,bandwidth varies from 2Bt to Bt.\n", + "Bt=32000#\n", + "r=1##assume values of Bt and r\n", + "Rb=(2*Bt)/(1+r)#\n", + "print \"transmission rate = \",Rb##Rb=Bt for r=1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Page no 326 Prob no 7.3" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "values of C-1,C0,C1 are obtained:\n", + "[[ 0.20939445]\n", + " [ 1.1262026 ]\n", + " [ 0.31692134]]\n" + ] + } + ], + "source": [ + "from numpy import mat\n", + "# problem fig. is ggiven on page no 324. Referring the fig. we are given the values of a0,a1,a-1,a-2\n", + "a=1#\n", + "b=-0.3#\n", + "c=0.1#\n", + "d=-0.2#\n", + "e=0.05#\n", + "#design a three-tap (N=1) equalizer by substituting these values into eq no 7.45 of the page no 325\n", + "A=mat([[0],[1],[0]])#\n", + "B=mat([[a, d, e],[b, a, d],[c, b, a]])\n", + "c=(B**-1)*A## As, A=B*C Hence c is obtained as given\n", + "print 'values of C-1,C0,C1 are obtained:'\n", + "print c" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no 334 Prob NO 7.4" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value of x : 0.0052\n", + "error probability = 9.96e-08 \n", + "Value of x : 96.1500\n", + "error probability = 1.17e-04 \n", + "error probability = 1.75e-04 \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# a) Find detection error probability\n", + "#Given: Ap=1mV, 6n=192.3uV\n", + "# The formula for polar case is given by Ap/6n\n", + "Ap=1#\n", + "sigma_n=192.3#\n", + "x=Ap/sigma_n##here we have to find the value of P(e)=Q(x) from the table10.2 given on page no. 454\n", + "print \"Value of x : %0.4f\"%x\n", + "Q1=(0.9964)*10**(-7)#\n", + "print \"error probability = %.2e \"%Q1 ##this is nearly equal to zero\n", + "\n", + "#Prob NO 7.4 b) Find detection error probability.\n", + "#In this case, only half the bits are transmitted by no pulse, there are, on the average, only half as many pulses in the on-off case(compared to the polar). \n", + "#To maintain the same power,we need to double the energy of each pulse in the on-off or the bipolar case(compared to the polar).\n", + "#Now, doubling the pulse energy is accomplished by multiplying the pulse by sqrt(2).\n", + "#Thus, for on-off Ap is sqrt(2) times the Ap in the polar case,that is, Ap=sqrt(2)*10**-3\n", + "x=Ap/2*sigma_n##here we have to find the value of P(e)=Q(x) from the table10.2 given on page no. 454\n", + "print \"Value of x : %0.4f\"%x\n", + "Q2=(1.166)*10**-4#\n", + "print \"error probability = %0.2e \"%Q2\n", + "#for a given power , the Ap for both the on-off and the bipolar cases are identical. Hence P(e)=1.5 Q(x)#\n", + "Q3=1.5*Q2#\n", + "print \"error probability = %0.2e \"%Q3" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter8.ipynb b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter8.ipynb new file mode 100644 index 00000000..2f0e3fa2 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/Chapter8.ipynb @@ -0,0 +1,70 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8 : Emerging digital communications technologies" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## page no. 367 Prob no. 8.3" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "No. of hours for resynchronizing : 60 Hr\n" + ] + } + ], + "source": [ + "#since both the plots can be out of synchronization by as much as 6 parts (bits)in 10**13 , we have \n", + "# timing error bits per second can be calculated as-\n", + "#error in synchronization is given as\n", + "e=6.0/(10**13)##timing eeor bits per transmitted bits\n", + "#bit rate is given as\n", + "r =1544000.0 ## in bits/sec\n", + "#timing error bits per second ,Te is given as\n", + "Te=e*r#\n", + "S=1/Te## seconds per timing error bits\n", + "H=S/3600.0## hours per timing error bits\n", + "#since a synchronization error can occur whenever the network is out of synchronization by 1/5 bits, the time between resynchronizing is given as\n", + "T=H/5.0#\n", + "print \"No. of hours for resynchronizing : %.f Hr\"%T" + ] + } + ], + "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 +} diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2correlationCoeff.png b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2correlationCoeff.png Binary files differnew file mode 100644 index 00000000..77e53b40 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2correlationCoeff.png diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2expansionofSignal.png b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2expansionofSignal.png Binary files differnew file mode 100644 index 00000000..4d19c746 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2expansionofSignal.png diff --git a/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2timeInvertedsignal.png b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2timeInvertedsignal.png Binary files differnew file mode 100644 index 00000000..111501c3 --- /dev/null +++ b/Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/screenshots/2timeInvertedsignal.png diff --git a/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-2-Molecular_Diffusion_-_Principles_of_Mass_Transfer_and_Separation_Process_by_Binay_K_Dutta_1.ipynb b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-2-Molecular_Diffusion_-_Principles_of_Mass_Transfer_and_Separation_Process_by_Binay_K_Dutta_1.ipynb new file mode 100644 index 00000000..7e8be8be --- /dev/null +++ b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-2-Molecular_Diffusion_-_Principles_of_Mass_Transfer_and_Separation_Process_by_Binay_K_Dutta_1.ipynb @@ -0,0 +1,789 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2 Molecular Diffusion" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1 pgno:10" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Molar average velocity of gas mixture is: 0.0303 m/s\n", + "Mass average velocity of gas mixture is: 0.029 m/s\n" + ] + } + ], + "source": [ + "#Calculation of average velocities\n", + "\n", + "N2 = 0.05 #mole fraction of Nitrogen denoted as 1\n", + "H2 = 0.15 #mole fraction of Hydrogen denoted as 2\n", + "NH3 = 0.76 #mole fraction of Ammonia denoted as 3\n", + "Ar = 0.04 #mole fraction of Argon denoted as 4\n", + "u1 = 0.03\n", + "u2 = 0.035\n", + "u3 = 0.03\n", + "u4 = 0.02\n", + "#Calculating molar average velocity\n", + "U = N2*u1 + H2*u2 + NH3*u3 + Ar*u4\n", + "print 'Molar average velocity of gas mixture is: %.4f m/s'%U\n", + "#Calculating of mass average velocity\n", + "M1 = 28\n", + "M2 = 2\n", + "M3 = 17\n", + "M4 = 40\n", + "M = N2*M1 + H2*M2 + NH3*M3 + Ar*M4\n", + "u = (1/M)*(N2*M1*u1 + H2*M2*u2 + NH3*M3*u3 + Ar*M4*u4)\n", + "print 'Mass average velocity of gas mixture is: %.3f m/s'%u" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2 pgno:16" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Time for complete evaporation is: 15.93 hours\n", + "(b) Time for disappearance of water is: 8.87 hours\n" + ] + } + ], + "source": [ + "#Diffusion of A through non-diffusing B\n", + "\n", + "from math import log\n", + "from math import exp\n", + "import numpy as np\n", + "\n", + "#Calcualtion for (a) part\n", + "#calculating vapor pressure of water at 301K\n", + "pv = exp(13.8573 - (5160.2/301)) #in bar\n", + "#wet-bulb temperature is 22.5 degree centigrade\n", + "#calculating mean air-film temperature\n", + "Tm = ((28+22.5)/2)+273 #in kelvin\n", + "#calculating diffusion coefficient\n", + "Dab = ((0.853*(30.48**2))*((298.2/273)**1.75))/(3600*10000) #in m^2/s\n", + "l = 2.5e-3 #in m\n", + "P = 1.013 #in bar\n", + "R = 0.08317 #Gas constant\n", + "pAo = exp(13.8573 - (5160.2/295.2)) #vapor pressure of water at the wet-bulb temperature, 22.2C\n", + "pAl = 0.6*round(pv,4)\n", + "Na = (((round(Dab,7)*P)/(R*298.2*l))*log((P-pAl)/(P-round(pAo,3))))*18 #in kg/m^2s\n", + "#amount of water per m^2 of floor area is\n", + "thickness = 2e-3\n", + "Amount = thickness*1 #in m^3 \n", + "#density of water is 1000kg/m^3\n", + "#therefore in kg it is\n", + "amount = Amount*1000\n", + "Time_for_completion = amount/Na #in seconds\n", + "Time_for_completion_hours = Time_for_completion/3600\n", + "print '(a) Time for complete evaporation is: %.2f'%Time_for_completion_hours,'hours'\n", + "\n", + "#Calculation for (b) part\n", + "water_loss = 0.1 #in kg/m^2.h\n", + "water_loss_by_evaporation = Na*3600\n", + "total_water_loss = water_loss + water_loss_by_evaporation\n", + "time_for_disappearance = amount/total_water_loss\n", + "print '(b) Time for disappearance of water is: %0.2f'%time_for_disappearance,'hours'\n", + "#Answers may vary due to round off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3 pgno:17" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) The molar flux of Ammonia is:1.922E-05 gmol/cm^2.s\n", + "(b) and (c)\n", + "Velocity of A is 0.522 cm/s\n", + "Velocity of B is 0.000 cm/s\n", + "Mass average velocity of A is 0.439 cm/s\n", + "Molar average velocity of A is 0.47 cm/s\n", + "(d) Molar flux of NH3 is 3.062E-06 gmol/cm^2.s\n" + ] + }, + { + "data": { + "text/plain": [ + "<matplotlib.text.Text at 0xa093160>" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAEPCAYAAABGP2P1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmUVOW19/HvthsURAXFSyIiGERABKeADIolojYoojGK\nOI8hGjRZud4Q9I329Zogid6oITGoiENENIqIE8SpNBBEJhFlCKAog68ag4g4gb3vH08B3W0P1d11\n6lRV/z5rndV1qp4+tT3SteuZzd0RERHZZqe4AxARkdyixCAiIhUoMYiISAVKDCIiUoESg4iIVKDE\nICIiFUSaGMzsHjP7wMwW11DmdjNbYWaLzOywKOMREZHaRV1jmA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wd2fAvYpt8bOAOCRbefu/km5\n33ky9fNN4P+7+1sevnW9RdhpbJsPqLjSpUjOyZlF9ERyQWpv4HbufkUVLzvV7/XwdepnGfBVuefL\nqPh3ZhTmHiJSQFRjEEkxsyMI/Qfldz5bb2Z7ph6/CJyx7dzMWtXjbdpQxd4aIrlENQaRHX5CWMr8\npdRS5vOAmYRO5BnuvsTMfg28bGbfAAsIu+dBxVpA5RqBA5jZdwh7D6t/QXKaOp9FamBmCWCYu1+e\ngWv9CNjV3X/f4MBEIqSmJJEauHuSsFtYJiamDSNsxSqS01RjEBGRClRjEBGRCpQYRESkAiUGERGp\nQIlBREQqUGIQEZEKlBhERKSC/wMlMWMmKfP/ywAAAABJRU5ErkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x9ed0c18>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "#Calculation of flux and velocity\n", + "\n", + "%matplotlib inline\n", + "from math import log\n", + "from math import exp\n", + "import numpy as np\n", + "from matplotlib import pyplot as plt\n", + "#calculation for (a) part\n", + "l = 1 #thickness of air in cm\n", + "pAo = 0.9 #in atm\n", + "pAl = 0.1 #in atm\n", + "Dab = 0.214 #in cm^2/s\n", + "T = 298 #in K\n", + "P = 1 #in atm\n", + "R = 82.1 #in (cm^3)(atm)/(K)(gmol)\n", + "#calculating molar flux of ammonia\n", + "Na = ((Dab*P)/(R*T*l))*log((P-pAl)/(P-pAo))\n", + "print '(a) The molar flux of Ammonia is:%0.3E'%Na,'gmol/cm^2.s'\n", + "\n", + "#calculation for (b) and (c) part\n", + "Nb = 0 #air is non-diffusing\n", + "U = (Na/(P/(R*T))) #molar average velocity\n", + "yA = pAo/P\n", + "yB = pAl/P\n", + "uA = U/yA #\n", + "uB = 0 #since Nb=0\n", + "Ma = 17\n", + "Mb = 29\n", + "M = Ma*yA + Mb*yB\n", + "u = uA*yA*Ma/M #since u =(uA*phoA + uB*phoB)/pho\n", + "print '(b) and (c)'\n", + "print 'Velocity of A is %0.3f'%uA,'cm/s'\n", + "print 'Velocity of B is %0.3f'%uB,'cm/s'\n", + "print 'Mass average velocity of A is %0.3f'%u,'cm/s'\n", + "print 'Molar average velocity of A is %0.2f'%U,'cm/s'\n", + "\n", + "#calculation for (d) part\n", + "Ca = pAo/(R*T)\n", + "Ia = Ca*(uA - u) #molar flux of NH3 relative to an observer moving\n", + " #with the mass average velocity \n", + "print '(d) Molar flux of NH3 is %0.3E'%Ia,'gmol/cm^2.s'\n", + "\n", + "z = []\n", + "pa =[]\n", + "for i in np.arange(0,1,0.01):\n", + " z.append(i)\n", + " \n", + "for i in range(0,len(z)):\n", + " pa.append(1-(0.1*exp(2.197*z[i])))\n", + " \n", + "from matplotlib.pyplot import plot\n", + "plot(z,pa);\n", + "plt.xlabel('z(cm)');\n", + "plt.ylabel('pA(atm)');\n", + "#Answers may vary due to round off error" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 2.4 pgno:19" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Rate of diffusion of oxygen 7.151E-10 kmol/s\n", + "(b) The partial pressure gradient of oxygen at midway in diffusion path is: -4.25 bar/m\n", + "(c)\n", + "Molar average velocity and diffusion velocities at \"midway\"\n", + "Molar average velocity in z-direction is 9.9E-05 m/s\n", + "The diffusion velocity of oxygen 7.9E-04 m/s\n", + "The diffusion velocity of Nitrogen -9.9E-05 m/s\n", + "Molar average velocity and diffusion velocities at \"top of tube\"\n", + "Molar average velocity in z-direction is 9.9E-05 m/s\n", + "The diffusion velocity of oxygen 3.72E-04 m/s\n", + "The diffusion velocity of Nitrogen -9.9E-05 m/s\n", + "Molar average velocity and diffusion velocities at \"bottom of tube\"\n", + "Molar average velocity in z-direction is 9.9E-05 m/s\n", + "The diffusion velocity of oxygen is not infinity\n", + "The diffusion velocity of Nitrogen -9.9E-05 m/s\n", + "(d)\n", + "New molar flux of (A) 4.95E-06 kmol/m^2.s\n", + "New molar flux of (B) 7.19E-06 kmol/m^2.s\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEKCAYAAAAMzhLIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHi1JREFUeJzt3XmUVNW59/HvI42CSDOIoAwCMqioiAM44NACKuLAvbnX\nqNFwxVl81USjETXCfZfG+Y3xGl1elWgS0TglKlEQ0HKIIoiKIoKgIIOKEyJBhIZ+3j92td1gd3V1\nd506p6p/n7X2qlOnTp/zcBZdT++9z97b3B0REZHabBV3ACIikmxKFCIikpEShYiIZKREISIiGSlR\niIhIRkoUIiKSUUncATSEmemZXhGRBnB3q+/PFGyNwt1V3Bk3blzsMSSl6F7oXuheZC4NVbCJQkRE\n8kOJQkREMlKiKHBlZWVxh5AYuhdVdC+q6F40njWm3SouZuaFGLeISJzMDG9KndkiIpIfShQiIpKR\nEoWIiGSkRCEiIhkpUYiISEZKFCIikpEShYiIZKREISIiGSlRiIhIRkoUIiKSkRKFiIhkpEQhIiIZ\nJTJRmNlwM5tvZgvN7NdxxyMi0pQlbvZYM2sGLACGASuAWcAp7v5+tWM0e6yISD0V0+yxg4BF7r7E\n3cuBh4GRWx70/fdQUZH32EREmpySuAOoQRdgWbX3y4EDtjyoTRvYsAFKSmCbbULZeuvw2qJF1b4W\nLeouLVtWvdZUtt02lOrbLVrAVklMsyIiOZbERJFVm9LYseNxD7WKgw4qY9CgMjZsCDWN9es3L99/\nD+vW/fj999+H8u23sHJl2FdZKo/57ruq17Vrq7bXrw/JolWrkDhatdq8bLddKJXbrVtX7at8X72U\nlobSvHnUt1dEmopUKkUqlWr0eZLYR3EgMN7dh6ffjwUq3P3GasfE3kdRURGSxtq1tZd//SuU6ttr\n1lS9VpZvv616bd68KmmUloaaU2kptG0bttu2/XFp166qtG4NVu8WSBFpChraR5HERFFC6MweCnwC\nzKSJdGa7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HGc+ZHMv5gPDANJt\n8rsCH+U1ymSo9/dmYmsU7r7RzP4PMIXwRMN97v6+mZ2b/vxud3/GzEaY2SJgLTA6xpAjk829AK4B\n2gF3pf+SLnf3QXHFHJUs70WTkOXvyHwzmwy8A1QA97h70SWKLP9f/Bb4o5nNIfyRfLm7fx1b0BEx\ns4eAw4EOZrYMGEdogmzw96am8BARkYyS3PQkIiIJoEQhIiIZKVGIiEhGShQiIpKREoWIiGSkRCEi\nIhkpUYjUk5lNM7PWOTjP9FycRyRqShQi9WBmQ4AFOZof6GHg7BycRyRSGnAnUov0qN7z0m/bAEuA\nD4FH3f259DGjgEsJk6rNcff/MrP7ge8IawJ0JMzmOxoYCLzu7qPTP9sJeLoYR9BLcVGiEKmDmZUQ\nFkG6CbgZGOzuX5vZHoT5tQ5Kv2/r7t+Y2R+Bbdz9Z2Z2AvAXwsJS84BZwJnuPid97o+Avdx9bQz/\nNJGsqOlJpG63A9PdfRLQudr8QEOARyrfu/s31X7m6fTrXOAzd3/Pw19l7xFWYau0ks1n8hRJnMRO\nCiiSBOl1lbu5+5gaPnZqX+tiQ/q1AlhfbX8Fm//eGcW5hooUEdUoRGphZvsR+h+qrwr3iZm1T28/\nD5xY+d7M2jXgMp2oYW0RkSRRjUKkdhcQpm5/IT11+xvAK4RO6SnuPs/MrgNeNLNNwJuE1QVh81rC\nljUGBzCzHQnrNqt/QhJNndki9WBmZcBJ7n5+Ds51DtDK3X/X6MBEIqSmJ5F6cPcUYSW1XAyUO4mw\ndK1IoqlGISIiGalGISIiGSlRiIhIRkoUIiKSkRKFiIhkpEQhIiIZKVGIiEhG/x/dtbi5bQDtAwAA\nAABJRU5ErkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x3659630>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "#Flux, velocity and pressure gradient\n", + "\n", + "#calculation of (a) part\n", + "#given data\n", + "from math import log\n", + "from math import pi\n", + "from math import exp\n", + "import numpy as np\n", + "from matplotlib import pyplot as plt\n", + "T = 298 #in kelvin\n", + "P = 1.013 #in bar\n", + "pAl = 0 #partial pressure of oxygen(A) at liquid surface\n", + "pAo = 0.21*1.013 #partial pressure of oxygen at open mouth\n", + "l = 0.05 #length of diffusion path in m\n", + "Dab = 2.1e-5 #diffusivity in m^2/s\n", + "R = 0.08317 #in m^3.bar.kmol.K\n", + "Na = Dab*P*log((P-pAl)/(P-pAo))/(R*T*l) #in kmol/m^2.s\n", + "area = (pi/4)*(0.015)**2\n", + "rate = area*Na\n", + "print '(a) Rate of diffusion of oxygen %0.3E'%rate,'kmol/s'\n", + "z = []\n", + "pa =[]\n", + "for i in np.arange(0,1,0.01):\n", + " z.append(i)\n", + " \n", + "for i in range(0,len(z)):\n", + " pa.append(P-(P-pAo)*exp((R*T*Na*z[i])/(Dab*P)))\n", + " \n", + "from matplotlib.pyplot import plot\n", + "plt.plot(z,pa);\n", + "plt.xlabel('z(cm)');\n", + "plt.ylabel('pA(atm)');\n", + "\n", + "#calculation of (b) part\n", + "z = 0.025 #diffusion path\n", + "pA = 0.113 #in bar\n", + "#we have to find partial pressure gradient of oxygen at mid way of diffusion path\n", + "#let dpA/dz = ppd\n", + "ppd = -(R*T*round(Na,8)*(P-pA))/(Dab*P)\n", + "print '(b) The partial pressure gradient of oxygen at midway in diffusion path is: %0.2f'%ppd,'bar/m'\n", + "\n", + "#calculation of (c) part\n", + "uA = Na*(R*T/pA) #velocity of oxygen\n", + "uB = 0 #since nitrogen is non-diffusing hence Nb = 0\n", + "U = pA*uA/P #since U=1/C*(uA*Ca + uB*Cb)\n", + "vAd = uA - U #diffusion velocity of oxygen\n", + "vBd = uB - U #diffusion velocity of nitrogen\n", + "print '(c)'\n", + "print 'Molar average velocity and diffusion velocities at \"midway\"'\n", + "print 'Molar average velocity in z-direction is %0.1E'%U,'m/s'\n", + "print 'The diffusion velocity of oxygen %0.1E'%vAd,'m/s'\n", + "print 'The diffusion velocity of Nitrogen %0.1E'%vBd,'m/s'\n", + "#at z=0(at top of tube)\n", + "uA = Na*(R*T/pAo)\n", + "uB = 0\n", + "U = pAo*uA/P\n", + "vAd = uA - U\n", + "vBd = uB - U\n", + "print 'Molar average velocity and diffusion velocities at \"top of tube\"'\n", + "print 'Molar average velocity in z-direction is %0.1E'%U,'m/s'\n", + "print 'The diffusion velocity of oxygen %0.2E'%vAd,'m/s'\n", + "print 'The diffusion velocity of Nitrogen %0.1E'%vBd,'m/s'\n", + "#at z=0.05(at bottom of tube)\n", + "#uA = inf\n", + "uB = 0\n", + "U = pAo*uA/P\n", + "vAd = uA - U\n", + "vBd = uB - U\n", + "print 'Molar average velocity and diffusion velocities at \"bottom of tube\"'\n", + "print 'Molar average velocity in z-direction is %0.1E'%U,'m/s'\n", + "print 'The diffusion velocity of oxygen is not infinity'\n", + "print 'The diffusion velocity of Nitrogen %0.1E'%vBd,'m/s'\n", + "\n", + "#calculation of (d) part\n", + "V = -2*U\n", + "pA = 0.113\n", + "Nad = round(Na,8) - V*(pA/(R*T))\n", + "Nbd = 0 - (P - pA)*V/(R*T)\n", + "print '(d)'\n", + "print 'New molar flux of (A) %0.2E'%Nad,'kmol/m^2.s'\n", + "print 'New molar flux of (B) %0.2E'%Nbd,'kmol/m^2.s'\n", + "#Answers may vary due to round off errors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5 pgno:21" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) The air-film thickness is :0.00193 m\n" + ] + } + ], + "source": [ + "#Diffusion with changing bulk concentration\n", + "\n", + "from math import log\n", + "#given data\n", + "area = 3*4 #in m^2\n", + "mperarea = 3.0/12 #in kg/m^2\n", + "#part (a)\n", + "P = 1.013 #in bar\n", + "Dab = 9.95e-6 #in m^2/s\n", + "R = 0.08317 #in m^3.bar./K.kmol\n", + "T = 273+27 #in K\n", + "#let d=1\n", + "d = 1 #in m\n", + "pAo = 0.065 #partial pressure of alcohol on liquid surface\n", + "pAd = 0 #partial pressure over d length of stagnant film of air\n", + "Na = (Dab*P*log((P-pAd)/(P-pAo)))/(R*T*d) #in kmol/m^2.s\n", + "Na = Na*60 #in kg/m^2.s\n", + "flux = mperarea/(5*60) #since the liquid evaporates completely in 5 minutes\n", + "#now we have to find the value of d\n", + "d = Na/flux\n", + "print '(a) The air-film thickness is :%0.5f'%d,'m'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6 pgno:24" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)\n", + "The steady-state flux is: 3.35E-06 kmol/m^2.s\n", + "The rate of transport of N2 from vessel 1 to 2: 6.6E-09 kmol/s\n", + "(b)\n", + "The flux and the rate of transport of oxygen is: -3.35E-06 kmol/m^2.s\n", + "(c)\n", + "Partial pressure at a point 0.05m from vessel 1 is: 1.2 atm\n", + "(d)\n", + "Net or total mass flux: -1.340E-05 kmol/m^2.s\n" + ] + } + ], + "source": [ + "#Equimolar counterdiffusion\n", + "\n", + "from math import pi\n", + "#given data\n", + "#part (a)\n", + "Dab = 0.23e-4*0.5*(293.0/316)**1.75 #in m^2/s\n", + "pA1 = 2*0.8 #in atm\n", + "pA2 = 2*0.2 #in atm\n", + "l = 0.15 #in m\n", + "R = 0.0821 #in m^3.atm./K.kmol\n", + "T = 293 #in K\n", + "Ma = 28\n", + "Mb = 32\n", + "Na = Dab*(pA1-pA2)/(R*T*l) #in kmol/m^2.s\n", + "area = pi/4*(0.05)**2 #in m^2\n", + "rate = area*Na\n", + "print '(a)'\n", + "print 'The steady-state flux is: %0.2E'%Na,'kmol/m^2.s'\n", + "print 'The rate of transport of N2 from vessel 1 to 2: %0.1E'%rate,'kmol/s'\n", + "\n", + "#part (b)\n", + "Nb = -Na\n", + "print '(b)'\n", + "print 'The flux and the rate of transport of oxygen is: %0.2E'%Nb,'kmol/m^2.s'\n", + "\n", + "#part (c)\n", + "#let dpA/dz = ppg\n", + "dz = 0.05 #in m\n", + "ppg = (pA2 - pA1)/l #in atm/m\n", + "pA = pA1 + (ppg)*dz #in atm\n", + "print '(c)'\n", + "print 'Partial pressure at a point 0.05m from vessel 1 is: %0.1f'%pA,'atm'\n", + "\n", + "#part (d)\n", + "nt = Ma*Na + Mb*Nb\n", + "print '(d)'\n", + "print 'Net or total mass flux: %0.3E'%nt,'kmol/m^2.s'\n", + "#Answers may vary due to round off errors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.7 pgno:25" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Methanol flux: 4.64e-05 kmol/m^2.s\n", + "Water flux: -4.06e-05 kmol/m^2.s\n" + ] + } + ], + "source": [ + "#Non-equimolar counterdiffusion in distillation of a binary mixture\n", + "\n", + "from math import log\n", + "#given data\n", + "Ha = 274.6*32 #molar latent heat of methanol(a)\n", + "Hb = 557.7*18 #molar latent heat of water(b)\n", + "yAl = 0.76 #mole fraction of methanol in the vapour\n", + "yAo = 0.825 #mole fraction of methanol in the vapour at the liquid-vapour interface\n", + "P = 1 #in atm\n", + "l = 1e-3 #in m\n", + "T =344.2 #in K\n", + "R = 0.0821 #m^3.atm./K.kmol\n", + "Dab = 1.816e-5 #in m^2/s\n", + "Na = Dab*P*log((1-0.1247*yAl)/(1-0.1247*yAo))/(0.1247*R*T*l)\n", + "print 'Methanol flux: %0.2e'%Na,'kmol/m^2.s'\n", + "Nb = -(Ha/Hb)*Na\n", + "print 'Water flux: %0.2e'%Nb,'kmol/m^2.s'\n", + "#Answers may vary due to round off errors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.8 pgno:27" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value of pA1 is 0.937 atm\n" + ] + } + ], + "source": [ + "#Equimolar counterdiffusion in an interconnected system\n", + "\n", + "#given values\n", + "from math import exp\n", + "V1 = 3000 #in cm^3\n", + "V2 = 4000 #in cm^3\n", + "Dab = 0.23 #in cm^2/s\n", + "Dba = 0.23 #in cm^2/s\n", + "l1 = 4 #in cm\n", + "d1 = 0.5 #in cm\n", + "l2 = 2 #in cm\n", + "d2 = 0.3 #in cm\n", + "pA3 = 1 #in atm\n", + "#unknowns\n", + "# pA1 and pA2\n", + "# dpA1bydt = (Dab/V1*l1)*((pA1)-(pA2))*((math.pi*(d1**2))/4)\n", + "#on integrating using Laplace trandformation\n", + "# initial conditions\n", + "t=18000 #in seconds\n", + "pA1 = 1-0.57*(exp((-1.005)*(10**(-6))*t)-exp((-7.615)*(10**(-6))*t))\n", + "print 'Value of pA1 is %0.3f'%pA1,'atm'" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 2.10 pgno:34" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Value of flux of water vapour: 2.96E-05 kmol/m^2.s\n" + ] + } + ], + "source": [ + "#Diffusion of only one component in a three-component mixture\n", + "\n", + "#given values\n", + "from math import log\n", + "y1l = 0 #mol fraction of dry air\n", + "y10 = (17.53/760) #mol fraction of water\n", + "l = 1.5 #in mm\n", + "C = 0.0409 #in kmol/m^3 : calculated by P/RT\n", + "D12 = 0.923 #Diffusivity of hydrogen over water\n", + "D13 = 0.267 #Diffusivity of oxygen over water\n", + "y2 = 0.6 #mole fraction of hydrogen\n", + "y3 = 0.4 #mole fraction of oxygen\n", + "D1m = 1/((y2/D12)+(y3/D13)) #calculating mean diffusivity\n", + "Ni = (D1m*C*1000/(l*10000))*log((1-y1l)/(1-y10))\n", + "print 'Value of flux of water vapour: %0.2E'%Ni,'kmol/m^2.s'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.11 pgno:35" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Flux of ethane 4.804E-05 gmol/cm^2.s\n" + ] + } + ], + "source": [ + "#Multicomponent diffusion\n", + "\n", + "from math import log\n", + "#given data\n", + "y1 = 0.4 #mole fraction of ethane(1)\n", + "y2 = 0.3 #mole fraction of ethylene(2)\n", + "y3 = 0.3 #mole fraction of hydrogen(3)\n", + "#calculating D13\n", + "#The Lennard-Jones parameters are\n", + "sigma1 = 4.443 #in angstrom\n", + "sigma2 = 4.163 #in angstrom\n", + "sigma3 = 2.827 #in angstrom\n", + "e1byk = 215.7\n", + "e2byk = 224.7\n", + "e3byk = 59.7\n", + "sigma13 = (sigma1 + sigma3)/2 #in angstrom\n", + "e13byk = (e1byk*e3byk)**0.5\n", + "kTbye13 = 993/113.5\n", + "ohmD13 = 0.76 #from collision integral table\n", + "D13 = ((0.001858)*(993**1.5)*((1.0/30)+(1.0/2))**0.5)/((2)*(sigma13**2)*(ohmD13))\n", + "#calculating D23\n", + "sigma23 = (sigma2+sigma3)/2\n", + "kTbye23 = ((993/224.7)*(993/59.7))*0.5\n", + "ohmD23 = 0.762\n", + "D23 = (0.001858*(993**1.5)*((1.0/28)+(1.0/2))**0.5)/(2*(sigma23**2)*ohmD23)\n", + "D = (D13+D23)/2 #in cm^2/s\n", + "l = 0.15 #in cm\n", + "#at z=0 (bulk gas)\n", + "y10 = 0.6\n", + "y20 = 0.2\n", + "y30 = 0.2\n", + "#at z=l (catalyst surface)\n", + "y1l = 0.4\n", + "y2l = 0.3\n", + "y3l = 0.3\n", + "C = 2.0/(82.1*993) #calculated by P/RT\n", + "N1 = (D*C/l)*log((y10+y20)/(y1l+y2l))\n", + "print 'Flux of ethane %0.3E'%N1,'gmol/cm^2.s'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.12 pgno:43" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The liquid-film thickness is: 0.0004 m\n" + ] + } + ], + "source": [ + "#Liquid-phase diffusion\n", + "\n", + "#given data\n", + "from math import pi\n", + "rc = 5e-4 #in m\n", + "D = 7e-10 #in m^2/s\n", + "Cab = 1 #in kmol/m^3\n", + "Na = 3.15e-6 #in kmol/m^2.s\n", + "W = 4*pi*(rc**2)*Na #the rate of reaction\n", + "#let (rc+delta)/delta = 1\n", + "w1 = 4*pi*D*Cab*rc*1 #flux of the reactant to the surface of the catalyst\n", + "rcplusdelta = W/w1\n", + "delta = rc/(rcplusdelta-1) #stagnant liquid-film thickness \n", + "print 'The liquid-film thickness is: ',delta,'m'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.13 pgno:46" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Tortuosity factor is: 2.5\n" + ] + } + ], + "source": [ + "#Diffusivity determination--diaphragm cell\n", + "\n", + "#given data\n", + "from math import log\n", + "from math import pi\n", + "V1 = 60.2 #in cm^3; volume of compartment 1\n", + "V2 = 59.3 #volume of compartment 2 in cm^3\n", + "Ca1i = 0.3 #initial concentration of KCl in compartment 1\n", + "Ca2i = 0 #initial concentration of KCl in compartment 2\n", + "Ca1f = 0.215 #final concentration of KCl in compartment 1\n", + "Ca2f = 0.0863 #final concentration of KCl in compartment 2\n", + "D = 1.51e-5 #diffusivity of KCl in cm^2/s\n", + "tf = 55.2*3600 #time of the experiment in s\n", + "#calcutaling cell constant\n", + "beta = (1/(D*tf))*log((Ca1i - Ca2i)/(Ca1f - Ca2f))\n", + "#diffusion of propionic acid\n", + "Cpa1i = 0.4 #initial concentration of propionic acid in compartment 1\n", + "Cpa2i = 0 #initial concentration of propionic acid in compartment 2\n", + "Cpa1f = 0.32 #final concentration of propionic acid in compartment 1\n", + "Cpa2f = 0.0812 #final concentration of propionic acid in compartment 2 by mass balance\n", + "tfp = 56.4*3600 #time for the experiment\n", + "Dp = (1/(beta*tfp))*log((Cpa1i-Cpa2i)/(Cpa1f-Cpa2f)) #diffusivity of the propionic acid\n", + "#calculating tortusity factor\n", + "A= (pi/4)*(3.5**2) #area of the diaphragm\n", + "epsilon = 0.39 #average porosity of the diaphragm\n", + "l = 0.18 #thickness of hte diaphragm\n", + "tou = (A*epsilon/(beta*l))*(1/V1 + 1/V2)\n", + "print 'Tortuosity factor is: ',round(tou,1)" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-3-Convective_Mass_Transfer_and_Mass_Transfer_Coefficient_1.ipynb b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-3-Convective_Mass_Transfer_and_Mass_Transfer_Coefficient_1.ipynb new file mode 100644 index 00000000..4e0cc29f --- /dev/null +++ b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-3-Convective_Mass_Transfer_and_Mass_Transfer_Coefficient_1.ipynb @@ -0,0 +1,284 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3 : Convective Mass Transfer and Mass Transfer Coefficient" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2 Page no. 80" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)\n", + "(i) Mass transfer-coefficient is 2.161E-03 kmol/(m^2.s.dy)\n", + "(ii) Mass transfer-coefficient is 2.003E-03 kmol/(m^2.s.dy)\n", + "(iii) Mass transfer-coefficient is 0.0449 m/s\n", + "Coefficient of Fg: 0.0021 kmol/m^2.s\n", + "(b)\n", + "(i) kG: 2.400E-06 lbmol/s.ft^2.psi\n", + "(ii) kG: 1.344 lbmol/h.ft^2.atm\n", + "(iii) kG: 4.503E-02 lbmol/h.ft^2.inchHg\n", + "Thickness of the stagnant film is: 2.4E-04 m\n" + ] + } + ], + "source": [ + "#given data\n", + "from math import log\n", + "P = 900.3 #pressure in mmHg\n", + "R = 0.08317 #m^3.bar/kmol.k\n", + "T = 300 #in K\n", + "kG = 2.4E-6 #gas phase mass transfer coefficient\n", + "ky = P*kG\n", + "print '(a)'\n", + "print '(i) Mass transfer-coefficient is %0.3E'%ky,'kmol/(m^2.s.dy)'\n", + "pA1 = 0.0877 #vapor pressure of alochol in bar\n", + "pB1 = (1.2 - 0.0877)*760/1.013 #in mmHg\n", + "pA2 = 0\n", + "pB2 = 1.2*760/1.013 #in mmHg\n", + "kY = kG*pB1*pB2/P\n", + "print '(ii) Mass transfer-coefficient is %0.3E'%kY,'kmol/(m^2.s.dy)'\n", + "kc = kG*(760/1.013)*R*T\n", + "print '(iii) Mass transfer-coefficient is %0.4f'%kc,'m/s'\n", + "Fg = kG*(pB2-pB1)/(log(pB2/pB1))\n", + "print 'Coefficient of Fg: %0.4f'%Fg,'kmol/m^2.s'\n", + "print '(b)'\n", + "kGo = kG\n", + "kG1 = kG*2.2046*51.7/10.764\n", + "print '(i) kG: %0.3E'%kG,'lbmol/s.ft^2.psi'\n", + "kG2 = kG1*3600*14.69\n", + "print '(ii) kG: ',round(kG2,3),'lbmol/h.ft^2.atm'\n", + "kG3 = kG*2.2046*3600/(10.764*0.0393)\n", + "print '(iii) kG: %0.3E'%kG3,'lbmol/h.ft^2.inchHg'\n", + "pB2 = 1.2\n", + "pB1 = 1.2 - 0.0877\n", + "P = 1.2\n", + "Dab = 0.102*(1.013/1.185)*((300.0/273)**1.75)*1e-4 #Diffusivity value at 1.2bar and 300K\n", + "pBM = (pB2-pB1)/log(pB2/pB1)\n", + "kG4 = kG*(760/1.013)\n", + "d = Dab*P/(kG4*R*T*pBM)\n", + "print 'Thickness of the stagnant film is: %0.1E'%d,'m'\n", + "#Answers may vary due to round off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5 Page no. 99" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Diffusivity of H2S in water at 25C Dab: 1.17E-09 m^2/s\n" + ] + } + ], + "source": [ + "#given data\n", + "Q = 13.2e-6 #liquid flow rate (pi*r^2*v)\n", + "l = 0.05 #length of the jet\n", + "W = 34 #Molecular weight of H2S\n", + "P = 1.03 #total pressure in the jet chamber\n", + "Cai = P*(0.1136) #kmol/m^3\n", + "Cab = 0\n", + "Rate = (4.42e-7)/W #in m^3/s\n", + "#let Dab = 1\n", + "Dab = 1\n", + "rate = 4*((Dab*Q*l)**0.5)*Cai\n", + "Dab = ((Rate/(4*Cai))**2)/(Q*l)\n", + "print 'Diffusivity of H2S in water at 25C Dab: %0.2E m^2/s'%Dab" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6 Page no. 100" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Rate of absorption of CO2 from the bubbles per minute: 4.760E-05 gmol/min\n" + ] + } + ], + "source": [ + "#given data\n", + "from math import pi\n", + "tc = 1.0/20 #contact time of a liquid element with a gas bubble db/vb\n", + "Dab = 2.19e-5\n", + "kL = 2*(Dab/(pi*tc))**0.5 #Mass transfer coefficient\n", + "tr = 0.3/0.2 #residence time of a single bubble\n", + "r = 1.0/2 #radius of the bubble\n", + "vol = (4.0/3)*pi*(r**3) #volume of the bubble\n", + "area = 4*pi*(r**2) #surface area of the bubble\n", + "Cs = 1.493e-5 #solubility of CO2 water\n", + "Cb = 0\n", + "Amt = kL*area*(Cs-Cb)*tr #amount of CO2 absorbed from a single bubble during its residence time\n", + "Bub = 15/vol\n", + "rate = Amt*Bub\n", + "print 'Rate of absorption of CO2 from the bubbles per minute: %0.3E gmol/min'%rate\n", + "#Answer vary due to round off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7 Page no.101" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a)\n", + "Film thickness: 2.16e-05 m\n", + "(b)\n", + "The contact time: 0.308 s\n", + "(c)\n", + "The fractional rate of surface renewal: 4.13 per sec\n" + ] + } + ], + "source": [ + "#given data\n", + "from math import pi\n", + "p = 2 #in atm\n", + "x = 2.0/1640 #mole fraction\n", + "W = 44*x + 18*(1-x) #Molecular wieght of the solution\n", + "sol = 997.0/W #Moles of solution per m^3\n", + "CO2 = 55.4*x #Moles of CO2 per m^3 solution\n", + "Cco = 2.3/44 #Concentration of the carbonated solution(kmol/m^3)\n", + "RoW = 1.0/(60*1000) #Volume rate of input of water(m^3/s)\n", + "RoA = RoW*Cco #rate of absorption of CO2 in the vessel(kmol/s)\n", + "V = 8e-3 #volume of the gas-liquid dispersion in the vessel(m^3)\n", + "a = 80 #specific interfacial area of contact between the dispersed gas snd the liquid(m^2/m^3)\n", + "#let kL = 1\n", + "kL = 1.0\n", + "Dab = 1.92e-9 #diffusivity of CO2\n", + "rateOA = V*a*(CO2-Cco)\n", + "kL = RoA/rateOA\n", + "#(a) part\n", + "delta = Dab/kL\n", + "print '(a)'\n", + "print 'Film thickness: %0.2e m'%delta\n", + "#(b) part\n", + "tc = (4*Dab)/(pi*(kL**2))\n", + "print '(b)'\n", + "print 'The contact time: %0.3f s'%tc\n", + "#(c) part\n", + "s = (kL**2)/(Dab)\n", + "print '(c)'\n", + "print 'The fractional rate of surface renewal: %0.2f per sec'%s" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8 Page no. 104" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The effluent concentration: 1 kg/m^3\n" + ] + } + ], + "source": [ + "#given data\n", + "from math import exp\n", + "Cb1 = 0 #concentration of the benzoic acid at the inlet\n", + "Cs = 3.01 #concentration of the liquid in contact with the surface of a sphere\n", + "dp = 0.8 #diameter of the sphere\n", + "vo = 2.2 #superficial liquid velocity\n", + "nu = 0.0095 #kinematic viscosity\n", + "Dab = 1e-5 #diffusivity of the solute\n", + "e = 0.4 #bed voidage\n", + "h = 70 #height of the column\n", + "QbyA = 2.2 #liquid flow rate per unit area of the bed\n", + "Re = (dp*vo)/nu #Reynolds number\n", + "Sc = nu/Dab #Schmidt number\n", + "ejd = 0.25*((Re)**(-0.31)) #epsilon*jD\n", + "Sh = ejd*Re*(Sc**(1.0/3))/e #Sherwood number\n", + "kL = Sh*Dab/(dp)\n", + "a = 6*(1-e)/dp #specific interfacial velocity\n", + "Cb2 = Cs-((Cs)/exp(kL*a*h/(QbyA)))\n", + "print 'The effluent concentration: %i kg/m^3'%round(Cb2,1)" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-4-Interphase_Mass_Transfer_1.ipynb b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-4-Interphase_Mass_Transfer_1.ipynb new file mode 100644 index 00000000..9b2f69b0 --- /dev/null +++ b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-4-Interphase_Mass_Transfer_1.ipynb @@ -0,0 +1,566 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4 : Interphase Mass Transfer" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1 Page no. 133" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) The interfacial concentrations are\n", + " xi = 0.03044 and yi = 0.03653\n", + "\n", + "(b) The overall gas-phase coefficient, Ky = 2.502 kmol/(h)(m^2)(dy)\n", + " The overall liquid-phase coefficients, Kx = 3.002 kmol/(h)(m^2)(dy)\n", + "\n", + "(c) The local mass flux, Na = 0.025 kmol/(h)(m^2)\n", + " Fraction of the total mass transfer resistance in the gas-phase = 0.347\n", + " Fraction of the total mass transfer resistance in the liquid-phase = 0.653\n" + ] + } + ], + "source": [ + "#Overall coefficient and driving force\n", + "\n", + "yb = 0.04 #bulk concentration of A in the gas-phase\n", + "xbst = yb/1.2 #xb star(equilibrium value)\n", + "xb = 0.025 #actual concentration of the solute in the bulk liquid\n", + "m = 1.2 #slope of the equilibrium line\n", + "#on gas phase basis\n", + "diff1 = 0.04 - (1.2*xb)\n", + "#on liquid phase basis\n", + "diff2 = xbst - xb\n", + "\n", + "ky = 7.2 #local individual mass transfer coefficients\n", + "kx = 4.6\n", + "xi = 0.03044 #interfacial concentration\n", + "yi = 1.2*xi\n", + "\n", + "Ky = 1.0/((1.0/ky)+(m/kx)) #overall gas-phase coefficient\n", + "Kx = 1.0/((1.0/(m*ky) + (1.0/kx))) #overall liquid-phase coefficient\n", + "Na = ky*(yb - yi)\n", + "Mtrg = (1.0/ky)/(1.0/Ky) #fraction of the total mass transfer resistance in the gas-phase\n", + "Mtrl = (1.0/kx)/(1.0/Kx) #fraction of the total mass transfer resistance in the liquid-phase\n", + "print '(a) The interfacial concentrations are'\n", + "print ' xi = %0.5f'%xi,' and yi = %0.5f'%yi\n", + "print\n", + "print '(b) The overall gas-phase coefficient, Ky = %0.3f'%Ky,'kmol/(h)(m^2)(dy)'\n", + "print ' The overall liquid-phase coefficients, Kx = %0.3f'%Kx,'kmol/(h)(m^2)(dy)'\n", + "print\n", + "print '(c) The local mass flux, Na = %0.3f'%Na,'kmol/(h)(m^2)'\n", + "print ' Fraction of the total mass transfer resistance in the gas-phase = %0.3f'%Mtrg\n", + "print ' Fraction of the total mass transfer resistance in the liquid-phase = %0.3f'%Mtrl" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2 Page no. 134" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Given mass transfer flux is 1.2 kmol/(h)(m^2) and Theorectical flux is 1.417\n", + "The actual overall coefficient is 21.43 kmol/(h)(m^2)(dy)\n", + "The interfacial resistance is 0.00714 (h)(m^2)(dy)/kmol\n" + ] + } + ], + "source": [ + "#Interfacial resistance to mass transfer\n", + "\n", + "#local individual mass transfer coefficients\n", + "ky = 60\n", + "kx = 35\n", + "#slope of the equilibrium line\n", + "m = 0.8\n", + "#local mass transfer flux\n", + "Nag = 1.2\n", + "yb = 0.08\n", + "xb = 0.03\n", + "ybst = m*xb\n", + "Ky = 1.0/((1.0/ky)+(m/kx)) #overall mass transfer coefficient\n", + "Na = Ky*(yb - ybst) #theoretical flux\n", + "print 'Given mass transfer flux is %0.1f'%Nag,'kmol/(h)(m^2) and Theorectical flux is %0.3f'%Na\n", + "Kytrue = (Nag)/(yb - m*xb)\n", + "resis = (1/Kytrue) - (1/Ky)\n", + "print 'The actual overall coefficient is %0.2f'%Kytrue,'kmol/(h)(m^2)(dy)'\n", + "print 'The interfacial resistance is %0.5f'%resis,'(h)(m^2)(dy)/kmol'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3 Page no. 134" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Flux of the solute, Na = 0.01919kmol/(h)(m^2)\n", + "(b) The local flux, Na = 0.00124\n", + "(c) The overall liquid-phase mass transfer coefficient is, Kx = 21.55kmol/(h)(m^2)(dx)\n", + "(d) Individual gas-phase driving force = 0.0037 mole fraction\n", + " Difference of partial pressure = 0.00536 bar\n", + " Overall Gas-phase driving force = 0.0272\n" + ] + } + ], + "source": [ + "#Application to a gas-liquid system\n", + "\n", + "P = 1.45 #Total pressure\n", + "mp = 3.318e4 #slope of the equilibrium relation given in the terms of partial pressure\n", + "xs = 0.065 #mole fraction of the solute in the bulk gas\n", + "pb = P*xs #partial pressure of the solute A in the bulk gas\n", + "T = 303 #Temperature of the falling water\n", + "R = 0.08317 #universal gas constant\n", + "kc = 90.3 #gas-phase mass transfer coefficient\n", + "ky = P*kc/(R*T) #gas-phase mass transfer coefficient\n", + "xi = 0.00201 #interfacial concentration of the solute in the liquid\n", + "yb = xs\n", + "fr = 0.136 #fraction of the gas-phase resistance\n", + "pi = mp*xi #in mmHg\n", + "pi = pi*1.013/760 #in bar\n", + "yi = pi/P\n", + "m = mp/(P*(760/1.013))\n", + "Na = ky*(yb - yi)\n", + "print '(a) Flux of the solute, Na = %0.5fkmol/(h)(m^2)'%Na\n", + "gR = (1/ky)\n", + "tmR = gR/0.136\n", + "lR = tmR*(1-0.136)\n", + "kx = m/lR\n", + "Nanew = xi - (Na/kx)\n", + "print '(b) The local flux, Na = %0.5f'%Nanew\n", + "Kx = 1/((1/kx) + (1/(m*ky)))\n", + "print '(c) The overall liquid-phase mass transfer coefficient is, Kx = %0.2fkmol/(h)(m^2)(dx)'%Kx\n", + "deltay = yb - yi\n", + "deltap = P*deltay\n", + "deltayO = yb - m*Nanew\n", + "print '(d) Individual gas-phase driving force = %0.4f mole fraction'%deltay\n", + "print ' Difference of partial pressure = %0.5f bar'%deltap\n", + "print ' Overall Gas-phase driving force = %0.4f'%deltayO\n", + "#Answers may vary very little due to round off error" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 4.4 Page no. 136" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Concentration of SO2 in the effluent solution: 1.495e-03 mole fraction\n", + " Liquid phase mass transfer coefficient: 25.7143 kmol/(h)(m^2)(dx)\n", + " The surface renewal rate is: 10.9474 per second\n", + "(b) New flow rate of water through the cell: 91.3 ml/min\n" + ] + } + ], + "source": [ + "#Mass transfer in a continuous-stirred cell\n", + "\n", + "from sympy.solvers import solve\n", + "from sympy import Symbol\n", + "Yin = 0.142/(1 - 0.142) #14.2% SO2 was in gas flow rate\n", + "Yout = 0.11/(1 - 0.11) #As 11% SO2 is in outlet gas at steady state\n", + "Qair = 0.0535 #on SO2-free basis(flow rate)\n", + "ABspt = Qair*(Yin - Yout) #Rate of absorption\n", + "Qwater = 27 #Water flow rate(in ml/min)\n", + "Qwater = Qwater/18 #in gmol/min\n", + "xb = ABspt/1.5 #bulk concentration of the liquid\n", + "print '(a) Concentration of SO2 in the effluent solution: %0.3e mole fraction'%xb\n", + "yb = 0.11 #bulk concentration of the gas-phase\n", + "m = 31.3 #slope of the equilibrium concentratin line\n", + "ybst = m*xb\n", + "Dab = 1.51e-5 #diffusivity of SO2 in water\n", + "ky = 3.8 #gas-phase mass transfer coefficient\n", + "ABspt = ABspt*60/1000 #in kmol/h\n", + "Area = 31.5/10000 #in m^2\n", + "Ky = ABspt/(Area*(yb-ybst)) #overall mass-transfer coefficient\n", + "kx = m/((1/Ky)-(1/ky))\n", + "print ' Liquid phase mass transfer coefficient: %0.4f kmol/(h)(m^2)(dx)'%kx\n", + "#to calculate surface renewal rate\n", + "C = 1.0/(18.0/1000) #in kmol/m^3\n", + "kl = kx/C\n", + "kl = kl*100/3600\n", + "s = (kl*kl)/Dab\n", + "print ' The surface renewal rate is: %0.4f per second'%s\n", + "yb=0.1\n", + "nABspt = Qair*(Yin - (yb/0.9))\n", + "var = Symbol('var')\n", + "ybst = solve(nABspt*0.001*60 - Ky*Area*(yb-var),var)\n", + "xb = ybst[0]/m\n", + "Q = nABspt*18/xb\n", + "print '(b) New flow rate of water through the cell: %0.1f ml/min'%Q\n", + "#Answers may vary due to round-off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5 Page no. 137" + ] + }, + { + "cell_type": "code", + "execution_count": 95, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Interfacial concentration of the phases are xi = 0.00222 and yi = 0.0157.\n", + "(b) Ky = 7.28\n", + " Kx = 41.2\n", + " Na = 0.065\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjQAAAEfCAYAAABWCFxrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xd4FNXXwPHvSehIAqETuqEoSFM6KqBUQV6lK4qgiBQV\nxa4UxYb+bCiIAiIgRVERrIAiCtIVpUjvEEEkdAglOe8fMwmbTTZsSNkknM/z7AM7c2fmzOzM5My9\nd2ZEVTHGGGOMycqCAh2AMcYYY0xqWUJjjDHGmCzPEhpjjDHGZHmW0BhjjDEmy7OExhhjjDFZniU0\nxhhjjMny0iWhEZFyIhIrInXSY/5+LL+RiPwlImdEZEEg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\nSZ8BJgLvAEOA/UkuGz2dEyPAlsArJYqj4DmnScsbrH3O+beer7mUtSEtNx74GEnyeWsJ9mdm5oTG\n2qU1v6y3zdu+bd7npVBoUOvhJD0yh0XEPRHxRETMILkslGsRsEOJ4niTJKn7yDlL6kiSOLXK3DmS\nPk5ymewZoBMwtvEaZmbFcUJj7UVuYvEQyS/3o/LKHJeWqy1zLBuRjCP5gKSvsPblnAeA/STt1ci+\nlgMfL+KY00l6qvLP+SiS8Tu1ReyjFC4BtiMZ2DwU+LGkg1rp2GbWhvkuJ2svtGYlImZKuhWokbQ+\n8Agf3uV0S6R3GTV3/0W4H/gxcGN66/Xu6bHzLy9dBBwDTJZ0DkmvRmfgUODkdJzQc8D/Sfoe8A/g\n/Yh4Nj+miHhL0q+BYZKWAZNI7nI6C5gWERPX6WybQdLhJONmjo2Il4BLJX0VGC9pr4hYVO4YzKzt\nckJjWVbocs5atys3UPZE4N/AYJK7m+YD55HcWdTUMVoUS0Q8IOlHwM+Aw4BngeNJkprIKbdY0hdI\nbq0eSnJpaCHwV5LeFoDfkYzBOYfkLq+XgTW3PX/k2BExQtJrwPdIbjF/A7gBOKOYuBvYVhRJO5Lc\n1XRTROSOmxlMciv3DcAhzd2/mZkiPG+VmZmZZZvH0JiZmVnmOaExMzOzzHNCY2ZmZpnnhMbMzMwy\nzwmNmZmZZZ4TGjMzM8s8JzRmZmaWeU5ozMzMLPOc0JiZmVnm/T8G7Wqbwk5KLQAAAABJRU5ErkJg\ngg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x8f263c8>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "#Graphical determination of interfacial concentration\n", + "\n", + "%matplotlib inline\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "from sympy.solvers import solve\n", + "from sympy import Symbol\n", + "#equilibrium data\n", + "p = [0.6,1.7,4.7,8.1,11.8,19.7,36,52,79] #partial pressure\n", + "g = [0.02,0.05,0.1,0.15,0.2,0.3,0.5,0.7,1.0] #g SO2 per 100g water\n", + "P = 4.5 #total pressure\n", + "kx = 80 #gas-phase mass transfer coefficients\n", + "ky = 15 #liquid-phase mass transfer coefficients\n", + "P = P*760/1.013 #in mmHg\n", + "x = []\n", + "y = []\n", + "i = 0\n", + "for i in range(0,len(p)):\n", + " y.append(p[i]/P)\n", + "for i in range(0,len(g)):\n", + " x.append(((g[i]/64)/((g[i]/64)+(100/18))))\n", + "fig = plt.figure()\n", + "ax = fig.add_subplot(111)\n", + "plt.plot(x,y,label='Exact plot')\n", + "#Point P\n", + "xb = 0.0014 #the bulk concentration of two phases at the given locations\n", + "yb = 0.02\n", + "slope = -80.0/15\n", + "z = np.polyfit(x,y,2)\n", + "f = np.poly1d(z)\n", + "#calculate new x's and y's\n", + "x_new = np.linspace(x[0],x[-1],50)\n", + "y_new = f(x_new)\n", + "plt.plot(x_new,y_new,'r',label='After cuvefitting')\n", + "#finding the intersection point\n", + "xs = Symbol('xs')\n", + "x_int = solve(z[0]*xs**2 + z[1]*xs + z[2] + 5.3*xs - 0.0275,xs)\n", + "y_int = slope*x_int[1] + 0.0275\n", + "plt.plot(xb,yb,'bo')\n", + "plt.plot(x_int[1],y_int,'bo')\n", + "plt.plot((xb,x_int[1]),(yb,y_int),'b-')\n", + "plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)\n", + "plt.xlabel('mol fraction \"x\"',fontsize=16)\n", + "plt.ylabel('mol fraction \"y\"',fontsize=16)\n", + "plt.title('Plot of equilibrium line and calculating interfacial concentration',fontsize=14)\n", + "xy=(xb,yb)\n", + "ax.annotate('(%s, %s)' % xy, xy=xy, textcoords='data')\n", + "xint = '%0.5f'%x_int[1]\n", + "yint = '%0.4f'%y_int\n", + "xy=(xint,yint)\n", + "ax.annotate('(%s, %s)' % xy, xy=xy, textcoords='data')\n", + "print '(a) Interfacial concentration of the phases are xi = %0.5f'%x_int[1],' and yi = %0.4f.'%y_int\n", + "m = 5.65 #taking the equilibrium line almost linear near interfacial concentration\n", + "Ky = 1.0/((1.0/15)+(m/80))\n", + "Kx = 1.0/((1.0/(m*15))+(1.0/80))\n", + "Na = ky*(yb-y_int)\n", + "print '(b) Ky = %0.2f'%Ky\n", + "print ' Kx = %0.1f'%Kx\n", + "print ' Na = %0.3f'%Na\n", + "#Answers may vary due to round-off errors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.6 Page no. 148" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Operating line is Yn+1 = 1.455Xn + 0.001360\n", + "Number of real trays = 59\n" + ] + } + ], + "source": [ + "#Number of trays for countercurrent contact\n", + "\n", + "from math import log\n", + "from sympy import Symbol\n", + "F_C = 0.12 #feed concentration\n", + "Gs = 6000*(1-F_C) #feed rate on solute free basis\n", + "s = 6000*F_C #mass of solute entering\n", + "Yn = F_C/(1-F_C) #feed concentration\n", + "Y1 = 0.00136 #exit concentration\n", + "Xo = 0 #entering solvent does not have any solute in it\n", + "Ls = 7685 #solvent input rate\n", + "#doing mass balance\n", + "X1 = Gs*(Yn - Y1)/Ls #exit concentration of solute\n", + "Yn = Symbol('Yn+1')\n", + "sl = (Ls/Gs)\n", + "print 'Operating line is ',Yn,' = %0.3fXn'%sl,' + %f'%Y1\n", + "#Since the equilibrium line and operating lines are linear\n", + "#Therefore we can calculate the number of trays using Kremser equation\n", + "Yn = F_C/(1-F_C)\n", + "alpha = 1.32 #slope of the equilibrium line \n", + "A = Ls/(alpha*Gs) #Absorption factor\n", + "#using Kremser equation\n", + "N = log(((Yn-(alpha*Xo))/(Y1-(alpha*Xo)))*(1-(1.0/A))+(1.0/A))/log(A)\n", + "Nom = N/0.4\n", + "print 'Number of real trays = %d'%Nom" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 4.7 Page no. 151" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) The test data fit the Freundlich adsorption isotherm in the form Y = aX^B\n", + " After fitting the data alpha is 0.184 and beta is 1.468\n", + "(b) Amount of adsorbent required 609.545 kg\n" + ] + } + ], + "source": [ + "#Batch adsorption from a solution\n", + "\n", + "%matplotlib inline\n", + "from math import log\n", + "from math import exp\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "cl = [15,40,60,100,135,210,325,450] #grams of clay used\n", + "pA = [9.1,7.81,6.93,5.66,4.76,3.38,2.44,1.48] #% A in the solution in equilibrium\n", + "i=0\n", + "X = []\n", + "Y = []\n", + "for i in range(0,len(cl)):\n", + " X.append(log((100-((90000/(100-pA[i]))-900))/cl[i]))\n", + " Y.append(log(((90000/(100-pA[i]))-900)/900))\n", + "#fitting the log-log data with degree 1\n", + "z = np.polyfit(X,Y,1)\n", + "f = np.poly1d(z)\n", + "print '(a) The test data fit the Freundlich adsorption isotherm in the form Y = aX^B'\n", + "print ' After fitting the data alpha is %0.3f'%exp(z[1]),' and beta is %0.3f'%z[0]\n", + "ads = 90 #amount of solute to be removed(in kg)\n", + "solv = 900 #amount of water remained(in kg)\n", + "Y = 10.0/solv\n", + "#putting in Freundlich adsorption isotherm\n", + "m = 90.0/(Y/exp(z[1]))**(1/z[0])\n", + "print '(b) Amount of adsorbent required %0.3f kg'%m\n", + "#Answers may vary due to round-off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.9 Page no. 154" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Amount of solvent B required in single stage contact is 4306.7\n", + "(b) The total amount of extracting solvent required is 1166 kg\n", + "(c) Required amount of solvent is 679.03 kg\n" + ] + } + ], + "source": [ + "#Multistage crosscurrent contact\n", + "\n", + "from sympy import Symbol\n", + "from sympy.solvers import solve\n", + "from math import log\n", + "Ls = 1000*(1-0.15) #amount of the carrier phase in the feed\n", + "Xo = 15.0/85 #feed concentration\n", + "e_con = 0.15*0.05/0.85 #exit concentration\n", + "Y1 = 3.75*e_con #equilibrium concentration\n", + "Yo = 0\n", + "Gs = 850*(Xo-e_con)/Y1\n", + "print '(a) Amount of solvent B required in single stage contact is %0.1f'%Gs\n", + "#an ideal three-stage crosscurrent cascade\n", + "#X1,X2,X3 are the intermediate concentrations\n", + "Gsn = Symbol('Gsn')\n", + "X1 = Symbol('X1')\n", + "X1 = solve(850*(0.1765-X1)-Gsn*3.75*X1,X1)\n", + "X2 = Symbol('X2')\n", + "X2 = solve(850*(X2-0.00882)-Gsn*3.75*0.00882,X2)\n", + "Gsn = solve(850*(X1[0]-X2[0])-Gsn*3.75*X2[0],Gsn)\n", + "nGs = 3*Gsn[0] #total amount of solvent\n", + "print '(b) The total amount of extracting solvent required is %0.0f kg'%nGs\n", + "#using material balance for nth stage and then integrating from X= Xo to X = Xf = 0.00882\n", + "Gs = (850/3.75)*log(Xo/e_con)\n", + "print '(c) Required amount of solvent is %0.2f kg'%Gs\n", + "#Answers may vary due to round-off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.11 Page no. 158" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Flux of the drug, Na = 2.72e-03 mg/cm^2.h\n" + ] + } + ], + "source": [ + "#Rate of drug delivery\n", + "\n", + "Cml = 0.513 #solubility of progesterone in the polymer(mg/cm^3)\n", + "beta = 0.022 #partition coefficient\n", + "Clb = 0 #drug concentration in the body fluid\n", + "Dm = 5.94e-3 #diffusivity of the drug in the polymer(in cm^2/h)\n", + "Dl = 2.08e-3 #diffudivity of the drug in the body(cm^2/h)\n", + "lm = 0.08 #thickness of the silicone membrane(cm)\n", + "dl = 0.008 #thickness of the diffusion fluid layer(cm)\n", + "Na = (beta*Cml - Clb)/((beta*lm/Dm)+(dl/Dl))\n", + "print 'Flux of the drug, Na = %0.2e mg/cm^2.h'%Na" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-5-Gas-Liquid_Contacting_Equipment_1.ipynb b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-5-Gas-Liquid_Contacting_Equipment_1.ipynb new file mode 100644 index 00000000..4f25408a --- /dev/null +++ b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/Chapter-5-Gas-Liquid_Contacting_Equipment_1.ipynb @@ -0,0 +1,259 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5 Gas-Liquid Contacting Equipment" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1 Page no. 201" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(a) Tower diameter by Fair's method is 6.42 ft\n", + " Flooding velocity by Fair's method is 5 ft\n", + " Flooding velocity by Kister ans Haas method is 4.86 ft/s\n", + " It is very close that is obtained by Fairs method and is acceptable\n", + "(b) Downcomer area = 1.767 ft^2 and downcomer liquid velocity = 0.105 ft/s\n", + " These are acceptable values. So we keep the revised column diameter at Dc = 6.12 ft\n", + "(c) Number of holes = 3004 placed on a triangular pitch\n", + "(d) Select an outlet weir height of hw = 2 inches on the tray\n", + "(e) Dry tray pressure drop, hd = 1.75 inches of liquid\n", + " how = 0.92 inch\n", + " pressure drop for flow of the vapour through the liquid\n", + " head loss for liquid flow below the downcomer flow, had = 0.85 inch\n", + " total pressure drop = 7.27 inch of liquid\n", + " The rate of entrainment is 0.0357 mol per mol gross downflow\n", + " The corresponding vapour velocity at the hole at weeping is 22.5 ft/s\n", + "Total column height = 60 ft\n" + ] + } + ], + "source": [ + "#Design of a sieve tray\n", + "\n", + "from math import pi\n", + "from math import sqrt\n", + "tL = 14100.0 #top liquid rate(kg/h)\n", + "bL = 15300.0 #Bottom liquid rate(kg/h)\n", + "tG = 23300.0 #top vapour rate(kg/h)\n", + "bG = 24500.0 #Bottom vapour rate(kg/h)\n", + "phoL = 810.0 #liquid density(kg/m^3)\n", + "phoG = 2.65 #average vapour density(kg/m^3)\n", + "sig = 20.5 #liquid surface tension(dyne/cm)\n", + "T = 82.0 #Temperature\n", + "p = 18.0 #average pressure at the column top(psia)\n", + "#Fair's method\n", + "Flv = (bL/bG)*(phoG/phoL)**(0.5) #Flow parameter\n", + "Csb = 0.285 #Souders-Brown flooding constant\n", + "usfl = Csb*((20/sig)**0.2)*(((50.4-0.165)/(0.165))**0.5) #flooding velocity\n", + "us = 5*0.7 #operating velocity when operating velocity is 70% of flooding velocity\n", + "Vfl = (bG/phoG)*35.315 #Volumetric flow rate of the vapour\n", + "Aa = Vfl/(us*3600)\n", + "fd = 0.2 #taking fractional downcomer area\n", + "At = Aa/(1-fd) #Tower cross-section\n", + "Dc = (4*32.4/pi)**(0.5) #Tower diameter\n", + "print \"(a) Tower diameter by Fair's method is %0.2f ft\"%Dc\n", + "print \" Flooding velocity by Fair's method is %0.0f ft\"%usfl\n", + "\n", + "#Kister and Haas method\n", + "dh = 3.0/8 #hole diameter\n", + "Af = 0.1 #fractional hole area on the tray\n", + "Dc = 6\n", + "lw = 0.727*Dc\n", + "L = bL/(0.81*3.78*60) #Liquid rate(gpm)\n", + "Ql = 83.3/(lw*12) #gpm per inch\n", + "fh = 0.1\n", + "hctw = (0.29*(0.1**-0.791)*(dh**0.833))/(1+(0.0036*(1.6**-0.59)*(0.1**-1.79)))\n", + "n = 0.0231*(dh/0.1)\n", + "hct = hctw*(62.2/50.4)**(0.5*(1-0.0866))\n", + "Csb = 0.144*((dh*dh*20.5/50.4)**0.125)*((0.165/50.4)**0.1)*((18/0.749)**0.5)\n", + "usfl = Csb*((50.4-0.165)/0.165)**0.5\n", + "print ' Flooding velocity by Kister ans Haas method is %0.2f ft/s'%usfl\n", + "print ' It is very close that is obtained by Fairs method and is acceptable'\n", + "#(b)Check of the estimated downcomer area\n", + "area = 3.38 #Estimated downcomer area\n", + "liq_f = 15300*35.315/(810*3600) #The clear liquid flow rate\n", + "liq_v = liq_f*area #The downcomer liquid velocity\n", + "d_vol = area*18/12 #Downcomer volume\n", + "res_t = d_vol/liq_f #Residence time\n", + "n_ar = Aa/(1-(2*0.06)) #Revised tower cross-section\n", + "Dc = (4*n_ar/pi)**0.5 #Tower diameter\n", + "d_area = n_ar*0.06 #Downcomer area\n", + "lw = 3.75 #Weir length\n", + "d_liqv = liq_f/d_area #downcomer liquid velocity\n", + "print '(b) Downcomer area = %0.3f ft^2'%d_area,' and downcomer liquid velocity = %0.3f ft/s'%d_liqv\n", + "print ' These are acceptable values. So we keep the revised column diameter at Dc = %0.2f ft'%Dc\n", + "#(c)Effective bubbling area and layout of the holes\n", + "eff_area = Aa-3 #effective bubbling area\n", + "frac_area = 0.905*(1.0/3)*(1.0/3)\n", + "tot_harea = eff_area*frac_area\n", + "n_holes = tot_harea/((pi/4)*((3.0/96)**2))\n", + "print '(c) Number of holes = %0.0f placed on a triangular pitch'%n_holes\n", + "#(d)Wier height\n", + "hw = 2\n", + "print '(d) Select an outlet weir height of hw = %0.0f inches on the tray'%hw\n", + "#(e)Pressure drop calculation\n", + "uh = Vfl/(tot_harea*3600) #Vapour velocity through the holes\n", + "thick = 3.0/16 #select a tray thickness\n", + "thbyD = thick/(3.0/8) #tray thickness/hole dia\n", + "Co = 0.73 #the orifice coefficient\n", + "hd = (0.186/(Co**2))*(0.165/50.4)*(39.1**2) #Dry tray pressure drop\n", + "print '(e) Dry tray pressure drop, hd = %0.2f inches of liquid'%hd\n", + "Ql = 83.3/(lw*12) #in gpm per inch of weir length\n", + "Fw = 1.27 #weir correction factor\n", + "how = 0.48*Fw*(Ql**(2.0/3)) \n", + "print ' how = %0.2f inch'%how\n", + "hc = hw + how\n", + "us = 326500/(22.9*3600)\n", + "beta = 0.6\n", + "hl = 0.6*2.92 #first calculate us and us(pg^0.5) and then from figure take beta\n", + "print ' pressure drop for flow of the vapour through the liquid'\n", + "Ada = 0.5*3.75/12 #area for liquid flow\n", + "had = 0.03*(83.3/(100*Ada))**2 \n", + "print ' head loss for liquid flow below the downcomer flow, had = %0.2f inch'%had\n", + "print ' total pressure drop = %0.2f inch of liquid'%(hc+hd+hl+had)\n", + "phi = (bL/bG)*(0.165/50.4)**0.5\n", + "print ' The rate of entrainment is %0.4f mol per mol gross downflow'%phi\n", + "sig = 20.5 #in dyne/cm\n", + "phol = 50.4 #lb/ft^3\n", + "dH = 3.0/8 #in inch\n", + "hsig = (0.04*sig)/(phol*dH) \n", + "hd = 0.58\n", + "uh = sqrt(((0.73**2)/0.186)*(50.4*hd/0.165))\n", + "print ' The corresponding vapour velocity at the hole at weeping is %0.1f ft/s'%uh\n", + "#column height\n", + "height = 29*1.5\n", + "ex_sp = 3*0.5\n", + "tot_h = 43.5+1.5+1.5+9+4\n", + "#total column height will be tray spacing + extra space for feed trays\n", + "# + extra space at trays with manholes + bottom space + top space\n", + "print 'Total column height = %0.0f ft'%tot_h\n", + "#Answers may vary due to round off error" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "## Example 5.2 Page no. 237" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Tower diameter when raschig ring is used as packing material, Dc = 0.90 m\n", + "Tower diameter, Dc when Pall ring is used, = 0.68 m\n", + "Power requirement is 287.25W\n", + "Actual Power requirement is 441.92W\n", + "volume fraction liquid holdup in the bed 0.0725 m^3 liquid per m^3 bed volume\n" + ] + } + ], + "source": [ + "#Design of packed tower\n", + "\n", + "from math import pi\n", + "from math import sqrt\n", + "L = 37525 #Liquid rate\n", + "G = 1500.0 #gas rate\n", + "M = 0.9*28.8 + (0.1*64) #average molecular weight of the feed gas\n", + "R = 0.08317 #gas constant\n", + "T = 303 #in K\n", + "P = 1.013 #in bar\n", + "phoG = P*M/(R*T) #kg/m^3\n", + "phoG_c = 0.081 #in lb/ft^3\n", + "muL = 0.81 #liquid viscosity\n", + "st = 70 #surface tension\n", + "phoL = 996 #in kg/m^3\n", + "phoL_c = 62 #in lb/ft^3\n", + "Flv = (L/G)*(phoG/phoL)**0.5\n", + "#Calculation of column diameter using raschig ring as packing material\n", + "dp = 3.0/4 #size of packing material\n", + "cp = 0.021 #from Eckert's GPDC chart(capacity parameter)\n", + "pwbypl = 1 #pho_w by pho_l\n", + "Fp = 94.5 #packing factor(in per ft)\n", + "gc = 4.18e8 #in ft/h^2\n", + "Gdash = sqrt((cp*phoG_c*phoL_c*gc)/(Fp*pwbypl*(muL**0.2)))\n", + "op_Gdash = Gdash*0.7\n", + "op_Gdash = op_Gdash*0.453592/(0.3048*0.3048)\n", + "tow_cross = G/op_Gdash\n", + "Dc = sqrt(4*tow_cross/pi)\n", + "print 'Tower diameter when raschig ring is used as packing material, Dc = %0.2f m'%Dc\n", + "#Calculation of column diameter when 50mm Pall ring is used as packing material\n", + "cp = 0.52 #capacity parameter from chart\n", + "Fp = 25 #flow parameter\n", + "v = 0.81 #liquid viscosity\n", + "Cs = cp/((Fp**0.5)*(v**0.05)) \n", + "usG = Cs*sqrt((phoL - phoG)/phoG) #superficial gas velocity\n", + "usG = usG*0.3048 \n", + "Gflow = G/(phoG*3600) #volumeteric gas flow rate\n", + "tow_cros = Gflow/usG #tower cross section\n", + "Dc = sqrt(4*tow_cros/pi) #tower diameter\n", + "print 'Tower diameter, Dc when Pall ring is used, = %0.2f m'%Dc\n", + "P_drop = 0.2*(5.0/0.3048) #pressure drop across the bed of 5m height\n", + "op_Pdrop = P_drop*1.1\n", + "op_Pdrop = op_Pdrop*0.0254*phoL*9.81\n", + "G = G/3600\n", + "Pow = (op_Pdrop/phoG)*G\n", + "print 'Power requirement is %0.2fW'%Pow\n", + "Pow = Pow/0.65\n", + "print 'Actual Power requirement is %0.2fW'%Pow\n", + "#calculation of operating liquid holup using Engel's equation\n", + "ap = 102\n", + "muL = 8.1e-4 #liquid viscosity\n", + "sigL = 0.07 #surface tension\n", + "usL = (L/phoL)/(0.362*3600) #superficial velocity\n", + "hLo = 0.93*(((usL**2)*102/9.81)**(1.0/6))*(((muL**2)*(ap**3)/((phoL**2)*9.81))**(1.0/10))*((0.07*102*102/phoL*9.81)**1.0/8)\n", + "print 'volume fraction liquid holdup in the bed %0.4f m^3 liquid per m^3 bed volume'%hLo\n", + "#Answers may vary due to round off error" + ] + } + ], + "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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter2_example_2.3_plot_1.png b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter2_example_2.3_plot_1.png Binary files differnew file mode 100644 index 00000000..a3043935 --- /dev/null +++ b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter2_example_2.3_plot_1.png diff --git a/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter2_example_2.4_plot_1.png b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter2_example_2.4_plot_1.png Binary files differnew file mode 100644 index 00000000..5634906e --- /dev/null +++ b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter2_example_2.4_plot_1.png diff --git a/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter4_example_4.5_plot_1.png b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter4_example_4.5_plot_1.png Binary files differnew file mode 100644 index 00000000..ef798e9e --- /dev/null +++ b/PRINCIPLES_OF_MASS_TRANSFER_AND_SEPARATION_PROCESS_by_Binay_K._Dutta/screenshots/chapter4_example_4.5_plot_1.png diff --git a/sample_notebooks/PRAVEENKUMAR C/CHAPTER_1.ipynb b/sample_notebooks/PRAVEENKUMAR C/CHAPTER_1.ipynb new file mode 100644 index 00000000..e2b145a8 --- /dev/null +++ b/sample_notebooks/PRAVEENKUMAR C/CHAPTER_1.ipynb @@ -0,0 +1,66 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The weight of a car in newton,W= 13734.0 N\n", + "The mass of the car in slugs,m= 95.9 slugs\n", + "The weight of the car in pounds,W= 3089.0 lb\n", + "The mass of the car in lbm,m= 3086.0 lbm\n" + ] + } + ], + "source": [ + "# CHAPTER 1:INTRODUCTION TO FLUID STATICS\n", + "# SAMPLE PROBLEM 1/1,PAGE NUMBER:19\n", + "\n", + "import math\n", + "\n", + "#Variable Declaration\n", + "m=1400; # Mass of car in kg\n", + "\n", + "#Calculation\n", + "g=9.81; # The acceleration due to gravity in m/s^2\n", + "W_1=m*g;# Weight in N\n", + "m_1=m/14.594;# Mass of the car in slugs (1slug=14.594kg)\n", + "g=32.2; # The acceleration due to gravity in ft/s^2\n", + "W_2=m_1*g;# Weight in pounds (lb)\n", + "m_2=m/0.45359; #Mass of the car in lbm\n", + "print \"The weight of a car in newton,W=\",round(W_1,0),\"N\"\n", + "print \"The mass of the car in slugs,m=\",round(m_1,1),\"slugs\"\n", + "print \"The weight of the car in pounds,W=\",round(W_2,0),\"lb\"\n", + "print \"The mass of the car in lbm,m=\",round(m_2,0),\"lbm\"\n", + "\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.11" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |