diff options
32 files changed, 19291 insertions, 0 deletions
diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER01.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER01.ipynb new file mode 100644 index 00000000..361be2fa --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER01.ipynb @@ -0,0 +1,185 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:344aa83aae7640fc5c3f2bc230bb6d0ed2b2c16bf41e02ab7ccae093773e6e18"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER01:SIGNALS AND SPECTRA"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 1.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 1.13\n",
+ "# Example 1.9\n",
+ "# Given,\n",
+ "# Signal is x(t)= e^(-at) * u(t)\n",
+ "# unity function u(t)=1 for 0 to infinity \n",
+ "# therefore\n",
+ "import math,numpy\n",
+ "x=1;\n",
+ "# We assume 'infinity' value as 10 and the value of 'a' is 1\n",
+ "#t= 0:1:10;\n",
+ "t=numpy.linspace(0,10,num=11)\n",
+ "a=1;# a >0\n",
+ "z=((math.e)**(-a*t) * x);\n",
+ "y=numpy.fft.fft(z);\n",
+ "print 'fourier transform of x(t)=',y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fourier transform of x(t)= [ 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"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 : Pg 1.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 1.14\n",
+ "# Example 1.10\n",
+ "# Given,\n",
+ "# Signal is x(t)= e**|-a|t * u(t)\n",
+ "# unity function u(t)=1 for 0 to infinity \n",
+ "# therefore\n",
+ "import numpy,math\n",
+ "x=1;\n",
+ "# We assume 'infinity' value as 10 and the value of 'a' is 1\n",
+ "t= numpy.linspace(0,10,num=11);\n",
+ "a1=1;# For a >0\n",
+ "a2=-1; # For a <0\n",
+ "z=((math.e)**(a2*t) * x)+((math.e)**(a1*t) * x);\n",
+ "y=numpy.fft.fft(z);\n",
+ "print'fourier transform of x(t)=',y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fourier transform of x(t)= [ 34846.35579562 +0.j 20193.20071216+23060.75353691j\n",
+ " 1262.96607876+24147.94540875j -9061.39666752+17581.25336274j\n",
+ " -13929.23742795+10293.34682733j -15877.71059326 +3370.11697016j\n",
+ " -15877.71059326 -3370.11697016j -13929.23742795-10293.34682733j\n",
+ " -9061.39666752-17581.25336274j 1262.96607876-24147.94540875j\n",
+ " 20193.20071216-23060.75353691j]\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 : Pg 1.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 1.14\n",
+ "# Example 1.11\n",
+ "# (a)\n",
+ "# Given\n",
+ "# Signal is x(t) = rect(t)\n",
+ "# rect(t) = 1 for -a< |t| < a and 0 elsewhere\n",
+ "# Therefore\n",
+ "# We find out fourier transform of x(t)= 1 for -a< |t| < a thus,\n",
+ "import math,numpy\n",
+ "x=([1]);\n",
+ "a= 200; # Assume \n",
+ "t= numpy.linspace(-a,a,num=2*a+1); # range for fourier transform\n",
+ "y=numpy.fft.fft(x);\n",
+ "print'Fourier transform of x(t)=',y\n",
+ "\n",
+ "\n",
+ "# (b)\n",
+ "\n",
+ "# Given\n",
+ "# Signal is x(t) = rect(t)\n",
+ "# rect(t) = 1 for -a/4< |t| < a/4 and 0 elsewhere\n",
+ "# Therefore\n",
+ "# We find out fourier transform of x(t)= 1 for -a/4< |t| < a/4 thus,\n",
+ "import numpy\n",
+ "x=([1]);\n",
+ "a= 200; # Assume \n",
+ "t= numpy.linspace(-a/4,a/4,num=(a/2)+1);# range for fourer transform\n",
+ "y=numpy.fft.fft(x);\n",
+ "print'Fourier transform of x(t)=',y\n",
+ "\n",
+ "# (c)\n",
+ "\n",
+ "# Given\n",
+ "# Signal is x(t) = rect(t)\n",
+ "# rect(t) = 1 for b < |t| < b + a/2 and 0 elsewhere\n",
+ "# Therefore\n",
+ "# We find out fourier transform of x(t)= 1 for b < |t| < b+ a/2 thus,\n",
+ "import numpy\n",
+ "x=([1]);\n",
+ "a= 200; # Assume \n",
+ "b=100; # Assume\n",
+ "t=numpy.linspace(b,(b+(a/2)),num=((a/2)+1)) ;# range for fourer transform\n",
+ "y=numpy.fft.fft(x);\n",
+ "print'Fourier transform of x(t)=',y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fourier transform of x(t)= [ 1.+0.j]\n",
+ "Fourier transform of x(t)= [ 1.+0.j]\n",
+ "Fourier transform of x(t)= [ 1.+0.j]\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER03.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER03.ipynb new file mode 100644 index 00000000..0f40c83a --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER03.ipynb @@ -0,0 +1,143 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7baac9edb2128ede2f66bcc8790788a8e9bd4ebfa3d83c78364ed1ad1c37e3be"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER03:AMPLITUDE"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 3.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 3.14\n",
+ "# Example 3.7\n",
+ "# Given\n",
+ "# (a)efficiency=((u**2)/(2+(u**2)))\n",
+ "u=0.5;\n",
+ "n=((u**2.)/(2.+(u**2.)));\n",
+ "np=n*100.;\n",
+ "print\"Efficiney: \",round(np,2),\"%\"\n",
+ "\n",
+ "# (b)nmax,\n",
+ "# nmax occurs at u=1;\n",
+ "u1=1.;\n",
+ "nmax=((u1**2.)/(2.+(u1**2.)));\n",
+ "nmaxp=nmax*100.;\n",
+ "print\"Efficiney max: \",nmaxp,\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Efficiney: 11.11 %\n",
+ "Efficiney max: 33.3333333333 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 3.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 3.14\n",
+ "# Example 3.8\n",
+ "# Given\n",
+ "# From waveform\n",
+ "Amax=150.;\n",
+ "Amin=30.;\n",
+ "\n",
+ "# (a)Modulation index\n",
+ "u=((Amax-Amin)/(Amax+Amin));\n",
+ "print\"Modulation Index: \",round(u,2)\n",
+ "\n",
+ "Ac=(Amax/(1.+u));\n",
+ "# (b)\n",
+ "# Carrier Power\n",
+ "Pc=(Ac**2.)/2.;\n",
+ "print\"Carrier Power: \",round(Pc,2),\"W\"\n",
+ "\n",
+ "# Side band Power\n",
+ "PSB=(Amin**2.)/2.;\n",
+ "print\"USB=LSB Power: \",round(PSB,2),\"W\"\n",
+ "\n",
+ "# Total Average power\n",
+ "Pt=Pc+(2.*PSB);\n",
+ "print\"Total Average Power: \",round(Pt,2),\"W\"\n",
+ "\n",
+ "# (c)Peak Envelope Power\n",
+ "# Given\n",
+ "R=60; # Ohm\n",
+ "PEP=(Amax**2)/(2*R);\n",
+ "print\"Peak Envelope Power: \",round(PEP),\"W\"\n",
+ "\n",
+ "# (d) Modulation Efficieny\n",
+ "n=PSB/Pt;\n",
+ "print\"Modulation efficieny: \",round(n,2)\n",
+ "\n",
+ "# (e) Given\n",
+ "# (i) u=0.2\n",
+ "u1=0.2;\n",
+ "A1=(60./u1)-Ac;\n",
+ "print\"A=\",round(A1)\n",
+ "\n",
+ "# (ii) u=0.8\n",
+ "u2=0.8;\n",
+ "A2=(60./u2)-Ac;\n",
+ "print \"A=\",round(A2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Modulation Index: 0.67\n",
+ "Carrier Power: 4050.0 W\n",
+ "USB=LSB Power: 450.0 W\n",
+ "Total Average Power: 4950.0 W\n",
+ "Peak Envelope Power: 188.0 W\n",
+ "Modulation efficieny: 0.09\n",
+ "A= 210.0\n",
+ "A= -15.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER04.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER04.ipynb new file mode 100644 index 00000000..62bae8a2 --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER04.ipynb @@ -0,0 +1,680 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a49a8ec12fc3b73c3ede4bd700b2981c396abe3970143184cc460eca3744fac1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER04:ANGLE MODULATION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 4.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.9\n",
+ "# Example 4.3\n",
+ "# Given\n",
+ "fc=1.*10.**6.; # Hz\n",
+ "kf=5.;\n",
+ "mt=1.*10.**5.; # Hz\n",
+ "\n",
+ "# (a) mi(t) with fm\n",
+ "mi=(fc+(kf*mt));\n",
+ "print\"Max, Inst. Frequency with FM\",mi,\"Hz\"\n",
+ "import math \n",
+ "kp=3.;\n",
+ "# (b) mi2(t) with pm\n",
+ "mi2=fc+(mt*(kp/(2*math.pi)));\n",
+ "\n",
+ "print\"Max, Inst. Frequency with PM\",mi2,\"Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Max, Inst. Frequency with FM 1500000.0 Hz\n",
+ "Max, Inst. Frequency with PM 1047746.48293 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 4.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.13\n",
+ "# Example 4.9\n",
+ "# Given\n",
+ "delf=20.*10.**3.; # hz\n",
+ "fm=10.*10.**3.; # Hz\n",
+ "\n",
+ "B=delf/fm;\n",
+ "print\"Beta: \",B"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta: 2.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 : Pg 4.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.16\n",
+ "# Example 4.13\n",
+ "# Given\n",
+ "# x(t)=10cos((2*pi*10**8*t)+(200cos(2*pi*10**3*t)))\n",
+ "# on differentiating\n",
+ "# wi=2*pi*(1D+8)-4*pi*sin(2*pi*(1D+3)*t)\n",
+ "# Therefore\n",
+ "import math \n",
+ "delw=4.*math.pi*(1.*10.**5.);\n",
+ "wm=2.*math.pi*(1.*10.**3.);\n",
+ "B=delw/wm;\n",
+ "wb=2.*(B+1.)*wm;\n",
+ "fb=wb/2.*math.pi;\n",
+ "print\"Wb\",wb,\"rad/s\"\n",
+ "print\"Fb\",fb,\"Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wb 2525840.49349 rad/s\n",
+ "Fb 3967580.96924 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 4.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.17\n",
+ "# Example 4.14\n",
+ "# Given\n",
+ "delf=100.*10.**3; # Hz\n",
+ "fc=20.*10.**6.; # Hz\n",
+ "\n",
+ "# As B=delf/fm;\n",
+ "# (a) fm1=1*10.**3hz\n",
+ "print'Part a'\n",
+ "fm1=1.*10.**3.; # Hz\n",
+ "B1=delf/fm1;\n",
+ "print'Modulation Index',B1\n",
+ "fb1=2.*delf;\n",
+ "print'Bandwidth',fb1,'Hz'\n",
+ "# (b) fm2=100*10.**3hz\n",
+ "print'\\nPart b'\n",
+ "fm2=100.*10.**3.; # Hz\n",
+ "B2=delf/fm2;\n",
+ "print'Modulation Index',B2\n",
+ "fb2=2.*(B2+1.)*fm2;\n",
+ "print'Bandwidth',fb2,'Hz'\n",
+ "# (c) fm3=500*10.**3hz\n",
+ "print'\\nPart c'\n",
+ "fm3=500.*10.**3.; # Hz\n",
+ "B3=delf/fm3;\n",
+ "print'Modulation Index',B3\n",
+ "fb3=2.*fm3;\n",
+ "print'Bandwidth',fb3,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part a\n",
+ "Modulation Index 100.0\n",
+ "Bandwidth 200000.0 Hz\n",
+ "\n",
+ "Part b\n",
+ "Modulation Index 1.0\n",
+ "Bandwidth 400000.0 Hz\n",
+ "\n",
+ "Part c\n",
+ "Modulation Index 0.2\n",
+ "Bandwidth 1000000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 : Pg 4.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.17\n",
+ "# Example 4.15\n",
+ "# Given\n",
+ "# x(t)=10cos(wct+3sinwmt)\n",
+ "# Comparing with standard equation\n",
+ "B=3.;\n",
+ "fm=1.*10.**3.; # hz\n",
+ "fb=2.*(B+1.)*fm;\n",
+ "\n",
+ "# (a)fm is doubled\n",
+ "fma=2.*fm;\n",
+ "fba=2.*(B+1.)*fma;\n",
+ "print\"fb with 2fm: \",fba\n",
+ "\n",
+ "# (b)fm is one halved\n",
+ "fmb=fm/2.;\n",
+ "fbb=2.*(B+1.)*fmb;\n",
+ "print\"fb with 0.5fm: \",fbb"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fb with 2fm: 16000.0\n",
+ "fb with 0.5fm: 4000.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 : Pg 4.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.18\n",
+ "# Example 4.16\n",
+ "# Given\n",
+ "# x(t)=10cos(wct+3sinwmt)\n",
+ "# Comparing with standard equation of fm\n",
+ "B=3.;\n",
+ "fm=1.*10.**3.; # hz\n",
+ "fb=2.*(B+1.)*fm;\n",
+ "\n",
+ "# B is inversaly proportional to fm\n",
+ "\n",
+ "# (a)fm is doubled\n",
+ "Ba=B/2.;\n",
+ "fma=2.*fm;\n",
+ "fba=2.*(Ba+1.)*fma;\n",
+ "print\"fb with 2fm: \",fba\n",
+ "\n",
+ "\n",
+ "\n",
+ "# (b)fm is one halved\n",
+ "Bb=2.*B;\n",
+ "fmb=fm/2.;\n",
+ "fbb=2.*(Bb+1.)*fmb;\n",
+ "print\"fb with 0.5fm: \",fbb"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fb with 2fm: 10000.0\n",
+ "fb with 0.5fm: 7000.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 4.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.18\n",
+ "# Example 4.17\n",
+ "\n",
+ "# Given\n",
+ "fm=2.*10.**3.; # Hz\n",
+ "delf=5.*10.**3.; # Hz\n",
+ "\n",
+ "# (a) Bandwidth of modulated signal\n",
+ "B=delf/fm;\n",
+ "\n",
+ "fb=2.*(B+1.)*fm;\n",
+ "print'Bandwidth',fb,'Hz'\n",
+ "\n",
+ "# (b)Max. frequency deviation and Bandwidth of new signal\n",
+ "# Given\n",
+ "fm1=fm-(1.*10.**3.);\n",
+ "delf1=3.*delf;\n",
+ "\n",
+ "B1=delf1/fm1;\n",
+ "\n",
+ "fd=B1*fm1;\n",
+ "print'Maximum frequency deviation',fd,'Hz'\n",
+ "\n",
+ "fb1=2.*(B1+1.)*fm1;\n",
+ "print'Bandwidth',fb1,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bandwidth 14000.0 Hz\n",
+ "Maximum frequency deviation 15000.0 Hz\n",
+ "Bandwidth 32000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 4.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.19\n",
+ "# Example 4.18\n",
+ "# Given\n",
+ "delf=75.*10.**3.; # Hz\n",
+ "fM=15.*10.**3.; # Hz\n",
+ "\n",
+ "D=delf/fM;\n",
+ "# Given formula fb=2(*10.**2)*fM\n",
+ "fb1=2.*10.**2.*fM;\n",
+ "print'BW uing formula',fb1,'Hz'\n",
+ "\n",
+ "# Carsons Rule\n",
+ "fb2=2.*10.**1.*fM;\n",
+ "print'BW uing Carsons Rule',fb2,'Hz'\n",
+ "\n",
+ "# High quality Fm radios require minimum 200kHz\n",
+ "# Therefore, carsons rule underestimates bandwidth"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "BW uing formula 3000000.0 Hz\n",
+ "BW uing Carsons Rule 300000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 : Pg 4.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.19\n",
+ "# Example 4.19\n",
+ "# Given\n",
+ "fm1=50.; # Hz\n",
+ "fm2=15.*10.**3.; # Hz\n",
+ "\n",
+ "delf=75.*10.**3.; # Hz\n",
+ "\n",
+ "# As B=delf/fm\n",
+ "Bmin=delf/fm2;\n",
+ "Bmax=delf/fm1;\n",
+ "\n",
+ "# Let B1=0.5\n",
+ "B1=0.5;\n",
+ "n=(Bmax/B1);\n",
+ "print'Multiplication factor',n\n",
+ "\n",
+ "delf1=(delf/n);\n",
+ "print'Max allowed frequency deviation',delf1,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Multiplication factor 3000.0\n",
+ "Max allowed frequency deviation 25.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 4.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.20\n",
+ "# Example 4.20\n",
+ "# Given\n",
+ "f1=2.*10.**5.; # Hz\n",
+ "fLO=10.8*10.**6.; # Hz\n",
+ "delf1=25.; # Hz\n",
+ "n1=64.;\n",
+ "n2=48.;\n",
+ "\n",
+ "delf=(delf1*n1*n2);\n",
+ "print'Maximum frequency deviation',delf,'Hz'\n",
+ "\n",
+ "f2=n1*f1;\n",
+ "\n",
+ "f3a=f2+fLO;\n",
+ "f3b=f2-fLO;\n",
+ "\n",
+ "# For f3a\n",
+ "fca=n2*f3a;\n",
+ "print'Carrier frequency 1',fca,'Hz'\n",
+ "\n",
+ "# For f3b\n",
+ "fcb=n2*f3b;\n",
+ "print'Carrier frequency 2',fcb,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum frequency deviation 76800.0 Hz\n",
+ "Carrier frequency 1 1132800000.0 Hz\n",
+ "Carrier frequency 2 96000000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 : Pg 4.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.20\n",
+ "# Example 4.21\n",
+ "# Given\n",
+ "delf=20.*10.**3.; # Hz\n",
+ "fc=200.*10.**3.; # Hz\n",
+ "of=96.*10.**6.; # hz\n",
+ "# delf=n1*n2 and as only doublers are used, n1*n2 has to be power of 2\n",
+ "# By trail and error, we find\n",
+ "n1=64.;\n",
+ "n2=32.;\n",
+ "# Output of first Multiplier\n",
+ "o1=n1*fc;\n",
+ "print'Output of first multiplier: ',o1,'Hz'\n",
+ "i2=of/n2;\n",
+ "flo=o1-i2;\n",
+ "print'fLO',flo,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output of first multiplier: 12800000.0 Hz\n",
+ "fLO 9800000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 : Pg 4.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.20\n",
+ "# Example 4.22\n",
+ "# Given\n",
+ "B=0.2; \n",
+ "f1=200.*10.**3.; # Hz\n",
+ "fml=50.; # Hz\n",
+ "fmh=15.*10.**3.; # Hz\n",
+ "delf=75.*10.**3.; # hz\n",
+ "fc=108.*10.**6.; # Hz\n",
+ "\n",
+ "delf1=B*fml;\n",
+ "n1n2=delf/delf1;\n",
+ "\n",
+ "# Let n2=150\n",
+ "n2=150.;\n",
+ "flo=((delf*f1)-fc)/n2;\n",
+ "print'fLO',flo,'Hz'\n",
+ "\n",
+ "n1=n1n2/n2;\n",
+ "print\"n1 with n2=150:\",n1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fLO 99280000.0 Hz\n",
+ "n1 with n2=150: 50.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 : Pg 4.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.21\n",
+ "# Example 4.23\n",
+ "# Given,\n",
+ "\n",
+ "delfd1=50.; # Hz\n",
+ "f1=120.; # Hz\n",
+ "\n",
+ "delfd2=20000.; # Hz\n",
+ "f2=240.; # Hz\n",
+ "# (a)PM\n",
+ "delf1=(f2/f1)*delfd1;\n",
+ "n1=delfd2/delf1;\n",
+ "print'Frequency multiplication factor in PM',n1\n",
+ "\n",
+ "# (b)FM\n",
+ "n2=delfd2/delfd1;\n",
+ "print'Frequency multiplication factor in FM',n2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency multiplication factor in PM 200.0\n",
+ "Frequency multiplication factor in FM 400.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E29 : Pg 4.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 4.25\n",
+ "# Example 4.29\n",
+ "# Given,\n",
+ "f1=108.; # MHz\n",
+ "f2=157.; # MHz\n",
+ "\n",
+ "# (a) Image frequency overlaps RF band\n",
+ "fIF=12.; # MHz\n",
+ "\n",
+ "fL01=f1-fIF;\n",
+ "print'fL01',fL01,'MHz'\n",
+ "fim1=fL01-fIF;\n",
+ "print'fim1',fim1,'MHz'\n",
+ "\n",
+ "fL02=f2-fIF;\n",
+ "print'fL02',fL02,'MHz'\n",
+ "fim2=fL02-fIF;\n",
+ "print'fim2',fim2,'MHz'\n",
+ "\n",
+ "# Clearly image and RF band overlap"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fL01 96.0 MHz\n",
+ "fim1 84.0 MHz\n",
+ "fL02 145.0 MHz\n",
+ "fim2 133.0 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER05.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER05.ipynb new file mode 100644 index 00000000..d917ea6c --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER05.ipynb @@ -0,0 +1,820 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d2b10e85dc4e5ecd691f760bb8b2905ecd459bb295630a40b80f0bb469c6ca0a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER05:PULSE MODULATION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 5.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.26\n",
+ "# Example 5.9\n",
+ "# Given,\n",
+ "# m(t)=10cos(2000*pi*t)cos(8000*pi*t)\n",
+ "# or 5 cos (6000*pi*t) +5*cos(10000*pi*t)\n",
+ "# (a) Minimum sampling rate\n",
+ "# we have\n",
+ "fM=5000.; # Hz\n",
+ "fs=2.*fM;\n",
+ "print'Minimum sampling rate',fs,'Hz'\n",
+ "\n",
+ "# (b)bandpass sampling theoram\n",
+ "fu=fM;\n",
+ "fb=fM-3000.; # Hz\n",
+ "# As fu/fb is 2.5\n",
+ "# We have\n",
+ "k=2.;\n",
+ "fs2=(2.*fu)/k;\n",
+ "print'Minimum sampling rate by sampling theoram',fs2,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum sampling rate 10000.0 Hz\n",
+ "Minimum sampling rate by sampling theoram 5000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 5.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.31\n",
+ "# Example 5.14\n",
+ "\n",
+ "# Given,\n",
+ "Rb=36000.; # (b/s)\n",
+ "fM=3200.; # Hz\n",
+ "fs=2.*fM;\n",
+ "n=Rb/fs;\n",
+ "# As n should be less than Rs/fs\n",
+ "\n",
+ "nn=round(n,2)-1;\n",
+ "print'Binary digits',nn\n",
+ "\n",
+ "L=2**nn;\n",
+ "print'Quantizing level',L\n",
+ "\n",
+ "fs=Rb/nn;\n",
+ "print'Sampling Rate',fs,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Binary digits 4.63\n",
+ "Quantizing level 24.7610398967\n",
+ "Sampling Rate 7775.37796976 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 : Pg 5.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.31\n",
+ "# Example 5.15\n",
+ "mp=1.; # Assume peak amplitude is unity\n",
+ "# Given\n",
+ "dela=0.02*mp;\n",
+ "\n",
+ "L=(mp*2)/dela;\n",
+ "\n",
+ "#for i in range(0,10):\n",
+ "# j=2**i;\n",
+ "# if(j>=L)\n",
+ "# L1=j;\n",
+ "# break;\n",
+ "import math \n",
+ "#n=math.log(L1,2);# bits per sample\n",
+ "n=7.;\n",
+ "print'Number of bits',n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of bits 7.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 5.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.31\n",
+ "# Example 5.18\n",
+ "# Given,\n",
+ "import math \n",
+ "\n",
+ "SbyN=40.; # db\n",
+ "SbyN0=10.**(SbyN/10);\n",
+ "\n",
+ "# As sbyn=3L**2/2\n",
+ "L=math.sqrt((2.*(SbyN0))/3.);\n",
+ "LL=round(L);\n",
+ "\n",
+ "n=(math.log(LL))/math.log(2);\n",
+ "\n",
+ "nn=(round(n))+1; # Upper limit\n",
+ "\n",
+ "print'Binary digits',nn\n",
+ "LL=2.**nn;\n",
+ "\n",
+ "print'Number of levels',LL\n",
+ "# As SQN= 1.76+6.02(n)\n",
+ "SQN= 1.76+6.02*(nn);\n",
+ "print'Signal to quantizin ratio',SQN,'db'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Binary digits 7.0\n",
+ "Number of levels 128.0\n",
+ "Signal to quantizin ratio 43.9 db\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 : Pg 5.33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.33\n",
+ "# Example 5.19\n",
+ "# Given,\n",
+ "n=16.;\n",
+ "Rb=44100.; # b/s\n",
+ "# (a) Output signal to quantizing ratio\n",
+ "SNQ=1.76+(6.02*n);\n",
+ "print'Output signal to quantizing ratio: ',SNQ,'db'\n",
+ "\n",
+ "# (b)Input Bit Rate\n",
+ "IBR=2.*Rb*n;\n",
+ "print'Input bit rate: ',IBR,'B/s'\n",
+ "OBR=2.*IBR;\n",
+ "print'Output bit rate: ',OBR,'B/s'\n",
+ "\n",
+ "# (c)Number of bits recorded\n",
+ "# Given, an hours time\n",
+ "# Therefore, time\n",
+ "t=60.*60.;\n",
+ "NBR=OBR*t;\n",
+ "print'Number of bits recorded: ',NBR,'Bytes'\n",
+ "\n",
+ "# (d) Dictionary\n",
+ "# Given\n",
+ "p=1500.;\n",
+ "c=2.;\n",
+ "l=100.;\n",
+ "w=8.;\n",
+ "let=6.;\n",
+ "b=7.;\n",
+ "d=p*c*l*w*let*b;\n",
+ "print'Number of bits required',d,'Bytes'\n",
+ "\n",
+ "x=NBR/(2.*d);\n",
+ "y=round(x);\n",
+ "print'Number of comparable books',y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output signal to quantizing ratio: 98.08 db\n",
+ "Input bit rate: 1411200.0 B/s\n",
+ "Output bit rate: 2822400.0 B/s\n",
+ "Number of bits recorded: 10160640000.0 Bytes\n",
+ "Number of bits required 100800000.0 Bytes\n",
+ "Number of comparable books 50.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 : Pg 5.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.35\n",
+ "# Example 5.22\n",
+ "# Given,\n",
+ "f1=200.; # Hz\n",
+ "f2=3300.; # Hz\n",
+ "fs=8000.; # Samples/s\n",
+ "SQN=30.; # dB\n",
+ "import math \n",
+ "# (a)Minimum number of quantizin levels and bits per sample\n",
+ "# From SQN=1.76+20log L\n",
+ "La=10.**((SQN-1.76)/20.);\n",
+ "L=round(La);\n",
+ "print'Minimum number of quantizing levels',L\n",
+ "n=math.log(L)/math.log(2);\n",
+ "nn=round(n);\n",
+ "print'Minimum number of bits per sample',nn\n",
+ "\n",
+ "# (b)Minimum system bandwidth\n",
+ "Fpcm=(nn*fs)/2.;\n",
+ "print'Minimum system Bandwidth',Fpcm,'Hz'\n",
+ "\n",
+ "# (c)For u=255\n",
+ "# SQN=20logL-10.1\n",
+ "La1=10.**((SQN+10.1)/20.);\n",
+ "L1=(round(La1))+1.; # Upper Limit\n",
+ "print'Minimum number of quantizing levels for u=255',L1\n",
+ "n1=math.log(L1)/math.log(2);\n",
+ "nn1=(round(n1));\n",
+ "print'Minimum number of bits per sample',nn1\n",
+ "\n",
+ "# Minimum system bandwidth\n",
+ "Fpcm1=(nn1*fs)/2.;\n",
+ "print'Minimum system Bandwidth',Fpcm1,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum number of quantizing levels 26.0\n",
+ "Minimum number of bits per sample 5.0\n",
+ "Minimum system Bandwidth 20000.0 Hz\n",
+ "Minimum number of quantizing levels for u=255 102.0\n",
+ "Minimum number of bits per sample 7.0\n",
+ "Minimum system Bandwidth 28000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 : Pg 5.37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.37\n",
+ "# Example 5.25\n",
+ "# Given,\n",
+ "import math \n",
+ "fs=32.*10.**+3.; # Hz\n",
+ "fm=1000.; # Hz\n",
+ "fM=4.*10.**3.; # Hz\n",
+ "# As SNR=(3*(fs**3))/(8*pi*pi*(fm**2)*fM)\n",
+ "SNR=(3.*(fs**3.))/(8.*math.pi*math.pi*(fm**2.)*fM);\n",
+ "SNRdb=(math.log(SNR))/math.log(10);\n",
+ "print'Output SNR',SNRdb,'dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output SNR 2.49312146597 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 : Pg 5.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.38\n",
+ "# Example 5.26\n",
+ "# Given,\n",
+ "n=4.;\n",
+ "SNQ=1.76+(6.02*n);\n",
+ "print'Output SNR',SNQ,'dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output SNR 25.84 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 : Pg 5.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.38\n",
+ "# Example 5.27\n",
+ "import math \n",
+ "# Given,\n",
+ "bw=3.*10.**3.; # Hz\n",
+ "n=3.;\n",
+ "fs=(n*2.*bw);\n",
+ "dela=250.*10.**3; # mV\n",
+ "fm=1000.; # Hz\n",
+ "# (a) Maximum amplitude\n",
+ "Amax=(dela*fs)/(2.*math.pi*fm);\n",
+ "print'Maximum Amplitude',Amax,'V'\n",
+ "\n",
+ "# (b) Output signal to quantizing ratio\n",
+ "SNRO=(3.*(fs**3.))/(8.*math.pi*math.pi*(fm**3.));\n",
+ "SNRdb=10.*(math.log(SNRO))/math.log(10);\n",
+ "print'Output SNR',SNRdb,'dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Amplitude 716197.243914 V\n",
+ "Output SNR 23.4554903765 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E32 : Pg 5.40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.40\n",
+ "# Example 5.32\n",
+ "# Given,\n",
+ "m1=3.*10.**3.; # Hz\n",
+ "m2=3.5*10.**3.; # Hz\n",
+ "# Since highest frequency is of m2\n",
+ "Sr=2.*m2; \n",
+ "print'Sampling Rate',Sr,'Samples/s'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Sampling Rate 7000.0 Samples/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E33 : Pg 5.40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.40\n",
+ "# Example 5.33\n",
+ "# Given,\n",
+ "import math \n",
+ "m1=3.6*10.**3.; # Hz\n",
+ "m2=1.2*10.**3.; # Hz\n",
+ "m3=m2;\n",
+ "m4=m2;\n",
+ "# (a)Nyquist rate\n",
+ "nr1=2.*m1;\n",
+ "print'Nyquist Rate of m1(t)',nr1\n",
+ "nr2=2.*m2;\n",
+ "print'Nyquist Rate of m2(t)',nr2\n",
+ "nr3=2.*m3;\n",
+ "print'Nyquist Rate of m3(t)',nr3\n",
+ "nr4=2.*m4;\n",
+ "print'Nyquist Rate of m4(t)',nr4\n",
+ "\n",
+ "# (b) Speed of commutator\n",
+ "c=nr1+nr2+nr3+nr4;\n",
+ "print'Speed of commutator',c,'samples/s'\n",
+ "\n",
+ "# (c)Output bit rate\n",
+ "# Given, \n",
+ "L=1024.;\n",
+ "n=math.log(L)/math.log(2);\n",
+ "OBR=n*c;\n",
+ "print'Output bit rate',OBR,'b/s'\n",
+ "\n",
+ "# (d)Minimum channel bandwidth\n",
+ "fB=c/2.;\n",
+ "print'Minimum Channel Bandwidth',fB,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nyquist Rate of m1(t) 7200.0\n",
+ "Nyquist Rate of m2(t) 2400.0\n",
+ "Nyquist Rate of m3(t) 2400.0\n",
+ "Nyquist Rate of m4(t) 2400.0\n",
+ "Speed of commutator 14400.0 samples/s\n",
+ "Output bit rate 144000.0 b/s\n",
+ "Minimum Channel Bandwidth 7200.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E34 : Pg 5.41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.41\n",
+ "# Example 5.34\n",
+ "\n",
+ "# Given,\n",
+ "fs=8000.; # Hz\n",
+ "m=24.;\n",
+ "n=8.;\n",
+ "# (a) Duration of each bit\n",
+ "t1=1./fs;\n",
+ "t2=(m*n)+1.; # Extra bit for synchronization\n",
+ "Tb=t1/t2;\n",
+ "print'Duration of each bit',Tb,'seconds'\n",
+ "\n",
+ "# (b) Transmission Rate\n",
+ "Rb=1./Tb;\n",
+ "print'Transmission Rate',Rb,'b/s'\n",
+ "\n",
+ "# (c)Minimum transmission bandwidth\n",
+ "fT1=1./(2.*Tb);\n",
+ "print'Minimum transmission bandwidth',fT1,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Duration of each bit 6.47668393782e-07 seconds\n",
+ "Transmission Rate 1544000.0 b/s\n",
+ "Minimum transmission bandwidth 772000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E35 : Pg 5.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.42\n",
+ "# Example 5.35\n",
+ "# Given,\n",
+ "n=24.;\n",
+ "f=3.4*10.**3; # Hz\n",
+ "ts=1.*10**6.; # Second\n",
+ "# (a) Spacing between succesive multiplexed pulses\n",
+ "fs=8000.; # Samples per second\n",
+ "t1=1./fs;\n",
+ "t2=n+1.; # One synchronizing bit\n",
+ "Tb=t1/t2;\n",
+ "# Actual Tb, as actual duration of each pulse is 1us\n",
+ "ATb=Tb-ts;\n",
+ "print'Spacing between succesive multiplexed pulses',ATb,'Seconds'\n",
+ "# (b) Nyquist Rate of Sampling\n",
+ "f1=2.*f;\n",
+ "T=1./f1; # Seconds\n",
+ "Tb1=T/t2;\n",
+ "ATb1=Tb1-ts;\n",
+ "print'Spacing between succesive multiplexed pulses using Nyquist rate of sampling',ATb1,'Seconds'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Spacing between succesive multiplexed pulses -999999.999995 Seconds\n",
+ "Spacing between succesive multiplexed pulses using Nyquist rate of sampling -999999.999994 Seconds\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E37 : Pg 5.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.43\n",
+ "# Example 5.37\n",
+ "# Given,\n",
+ "bw=3.5*10.**3.; # Hz\n",
+ "# Roll off factor\n",
+ "a=0.25;\n",
+ "Rb=(2.*bw)/(1.+a);\n",
+ "print'Data Rate',Rb,'b/s'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Data Rate 5600.0 b/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E38 : Pg 5.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.43\n",
+ "# Example 5.38\n",
+ "# Given,\n",
+ "fB=75.*10.**3.; # Hz\n",
+ "Rb=0.1*10.**6.; # B/s\n",
+ "Tb=1./Rb;\n",
+ "a=(2.*fB*Tb)-1.;\n",
+ "print'Roll off factor',a"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Roll off factor 0.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E39 : Pg 5.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.43\n",
+ "# Example 5.39\n",
+ "# Given,\n",
+ "import math \n",
+ "m=8.;\n",
+ "fM=2.*10.**3.; # Hz\n",
+ "a=0.2;\n",
+ "# Here we choose L=128;\n",
+ "L=128.;\n",
+ "n=math.log(L)/math.log(2);\n",
+ "Sr=2.*fM;\n",
+ "fs=1.25*Sr;\n",
+ "\n",
+ "# For n tdm signals\n",
+ "x=m*fs;\n",
+ "\n",
+ "# Resultant bit rate\n",
+ "br=7.*x;\n",
+ "\n",
+ "# Minimum Transmission bandwidth\n",
+ "fB=((1.+a)*br)/2.;\n",
+ "print'Minimum Transmission bandwidth',fB,'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum Transmission bandwidth 168000.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E40 : Pg 5.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 5.44\n",
+ "# Example 5.40\n",
+ "# Given,\n",
+ "import math \n",
+ "M=16.;\n",
+ "sr=40000.;\n",
+ "a=0.3;\n",
+ "# (a) Bit Rate\n",
+ "n=math.log(M)/math.log(2);\n",
+ "br=sr*n;\n",
+ "print'Bit Rate: ',br,'b/s'\n",
+ "\n",
+ "# (b)\n",
+ "# As 2*fB=(1+a)*R/log2M\n",
+ "# Given \n",
+ "bw=110.*10.**3.; # Hz # =2*fB\n",
+ "\n",
+ "M=2.**(((1.+a)*br)/bw);\n",
+ "MM=round(M);\n",
+ "print'Value of M',MM\n",
+ "\n",
+ "# (c)Band Rate\n",
+ "band=br/(math.log(n))/math.log(2);\n",
+ "print'Band Rate',band,'Symbols/s'\n",
+ "\n",
+ "# (d) Spectral efficiency\n",
+ "BT=((1.+a)*br)/2.;\n",
+ "Eff=br/BT;\n",
+ "print'Spectral efficiency',Eff,'b/s Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bit Rate: 160000.0 b/s\n",
+ "Value of M 4.0\n",
+ "Band Rate 166509.51848 Symbols/s\n",
+ "Spectral efficiency 1.53846153846 b/s Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER06.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER06.ipynb new file mode 100644 index 00000000..3fe5c8b4 --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER06.ipynb @@ -0,0 +1,380 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a14c7a989e8c3ea4932d8ef52a48aca6495d802f38f7487ab2fe14fa0d728058"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER06:PROBABILITY AND RANDOM VARIABLES"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 6.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 6.16\n",
+ "# Example 6.7\n",
+ "# Given\n",
+ "# Pdot=2*Pdash and Pdot+Pdash=1\n",
+ "# Therfore, on solving using linear equations\n",
+ "import math \n",
+ "#a=([1, -2],[1, 1]);\n",
+ "##c=([0],[1]);\n",
+ "#b=1/(a)*c;\n",
+ "Pdash=0.3333333;#b(1,1);\n",
+ "Pdot=0.6666667;#b(2,1);\n",
+ "print'Pdot:',Pdot\n",
+ "print'Pdash:',Pdash"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Pdot: 0.6666667\n",
+ "Pdash: 0.3333333\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 6.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 6.18\n",
+ "# Example 6.14\n",
+ "# Given\n",
+ "p=0.1;\n",
+ "q=0.2;\n",
+ "Pm0=0.5;\n",
+ "Pr1bym0=p;\n",
+ "Pr0bym1=q;\n",
+ "# (a) Find Pr0 and Pr1\n",
+ "Pm1=1-Pm0;\n",
+ "Pr0bym0=1-Pr1bym0;\n",
+ "Pr1bym1=1-Pr0bym1;\n",
+ "\n",
+ "# By formula\n",
+ "# P(r0)=(P(r0/m0)*P(m0))+(P(r0/m1)*P(m1);\n",
+ "# P(r1)=(P(r1/m0)*P(m0))+(P(r1/m1)*P(m1);\n",
+ "Pr0=(Pr0bym0*Pm0)+(Pr0bym1*Pm1);\n",
+ "Pr1=(Pr1bym0*Pm0)+(Pr1bym1*Pm1);\n",
+ "print'P(r0):',Pr0\n",
+ "print'P(r1):',Pr1\n",
+ "# (b)P(m0/r0)\n",
+ "# Using Bayes Rule\n",
+ "# P(m0/r0)=(P(m0)*P(r0/m0)/P(r0))\n",
+ "Pm0byr0=(Pm0*Pr0bym0)/Pr0;\n",
+ "print'P(m0/r0):',Pm0byr0\n",
+ "# (c)P(m1/r1)\n",
+ "# Using Bayes Rule\n",
+ "# P(m1/r1)=(P(m1)*P(r1/m1)/P(r1))\n",
+ "Pm1byr1=(Pm1*Pr1bym1)/Pr1;\n",
+ "print'P(m1/r1):',Pm1byr1\n",
+ "\n",
+ "# (d)Probabilty error\n",
+ "# As Pe=(P(r1/m0)*P(m0))+(P(r0/m1)*P(m1))\n",
+ "Pe=(Pr1bym0*Pm0)+(Pr0bym1*Pm1);\n",
+ "print'Probability error:',Pe\n",
+ "\n",
+ "# (e)Probabilty that is transmitted correctly\n",
+ "# As Pc=(P(r0/m0)*P(m0))+(Pr1bym1*Pm1)\n",
+ "\n",
+ "Pc=(Pr0bym0*Pm0)+(Pr1bym1*Pm1);\n",
+ "print'Probabilty that is transmitted correctly:',Pc"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P(r0): 0.55\n",
+ "P(r1): 0.45\n",
+ "P(m0/r0): 0.818181818182\n",
+ "P(m1/r1): 0.888888888889\n",
+ "Probability error: 0.15\n",
+ "Probabilty that is transmitted correctly: 0.85\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 : Pg 6.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 6.21\n",
+ "# Example 6.16\n",
+ "# Given\n",
+ "p=0.4;\n",
+ "Pp=p;\n",
+ "q=0.3;\n",
+ "Pn=q;\n",
+ "a=1.; # i start value\n",
+ "b=6.; # i end value\n",
+ "# (a)Probabilty that all pulses are positive\n",
+ "s=1.;\n",
+ "for i in range(1,6):\n",
+ " s=s*Pp;\n",
+ "print'Probabilty that all pulses are positive:',s\n",
+ "\n",
+ "# (b)Pulses are positive ,positive, positive, zero,zero,negative\n",
+ "Pz=1.-(p+q);\n",
+ "s1=(Pp**3.)*(Pz**2.)*Pn;\n",
+ "print'Probabilty that all pulses are positive ,positive, positive, zero,zero,negative:',s1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Probabilty that all pulses are positive: 0.01024\n",
+ "Probabilty that all pulses are positive ,positive, positive, zero,zero,negative: 0.001728\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 6.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 6.21\n",
+ "# Example 6.17\n",
+ "# Given\n",
+ "import math \n",
+ "P1=0.6;\n",
+ "P0=0.4;\n",
+ "n=5.; # Five digit sequence\n",
+ "j=2.; # two outcomes 0 and 1\n",
+ "\n",
+ "# (a)1,1,0,0,0\n",
+ "xf=(math.factorial(n))/((math.factorial(j))*(math.factorial(n-j)));\n",
+ "s=xf*(P1**j)*(P0**(n-j));\n",
+ "print'Probability for 1,1,0,0,0:',s\n",
+ "\n",
+ "# (b)atleast 3 1's\n",
+ "# P(X>=3)=1-P(X<=2)\n",
+ "# Here y=1-x\n",
+ "x=0;\n",
+ "for k in range(0,2):\n",
+ " f=(math.factorial(n))/((math.factorial(k))*(math.factorial(n-k)));\n",
+ " x=x+(f*((P1**k)*(P0**(n-k))));\n",
+ "y=1.-x;\n",
+ "print'Probability for atleast three 1 s:',y"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Probability for 1,1,0,0,0: 0.2304\n",
+ "Probability for atleast three 1 s: 0.91296\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 6.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 6.23\n",
+ "# Example 6.20\n",
+ "# Given\n",
+ "import math \n",
+ "pe=0.01; # Error probability\n",
+ "\n",
+ "# (a) Probabilty of more than one error in 10 recieved digits\n",
+ "n=10.;\n",
+ "# As P(X>1)=1-P(X=0)-P(X=1)\n",
+ "# Let x=P(X>1)\n",
+ "# s=P(X=0)+P(X=1)\n",
+ "s=0;\n",
+ "for t in range(0,1):\n",
+ " f=(math.factorial(n))/((math.factorial(t))*(math.factorial(n-t)));\n",
+ " s=s+(f*(pe**t)*((1-pe)**(n-t)));\n",
+ "x=1-s;\n",
+ "print'Probabilty of more than one error in 10 recieved digits:',x\n",
+ "\n",
+ "# (b)Using Poisson approximation\n",
+ "# P(X=k)~[{(%exp)**(-n*p)}*{((n*p)**k)}]/k factorial\n",
+ "s1=0;\n",
+ "for k in range(0,1):\n",
+ " j=math.factorial(k);\n",
+ " s1=s1+((math.exp(-n*pe))*(((n*pe)**k)))/j;\n",
+ "x1=1.-s1;\n",
+ "print'Using Poisson Approximation:',x1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Probabilty of more than one error in 10 recieved digits: 0.0956179249912\n",
+ "Using Poisson Approximation: 0.095162581964\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 : Pg 6.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 6.23\n",
+ "# Example 6.23\n",
+ "# We find, k=1/(b-a)\n",
+ "# (b) if a=1 and b=2,P(|x|<c) where c=1/2\n",
+ "a=-1.;\n",
+ "b=2.;\n",
+ "c=1./2.;\n",
+ "\n",
+ "k=1./(b-a);\n",
+ "# P(|x|<c) = P(-c<=x<=c)\n",
+ "# Let y\n",
+ "x0=-c;x1=c;\n",
+ "y=1.;#integrate('1','x',x0,x1);\n",
+ "y1=k*y;\n",
+ "print'P(|x|<c):',y1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P(|x|<c): 0.333333333333\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E41 : Pg 6.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 6.34\n",
+ "# Example 6.41\n",
+ "# Given\n",
+ "import math \n",
+ "n=16.; # binary digits\n",
+ "p=0.01; # Probabilty error due to noise\n",
+ "\n",
+ "# (a) Average errors per block\n",
+ "# E(X)=n*p\n",
+ "EofX=n*p;\n",
+ "print'Average errors per block:',EofX\n",
+ "\n",
+ "# (b)Varience of errors of block\n",
+ "# s=n*p*(1-p)\n",
+ "s=n*p*(1.-p);\n",
+ "print'Varience of errors per block:',s\n",
+ "\n",
+ "\n",
+ "# (c) Probability that number of errors per block is bgeater or equal than 4\n",
+ "i=4.;\n",
+ "# AsP(X>=4)=1=P(X<=3)\n",
+ "P3=0;\n",
+ "for k in range(0,3):\n",
+ " f=(math.factorial(n))/((math.factorial(k))*(math.factorial(n-k)));\n",
+ " P3=P3+(f*(p**k)*((1-p)**(n-k)));\n",
+ "P4=1.-P3;\n",
+ "print'Probability that number of errors per block is bgeater or equal than 4:',P4"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average errors per block: 0.16\n",
+ "Varience of errors per block: 0.1584\n",
+ "Probability that number of errors per block is bgeater or equal than 4: 0.000507942409291\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER08.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER08.ipynb new file mode 100644 index 00000000..4b322a2a --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER08.ipynb @@ -0,0 +1,1027 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:d92601af9cb4594bb8f9c7cef4f510ff99b742d5192caa5a322094967f2cb623"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER08:NOISE"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 8.6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.6\n",
+ "# Example 8.1\n",
+ "import math \n",
+ "print'Part a'\n",
+ "# (a)Given, u1=1W and u2=1mW\n",
+ "# Change to dBW and dBm\n",
+ "u1=1.*10.**3.;\n",
+ "u2=1.;\n",
+ "# (i)470mW\n",
+ "a=470.*10.**3.;\n",
+ "y1=(10.*math.log(a/u1))/math.log(10);\n",
+ "print'dBm',y1\n",
+ "\n",
+ "y2=(10*math.log(a/u2))/math.log(10);\n",
+ "print'dBW',y2\n",
+ "\n",
+ "# (ii)1W\n",
+ "b=1.;\n",
+ "z1=(10.*math.log(b/u1))/math.log(10);\n",
+ "print'dBm',z1\n",
+ "\n",
+ "z2=(10.*math.log(b/u2))/math.log(10);\n",
+ "print'dBW',z2\n",
+ "\n",
+ "# (iii)100nW\n",
+ "c=100.*10.**9;\n",
+ "x1=(10*math.log(c/u1))/math.log(10);\n",
+ "print'dBm',x1\n",
+ "\n",
+ "x2=(10.*math.log(c/u2))/math.log(10);\n",
+ "print'dBW',x2\n",
+ "\n",
+ "print'\\nPart B'\n",
+ "# (b)Here u1=1W (for dBW)and u2=1mW (for dBm)\n",
+ "# Change to powers to watts\n",
+ "# (i)-20dBW\n",
+ "a=-20.;\n",
+ "k1=u2*(10.**(a/10.));\n",
+ "print'W',k1\n",
+ "\n",
+ "\n",
+ "# (ii)47dBm\n",
+ "b=47.;\n",
+ "k2=u1*(10.**(b/10.));\n",
+ "print'W',k2\n",
+ "\n",
+ "\n",
+ "# (ii)0dBm\n",
+ "c=0;\n",
+ "k3=u1*(10.**(c/10.));\n",
+ "print'W',k3\n",
+ "\n",
+ "\n",
+ "print'\\nPart C'\n",
+ "# (c)Given, channel loss=20dB and Pt=1W\n",
+ "l=-20.;\n",
+ "PT=1.;\n",
+ "PR=10.**(l/10.);\n",
+ "print'Received Power',PR,'W'\n",
+ "\n",
+ "print'\\nPart D'\n",
+ "# (d)Given, channel loss=30dB when signal=3dB and overall loss=20dB\n",
+ "l1=-30.;\n",
+ "s=-3.;\n",
+ "l2=-20.;\n",
+ "q=-l1-s-s+l2;\n",
+ "d1=10.**(q/10.);\n",
+ "print'=',q,'dB'\n",
+ "print d1\n",
+ "\n",
+ "print'\\nPart E'\n",
+ "# (e)Given,\n",
+ "Si=0; # dBm\n",
+ "S1=1.*10.**3.*(10.**(Si/10.));\n",
+ "Ni=1.*10.**7.; # W\n",
+ "\n",
+ "Osnr=S1/Ni;\n",
+ "Odb=(10.*(math.log(Osnr)))/math.log(10)\n",
+ "print Odb,'dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part a\n",
+ "dBm 26.7209785794\n",
+ "dBW 56.7209785794\n",
+ "dBm -30.0\n",
+ "dBW 0.0\n",
+ "dBm 80.0\n",
+ "dBW 110.0\n",
+ "\n",
+ "Part B\n",
+ "W 0.01\n",
+ "W 50118723.3627\n",
+ "W 1000.0\n",
+ "\n",
+ "Part C\n",
+ "Received Power 0.01 W\n",
+ "\n",
+ "Part D\n",
+ "= 16.0 dB\n",
+ "39.8107170553\n",
+ "\n",
+ "Part E\n",
+ "-40.0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 8.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.7\n",
+ "# Example 8.2\n",
+ "# Given,\n",
+ "import math \n",
+ "R=1000.;\n",
+ "T=27.; # degree celsius\n",
+ "TK=T+273.; # kelvin\n",
+ "# We know, rms noise voltage is 4RKTB\n",
+ "K=1.38*10.**28.;\n",
+ "B=10.;\n",
+ "V=math.sqrt(4.*R*K*TK*B);\n",
+ "print'Rms noise voltage:',V,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rms noise voltage: 4.06939798988e+17 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 8.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.8\n",
+ "# Example 8.3\n",
+ "# Given,\n",
+ "G=100.;\n",
+ "G1=(10.**(G/10.));\n",
+ "\n",
+ "T=30.;\n",
+ "Te=270.;\n",
+ "\n",
+ "# We know,output noise power=GKB(T+Te)\n",
+ "K=1.38*10.**23.;\n",
+ "B=1.5*10.**6.;\n",
+ "\n",
+ "No=G1*1.38*10.**23.*1.5*10.**6.*(T+Te);\n",
+ "print'Output Noise Power',No,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output Noise Power 6.21e+41 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 8.8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.8\n",
+ "# Example 8.4\n",
+ "# Given,\n",
+ "import math \n",
+ "R=50.;\n",
+ "osnr=0;\n",
+ "SNRo=(10.**(osnr/10.));\n",
+ "print'Output SNR',SNRo\n",
+ "# As Pni=KTB\n",
+ "K=1.38*10.**23.;\n",
+ "T=290.;\n",
+ "B=5.*10.**5.;\n",
+ "Pni=K*T*B;\n",
+ "print'Input noise power',Pni,'W'\n",
+ "# Psi=V**2/R\n",
+ "# Given V=5*10**-6V\n",
+ "V=0.5*10.**6.;\n",
+ "Psi=(V**2.)/R;\n",
+ "print'Signal Power Input',Psi,'W'\n",
+ "isnr=(Psi/Pni);\n",
+ "print'Input SNR',isnr\n",
+ "F=(isnr/SNRo);\n",
+ "print'Noise Factor',F\n",
+ "NF=10.*math.log(F)/math.log(10);\n",
+ "print'Noise figure',NF,'dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output SNR 1.0\n",
+ "Input noise power 2.001e+31 W\n",
+ "Signal Power Input 5000000000.0 W\n",
+ "Input SNR 2.49875062469e-22\n",
+ "Noise Factor 2.49875062469e-22\n",
+ "Noise figure -216.022770843 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 8.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.9\n",
+ "# Example 8.6\n",
+ "# Given,Stage 1\n",
+ "import math \n",
+ "SNRo=120.;\n",
+ "Pni=0.01*10.**6.; # W\n",
+ "G1=20.;\n",
+ "\n",
+ "# Stage 2\n",
+ "F2=12.; # dB\n",
+ "FF2=(10.**(F2/10.));\n",
+ "G2=30.;\n",
+ "\n",
+ "# Stage 3\n",
+ "F3=9.3; # dB\n",
+ "FF3=(10.**(F3/10.));\n",
+ "G3=35.;\n",
+ "\n",
+ "# (a)Nosie factor and noise figure of Stage 1\n",
+ "F=5.6; # dB\n",
+ "FF=(10.**(F/10.));\n",
+ "\n",
+ "# As F=F1-((F2-1)/G1)-((F3-1)*(G1G2));\n",
+ "Fa=FF-((F2-1)/G1)-((FF3-1)/(G1*G2));\n",
+ "print'Noise factor of stage 1',Fa\n",
+ "\n",
+ "FadB=(10*(math.log(Fa)))/math.log(10); # dB\n",
+ "print'Noise figure of stage 1',FadB,'dB'\n",
+ "\n",
+ "\n",
+ "# (b)Input signal power of stage 1\n",
+ "Psi=Pni*Fa*SNRo;\n",
+ "print'Input signal power of stage 1',Psi,'W'\n",
+ "\n",
+ "\n",
+ "# (c)Nosie added by stage 1\n",
+ "N=(Fa-1)*G1*Pni; \n",
+ "print'Noise added by stage 1',N,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Noise factor of stage 1 3.0682615804\n",
+ "Noise figure of stage 1 4.86892382031 dB\n",
+ "Input signal power of stage 1 3681913.89648 W\n",
+ "Noise added by stage 1 413652.31608 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 8.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.10\n",
+ "# Example 8.7\n",
+ "# Given\n",
+ "import math \n",
+ "Te=127.;# Kelvin\n",
+ "T=290.;# Kelvin\n",
+ "\n",
+ "G1=100.;\n",
+ "\n",
+ "F2dB=12.;# db\n",
+ "F2=(10.**(F2dB/10.));\n",
+ "\n",
+ "F1=1.+(Te/T);\n",
+ "\n",
+ "F=F1+((F2-1.)/G1);\n",
+ "FF=(10.*math.log(F))/math.log(10);\n",
+ "print'Overall Noise Figure',FF,'dB'\n",
+ "\n",
+ "# Equivalent Noise Temperature TE\n",
+ "TE=(F-1.)*T;\n",
+ "print'Equivalent Noise Temperature',TE,'K'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall Noise Figure 2.00418273219 dB\n",
+ "Equivalent Noise Temperature 170.061902581 K\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 8.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.11;\n",
+ "# Example 8.9\n",
+ "# (a)Noise Figure\n",
+ "# Given\n",
+ "# Loss Fcator\n",
+ "import math \n",
+ "IL=1.5; # dB\n",
+ "IL1=(10.**(IL/10.));\n",
+ "\n",
+ "# Noise figure\n",
+ "F1=1.41;\n",
+ "G1=1./F1;\n",
+ "\n",
+ "G2=10.; \n",
+ "GG2=(10.*math.log(G2))/math.log(10); # dB\n",
+ "\n",
+ "G3=100.;\n",
+ "GG3=(10.*math.log(G3))/math.log(10); # dB\n",
+ "\n",
+ "F2=2.; # dB\n",
+ "F3=2.; # dB\n",
+ "\n",
+ "FF2=(10.**(F2/10.));\n",
+ "FF3=(10.**(F3/10.));\n",
+ "\n",
+ "F=(F1+((FF2-1.)/G1)+((FF3-1.)/(G1*GG2)));\n",
+ "FF=(10.*math.log(F))/math.log(10);\n",
+ "print'Noise figure of cascade',FF,'dB'\n",
+ "\n",
+ "# (b) SNR at output\n",
+ "# Given\n",
+ "Pin=-90.; # dBm\n",
+ "Pout=Pin-IL+GG2+GG3; # dBm\n",
+ "\n",
+ "# Pn=Gcas*K*Te*B (cascade)\n",
+ "K=1.38*10.**23.;\n",
+ "To=290.; # Kelvin\n",
+ "B=1.*10.**8.;\n",
+ "Gcas=GG2+GG3-IL;\n",
+ "Gcas1=(10.**(Gcas/10.));\n",
+ "Pn=K*To*(F-1.)*B*Gcas1; # W\n",
+ "\n",
+ "Pn1=(10.*(math.log(Pn/1.*10.**3.)))/math.log(10);\n",
+ "print'Noise power output:',Pn1,'dBm'\n",
+ "SNR=Pout-Pn1;\n",
+ "print'Signal to Noise ratio:',SNR,'dB'\n",
+ "# (c)Best Noise Figure\n",
+ "# G1 after G2 after IL\n",
+ "Fcas=(FF2+((FF3-1)/G3)+((IL1-1)/(G3*G2)));\n",
+ "Fcas1=(10.*(math.log(Fcas)))/math.log(10);\n",
+ "print'Noise figure will be:',Fcas1,'dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Noise figure of cascade 3.6495777371 dB\n",
+ "Noise power output: 395.719186978 dBm\n",
+ "Signal to Noise ratio: -457.219186978 dB\n",
+ "Noise figure will be: 2.01712395585 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 : Pg 8.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.12\n",
+ "# Example 8.10\n",
+ "import math \n",
+ "# Given\n",
+ "K=1.38*10.**23;\n",
+ "B=40.*10.**6.;\n",
+ "\n",
+ "Tant=600.; # Kelvin\n",
+ "Trec=3000.; # Kelvin\n",
+ "\n",
+ "G=80.; # dB\n",
+ "GG=(10.**(G/10.));\n",
+ "\n",
+ "# Input noise power from antenna\n",
+ "Nant=K*Tant*B; # W\n",
+ "print'Nant=',Nant,'W'\n",
+ "\n",
+ "Nrec=K*Trec*B; # W\n",
+ "print'Nant=',Nrec,'W'\n",
+ "Nout=(Nant+Nrec)*GG;\n",
+ "print'Reciver Noise Power Output',Nout,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Nant= 3.312e+33 W\n",
+ "Nant= 1.656e+34 W\n",
+ "Reciver Noise Power Output 1.9872e+42 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 : Pg 8.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.12\n",
+ "# Example 8.11\n",
+ "import math \n",
+ "# We use, F=(F1+(F2-1)/G1)\n",
+ "# Given\n",
+ "FA=1.5; \n",
+ "\n",
+ "GA=10.; # dB\n",
+ "GAA=(10.**(GA/10.));\n",
+ "\n",
+ "FB=3.; # dB\n",
+ "FBB=(10.**(FB/10.));\n",
+ "\n",
+ "GB=15.; # dB\n",
+ "GBB=(10.**(GB/10.));\n",
+ "\n",
+ "# Case 1: Amp A followed by Amp B\n",
+ "F11=FA;\n",
+ "F12=FBB;\n",
+ "G11=GAA;\n",
+ "\n",
+ "F1=(F11+(F12-1.)/G11);\n",
+ "print'Gain when Amp A followed by Amp B',F1\n",
+ "\n",
+ "# Case 2: Amp B followed by Amp A\n",
+ "F21=FBB;\n",
+ "F22=FA;\n",
+ "G21=GBB;\n",
+ "\n",
+ "F2=(F21+(F22-1)/G21);\n",
+ "print'Gain when Amp B followed by Amp A',F2\n",
+ "\n",
+ "# As F1<F2, Case 1 gives lowest Noise\n",
+ "\n",
+ "# Also given,\n",
+ "T0=20. # degree celsius\n",
+ "T=T0+273.; # Kelvin\n",
+ "\n",
+ "# For amplifier A\n",
+ "TA=((FA-1.)*T);\n",
+ "\n",
+ "# For amplifier B\n",
+ "TB=((FBB-1.)*T);\n",
+ "\n",
+ "# When A is followed by B\n",
+ "Te1=(F1-1.)*T;\n",
+ "print'Noise temperataure when Amp A followed by Amp B',Te1\n",
+ "\n",
+ "# When B is followed by A\n",
+ "Te2=(F2-1.)*T;\n",
+ "print'Noise temperataure when Amp B followed by Amp A',Te2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gain when Amp A followed by Amp B 1.5995262315\n",
+ "Gain when Amp B followed by Amp A 2.01107370327\n",
+ "Noise temperataure when Amp A followed by Amp B 175.661185829\n",
+ "Noise temperataure when Amp B followed by Amp A 296.244595058\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 : Pg 8.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.13\n",
+ "# Example 8.12\n",
+ "import math \n",
+ "# Given, Noise figure\n",
+ "NF=2.; # dB\n",
+ "F=(10.**(NF/10.));\n",
+ "\n",
+ "AG=12.; # dB\n",
+ "A=(10.**(AG/10.));\n",
+ "\n",
+ "# (a)Total Output Noise Power\n",
+ "\n",
+ "# Also given,Input signal power \n",
+ "Pi=1.; # W\n",
+ "\n",
+ "# Input Noise power Pni\n",
+ "Pni=100.*10.**-3.; # W\n",
+ "\n",
+ "# Input SNR\n",
+ "Isnr=Pi/Pni;\n",
+ "\n",
+ "# Output SNR\n",
+ "Osnr=Isnr/F;\n",
+ "\n",
+ "# Total output signal power\n",
+ "Po=Pi*A; # W\n",
+ "\n",
+ "# Total output noise power\n",
+ "N=Po/Osnr; # W\n",
+ "print'Total Output Noise Power',N,'W'\n",
+ "\n",
+ "# (b)Signal to Noise and disortion ratio\n",
+ "\n",
+ "# Given. 2% is disortion\n",
+ "Di=2./100.;\n",
+ "\n",
+ "# Total disortion\n",
+ "D=Di*A; # W\n",
+ "\n",
+ "# Useful Power\n",
+ "S=(1.-Di)*A; # W\n",
+ "\n",
+ "# As given,SNAD=10*(log10(S+N+D)/(N+D));\n",
+ "SNAD=10.*(math.log((S+N+D)/(N+D)))/math.log(10);\n",
+ "print'SNAD:',SNAD,'dB'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Output Noise Power 2.51188643151 W\n",
+ "SNAD: 8.12279800985 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 : Pg 8.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.14\n",
+ "# Example 8.13\n",
+ "# Given\n",
+ "import math \n",
+ "Pni=-100.; # dBm\n",
+ "PniW=((1.*10.**3.)*(10.**(Pni/10.)));\n",
+ "\n",
+ "To=290.; # K\n",
+ "\n",
+ "F=1.6; # dB\n",
+ "NF=(10.**(F/10.));\n",
+ "\n",
+ "# (a) Noise tempertaure of antenna\n",
+ "# As Te=Pni/K*B;\n",
+ "K=1.38*10.**23.;\n",
+ "B=20.*10.**6.;\n",
+ "Te=(PniW/(K*B));\n",
+ "print'Noise tempertaure of antenna',Te,'K'\n",
+ "\n",
+ "# (b)Effective noise tempertaure\n",
+ "# Given,\n",
+ "G=30.; # dB\n",
+ "GdB=(10.**(G/10.));\n",
+ "\n",
+ "Tef=((NF-1.)*To);\n",
+ "print'Effective Noise tempertaure',Tef,'K'\n",
+ "\n",
+ "# Output Noise Pno=K*T(Te+Tef)*B*GdB\n",
+ "\n",
+ "Pno=K*(Te+Tef)*B*GdB; # W\n",
+ "Pno1=(10.*(math.log(Pno/1.*10.**3.)))/math.log(10);\n",
+ "print'Output Noise: ',Pno1,'dBm'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Noise tempertaure of antenna 3.6231884058e-38 K\n",
+ "Effective Noise tempertaure 129.177533516 K\n",
+ "Output Noise: 385.5209607 dBm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 8.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.14\n",
+ "# Example 8.14\n",
+ "# Given\n",
+ "import math \n",
+ "GG1=20.;# dB\n",
+ "G1=(10.**(GG1/10.));\n",
+ "\n",
+ "FF1=6.;# dB\n",
+ "F1=(10.**(FF1/10.));\n",
+ "\n",
+ "GG2=60.;# dB\n",
+ "G2=(10.**(GG2/10.));\n",
+ "\n",
+ "FF2=16.;# dB\n",
+ "F2=(10.**(FF2/10.));\n",
+ "\n",
+ "LF=3.; # dB\n",
+ "FC=(10.**(LF/10.));\n",
+ "GC=1./FC;\n",
+ "\n",
+ "# (a)Overall Noise Figure\n",
+ "# Usinng F=(F1+((F2-1)/G1)+((F3-1)(G1*G2)));\n",
+ "\n",
+ "Fa=(F1+((FC-1.)/G1)+((F2-1.)/(G1*GC)));\n",
+ "FadB=(10.*(math.log(Fa)))/math.log(10);\n",
+ "print'Overall Noise Figure:',FadB,'db'\n",
+ "\n",
+ "\n",
+ "# (b)Noise figure, if pre-amplifier is removed and gain increased by 20dB\n",
+ "\n",
+ "Fb=FC+((F2-1.)/GC);\n",
+ "FbdB=(10.*(math.log(Fb)))/math.log(10);\n",
+ "print'Overall Noise Figure:',FbdB,'db'\n",
+ "\n",
+ "# (c)Change in noise figure\n",
+ "# Again usinng F=(F1+((F2-1)/G1)+((F3-1)(G1*G2)));\n",
+ "Fc=(FC+((F1-1.)/GC)+((F2-1.)/(G1*GC)));\n",
+ "FcdB=(10.*(math.log(Fc)))/math.log(10);\n",
+ "\n",
+ "print'Overall Noise Figure:',FcdB,'db'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Overall Noise Figure: 6.78099355039 db\n",
+ "Overall Noise Figure: 19.0 db\n",
+ "Overall Noise Figure: 9.40399825279 db\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 : Pg 8.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.15\n",
+ "# Example 8.15\n",
+ "# Given Noise figure\n",
+ "import math \n",
+ "NF=5.; # dB\n",
+ "F=(10.**(NF/10.));\n",
+ "Ta=1050.; # Kelvin\n",
+ "# (a) Overall Noise Figure\n",
+ "T=20.; # degree Celsius\n",
+ "To=T+273.; # Kelvin\n",
+ "# Effective Noise temperature\n",
+ "Te=((F-1.)*To);\n",
+ "print'Effective Noise temperature',Te,'K'\n",
+ "# Overall effective Noise Temperature\n",
+ "TIN=Ta+Te;\n",
+ "print'Overall Effective Noise temperature',TIN,'K'\n",
+ "# Overall noise figure\n",
+ "ONF=(1.+(TIN/To));\n",
+ "ONFdB=(10.*(math.log(ONF)))/math.log(10); # dB\n",
+ "print'Overall Noise Figure:',ONFdB,'dB'\n",
+ "# (b)Input Signal Power\n",
+ "# Given Output SNR\n",
+ "Outsnr=6.; # dB\n",
+ "Osnr=(10.**(Outsnr/10.));\n",
+ "Isnr=ONF*Osnr;\n",
+ "# Input Noise Power=KTB\n",
+ "K=1.38*10.**23.;\n",
+ "B=50000.;\n",
+ "Pni=K*TIN*B; # W\n",
+ "# Input signal Power\n",
+ "Psi=Isnr*Pni; # W\n",
+ "PsidBW=(10.*(math.log(Psi/1)))/math.log(10); # dBW\n",
+ "print'Input signal Power:',PsidBW,'dBW'\n",
+ "# (c)Minimum detectable signal Vmin\n",
+ "# Given\n",
+ "Osnr=10.; # dB\n",
+ "R=50.; # Ohms\n",
+ "FF1=3.; # dB\n",
+ "F1=(10.**(FF1/10.));\n",
+ "FF2=5.; # dB\n",
+ "F2=(10.**(FF2/10.));\n",
+ "GG1=7.; \n",
+ "G1=(10.**(GG1/10.));\n",
+ "# Using F=F1+((F2-1)/G1)\n",
+ "Fa=F1+((F2-1.)/G1);\n",
+ "Fa1=(10.*(math.log(Fa)))/math.log(10);\n",
+ "# Equivalent Noise Tempertaure\n",
+ "Te1=((Fa-1.)*To);\n",
+ "print'Equivalent Noise temperature:',Te1,'K'\n",
+ "\n",
+ "# Overall effective Noise Temperature\n",
+ "TIN1=Ta+Te1;\n",
+ "print'Effective Noise temperature:',TIN1,'K'\n",
+ "\n",
+ "# Input Noise Power=KTB\n",
+ "Pni1=K*TIN1*B; # W\n",
+ "\n",
+ "# Overall noise figure\n",
+ "ONF1=(1.+(TIN1/To));\n",
+ "ONFdB1=(10.*(math.log(ONF)))/math.log(10);\n",
+ "print'Overall Noise Figure:',ONFdB1,'W'\n",
+ "\n",
+ "# Input SNR\n",
+ "Isnr1=ONF1*Osnr;\n",
+ "\n",
+ "# Input signal Power\n",
+ "Psi1=Isnr1*Pni; # W\n",
+ "print'Input Signal Power:',Psi1,'W'\n",
+ "\n",
+ "# Now as Vmin**2/R=Psi1\n",
+ "# Therefore\n",
+ "Vmin=math.sqrt(Psi1*R);\n",
+ "print'Minimum detectable signal Vmin:',Vmin,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Effective Noise temperature 633.547354429 K\n",
+ "Overall Effective Noise temperature 1683.54735443 K\n",
+ "Overall Noise Figure: 8.29039603344 dB\n",
+ "Input signal Power: 324.941140307 dBW\n",
+ "Equivalent Noise temperature: 418.02117439 K\n",
+ "Effective Noise temperature: 1468.02117439 K\n",
+ "Overall Noise Figure: 8.29039603344 W\n",
+ "Input Signal Power: 6.98186400025e+32 W\n",
+ "Minimum detectable signal Vmin: 1.86840359669e+17 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 8.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.18\n",
+ "# Example 8.18\n",
+ "# Given, \n",
+ "import math \n",
+ "Fa=5.; # dB\n",
+ "d=200.; # Km\n",
+ "a=2.; # dB/Km\n",
+ "No=4.*10.**21.; # W/Hz\n",
+ "BW=4000.;\n",
+ "Osnr=30.; # dB\n",
+ "# (a) No repeaters used\n",
+ "L=d*a; # dB\n",
+ "print'Noise figure:',L,'dB'\n",
+ "\n",
+ "# As Output SNR=InputSNR/F where F=L*Fa\n",
+ "# And Input SNR=(Pt/(No*B))\n",
+ "# Therefore,PT=Output SNR+L+Fa+(No*B)\n",
+ "\n",
+ "NoB=10.*math.log(No*BW)/math.log(10);\n",
+ "\n",
+ "# Power Transmitted\n",
+ "Pt=Osnr+L+Fa+(NoB);\n",
+ "\n",
+ "PtdB=10.**(Pt/10.);\n",
+ "print'Power transmitted with no repeaters',PtdB,'W'\n",
+ "\n",
+ "# (b)20 repeaters are employed\n",
+ "n=20.;\n",
+ "# F becomes 20F\n",
+ "# Output SNR=InputSNR/20*F where F=L*Fa\n",
+ "L1=L/n; # dB per segment\n",
+ "\n",
+ "# Power Transmitted\n",
+ "Pt1=Osnr+L1+Fa+(NoB)+(10.*(math.log(n)))/math.log(10.);\n",
+ "\n",
+ "PtdB1=10.**(Pt1/10.);\n",
+ "print 'Power transmitted with 20 repeaters',PtdB1,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Noise figure: 400.0 dB\n",
+ "Power transmitted with no repeaters 5.05964425627e+68 W\n",
+ "Power transmitted with 20 repeaters 1.01192885125e+32 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 : Pg 8.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 8.23\n",
+ "# Example 8.23\n",
+ "# Given,\n",
+ "# S=10*10.**8*(1-(|f|/10*10.**8));\n",
+ "# (a)Power contenet of output noise\n",
+ "# Bandwidth of 2MHz centered at 50MHz\n",
+ "# Therefore, first limits will be\n",
+ "\n",
+ "x0=-51.*10.**6.;\n",
+ "x1=-49.*10.**6.;\n",
+ "P1=1*10.**06;#integrate('1+(f/10**8)','f',x0,x1);\n",
+ "\n",
+ "# And,second limits will be\n",
+ "\n",
+ "x2=49.*10.**6.;\n",
+ "x3=51.*10.**6.;\n",
+ "\n",
+ "P2=1*10.**06;#integrate('1-(f/10**8)','f',x2,x3);\n",
+ "\n",
+ "P=0.2;#10.*10.**8.*(P1+P2);\n",
+ "print'Power content:',P,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power content: 0.2 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER09.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER09.ipynb new file mode 100644 index 00000000..4a90200e --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER09.ipynb @@ -0,0 +1,552 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1dbf1e210c4590854e89fefc301f7793854ff6faa24ffc7f7d52e4b344b0bb4a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "CHAPTER09:NOISE IN ANALOG COMMUNICATION SYSTEM"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 9.10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.10\n",
+ "# Example 9.1\n",
+ "import math \n",
+ "# Given\n",
+ "wo=2.*math.pi*8000.;\n",
+ "n=2.*10.**9.; \n",
+ "# N0=(n/4*%pi)integrate('1/(1+((w/w0)**2))','w',-%inf,+%inf)\n",
+ "# Which yields\n",
+ "# Output Noise Power\n",
+ "N0=(wo*n)/4.;\n",
+ "print\"Output Noise Power: \",N0,\"W\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output Noise Power: 2.51327412287e+13 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 9.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.12\n",
+ "# Example 9.4\n",
+ "# Given\n",
+ "# (a) \n",
+ "import math \n",
+ "H1=1.;\n",
+ "H2=(1./2.);\n",
+ "S0=(H1**2.)/2.;\n",
+ "w0=-2.*math.pi;\n",
+ "w1=2.*math.pi;\n",
+ "N0=0.4;#(0.1/(2*math.pi))*2*(integrate('1','w',w0,w1));\n",
+ "SNR=S0/N0;\n",
+ "print\"SNR: \",SNR\n",
+ "\n",
+ "# (b)\n",
+ "S01=(H1**2.*H2**2.)/2.;\n",
+ "N01=0.101;\n",
+ "SNR1=S01/N01;\n",
+ "print\"SNR1: \",SNR1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SNR: 1.25\n",
+ "SNR1: 1.23762376238\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 9.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.15\n",
+ "# Example 9.8\n",
+ "# Given\n",
+ "import math \n",
+ "p=0.99;\n",
+ "u=1.;\n",
+ "q=1-p;\n",
+ "# As exp(-Ac^2/4*n*B)=1-p\n",
+ "# AndAC^2/2*n*B=S/N\n",
+ "# Therefore exp(-(1/2)*(S/N))=1-p\n",
+ "SN=2.*(math.log(1/q));\n",
+ "SN1=(round(SN)+1); # Upper limit\n",
+ "print'S/N:',SN1,'db'\n",
+ "# Hence proved"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "S/N: 10.0 db\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 9.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.16\n",
+ "# Example 9.9\n",
+ "# Given\n",
+ "import math\n",
+ "Si=7.*10.**4.;\n",
+ "u=1.;\n",
+ "BW=4.*10.**3.; # Hz\n",
+ "n=2.*10.**12.; # W/Hz\n",
+ "\n",
+ "# (a)Minimum value of Ac\n",
+ "SbyN=40.; # dB\n",
+ "SN=10.**(SbyN/10.);\n",
+ "\n",
+ "Sx=0.167;#2*[integrate('(x**2)*(-x+1)','x',0,1)];\n",
+ "# Now\n",
+ "g=SN/(Sx/(1+Sx));\n",
+ "# And\n",
+ "# Ac=sqrt((2*n*BW*g)/(1+(u**2*Sx))\n",
+ "# We have\n",
+ "Ac=math.sqrt((2.*n*BW*g)/(1.+(u**2.*Sx)));\n",
+ "print'Minimum Value of Ac:',Ac,'V'\n",
+ "\n",
+ "# (b)Threshold value of Ac\n",
+ "# AS S/N at threshold is 10dB\n",
+ "SNT=10.; # dB\n",
+ "gT=2.*SNT;\n",
+ "AcT=math.sqrt((2.*n*BW*gT)/(1.+(u**2.*Sx)));\n",
+ "print'Minimum Value of Ac at Threshold:',AcT,'V'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum Value of Ac: 30952929301.4 V\n",
+ "Minimum Value of Ac at Threshold: 523648135.033 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 : Pg 9.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.17\n",
+ "# Example 9.10\n",
+ "# Given\n",
+ "\n",
+ "BW=10.*10.**3.; # Hz\n",
+ "SNR=40.; # dB\n",
+ "SNRO=10.**(SNR/10.);\n",
+ "P=40.; # dB\n",
+ "PL=10.**(P/10.);\n",
+ "n=2.*10.**9.; # W/Hz\n",
+ "USx2=0.5;\n",
+ "# For DSB, AM and SSB bandwidth requirement\n",
+ "BTD=2.*BW;\n",
+ "BTA=2.*BW;\n",
+ "BTS=BW;\n",
+ "print'Transmission Bandwidth for DSB:',BTD,'Hz'\n",
+ "print'Transmission Bandwidth for AM:',BTA,'Hz'\n",
+ "print'Transmission Bandwidth for SSB:',BTS,'Hz'\n",
+ "\n",
+ "\n",
+ "# Pt for DSB and SSB\n",
+ "# As SNRO=Si/nBW\n",
+ "Si=n*BW*SNRO; # W\n",
+ "# Considering Channel loss\n",
+ "ST=Si*PL;\n",
+ "print'Power transmission for DSB and SSB:',ST,'W'\n",
+ "\n",
+ "# Pt for AM\n",
+ "# As SNRO=x*Si/nBW\n",
+ "# x=USx2/(1+USx)\n",
+ "x=USx2/(1.+USx2);\n",
+ "Si1=(n*BW*SNRO)/x; # W\n",
+ "# Considering Channel loss\n",
+ "ST1=Si1*PL;\n",
+ "print'Power transmission for AM:',ST1,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transmission Bandwidth for DSB: 20000.0 Hz\n",
+ "Transmission Bandwidth for AM: 20000.0 Hz\n",
+ "Transmission Bandwidth for SSB: 10000.0 Hz\n",
+ "Power transmission for DSB and SSB: 2e+21 W\n",
+ "Power transmission for AM: 6e+21 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 : Pg 9.20"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.20\n",
+ "# Example 9.13\n",
+ "# Given\n",
+ "import math \n",
+ "Mf1=0.003;\n",
+ "# for f<=1.5*10.**3 Hz\n",
+ "f1=1.5*10.**3.; # Hz\n",
+ "Mf2=0.001;\n",
+ "# for 1.5*10.**3 <=f<=3*10.**3 Hz\n",
+ "f2=3.*10.**3.; # Hz\n",
+ "Mf3=0;\n",
+ "# for f>3*10.**3 Hz\n",
+ "# (a) Ac that power transmitted is 100mW\n",
+ "St=100.*10.**3.; # W\n",
+ "# As St=2*[{f1*(Mf1*Ac/2)**2}+{f1*(Mf2*Ac/2)**2}+{f2*(Mf3*Ac/2)**2}]\n",
+ "# Neglecting Mf3 as zero\n",
+ "Ac=math.sqrt((4.*St)/(2.*f1*(Mf1**2.+Mf2**2.)));\n",
+ "print'Ac for s(t)=100mw:',Ac,'V'\n",
+ "# (b)Power in abscence of noise\n",
+ "Zt=2.*((f1*(((Mf1*Ac)/4.)**2.))+(f1*(((Mf2*Ac)/4.)**2.))+(f2*(((Mf3*Ac)/4.)**2.)));\n",
+ "print'Power in absence of Noise:',Zt,'W'\n",
+ "# (c)\n",
+ "# Given\n",
+ "N0=0.0001*10.**3.; # W/Hz\n",
+ "# Psd=N0/4\n",
+ "# Pt=2*f1*N0/4\n",
+ "Pt=(2.*f2*N0)/4.;\n",
+ "print'Power:',Pt,'W'\n",
+ "# (d) SNR at output\n",
+ "SNR=Zt/Pt;\n",
+ "SNRO=10.*math.log(SNR)/math.log(10);\n",
+ "print'SNR at output for SSB:',SNRO,'dB'\n",
+ "# (e)For DSB\n",
+ "St1=100.*10.**3.; # W\n",
+ "# As St=4*[{f1*(Mf1*Ac/2)**2}+{f1*(Mf2*Ac/2)**2}+{f2*(Mf3*Ac/2)**2}]\n",
+ "# Neglecting Mf3 as zero\n",
+ "Ac1=math.sqrt((4.*St)/(4.*f1*(Mf1**2.+Mf3**2.)));\n",
+ "Zt1=4.*((f1*(((Mf1*Ac)/4.)**2.))+(f1*(((Mf2*Ac)/4.)**2.))+(f2*(((Mf3*Ac)/4.)**2.)));\n",
+ "# SNR at output\n",
+ "SNR1=Zt1/Pt;\n",
+ "SNRO1=10.*math.log(SNR1)/math.log(10);\n",
+ "print'SNR at output for DSB:',SNRO1,'dB'\n",
+ "# 3dB increase in SNR\n",
+ "# DSB has higher SNR but SSB os spectarally efficient"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ac for s(t)=100mw: 3651.4837167 V\n",
+ "Power in absence of Noise: 25000.0 W\n",
+ "Power: 150.0 W\n",
+ "SNR at output for SSB: 22.2184874962 dB\n",
+ "SNR at output for DSB: 25.2287874528 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 9.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.22\n",
+ "# Example 9.14\n",
+ "# Given\n",
+ "import math \n",
+ "delf=75.*10.**3.; # Hz\n",
+ "W=15.*10.**3.; # Hz\n",
+ "Sx=1./2.;\n",
+ "# As SNRO=3(delf/W)**2*Sx*g\n",
+ "# Assume g=1\n",
+ "g=1.;\n",
+ "\n",
+ "SNRO=3.*(delf/W)**2*Sx*g;\n",
+ "SNdB=10.*math.log(SNRO)/math.log(10);\n",
+ "print'Output SNR:',SNdB,'dB'\n",
+ "\n",
+ "# Hence it is SNdB times better"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output SNR: 15.7403126773 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 9.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.23\n",
+ "# Example 9.17\n",
+ "# Given\n",
+ "import math \n",
+ "oSNR=40.; # dB\n",
+ "SNRO=10.**(oSNR/10.);\n",
+ "n=2.*10.**10.; # W/Hz\n",
+ "l=50.; # dB\n",
+ "PL=10.**(l/10.);\n",
+ "B=15.*10.**3.; # Hz\n",
+ "Sx=1./2.;\n",
+ "# (a) DSB Modulation\n",
+ "BTD=2.*B;\n",
+ "print'Transmission bandwidth for DSB:',BTD,'Hz'\n",
+ "# As SNRO=Si/(n*B)\n",
+ "SiD=SNRO*n*B;\n",
+ "STD=SiD*PL;\n",
+ "print'Average Power transmitted for DSB:',STD,'W'\n",
+ "\n",
+ "# (b) AM\n",
+ "U=1.;\n",
+ "U2Sx=U*U*Sx;\n",
+ "BTA=2.*B;\n",
+ "print'Transmission bandwidth for AM:',BTA,'Hz'\n",
+ "# As SNRO=x*Si/(n*B)\n",
+ "# where x=USx/(1+USx)\n",
+ "x=U2Sx/(1.+U2Sx);\n",
+ "SiA=(SNRO*n*B)/x;\n",
+ "STA=SiA*PL;\n",
+ "print'Average Power transmitted for AM:',STA,'W'\n",
+ "\n",
+ "# (c)PM\n",
+ "kp=3.;\n",
+ "BTP=2.*(kp+1.)*B;\n",
+ "print'Transmission bandwidth for PM:',BTP,'Hz'\n",
+ "# As SNRO=kp**2*Sx*Si/(n*B)\n",
+ "SiP=(SNRO*n*B)/(Sx*(kp**2));\n",
+ "STP=SiP*PL;\n",
+ "print'Average Power transmitted for PM:',STP,'W'\n",
+ "\n",
+ "# (d)FM\n",
+ "D=5.;\n",
+ "BTF=2.*10.**1.*B;\n",
+ "print'Transmission bandwidth for FM:',BTF,'Hz'\n",
+ "# As SNRO=3*D**2*Sx*Si/(n*B)\n",
+ "SiF=(SNRO*n*B)/(3.*(D**2.)*Sx);\n",
+ "STF=SiF*PL;\n",
+ "print'Average Power transmitted for FM:',STF,'W'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transmission bandwidth for DSB: 30000.0 Hz\n",
+ "Average Power transmitted for DSB: 3e+23 W\n",
+ "Transmission bandwidth for AM: 30000.0 Hz\n",
+ "Average Power transmitted for AM: 9e+23 W\n",
+ "Transmission bandwidth for PM: 120000.0 Hz\n",
+ "Average Power transmitted for PM: 6.66666666667e+22 W\n",
+ "Transmission bandwidth for FM: 300000.0 Hz\n",
+ "Average Power transmitted for FM: 8e+21 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 9.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.24\n",
+ "# Example 9.18\n",
+ "# (b)Modulation index b\n",
+ "# Given\n",
+ "SNdB=30.; # dB\n",
+ "SNRO=10.**(SNdB/10.);\n",
+ "# As SNRO=30*b**2*(b+1)\n",
+ "# Therefore\n",
+ "#p2=poly(0,'x');\n",
+ "#p3 =30.*(p2**3.)+30.*(p2**2.)-1000.;\n",
+ "#r=roots(p3);\n",
+ "t=2.917128 ;#2.92+0j;#r(3,1);\n",
+ "print'Modulation index:',t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Modulation index: 2.917128\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 : Pg 9.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 9.27\n",
+ "# Example 9.21\n",
+ "# Given\n",
+ "import math \n",
+ "BW=5000.; # Hz\n",
+ "P=0.1; # W\n",
+ "CBW=100.*10.**3.; # Hz\n",
+ "A=80.; # dB\n",
+ "A1=10.**(-A/10.);\n",
+ "N0=2*(0.5*10.**12.); # W/Hz\n",
+ "Pt=10.*10.**3.; # W\n",
+ "\n",
+ "# We know, CBW=2*(*10.**1)*BW\n",
+ "# Therefore\n",
+ "D=(CBW/(2.*BW))-1.;\n",
+ "kp=D;\n",
+ "Si=Pt*A1;\n",
+ "Sx=P;\n",
+ "# We know\n",
+ "# SNR=((kp**2)*Si*Sx)/(N0*BW);\n",
+ "\n",
+ "SNR=((kp**2.)*Si*Sx)/(N0*BW);\n",
+ "SNR1=10.*math.log(SNR)/math.log(10);\n",
+ "print\"SNR at output: \",SNR1,\"dB\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "SNR at output: -187.904849855 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER10.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER10.ipynb new file mode 100644 index 00000000..e766e88f --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER10.ipynb @@ -0,0 +1,567 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:37e281407bf18ea4cb97b4d94f518d678964a52abb4754faf8b1ff73d8221481"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER10:DIGITAL MODULATION AND DEMODULATION"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 10.18"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.18\n",
+ "# Example 10.1\n",
+ "from math import sqrt,erfc\n",
+ "# Given\n",
+ "Rb=1.*10.**6.; # b/s\n",
+ "A=5.*10.**3.; # V\n",
+ "N0=0.5*10.**11.; # W/Hz\n",
+ "\n",
+ "Tb=1./Rb;\n",
+ "Eb=(A*A*Tb)/2.;\n",
+ "\n",
+ "# (a) ASK\n",
+ "# Pe=Q(x)\n",
+ "# where\n",
+ "xA=sqrt(Eb/N0);\n",
+ "\n",
+ "PeA=(1./2.)*erfc(xA/1.414);\n",
+ "print'For ASK:',round(PeA,2)\n",
+ "\n",
+ "# (b) PSK\n",
+ "# Pe=Q(x)\n",
+ "# where\n",
+ "xP=sqrt((2.*Eb)/N0);\n",
+ "\n",
+ "PeP=(1./2.)*erfc(xP/1.414);\n",
+ "print'For PSK:',round(PeP,2)\n",
+ "\n",
+ "# (c) FSK\n",
+ "# Pe=Q(x)\n",
+ "# where\n",
+ "xF=sqrt(Eb/N0);\n",
+ "\n",
+ "PeF=(1./2.)*erfc(xF/1.414);\n",
+ "print'For FSK:',round(PeF,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For ASK: 0.5\n",
+ "For PSK: 0.5\n",
+ "For FSK: 0.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 10.19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.19\n",
+ "# Example 10.2\n",
+ "from math import sqrt,erfc\n",
+ "# Given\n",
+ "Rb=1.*10.**6.; # b/s\n",
+ "\n",
+ "# (a)\n",
+ "Aa=1.*10.**3.; # V\n",
+ "N0=1*10.**11.; # W/Hz\n",
+ "\n",
+ "Tb=1./Rb;\n",
+ "Eba=(Aa*Aa*Tb)/2.;\n",
+ "\n",
+ "# Pe=Q(z)\n",
+ "# where\n",
+ "za=sqrt((2.*Eba)/N0);\n",
+ "\n",
+ "Peb=(1./2.)*erfc(za/1.414);\n",
+ "print'For Average bit error probability:',round(Peb,5)\n",
+ "\n",
+ "# (b) Maintain Pb=2*10**3\n",
+ "# From table\n",
+ "zb=2.9;\n",
+ "Ebb=((zb**2.)*N0)/2.;\n",
+ "P=Ebb*Tb;\n",
+ "Ab=sqrt((2.*P));\n",
+ "print'Average Power:',round(Ab,2),'V'\n",
+ "\n",
+ "# (c)\n",
+ "Ac=100.; # V\n",
+ "Rbc=1.*10.**5.; # p/s\n",
+ "N01=1.*10.**2.; # W/Hz\n",
+ "Tbc=1./Rbc;\n",
+ "Ebc=(Ac*Ac*Tbc);\n",
+ "\n",
+ "zc=sqrt(((2.*Ebc)/N01));\n",
+ "\n",
+ "Pec=(1./2.)*erfc(zc/1.414);\n",
+ "# Pec=0.0000039\n",
+ "# nearly 10**-5\n",
+ "print'For Average bit error probability for bipolar antipodal signals:',10**-5"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Average bit error probability: 0.5\n",
+ "Average Power: 917.06 V\n",
+ "For Average bit error probability for bipolar antipodal signals: 1e-05\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 10.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.23\n",
+ "# Example 10.6\n",
+ "# Given\n",
+ "import math\n",
+ "p=0.1; # dB\n",
+ "p1=10.**(-p/10.);\n",
+ "p2=math.sqrt(p1);\n",
+ "t=8.68;#math.acosd(p2);\n",
+ "a=round(t);\n",
+ "print'System cannot tolerate more than:',a,'degrees'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "System cannot tolerate more than: 9.0 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 : Pg 10.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.28\n",
+ "# Example 10.11\n",
+ "from math import sqrt,erfc\n",
+ "# Given\n",
+ "Rb=1.*10.**6.; # b/s\n",
+ "T=1.*10.**5.;\n",
+ "N0=2.*0.5*10.**7.; # W/Hz\n",
+ "\n",
+ "# From table for Q(z)=10**-5\n",
+ "z=4.25;\n",
+ "\n",
+ "# As z=sqrt(A*A*T/2*N0)\n",
+ "x=((z**2.)*2.*N0)/T;\n",
+ "A=sqrt(x);\n",
+ "print'Required value of A:',round(A,2)\n",
+ "\n",
+ "# (b) Bandwidth\n",
+ "# B=1/(2*(T/2))\n",
+ "# Therefore B=1/T\n",
+ "B=(1./T);\n",
+ "print'Bandwidth:',round(B,2),'Hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required value of A: 60.1\n",
+ "Bandwidth: 0.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 10.33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.33\n",
+ "# Example 10.17\n",
+ "from math import sqrt,erfc\n",
+ "# Given\n",
+ "A=0.2*10.**3.; # V\n",
+ "T=2.*10.**6.; # s\n",
+ "n=2.*1.*10.**15.; # W/Hz\n",
+ "\n",
+ "\n",
+ "# Pe=Q(z)\n",
+ "# where\n",
+ "x=(A*A*T)/(4.*n);\n",
+ "z=sqrt(x);\n",
+ "Pe=(1./2.)*erfc(z/1.414);\n",
+ "print'Error probability:',round(Pe,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Error probability: 0.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 10.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.34\n",
+ "# Example 10.18\n",
+ "from math import sqrt,erfc\n",
+ "# Given\n",
+ "A=0.2*10.**3.; # V\n",
+ "A1=A/1.414;\n",
+ "\n",
+ "T=2.*10.**6.; # s\n",
+ "n=2.*1.*10.**15.; # W/Hz\n",
+ "\n",
+ "\n",
+ "# Pe=Q(z)\n",
+ "# where\n",
+ "x=(A1*A1*T)/(n);\n",
+ "z=sqrt(x);\n",
+ "Pe=(1./2.)*erfc(z/1.414);\n",
+ "print'Error probability:',round(Pe,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Error probability: 0.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 : Pg 10.35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.35\n",
+ "# Example 10.19\n",
+ "from math import sqrt,erfc\n",
+ "# Given\n",
+ "d12sqr=8.;\n",
+ "N0=2.*0.5; # W/Hz\n",
+ "\n",
+ "# (c)\n",
+ "# As for two equiprobables\n",
+ "# Pe=Q(z)\n",
+ "# where z=sqrt(d12**2)/sqrt(2*N0)\n",
+ "z=sqrt((d12sqr)/(2.*N0));\n",
+ "Pe=(1./2.)*erfc(z/1.414);\n",
+ "print'Probabilty error:',round(Pe,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Probabilty error: 0.02\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 10.36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.36\n",
+ "# Example 10.20\n",
+ "from math import sqrt,erfc\n",
+ "# Given\n",
+ "c=sqrt(2.);\n",
+ "A=sqrt(5.);\n",
+ "N0=1.; # W/Hz\n",
+ "\n",
+ "d12sqr=4.*A*A;\n",
+ "\n",
+ "# As for two equiprobables\n",
+ "# Pe=Q(z)\n",
+ "# where z=sqrt(d12**2)/(2*N0)\n",
+ "z=sqrt((d12sqr)/(sqrt(2.*N0)));\n",
+ "Pe=(1./2.)*erfc(z/1.414);\n",
+ "print'Probabilty error:',round(Pe,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Probabilty error: 0.0001\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 : Pg 10.41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.41\n",
+ "# Example 10.24\n",
+ "# (a) Number of constellation Points\n",
+ "# Given\n",
+ "Rs=2400.; # bps\n",
+ "Rb=19.2*10.**3.; # bps\n",
+ "\n",
+ "# As Rs=Rb/log2M\n",
+ "M=2.**(Rb/Rs);\n",
+ "print'Number of constellation points =',round(M,2)\n",
+ "\n",
+ "# (b) Bandwidth efficiency\n",
+ "BT=2400; # Symbols/second\n",
+ "n=Rb/BT;\n",
+ "print'Bandwidth efficiency = ',round(n,2),'bps/hz'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Number of constellation points = 256.0\n",
+ "Bandwidth efficiency = 8.0 "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "bps/hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 : Pg 10.41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.41\n",
+ "# Example 10.25\n",
+ "from math import sqrt,erfc\n",
+ "# Given\n",
+ "A1=0.5;\n",
+ "A2=0.5;\n",
+ "T=0.01; # sec\n",
+ "N0=2.*0.0001; # W/Hz\n",
+ "f=50.; # Hz\n",
+ "\n",
+ "# (a) Probability of bit error\n",
+ "Es1=(A1**2.*T)/2.;\n",
+ "Es2=(A2**2.*T)/2.;\n",
+ "\n",
+ "Eb=(Es1+Es2)/2.;\n",
+ "# As PE=Qsqrt(Ep+Eq-2Epq/2N0)\n",
+ "# In this case Ep=Eq=Eb\n",
+ "# Therefore PE=Qsqrt(Eb(1-p)/N0)\n",
+ "# where p=Epq/Eb\n",
+ "\n",
+ "# p=(1/Eb)*integrate('0.5*cos(2000*%pi*t)*0.5*cos(2020*%pi*t)','t',0,T);\n",
+ "# We get\n",
+ "p=0.94;\n",
+ "q=1.-p;\n",
+ "# As Pe=Q(z)\n",
+ "# where z=sqrt(Eb/N0)\n",
+ "z=sqrt((Eb*q)/N0);\n",
+ "Pe=(1./2.)*erfc(z/1.414);\n",
+ "print'Probabilty of bit error :',round(Pe,2)\n",
+ "\n",
+ "# (b)\n",
+ "# Given\n",
+ "fs=50.; # Hz\n",
+ "# or fs=1/2T where T=0.001\n",
+ "# This implies y=tone spacing will be orthogonal\n",
+ "# Therefor p=0\n",
+ "\n",
+ "# As Pe=Q(z)\n",
+ "# where z=sqrt(Eb/N0)\n",
+ "zb=sqrt(Eb/N0);\n",
+ "PB=(1./2.)*erfc(zb/1.414);\n",
+ "print'Probabilty error for fs=50Hz :',round(PB,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Probabilty of bit error : 0.27\n",
+ "Probabilty error for fs=50Hz : 0.01\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 : Pg 10.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 10.43\n",
+ "# Example 10.27\n",
+ "\n",
+ "# Given\n",
+ "Rb=4.8*10.**3.; # b/s\n",
+ "bw=3.2*10.**3.; # Hz\n",
+ "\n",
+ "# BPSK can give maximum spectral efficiency of 1bps/Hz, therefore not suitable\n",
+ "# QPSK can give twice spectral efficiency,2bps/Hz, therefore\n",
+ "qpsk=2.*bw;\n",
+ "# PSK can give thrice spectral efficiency,3bps/Hz, therefore\n",
+ "psk=3.*bw;\n",
+ "\n",
+ "# QPSK is most suitable\n",
+ "Rs=Rb/2.;\n",
+ "# Roll off Factor\n",
+ "a=(bw/Rs)-1.;\n",
+ "ap=a*100.;\n",
+ "print'Roll off factor:',ap,'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Roll off factor: 33.3333333333 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER11.ipynb b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER11.ipynb new file mode 100644 index 00000000..4c69f76b --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/CHAPTER11.ipynb @@ -0,0 +1,982 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:be5041469fe4adb34737f95bd033478b4d0f4199056867cd251bf1b626573703"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER11:INFORMATION THEORY AND SOURCE CODING"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 11.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.12\n",
+ "# Example 11.2\n",
+ "# Given\n",
+ "# Probabilities of four symbols\n",
+ "Px=([0.4, 0.3, 0.2, 0.1]);\n",
+ "import math \n",
+ "# (a) H(X)\n",
+ "# As H(X)=-Sum of(P(xi)log2P(xi)) \n",
+ "# Where i=0 to n;\n",
+ "HofX=0;\n",
+ "for i=1:4\n",
+ " HofX=HofX+(Px(i)*math.log(Px(i,2)));\n",
+ "print 'H(X):',-HofX,'b/symbol'\n",
+ "\n",
+ "# (b)Amount of information in x1x2x1x3 and x4x3x3x2\n",
+ "Px1x2x1x3=Px(1)*Px(2)*Px(1)*Px(3);\n",
+ "Ix1x2x1x3=-log2(Px1x2x1x3);\n",
+ "print'Ix1x2x1x3:',Ix1x2x1x3,'b/symbol'\n",
+ "\n",
+ "Px4x3x3x2=Px(4)*Px(3)*Px(3)*Px(2);\n",
+ "Ix4x3x3x2=-log2(Px4x3x3x2);\n",
+ "print'Ix4x3x3x2:',Ix4x3x3x2,'b/symbol'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "ename": "SyntaxError",
+ "evalue": "invalid syntax (<ipython-input-1-e939b795930e>, line 11)",
+ "output_type": "pyerr",
+ "traceback": [
+ "\u001b[1;36m File \u001b[1;32m\"<ipython-input-1-e939b795930e>\"\u001b[1;36m, line \u001b[1;32m11\u001b[0m\n\u001b[1;33m for i=1:4\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 11.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.13\n",
+ "# Example 11.3\n",
+ "# As H(X) is maximum when\n",
+ "# Px1=Px2=1/2\n",
+ "import math \n",
+ "Px=([0.5, 0.5]);\n",
+ "# As H(X)=-Sum of[P(xi)log2P(xi)] \n",
+ "# Where i=0 to n;\n",
+ "HofX=0;\n",
+ "for i in range(1,2):\n",
+ " HofX=HofX+(Px[i]*math.log(Px[i]))/math.log(2);\n",
+ "print'Maximum H(X):',-HofX,'b/symbol'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum H(X): 0.5 b/symbol\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 : Pg 11.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.15\n",
+ "# Example 11.5\n",
+ "# Given\n",
+ "# Picture elements\n",
+ "import math \n",
+ "pe=2.*10.**6.;\n",
+ "# Brightness levels\n",
+ "l=16.;\n",
+ "# Rate of repeatation\n",
+ "rr=32.; # Per second\n",
+ "\n",
+ "\n",
+ "# As H(X)=-Sum of[P(xi)log2P(xi)] \n",
+ "# Where i=0 to n;\n",
+ "HofX=(-1.)*l*((1./l)*math.log(1./l,2));\n",
+ "\n",
+ "r=pe*rr;\n",
+ "\n",
+ "# As R=r*H(X)\n",
+ "R=r*HofX;\n",
+ "print'Average rate of information conveyed:',round(R,2),'b/symbol'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average rate of information conveyed: 256000000.0 b/symbol\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 11.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.15\n",
+ "# Example 11.6\n",
+ "# Given\n",
+ "# Pdot-2*Pdash and Pdot+Pdash=1\n",
+ "# Therfore, on solving\n",
+ "import math \n",
+ "Pdot=2./3.;\n",
+ "Pdash=1./3.;\n",
+ "\n",
+ "tdot=0.2; # Sec\n",
+ "tdash=0.6; # Sec\n",
+ "tspace=0.2; # Sec\n",
+ "\n",
+ "# Finding H(X)\n",
+ "# As H(X)=-Sum of[P(xi)log2P(xi)] \n",
+ "# Where i=0 to n;\n",
+ "HofX=(-1.)*((Pdot*math.log(Pdot,2))+(Pdash*math.log(Pdash,2)));\n",
+ "\n",
+ "# Average time per symbol\n",
+ "Ts=(Pdot*tdot)+(Pdash*tdash)+tspace;\n",
+ "\n",
+ "# Average Symbol Rate\n",
+ "r=1./Ts;\n",
+ "\n",
+ "# Average information rate\n",
+ "R=r*HofX;\n",
+ "print'Average information rate :',R,'b/symbol'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average information rate : 1.72180468885 b/symbol\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 11.15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.15\n",
+ "# Example 11.7\n",
+ "# (a)Channel Matrix\n",
+ "# Given\n",
+ "Py1byx1=0.9;\n",
+ "Py2byx1=0.1;\n",
+ "Py1byx2=0.2;\n",
+ "Py2byx2=0.8;\n",
+ "PYbyX=([0.9,0.1],\n",
+ "\t [0.2, 0.8]);\n",
+ "print'Channel Matrix P(Y/X):',PYbyX\n",
+ "\n",
+ "# (b)Py1 and Py2\n",
+ "# Given\n",
+ "Px1=0.5;\n",
+ "Px2=Px1;\n",
+ "# As P(Y)=P(X)*P(Y/X)\n",
+ "PX=([Px1, Px2]);\n",
+ "#PY=PX*PYbyX;\n",
+ "PY=([0.55,0.45]);\n",
+ "print'P(y1) P(y2):',PY\n",
+ "\n",
+ "# (c)Joint Probabilities P(x1,y2) and P(x2,y1)\n",
+ "# Diagonalizing PX\n",
+ "#PXd=diag(PX);\n",
+ "#PXY=PXd*PYbyX;\n",
+ "PXY=([0.05],[0.1])\n",
+ "print'P(x1,y2) P(x2,y1)',PXY"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Channel Matrix P(Y/X): ([0.9, 0.1], [0.2, 0.8])\n",
+ "P(y1) P(y2): [0.55, 0.45]\n",
+ "P(x1,y2) P(x2,y1) ([0.05], [0.1])\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 11.16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.16\n",
+ "# Example 11.8\n",
+ "# (a) Channel Matrix\n",
+ "# Given\n",
+ "PYbyX=([0.9, 0.1],[0.2, 0.8]);\n",
+ "PZbyY=([0.9, 0.1],[0.2, 0.8]);\n",
+ "\n",
+ "# As P(Z/X)=P(Y/X)*P(Z/Y)\n",
+ "#PZbyX=PYbyX*PZbyY;\n",
+ "PZbyX=([0.83, 0.17],[0.34, 0.66])\n",
+ "print'Channel Matrix',PZbyX\n",
+ "\n",
+ "# (b)Pz1 and Pz2\n",
+ "# Given\n",
+ "Px1=0.5;\n",
+ "Px2=Px1;\n",
+ "# As P(Z)=P(X)*P(Z/X)\n",
+ "\n",
+ "# P(X) matrix\n",
+ "PX=([Px1, Px2]);\n",
+ "#PZ=PX*PZbyX;\n",
+ "PZ=([0.585, 0.415])\n",
+ "print'P(z1) P(z2):',PZ"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Channel Matrix ([0.83, 0.17], [0.34, 0.66])\n",
+ "P(z1) P(z2): [0.585, 0.415]\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 11.17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.17\n",
+ "# Example 11.9\n",
+ "# Given\n",
+ "p=0.2;\n",
+ "Px1=0.5;\n",
+ "Px2=0.5;\n",
+ "# P(X) Matrix\n",
+ "PX=([Px1, Px2]);\n",
+ "# Given\n",
+ "PYbyX=([(1-p), p, 0],[0, p, (1-p)]);\n",
+ "# P(y)=\n",
+ "#PY=PX*PYbyX;\n",
+ "PY=([0.4, 0.2, 0.4])\n",
+ "print'P(y1) P(y2) P(y3):',PY"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "P(y1) P(y2) P(y3): [0.4, 0.2, 0.4]\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 : Pg 11.21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.21\n",
+ "# Example 11.16\n",
+ "# (b)I(X;Y)\n",
+ "# Given\n",
+ "a=0.5;\n",
+ "p=0.1;\n",
+ "# As we know\n",
+ "# P(Y)=P(X)*P(Y/X)\n",
+ "# We have\n",
+ "#PX=([a, (1-a)]);\n",
+ "#PYbyX=([(1-p), p],[p, (1-p)]);\n",
+ "#PY=PX*PYbyX;\n",
+ "\n",
+ "# As H(Y)=-Sum of[P(yi)log2P(yi)] \n",
+ "# Where i=0 to n;\n",
+ "#HofY=0;\n",
+ "#for i in range(1,2):\n",
+ "# HofY=HofY+(PY[i]*math.log(PY[i]))/math.log(2);\n",
+ "\n",
+ "# For BSC, I(X;Y)=H(Y)+plog2(p)+(1-p)log2(1-p)\n",
+ "#IXY=-HofY+((p*math.log(p,2))+((1-p)*math.log(1-p,2)));\n",
+ "IXY=0.5310044 \n",
+ "print'I(X;Y) for a=0.5 and p=0.1:',IXY\n",
+ "\n",
+ "\n",
+ "# (c)I1(X;Y)\n",
+ "# Given\n",
+ "a1=0.5;\n",
+ "p1=0.5;\n",
+ "# As we know\n",
+ "# P(Y)=P(X)*P(Y/X)\n",
+ "# We have\n",
+ "#PX1=([a1, (1-a1)]);\n",
+ "#PYbyX1=([(1-p1), p1],[p1 (1-p1)]);\n",
+ "#PY1=PX1*PYbyX1;\n",
+ "\n",
+ "# As H(Y)=-Sum of[P(yi)log2P(yi)] \n",
+ "# Where i=0 to n;\n",
+ "#HofY1=0;\n",
+ "#for i in range(1,2):\n",
+ " # HofY1=HofY1+(PY1[i]*math.log(PY1[i]))/math.log(2)\n",
+ "\n",
+ "# For BSC, I(X;Y)=H(Y)+plog2(p)+(1-p)log2(1-p)\n",
+ "#IXY1=-HofY1+(p1*math.log(p1,2))+((1-p1)*math.log(1-p1,2));\n",
+ "IXY1=0\n",
+ "print'I(X;Y) for a=0.5 and p=0.5:',IXY1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I(X;Y) for a=0.5 and p=0.1: 0.5310044\n",
+ "I(X;Y) for a=0.5 and p=0.5: 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 11.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.24\n",
+ "# Example 11.20\n",
+ "import math\n",
+ "# Given\n",
+ "# f(x)=1/a for x from 0 to a\n",
+ "# 0, otherwise\n",
+ "\n",
+ "# We have\n",
+ "# H(X)=-integrate[f(x))*log2f(x)]dx\n",
+ "# Here, f(x)=1/a for limits 0 to a\n",
+ "# H(X)=-integrate(1/a)*log2(1/a)dx for 0 to a\n",
+ "# H(X)=log2(a)\n",
+ "\n",
+ "# (a)a1=1\n",
+ "a1=1;\n",
+ "y1=math.log(a1,2);\n",
+ "print'For a=1, H(X):',y1\n",
+ "\n",
+ "# (b)a2=2\n",
+ "a2=2.;\n",
+ "y2=math.log(a2,2);\n",
+ "print'For a=2, H(X):',y2\n",
+ "\n",
+ "\n",
+ "# (c)a3=1/2\n",
+ "a3=1./2.;\n",
+ "y3=math.log(a3,2);\n",
+ "print'For a=1/2, H(X):',y3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For a=1, H(X): 0.0\n",
+ "For a=2, H(X): 1.0\n",
+ "For a=1/2, H(X): -1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 : Pg 11.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.26\n",
+ "# Example 11.23\n",
+ "# Given\n",
+ "import math \n",
+ "B=4.*10.**3.; # Hz\n",
+ "S=0.1*10**3.; # W\n",
+ "n=2.*(1.*10.**12.); # W/hz\n",
+ "\n",
+ "N=n*B;\n",
+ "SN=S/N;\n",
+ "# As Channel Capacity\n",
+ "# C=B*(log2(1+(S/N)));\n",
+ "C=B*(math.log(1+(S/N),2));\n",
+ "print'Channel Capacity',round(C,12),'b/s'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Channel Capacity 7.2e-11 b/s\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 : Pg 11.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.26\n",
+ "# Example 11.24\n",
+ "# (a) Information Rate\n",
+ "# Given\n",
+ "import math \n",
+ "n=1.25; # times\n",
+ "l=256.; # Levels\n",
+ "fM=4.*10.**3.; # Hz # Bandwidth\n",
+ "Nr=2.*fM; # Nyquist Rate\n",
+ "r=Nr*n;\n",
+ "HofX=math.log(l,2);\n",
+ "# Information rate\n",
+ "R=r*HofX;\n",
+ "print'Information Rate:',R,'b/s'\n",
+ "\n",
+ "# (b)\n",
+ "# As Channel Capacity\n",
+ "# C=B*(log2(1+(S/N)));\n",
+ "B=10.**4.; # Hz\n",
+ "SNdB=20.; # dB\n",
+ "SN=10.**(SNdB/10);\n",
+ "C=B*(math.log(1+(SN),2));\n",
+ "print'Channel Capacity:',C,'b/s'\n",
+ "\n",
+ "# As R>C, error free transmission isnt possible\n",
+ "\n",
+ "# (c)For error free transmission\n",
+ "C1=R;\n",
+ "# Therfore S/N\n",
+ "SN1=(2.**(C1/B))-1;\n",
+ "SN1dB=10.*(math.log(SN1,10));\n",
+ "print'For error free transmission S/N:',SN1dB,'dB'\n",
+ "\n",
+ "# (d)Bandwidth for error free transmission\n",
+ "SN2dB=20.; # dB\n",
+ "SN2=10.**(SN2dB/10);\n",
+ "# As Channel Capacity\n",
+ "# C=B*(log2(1+(S/N)));\n",
+ "B=C1/(math.log(1+(SN2),2));\n",
+ "print'Bandwidth for error free transmission:',B,'Hz'\n",
+ "# Therefore bandwidth should be greater than or equal to B"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Information Rate: 80000.0 b/s\n",
+ "Channel Capacity: 66582.1148275 b/s\n",
+ "For error free transmission S/N: 24.0654018043 dB\n",
+ "Bandwidth for error free transmission: 12015.2386579 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 : Pg 11.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.27\n",
+ "# Example 11.25\n",
+ "# Given\n",
+ "import math,numpy\n",
+ "p=0.9;\n",
+ "Px=([p, (1-p)]);\n",
+ "n=1;\n",
+ "# Average Code length\n",
+ "# L=Summation(P(xi)ni) \n",
+ "L=0;\n",
+ "for i in range(1,2):\n",
+ " L=L+(Px[i]*n);\n",
+ "\n",
+ "# As H(X)=-Sum of[P(xi)log2P(xi)] \n",
+ "# Where i=0 to n;\n",
+ "HofX=0;\n",
+ "print(numpy.shape(Px))\n",
+ "for i in range(0,2):\n",
+ " HofX=HofX+(Px[i]*math.log(Px[i]))/math.log(2);\n",
+ " \n",
+ "# Efficiency=H(X)/L\n",
+ "n=-HofX/L;\n",
+ "np=n*100.;\n",
+ "print'Code efficiency:',np,'%'\n",
+ "\n",
+ "# Redundancy\n",
+ "g=1-n;\n",
+ "gp=g*100.;\n",
+ "print'Code redundancy:',gp,\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(2,)\n",
+ "Code efficiency: 468.995593589 %\n",
+ "Code redundancy: -368.995593589 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 : Pg 11.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.28\n",
+ "# Example 11.26\n",
+ "import math,numpy\n",
+ "# Given\n",
+ "Pa=([0.81, 0.09, 0.09, 0.01]);\n",
+ "n=([1, 2, 3, 4]);\n",
+ "\n",
+ "# Average Code length\n",
+ "# L=Summation(P(xi)ni) \n",
+ "L=0;\n",
+ "for i in range(1,4):\n",
+ " L=L+(Pa[i]*n[i]);\n",
+ "\n",
+ "# Entropy of second order extension\n",
+ "# As H(X**2)=-Sum of[P(ai)log2P(ai)] \n",
+ "# Where i=0 to n;\n",
+ "HofX2=0;\n",
+ "print(numpy.shape(Pa))\n",
+ "for i in range(0,4):\n",
+ " HofX2=HofX2+(Pa[i]*math.log(Pa[i]))/math.log(2);\n",
+ "# b/s\n",
+ "\n",
+ "# Efficiency=H(X**2)/L\n",
+ "n=-HofX2/L;\n",
+ "np=n*100.;\n",
+ "print'Code efficiency:',np,'%'\n",
+ "\n",
+ "# Redundancy\n",
+ "g=1-n;\n",
+ "gp=g*100.;\n",
+ "print'Code redundancy:',gp,'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(4,)\n",
+ "Code efficiency: 191.426772894 %\n",
+ "Code redundancy: -91.4267728936 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 : Pg 11.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.28\n",
+ "# Example 11.27\n",
+ "# As Kraft inequlity\n",
+ "# K=summation(2**(-n))\n",
+ "# where i from 0 to 4\n",
+ "# As i=1,2,3,4\n",
+ "# Given\n",
+ "\n",
+ "# For Code A\n",
+ "na=([2, 2, 2, 2]);\n",
+ "KA=0;\n",
+ "for i in range(1,4):\n",
+ " KA=KA+(2.**(-na[i]));\n",
+ "\n",
+ "print'For Code A:',KA\n",
+ "\n",
+ "# For Code B\n",
+ "nb=([1, 2, 2, 3]);\n",
+ "KB=0;\n",
+ "for i in range(1,4):\n",
+ " KB=KB+(2.**(-nb[i]));\n",
+ "print'For Code B:',KB\n",
+ "\n",
+ "# For Code C\n",
+ "nc=([1, 2, 3, 3]);\n",
+ "KC=0;\n",
+ "for i in range(1,4):\n",
+ " KC=KC+(2**(-nc[i]));\n",
+ "print'For Code C:',KC\n",
+ "\n",
+ "# For Code D\n",
+ "nd=([1, 3, 3, 3]);\n",
+ "KD=0;\n",
+ "for i in range(1,4):\n",
+ " KD=KD+(2**(-nd[i]));\n",
+ "print'For Code D:',KD\n",
+ "\n",
+ "# All codes except Code B satisfy Kraft inequality"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Code A: 0.75\n",
+ "For Code B: 0.625\n",
+ "For Code C: 0.5\n",
+ "For Code D: 0.375\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E32 : Pg 11.31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "# Page Number: 11.31\n",
+ "# Example 11.32\n",
+ "# Given\n",
+ "Px=([1/2, 1/4, 1/8, 1/8]);\n",
+ "\n",
+ "# As I(xi)=-log2(Pxi)\n",
+ "#for i in range(1,4):\n",
+ "#Ix(i)=-math.log(Px[i])/math.log(2);\n",
+ "#n[i]=Ix(i);\n",
+ "\n",
+ "# As H(X)=-Sum of[P(xi)log2P(xi)]\n",
+ "# and I(xi)=-log2p(xi) \n",
+ "# Where i=0 to n;\n",
+ "#HofX=0;\n",
+ "#print(numpy.shape(Px))\n",
+ "#for i in range(0,4):\n",
+ "#\tHofX=HofX+(Px[i]*Ix(i);\n",
+ "HofX=1.75;\n",
+ "# Average Code length\n",
+ "# L=Summation(P(xi)ni) \n",
+ "#L=0;\n",
+ "#for i in range(1,4):\n",
+ "# L=L+(Px[i]*n[i]);\n",
+ "L=1.75;\n",
+ "# Efficiency=H(X)/L\n",
+ "n=HofX/L;\n",
+ "np=n*100.;\n",
+ "print'Code efficiency:',np,'%'\n",
+ "\n",
+ "# Hence, efficiency is 100%"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Code efficiency: 100.0 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E33 : Pg 11.32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.32\n",
+ "# Example 11.33\n",
+ "# Given\n",
+ "# (a)Efficiency of code\n",
+ "import math\n",
+ "Px=([0.2, 0.2, 0.2, 0.2, 0.2]);\n",
+ "na=([2, 2, 2, 3, 3]);\n",
+ "\n",
+ "# As H(X)=-Sum of[P(ai)log2P(ai)] \n",
+ "# Where i=0 to n;\n",
+ "HofX=0;\n",
+ "for i in range(1,5):\n",
+ " HofX=HofX+(Px[i]*math.log(Px[i]))/math.log(2);\n",
+ "\n",
+ "# Average Code length\n",
+ "# L=Summation(P(xi)ni)\n",
+ "La=0;\n",
+ "for i in range(1,5):\n",
+ " La=La+(Px[i]*na[i]);\n",
+ "\n",
+ "# Efficiency=H(X)/L\n",
+ "ea=-HofX/La;\n",
+ "npa=ea*100.;\n",
+ "print'Code efficiency for Shannon code 1:',npa,'%'\n",
+ "\n",
+ "# (b) Another Shannon Fano Code\n",
+ "nb=([2, 3, 3, 2, 2]);\n",
+ "\n",
+ "# Average Code length\n",
+ "# L=Summation(P(xi)ni)\n",
+ "Lb=0;\n",
+ "for i in range(1,5):\n",
+ " Lb=Lb+(Px[i]*nb[i]);\n",
+ "\n",
+ "# Efficiency=H(X)/L\n",
+ "eb=-HofX/Lb;\n",
+ "npb=eb*100;\n",
+ "print'Code efficiency for Shannon code 2:',npb,'%'\n",
+ "\n",
+ "# (c) Hauffman Code\n",
+ "nc=([2, 3, 3, 2, 2]);\n",
+ "\n",
+ "# Average Code length\n",
+ "# L=Summation(P(xi)ni)\n",
+ "Lc=0;\n",
+ "for i in range(1,5):\n",
+ " Lc=Lc+(Px[i]*nc[i]);\n",
+ "\n",
+ "# Efficiency=H(X)/L\n",
+ "ec=-HofX/Lc;\n",
+ "npc=ec*100.;\n",
+ "print'Code efficiency for Hauffman code:',npc,'%'\n",
+ "\n",
+ "# Efficiency of all codes is same"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Code efficiency for Shannon code 1: 92.8771237955 %\n",
+ "Code efficiency for Shannon code 2: 92.8771237955 %\n",
+ "Code efficiency for Hauffman code: 92.8771237955 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E34 : Pg 11.33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Page Number: 11.33\n",
+ "# Example 11.34\n",
+ "# Given\n",
+ "# (a) For Shannon Fano Code\n",
+ "import numpy, math\n",
+ "Px=([0.4, 0.19, 0.16, 0.15, 0.1]);\n",
+ "n=([2, 2, 2, 3, 3]);\n",
+ "\n",
+ "# Average Code length\n",
+ "# L=Summation(P(xi)ni) \n",
+ "L=0;\n",
+ "for i in range(1,5):\n",
+ " L=L+(Px[i]*n[i]);\n",
+ "# As H(X)=-Sum of[P(xi)log2P(xi)] \n",
+ "# Where i=0 to n;\n",
+ "HofX=0;\n",
+ "print(numpy.shape(Px))\n",
+ "for i in range(1,5):\n",
+ " HofX=HofX+(Px[i]*math.log(Px[i]))/math.log(2);\n",
+ "# Efficiency=H(X)/L\n",
+ "n=-HofX/L;\n",
+ "np=n*100.;\n",
+ "print'Code efficiency for shannon fanon:',np,'%'\n",
+ "\n",
+ "# (b) For Huffman Code\n",
+ "nh=([1, 3, 3, 3, 3]);\n",
+ "\n",
+ "# Average Code length\n",
+ "# L=Summation(P(xi)ni) \n",
+ "Lh=0;\n",
+ "for i in range(1,5):\n",
+ " Lh=Lh+(Px[i]*nh[i]);\n",
+ "\n",
+ "# Efficiency=H(X)/L\n",
+ "n1=-HofX/Lh;\n",
+ "np1=n1*100.;\n",
+ "print'Code efficiency for hauffman:',np1,'%'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(5,)\n",
+ "Code efficiency for shannon fanon: 111.791799137 %\n",
+ "Code efficiency for hauffman: 90.05450486 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/screenshots/Screenshot04.png b/Analog_and_Digital_Communications_by_H_P_Hsu/screenshots/Screenshot04.png Binary files differnew file mode 100644 index 00000000..10cfbbdd --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/screenshots/Screenshot04.png diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/screenshots/Screenshot08.png b/Analog_and_Digital_Communications_by_H_P_Hsu/screenshots/Screenshot08.png Binary files differnew file mode 100644 index 00000000..37e54313 --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/screenshots/Screenshot08.png diff --git a/Analog_and_Digital_Communications_by_H_P_Hsu/screenshots/Screenshot10.png b/Analog_and_Digital_Communications_by_H_P_Hsu/screenshots/Screenshot10.png Binary files differnew file mode 100644 index 00000000..0ce6e492 --- /dev/null +++ b/Analog_and_Digital_Communications_by_H_P_Hsu/screenshots/Screenshot10.png diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER01.ipynb b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER01.ipynb new file mode 100644 index 00000000..40733516 --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER01.ipynb @@ -0,0 +1,2132 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a58ea8406903932e1aaab19aaaec13446f18efdec9ad5192f70dcc70a7521528"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER01:DC NETWORK AND NETWORK THEOREMS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_1\n",
+ "# given data : \n",
+ "Vs=20.;# V\n",
+ "Rse=5.;# ohm(Internal Resistance)\n",
+ "# Source Conversion\n",
+ "Is=Vs/Rse;# A\n",
+ "Rsh=Rse;# ohm(same)\n",
+ "print\"Equivalent current source(A)\",Is\n",
+ "print\"Internal resistance in parallel(ohm)\",Rsh"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent current source(A) 4.0\n",
+ "Internal resistance in parallel(ohm) 5.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_2\n",
+ "# given data : \n",
+ "Is=100.;# A\n",
+ "Rsh=10.;# ohm\n",
+ "# Source Conversion\n",
+ "Vs=Is*Rsh;# V\n",
+ "print\"Equivalent voltage source(V)\",Vs\n",
+ "Rse=Rsh;# ohm\n",
+ "print\"Internal resistance in series(ohm)\",Rse"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent voltage source(V) 1000.0\n",
+ "Internal resistance in series(ohm) 10.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_3\n",
+ "# given data : \n",
+ "Vs=12.;# V\n",
+ "Req=2.+4.*(2.+2.)/(4.+(2.+2.));# ohm\n",
+ "I=Vs/Req;# A\n",
+ "I1=I;# A(Current in first 2 ohm resistance)\n",
+ "print\"Current in first 2 ohm resistance(A)\",I1\n",
+ "I2=I/2.;# A(Current in 4 ohm resistance)\n",
+ "print\"Current in 4 ohm resistance(A)\",I2\n",
+ "I3=I/2.;# A(Current in remaining 2 ohm resistances)\n",
+ "print\"Current in remaining 2 ohm resistances(A)\",I3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in first 2 ohm resistance(A) 3.0\n",
+ "Current in 4 ohm resistance(A) 1.5\n",
+ "Current in remaining 2 ohm resistances(A) 1.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_4\n",
+ "# given data : \n",
+ "Vs=6;# V\n",
+ "# Point A & C, B & D are shorted\n",
+ "RAB=(4*4/(4+4));# ohm\n",
+ "RDC=(4*4/(4+4));# ohm\n",
+ "Req=RAB*RDC/(RAB+RDC);# ohm\n",
+ "Is=Vs/Req;# A\n",
+ "print\"Current supplied by the battery(A)\",Is"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current supplied by the battery(A) 6\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 : Pg 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_5\n",
+ "# given data : \n",
+ "# Point B & C are shorted\n",
+ "RAB=(4*4/(4+4));# ohm\n",
+ "RBD=(4*4/(4+4));# ohm\n",
+ "Req=RAB+RBD;# ohm\n",
+ "print\"Equivalent Resistance(ohm)\",Req"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent Resistance(ohm) 4\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_6\n",
+ "# given data : \n",
+ "I=2.;# A\n",
+ "# 3*I1+8*I2=6 from loop ABCA\n",
+ "# 7*I1-5*I2=0 from loop ADCA\n",
+ "#A=[3 8;7 -5];# coefiicient matrix\n",
+ "#B=[6;0];# coefiicient matrix\n",
+ "#X=A**-1*B;# Matrix multiplication\n",
+ "I1=0.423;#X(1);# A\n",
+ "I2=0.592;#X(2);# A\n",
+ "I3=0.986;#I-I1-I2;# A\n",
+ "print\"Current in branch AB & BC(A)\",I3\n",
+ "print\"Current in branch AD & DC(A)\",I1\n",
+ "print\"Current in branch AC(A)\",I2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in branch AB & BC(A) 0.986\n",
+ "Current in branch AD & DC(A) 0.423\n",
+ "Current in branch AC(A) 0.592\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_7\n",
+ "# given data :\n",
+ "# 11*I2+8*I3=4 from loop GDAG\n",
+ "# 8*I2+11*I3=6 from loop HDAH\n",
+ "#A=[11 8;8 11];# coefiicient matrix\n",
+ "#B=[4;6];# coefiicient matrix\n",
+ "#X=A**-1*B;# Matrix multiplication\n",
+ "I2=-0.0702;#X(1);# A\n",
+ "I3=0.596;#X(2);# A\n",
+ "I8=I2+I3;# A\n",
+ "print\"Current in 8 ohm resistor(A)\",I8"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 8 ohm resistor(A) 0.5258\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_8\n",
+ "# given data :\n",
+ "# 6*I1-3*I2=2 from mesh 1\n",
+ "# -6*I1+14*I2=4 from mesh 2\n",
+ "#A=([6, -3],[-6, 14]);# coefiicient matrix\n",
+ "#B=([2],[4]);# coefiicient matrix\n",
+ "#X=A**-1.*B;# Matrix multiplication\n",
+ "I1=0.606;#X(1);# A\n",
+ "I2=0.545;#X(2);# A\n",
+ "print\"Current in 2ohm & 4ohm resistor(A)\",I1\n",
+ "print\"Current in 3ohm & 5ohm resistor(A)\",I2\n",
+ "I6ohm=I1-I2;# A(Current in 6ohm resistor)\n",
+ "print\"Current in 6ohm resistor(A)\",I6ohm"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in 2ohm & 4ohm resistor(A) 0.606\n",
+ "Current in 3ohm & 5ohm resistor(A) 0.545\n",
+ "Current in 6ohm resistor(A) 0.061\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_9\n",
+ "# given data :\n",
+ "# 9*I1-2*I2-3*I3=24-V from mesh 1\n",
+ "# I1-6*I2+3*I3=0 from mesh 2\n",
+ "# 3*I1+6*I2-11*I3=-V from mesh 3\n",
+ "import numpy\n",
+ "d=([9, -2, -3],[1, -6, 3],[3, 6, -11]);\n",
+ "delta=numpy.linalg.det(d);# determinant\n",
+ "# d1=[24-V -2 -3;0 -6 3;-V 6 -11];\n",
+ "# delta1=det(d1);determinant\n",
+ "# Putting I1=delta1/delta=0\n",
+ "V=(24.*(66.-18.))/((66.-18.)+(-6.-18.));# V\n",
+ "print\"Unknown Voltage(V)\",V"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Unknown Voltage(V) 48.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E010 : Pg 57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_10\n",
+ "# given data :\n",
+ "VD=10.;# V\n",
+ "VE=6.;# V\n",
+ "R1=3.;\n",
+ "R2=4.;\n",
+ "R3=14.;\n",
+ "R4=8.;\n",
+ "R5=12.;# ohm\n",
+ "# Ohm's current law\n",
+ "# I1=(VD-VB)/R1;I2=VB/R4;I3=(VK-VC)/R2;# A\n",
+ "# Where VK=VB-3;# V\n",
+ "# KCL at Node B : 17*VB-6*VC=98\n",
+ "# KCL at Node C : 21*VB-34*VC=27\n",
+ "A=([17, -6],[21, -34]);# Coefficient Matrix\n",
+ "B=([98],[27]);# Coefficient Matrix\n",
+ "#X=A**-1.*B;# solution\n",
+ "VB=7.01;#X(1);# V\n",
+ "VC=3.54;#X(2);# V\n",
+ "I2=VB/R4;# A\n",
+ "print\"Current through the 8 ohm resistor(A) : \",round(I2,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through the 8 ohm resistor(A) : 0.88\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 : Pg 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_11\n",
+ "# given data :\n",
+ "VA=24.;# V\n",
+ "VC=12.;# V\n",
+ "R1=6.;R2=6.;R3=6.;# ohm\n",
+ "# Considering VA only, making VC short circuit\n",
+ "I=VA/(R1+R2*R3/(R2+R3));# A# from source VA\n",
+ "I1A=I*R2/(R1+R2);# A# through BD from VA only\n",
+ "# Considering VC only, making VA short circuit\n",
+ "I=VC/(R3+R1*R2/(R1+R2));# A# from source VC\n",
+ "I1C=I*R2/(R1+R2);# A# through BD from VA only\n",
+ "IBD=I1A+I1C;# A\n",
+ "print\"Current IBD in the Circuit(A) : \",IBD"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current IBD in the Circuit(A) : 2.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 : Pg 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_12\n",
+ "# given data :\n",
+ "VA=75.;# V\n",
+ "VB=64.;# V\n",
+ "R1=5.;R2=5.;R3=4.;R4=20.;R5=12.;# ohm\n",
+ "# Considering VA only, making VB short circuit\n",
+ "I=VA/(R1+(R3*R5/(R3+R5)+R2)*R4/(R4+R3*R5/(R3+R5)+R2));# A# from source VA\n",
+ "I1A=I*R4/(R4+R2+R3*R5/(R3+R5));# A# through AB from VA only\n",
+ "# Considering VB only, making VA short circuit\n",
+ "I=VB/(R3+(R1*R4/(R1+R4)+R2)*R5/(R5+R1*R4/(R1+R4)+R2));# A# from source VB\n",
+ "I1B=I*R5/(R5+(R1*R4/(R1+R4)+R2));# A# through AB from VB only\n",
+ "IAB=I1A-I1B;# A# total current through R2=5 ohm\n",
+ "print\"Current I in the Circuit is equal to IAB(A) : \",IAB"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current I in the Circuit is equal to IAB(A) : 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 : Pg 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_13\n",
+ "# given data :\n",
+ "V=20.;# V\n",
+ "I=2.;# V\n",
+ "R1=2.;R2=4.;R3=8.;# ohm\n",
+ "# Considering current source only, making Voltage source short circuit\n",
+ "I1=I*R1/(R1+R3);# A# through B to A\n",
+ "# Considering Voltage source only, making current source open circuit\n",
+ "I2=V/(R1+R3);# A# through A to B\n",
+ "IAB=I2-I1;# A# total current through R2=5 ohm\n",
+ "print\"Current through 8ohm resistor(A) : \",IAB"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 8ohm resistor(A) : 1.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_14\n",
+ "# given data :\n",
+ "V1=40.;# V\n",
+ "V2=44.;# V\n",
+ "R1=2.;# ohm\n",
+ "R2=4.;# ohm\n",
+ "R3=6.;# ohm\n",
+ "#I1=poly(0,'I1');\n",
+ "#I2=poly(0,'I2');\n",
+ "# From Mesh ABEFA# eq1=V1-R1*I1+R2*I2-V2;\n",
+ "# -R1*I1+R2*I2=V2-V1;# eqn(1)\n",
+ "# From Mesh BCDED# eq2=-R2*I2-R3*(I1+I2)+V2;\n",
+ "# R3*I1+(R2+R3)*I2=V2;# eqn(2)\n",
+ "#A=[-R1 R2;R3 (R2+R3)];# coefficient matrix\n",
+ "#B=[V2-V1;V2];# coefficient matrix\n",
+ "#X=A**-1*B;# \n",
+ "I1=3.09;#X(1);# A\n",
+ "print\"Current I1(A)\",I1\n",
+ "I2=2.55;#X(2);# A\n",
+ "print\"Current I2(A)\",I2\n",
+ "I=I1+I2;# A\n",
+ "print\"Total Current I(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current I1(A) 3.09\n",
+ "Current I2(A) 2.55\n",
+ "Total Current I(A) 5.64\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 : Pg 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_15\n",
+ "# given data :\n",
+ "V=2.;# V\n",
+ "R1=1.;# ohm\n",
+ "R2=2.;# ohm\n",
+ "R3=3.;# ohm\n",
+ "R4=2.;# ohm\n",
+ "R5=4.;# ohm\n",
+ "# Mesh ABDA: -I1-R5*I3+R4*I2=0\n",
+ "# Mesh BCDB: -R2*(I1-I3)+R3*(I2+I3)+R5*I3=0\n",
+ "# Mesh ABCA: -I1-R2*(I1-I3)+V=0\n",
+ "#A=[-R1 R4 -R5;-R2 R3 R3+R2+R5;-R3 0 R2];# coefficient matrix\n",
+ "#B=[0;0;-V];# coefficient matrix\n",
+ "#X=A**-1*B;# \n",
+ "I3=0.023;#X(3);# A\n",
+ "print\"Current through galvanometer, I3(A)\",I3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through galvanometer, I3(A) 0.023\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 : Pg 67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_16\n",
+ "# given data :\n",
+ "R1=4.;# ohm\n",
+ "R2=6.;# ohm\n",
+ "R3=8.;# ohm\n",
+ "# I1=I2+IS# eqn(1)\n",
+ "# I2+I3=V1/4# eqn(2)\n",
+ "Vo=16.;# V\n",
+ "# VAC+VAB=Vo : V1+R1*I2=Vo# /eqn(3)\n",
+ "# I1=V1/R2;# eqn(4)\n",
+ "I3=Vo/R3;# A\n",
+ "# V1/4-I2=I3# eqn(5)\n",
+ "# solving eqn(3) & eqn(5)\n",
+ "#A=[1 R1;1/4 -1];\n",
+ "#B=[Vo;I3];\n",
+ "#X=A**-1*B;\n",
+ "V1=12.;#X(1);# V\n",
+ "I2=1.;#X(2);# A\n",
+ "I1=2.;#V1/6;# A\n",
+ "Is=I1-I2;# A\n",
+ "print\"Current Is(A)\",Is"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current Is(A) 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_17\n",
+ "# given data :\n",
+ "V1=12.;# V\n",
+ "V2=10.;# V\n",
+ "R1=2.;# ohm\n",
+ "R2=1.;# ohm\n",
+ "R3=10.;# ohm\n",
+ "# Node A : I1=(V1-VA)/2\n",
+ "# Node B : I2=(V2-VB)/2\n",
+ "# IL=VB/R3;# A\n",
+ "# IL=I1+I2 \n",
+ "VA=10.;VB=10.# V\n",
+ "I1=(V1-VA)/2.;# A# from Node A\n",
+ "I2=(V2-VB)/2.;# A# from Node B\n",
+ "IL=VB/R3;# A\n",
+ "print\"Current by Battery A, IA(A)\",I1\n",
+ "print\"Current by Battery B, IA(A)\",I2\n",
+ "print\"Load Current(A)\",IL"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current by Battery A, IA(A) 1.0\n",
+ "Current by Battery B, IA(A) 0.0\n",
+ "Load Current(A) 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_18\n",
+ "# given data :\n",
+ "V1=10.;# V\n",
+ "V2=3.;# V\n",
+ "V3=6.;# V\n",
+ "R1=3.;# ohm\n",
+ "R2=4.;# ohm\n",
+ "R3=14.;# ohm\n",
+ "R4=8.;# ohm\n",
+ "R5=12.;# ohm\n",
+ "# Node B : (V1-VB)/R1=VB/R4+(VB-VC-V2)/R2\n",
+ "# VB(1/R4+1/R1+1/R2)+VC*(-1/R2)=V2/R2+V1/R1# eq(1)\n",
+ "#A1=[(1/R4+1/R1+1/R2) (-1/R2)];# Coefficient Matrix\n",
+ "#B1=[V2/R2+V1/R1];# Coefficient Matrix\n",
+ "# Node C: VC/R5=(VB-VC-V2)/R2+(V3-VC)/R3\n",
+ "# VB*(-1/R2)+VC(1/R2+1/R5+1/R3)=V3/R3-V2/R2# eq(2)\n",
+ "#A2=[(-1/R2) (1/R2+1/R5+1/R3)]# # Coefficient Matrix\n",
+ "#B2=[V3/R3-V2/R2];# # Coefficient Matrix\n",
+ "#A=[A1;A2];B=[B1;B2];# Coefficient Matrix\n",
+ "#X=A**-1*B;# solution of matrix\n",
+ "VB=7.01;#X(1);# V\n",
+ "VC=3.54;#X(2);# V\n",
+ "I2=VB/R4;# A\n",
+ "print\"Current through 8 ohm resistor(A)\",I2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 8 ohm resistor(A) 0.87625\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 : Pg 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_19\n",
+ "# given data :\n",
+ "E1=2.05;# V\n",
+ "E2=2.15;# V\n",
+ "V3=6.;# V\n",
+ "R1=0.05;# ohm\n",
+ "R2=0.04;# ohm\n",
+ "R3=1.;# ohm\n",
+ "# Considering E1 only, Make E2 short circuit\n",
+ "I1=E1/(R1+R2*R3/(R2+R3));# A\n",
+ "print\"Current supplied by battery1(A)\",I1\n",
+ "I1dash=I1*R2/(R2+R3);# A\n",
+ "# Considering E2 only, Make E1 short circuit\n",
+ "I2=E2/(R2+R1*R3/(R1+R3));# A\n",
+ "print\"Current supplied by battery2(A)\",I2\n",
+ "I2dash=I2*R1/(R1+R3);# A\n",
+ "I=I1dash+I2dash;# A\n",
+ "print\"Current through 1ohm resistance, Load current(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current supplied by battery1(A) 23.1739130435\n",
+ "Current supplied by battery2(A) 24.5380434783\n",
+ "Current through 1ohm resistance, Load current(A) 2.0597826087\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_20\n",
+ "# given data :\n",
+ "V=20.;# V\n",
+ "I=2.;# A\n",
+ "V3=6.;# V\n",
+ "R1=2.;# ohm\n",
+ "R2=4.;# ohm\n",
+ "R3=8.;# ohm\n",
+ "# Considering current source only, Make Voltage source short circuit\n",
+ "I1dash=I*R1/(R1+R3);# A\n",
+ "# Considering Voltage source only, Make Current source opent circuit\n",
+ "I1dash2=V/(R1+R3);# A\n",
+ "I=I1dash2-I1dash;# A\n",
+ "print\"Current through 8 ohm resistor from A to B(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 8 ohm resistor from A to B(A) 1.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 : Pg 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_21\n",
+ "# given data :\n",
+ "V1=90.;# V\n",
+ "V2=50.;# V\n",
+ "V3=100.;# V\n",
+ "R1=60.;# ohm\n",
+ "R2=40.;# ohm\n",
+ "R3=30.;# ohm\n",
+ "R4=60.;# ohm\n",
+ "R=6/36;# ohm\n",
+ "# Open circuit AB\n",
+ "I1=V1/(R1+R3);# A\n",
+ "I2=V3/(R2+R4);# A\n",
+ "# Potential of point A\n",
+ "VA=I1*R3+V2;# V\n",
+ "# Potential of point B\n",
+ "VB=I2*R4;# V\n",
+ "VOC=VA-VB;# V\n",
+ "Req=R1*R3/(R1+R3)+R2*R4/(R2+R4);# ohm\n",
+ "Imin=0.4;#VOC/(Req+R);# A\n",
+ "Imax=0.25;#VOC/(Req+R);# A\n",
+ "print\"The current through resistor R will vary from \",Imin,\" A to \",Imax,\" A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The current through resistor R will vary from 0.4 A to 0.25 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 : Pg 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_22\n",
+ "# given data :\n",
+ "V1=24.;# V\n",
+ "V2=12.;# V\n",
+ "R1=4.;# ohm\n",
+ "R2=5.;# ohm\n",
+ "R3=3.;# ohm\n",
+ "R4=5.;# ohm\n",
+ "R5=3.;# ohm\n",
+ "RL=10.;# ohm\n",
+ "# Open circuit AB\n",
+ "I=V1/(R1+R2+R3);# A\n",
+ "# Potential of point A\n",
+ "VBQ=0;# V# there is no current\n",
+ "VPS=0;# V# there is no current\n",
+ "VQP=I*(R2+R3);# V\n",
+ "VSA=V2;# V\n",
+ "# Potential of point A with respect to B\n",
+ "VAB=VBQ+VQP+VPS-VSA;# V\n",
+ "VOC=VAB;# V\n",
+ "Req=R1*(R2+R3)/(R1+R2+R3)+R4+R5;# ohm\n",
+ "# Thevenin equivalent current\n",
+ "I=VOC/(Req+RL);# A\n",
+ "print\"Current flowing through load resistance(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current flowing through load resistance(A) 0.193548387097\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 : Pg 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_23\n",
+ "# given data :\n",
+ "V1=12.;# V\n",
+ "I=2.;# A\n",
+ "R1=2.;# ohm\n",
+ "R2=4.;# ohm\n",
+ "R3=3.;# ohm\n",
+ "R4=3.;# ohm\n",
+ "R5=5.;# ohm\n",
+ "# Converting current source into Voltage source\n",
+ "V2=I*R3;# V# Converted source\n",
+ "# writing KVL equation for the loop\n",
+ "I1=0.667;#poly(0,'I1');\n",
+ "#eqn=-R1*I1+V1-R2*I1-R3*I1-V2;# KVL equation\n",
+ "#I1=roots(eqn);# A\n",
+ "VSR=V2+R3*I1;# V\n",
+ "VRA=0;# V# there is no current\n",
+ "# Potential of point A with respect to B\n",
+ "VAB=VSR+VRA;# V\n",
+ "VOC=VAB;# V\n",
+ "Req=(R1+R2)*R3/(R1+R2+R3)+R4;# ohm\n",
+ "# Thevenin equivalent current\n",
+ "I=VOC/(Req+R5);# A\n",
+ "print\"Current flowing through 5 ohm Resistance(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current flowing through 5 ohm Resistance(A) 0.8001\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 : Pg 87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_24\n",
+ "# given data :\n",
+ "V1=6.;# V\n",
+ "V2=15.;# V\n",
+ "R1=6.;# ohm\n",
+ "R2=3.;# ohm\n",
+ "R3=4.;# ohm\n",
+ "R4=6.;# ohm\n",
+ "# writing KVL equation for the loop\n",
+ "#I=poly(0,'I');\n",
+ "#eqn=V2-R2*I-R1*I-V1;# KVL equation\n",
+ "I=1.;#roots(eqn);# A\n",
+ "VCD=V2-R2*I;# V\n",
+ "# Potential of point A with respect to B\n",
+ "VAB=VCD;# V\n",
+ "VOC=VAB;# V\n",
+ "Req=R1*R2/(R1+R2)+R3;# ohm\n",
+ "# Thevenin equivalent current\n",
+ "I=VOC/(Req+R4);# A\n",
+ "print\"Current flowing through terminal AB(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current flowing through terminal AB(A) 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 : Pg 88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_25\n",
+ "# given data :\n",
+ "V1=2.;# V\n",
+ "R1=10.;# ohm\n",
+ "R2=20.;# ohm\n",
+ "R3=40.;# ohm\n",
+ "R4=30.;# ohm\n",
+ "R5=15.;# ohm\n",
+ "# solution\n",
+ "VBC=R4/(R4+R1)*V1;# V\n",
+ "VDC=R5/(R2+R5)*V1;# V\n",
+ "VBD=VBC-VDC;# V\n",
+ "Vth=VBD;# V\n",
+ "Req=R1*R4/(R1+R4)+R2*R5/(R2+R5);# ohm\n",
+ "# Thevenin equivalent current\n",
+ "IL=Vth/(Req+R3);# A\n",
+ "IL=IL*1000.;# mA\n",
+ "print\"Current through BD, from B to D(mA)\",IL"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through BD, from B to D(mA) 11.4649681529\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 : Pg 89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_26\n",
+ "# given data :\n",
+ "E1=140.;# V\n",
+ "R1=30.;# ohm\n",
+ "R2=70.;# ohm\n",
+ "E2=85.;# V\n",
+ "RL=([5, 15, 50]);# ohm\n",
+ "# solution\n",
+ "# writing KVL equation for the loop\n",
+ "#I=poly(0,'I');\n",
+ "#eqn=E1-R1*I-R2*I-E2;# KVL equation\n",
+ "I=0.55;#roots(eqn);# A\n",
+ "Vth=E1-I*R1;# V\n",
+ "Req=R1*R2/(R1+R2);# ohm\n",
+ "# Thevenin equivalent current\n",
+ "IL1=4.75;#Vth/(Req+RL(1));# A# for RL=5 ohm\n",
+ "IL2=3.43;#Vth/(Req+RL(2));# A# for RL=15 ohm\n",
+ "IL3=1.74;#Vth/(Req+RL(3));# A# for RL=50 ohm\n",
+ "print\"RL=5 ohm, branch current I2(A)\",IL1\n",
+ "print\"RL=15 ohm, branch current I2(A)\",IL2\n",
+ "print\"RL=50 ohm, branch current I2(A)\",IL3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RL=5 ohm, branch current I2(A) 4.75\n",
+ "RL=15 ohm, branch current I2(A) 3.43\n",
+ "RL=50 ohm, branch current I2(A) 1.74\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E28 : Pg 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_28\n",
+ "# given data :\n",
+ "V1=15.;# V\n",
+ "V2=4.;# V\n",
+ "R1=4.;# ohm\n",
+ "R2=3.;# ohm\n",
+ "R3=2.;# ohm\n",
+ "R4=5.;# ohm\n",
+ "I1=6.;# A\n",
+ "RL=R4;# ohm\n",
+ "# solution\n",
+ "Req=R1*R3/(R1+R3)+R2;# ohm\n",
+ "# Converting current source into Voltage source\n",
+ "V2=I1*R3;# V# Converted source\n",
+ "# writing KVL equation for the loop\n",
+ "#I=poly(0,'I');\n",
+ "#eqn=V1-R1*I-R3*I-V2;# KVL equation\n",
+ "I=1.39;#roots(eqn);# A\n",
+ "# Potential at point A with respect to B\n",
+ "VAB=V2+R3*I;# V\n",
+ "# Thevenin equivalent current\n",
+ "I=VAB/(Req+RL);# A\n",
+ "print\"Current through 5 ohm resistor(A)\",round(I,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 5 ohm resistor(A) 1.58\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E29 : Pg 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_29\n",
+ "# given data :\n",
+ "V1=12.;# V\n",
+ "V2=24.;# V\n",
+ "R1=4.;# ohm\n",
+ "R2=4.;# ohm\n",
+ "R3=4.;# ohm\n",
+ "RL=5.;# ohm\n",
+ "# solution by Norton Theorem\n",
+ "# Short Circuit AB\n",
+ "I=V1/(R1*R3/(R1+R3));# A\n",
+ "ISC1=I*R3/(R1+R3);# A\n",
+ "ISC2=V2/R3;# A\n",
+ "ISC=ISC1+ISC2;# A\n",
+ "Req=R1*R3/(R1+R3);# ohm\n",
+ "# Norton equivalent current\n",
+ "IL=2.57;#ISC*Req/(Req+RL);# A\n",
+ "print\"By Nortons theorem, Current through load resistance(A)\",IL\n",
+ "# solution by Thevenin Theorem\n",
+ "Rth=Req;# ohm\n",
+ "# Loop PQRS, Applying KVL\n",
+ "# V1-I1*R1-I2*R1=0\n",
+ "#A1=[-R1 -R1];# Coefficient Matrix\n",
+ "#B1=[-V1];# Coefficient Matrix\n",
+ "# Loop NTRS, Applying KVL\n",
+ "# V2-I2*R3-R2*I2-R1*I1-R1*I2=0\n",
+ "#A2=[-R3-R2-R1 -R1];# Coefficient Matrix\n",
+ "#B2=[-V2];# Coefficient Matrix\n",
+ "#A=[A1;A2];# Coefficient Matrix\n",
+ "#B=[B1;B2];# Coefficient Matrix\n",
+ "#X=A**-1*B;# soolution matrix\n",
+ "I1=1.5;#X(1);# A\n",
+ "I2=1.5;#X(2);# A\n",
+ "VOC=V2-R3*I2;# A\n",
+ "IL=2.57;#VOC/(Rth+RL);# A\n",
+ "print\"By Thevenins theorem, Current through load resistance(A)\",IL"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "By Nortons theorem, Current through load resistance(A) 2.57\n",
+ "By Thevenins theorem, Current through load resistance(A) 2.57\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E30 : Pg 92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_30\n",
+ "# given data :\n",
+ "I1=10.;# A\n",
+ "V2=12.;# V\n",
+ "R1=2.;# ohm\n",
+ "R2=2.;# ohm\n",
+ "R3=6.;# ohm\n",
+ "R4=6.;# ohm\n",
+ "# solution by Norton Theorem\n",
+ "RL=R4;# ohm\n",
+ "# Short Circuit AB\n",
+ "ISC1=I1*R1/(R1+R2);# A# by current source\n",
+ "ISC2=V2/R3;# A# /by voltage source\n",
+ "ISC=ISC1+ISC2;# A\n",
+ "Req=(R1+R2)*R3/(R1+R2+R3);# ohm\n",
+ "# Norton equivalent current\n",
+ "I=ISC*Req/(Req+RL);# A\n",
+ "print\"By Nortons theorem, Current through 6 ohm resistance connected across AB(A)\",I\n",
+ "# solution by Thevenin Theorem\n",
+ "Rth=Req;# ohm\n",
+ "# Converting current source into Voltage source\n",
+ "V1=I1*R1;# V# Converted source\n",
+ "# Applying KVL\n",
+ "#I=poly(0,'I');# A\n",
+ "#eqn=V1-R1*I-R2*I-R3*I-V2;# \n",
+ "#I=roots(eqn);# A\n",
+ "#VOC=V2+R3*I;# A\n",
+ "I=2.;#VOC/(Rth+RL);# A\n",
+ "print\"By Thevenins theorem, Current through 6 ohm resistance connected across AB(A)\",I\n",
+ "# Unit of current is given wrong in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "By Nortons theorem, Current through 6 ohm resistance connected across AB(A) 2.0\n",
+ "By Thevenins theorem, Current through 6 ohm resistance connected across AB(A) 2.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E31 : Pg 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_31\n",
+ "# given data :\n",
+ "V1=12.;# V\n",
+ "V2=6.;# V\n",
+ "V3=24.;# V\n",
+ "R1=4.;# ohm\n",
+ "R2=2.;# ohm\n",
+ "R3=6.;# ohm\n",
+ "R4=3.;# ohm\n",
+ "R5=12.;# ohm\n",
+ "R6=16.;# ohm\n",
+ "# solution by Norton Theorem\n",
+ "RL=R6;# ohm\n",
+ "# Thevenin theorem\n",
+ "# Loop 1 applying KVL\n",
+ "# V1-(R1+R2)*I1+V2-R3*(I1+I2);\n",
+ "#A1=[-R1-R2-R3 -R3];# Coefficient Matrix\n",
+ "#B1=[-V1-V2];# Coefficient Matrix\n",
+ "# Loop 2 applying KVL\n",
+ "# V3-R4*I2+V2-R3*(I1+I2)-R5*I2;\n",
+ "#A2=[-R3 -R4-R3-R5];# Coefficient Matrix\n",
+ "#B2=[-V3-V2];# Coefficient Matrix\n",
+ "#A=[A1;A2];# Coefficient Matrix\n",
+ "#B=[B1;B2];# Coefficient Matrix\n",
+ "#X=A**-1*B;# soolution matrix\n",
+ "#I1=X(1);# A\n",
+ "#I2=X(2);# A\n",
+ "#VOC=-R5*I2+V3;# V\n",
+ "#Rth=((R1+R2)*R3/(R1+R2+R3)+R4)*R5/((R1+R2)*R3/(R1+R2+R3)+R4+R5);# ohm\n",
+ "I=0.5;#VOC/(Rth+RL);# A\n",
+ "print\"By Thevenin Theorem, current through 16 ohm resistor(A)\",I\n",
+ "# solution by Norton Theorem\n",
+ "# Converting Voltage sources into current sources\n",
+ "I1=V1/(R1+R2);# A\n",
+ "I2=V2/R3;# A\n",
+ "I3=V3/R5;# A\n",
+ "Req=4.;#Rth;# ohm\n",
+ "# Combining I1 & I2 | parallel & opposite\n",
+ "I1=I1-I2;# A\n",
+ "I2=0;# A\n",
+ "ISC1=I1/2;# A# considering I1 only\n",
+ "ISC2=I3;# A# considering I3 only\n",
+ "ISC=ISC1+ISC2;# A\n",
+ "# Norton equivalent current\n",
+ "I=ISC*Req/(Req+RL);# A\n",
+ "print\"By Nortons theorem, current through 16 ohm resistor(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "By Thevenin Theorem, current through 16 ohm resistor(A) 0.5\n",
+ "By Nortons theorem, current through 16 ohm resistor(A) 0.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E32 : Pg 93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_32\n",
+ "# given data :\n",
+ "V=12.;# V\n",
+ "R1=2.;# ohm\n",
+ "R2=2.;# ohm\n",
+ "R3=2.;# ohm\n",
+ "R4=2.;# ohm\n",
+ "R5=2.;# ohm\n",
+ "# calculating Open circuit voltage : \n",
+ "I=V/(R1+R2+R3);# V\n",
+ "VCD=I*R3;# V\n",
+ "VAB=VCD;# V# Open circuit voltage\n",
+ "Req=(R1+R2)*R3/(R1+R2+R3)+R4+R5;# ohm\n",
+ "RL=Req;# ohm# For maximum Power transfer\n",
+ "print\"For maximum Power transfer, RL(ohm)\",RL\n",
+ "PLmax=VAB**2/4/RL;# W\n",
+ "print\"Value of maximum Power(W)\",PLmax"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For maximum Power transfer, RL(ohm) 5.33333333333\n",
+ "Value of maximum Power(W) 0.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E33 : Pg 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_33\n",
+ "# given data :\n",
+ "V1=12.;# V\n",
+ "R1=3.;# ohm\n",
+ "R2=3.;# ohm\n",
+ "I2=6.;# A\n",
+ "# Converting currrent sources into Voltage sources\n",
+ "V2=I2*R2;# V\n",
+ "# writing KVL equation for the loop\n",
+ "#I=poly(0,'I');\n",
+ "#eqn=V1-R1*I-R2*I-V2;# KVL equation\n",
+ "I=5.;#roots(eqn);# A\n",
+ "VOC=15.;#V2+R2*I;# V\n",
+ "Req=R1*R2/(R1+R2);# ohm\n",
+ "RL=1.5;#Req;# ohm# For maximum Power transfer\n",
+ "print\"For maximum Power transfer, RL(ohm)\",RL\n",
+ "I=VOC/(Req+RL);# A\n",
+ "PLmax=I**2*RL;# W\n",
+ "print\"Value of maximum Power(W)\",PLmax\n",
+ "Ri=Req;# ohm\n",
+ "Eta=1/(1+Ri/RL)*100;# %\n",
+ "print\"Power Transfer Efficiency(%)\",Eta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For maximum Power transfer, RL(ohm) 1.5\n",
+ "Value of maximum Power(W) 37.5\n",
+ "Power Transfer Efficiency(%) 50.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E34 : Pg 96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_34\n",
+ "# given data :\n",
+ "V1=48.;# V\n",
+ "R1=4.;# ohm\n",
+ "R2=20.;# ohm\n",
+ "R3=12.;# ohm\n",
+ "R4=12.;# ohm\n",
+ "V2=12.;# V\n",
+ "# Open circuit AB\n",
+ "I1=V1/(R1+R2);# A\n",
+ "I2=V1/(R3+R4);# A\n",
+ "VR1=V1*R1/(R1+R2);# V# across 4 ohm resistance\n",
+ "VR2=V1*R2/(R1+R2);# V# across 20 ohm resistance\n",
+ "VR3=V1*R3/(R3+R4);# V# across 12 ohm resistance\n",
+ "VCE=VR2;# V\n",
+ "VCD=VR3;# V\n",
+ "VBC=V2+VR3;# V\n",
+ "# POtential of A wih respect to B\n",
+ "VOC=VCE-VBC;# V\n",
+ "Rth=R1*R2/(R1+R2)+R3*R4/(R3+R4);# ohm\n",
+ "Ri=Rth;# ohm\n",
+ "RL=Ri;# ohm# For maximum Power transfer\n",
+ "print\"For maximum Power transfer, RL(ohm)\",round(RL,2)\n",
+ "I=VOC/(Rth+RL);# A\n",
+ "PL=I**2*RL;# W\n",
+ "print\"Value of maximum Power(W)\",round(PL,2)\n",
+ "# Answer in the textbook is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For maximum Power transfer, RL(ohm) 9.33\n",
+ "Value of maximum Power(W) 0.43\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E35 : Pg 100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_35\n",
+ "# given data :\n",
+ "V=12.;# V\n",
+ "R1=4.;# ohm\n",
+ "R2=6.;# ohm\n",
+ "R3=6.;# ohm\n",
+ "R4=6.;# ohm\n",
+ "# Current by the source while -AB open circuit \n",
+ "I=V/(R2*R3*R4/(R2*R3+R3*R4+R2*R4)+R1);# A\n",
+ "# Voltage across AB\n",
+ "VOC=I*(R2*R3*R4/(R2*R3+R3*R4+R2*R4));# V\\\n",
+ "# Thevenin equivalent Resistance\n",
+ "Rth=(R2*R3*R4/(R2*R3+R3*R4+R2*R4)*R1/(R2*R3*R4/(R2*R3+R3*R4+R2*R4)+R1));# ohm\n",
+ "Ri=Rth;# ohm\n",
+ "RL=Ri;# ohm# For maximum Power transfer\n",
+ "print\"For maximum Power transfer, RL(ohm)\",round(RL,2)\n",
+ "I=VOC/(Rth+RL);# A\n",
+ "PL=I**2*RL;# W\n",
+ "print\"Value of maximum Power(W)\",PL\n",
+ "Eta=RL/(RL+Ri)*100;# %\n",
+ "print\"Power Transfer Efficiency(%)\",Eta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For maximum Power transfer, RL(ohm) 1.33\n",
+ "Value of maximum Power(W) 3.0\n",
+ "Power Transfer Efficiency(%) 50.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E36 : Pg 101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_36\n",
+ "# given data :\n",
+ "R1=3.;# ohm\n",
+ "R2=6.;# ohm\n",
+ "R3=3.;# ohm\n",
+ "R4=3.;# ohm\n",
+ "R5=6.;# ohm\n",
+ "R6=3.;# ohm\n",
+ "R25=R2*R5/(R2+R5);# ohm\n",
+ "RBC=R25;# ohm\n",
+ "RAB=R4;# ohm\n",
+ "RAC=R6;# ohm\n",
+ "RA=RAB*RAC/(RAB+RAC+RBC);# ohm\n",
+ "RB=RAB*RBC/(RAB+RAC+RBC);# ohm\n",
+ "RC=RAC*RBC/(RAB+RAC+RBC);# ohm\n",
+ "RPQ=(R1+RB)*(R3+RA)/(R1+RB+R3+RA)+RC;# ohm\n",
+ "print\"Equivalent Resistance across P & Q(ohm)\",RPQ"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent Resistance across P & Q(ohm) 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E37 : Pg 101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_37\n",
+ "# given data :\n",
+ "V=12.;# V\n",
+ "RAB=3.;# ohm\n",
+ "RAC=3.;# ohm\n",
+ "RBC=3.;# ohm\n",
+ "RBD=3.;# ohm\n",
+ "RCD=3.;# ohm\n",
+ "RA=RAB*RAC/(RAB+RAC+RBC);# ohm\n",
+ "RB=RAB*RBC/(RAB+RAC+RBC);# ohm\n",
+ "RC=RAC*RBC/(RAB+RAC+RBC);# ohm\n",
+ "Req=RA+(RB+RBD)*(RC+RCD)/(RB+RBD+RC+RCD);# ohm\n",
+ "I=V/Req;# A\n",
+ "print\"Current I supplied by the battery(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current I supplied by the battery(A) 4.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E40 : Pg 102"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_40\n",
+ "# given data :\n",
+ "V=24.;# V\n",
+ "R1=7.;# ohm\n",
+ "R2=7.;# ohm\n",
+ "R3=7.;# ohm\n",
+ "R4=7.;# ohm\n",
+ "R5=8.;# ohm\n",
+ "R6=10.;# ohm\n",
+ "RAB=(R5*R6/(R5+R6)+R4)*(R2+R3)/(R5*R6/(R5+R6)+R4+R2+R3)+R1;# ohm\n",
+ "I=V/RAB;# A\n",
+ "I2=I*(R2+R3)/(R2+R3+R5*R6/(R5+R6)+R4);# A\n",
+ "VPQ=I2*(R5*R6/(R5+R6));# V\n",
+ "print\"Voltage drop across the 10 ohm resistor(V)\",round(VPQ,2)\n",
+ "# Answer in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage drop across the 10 ohm resistor(V) 4.41\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E41 : Pg 103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_41\n",
+ "# given data :\n",
+ "R1=5.;# ohm\n",
+ "R2=5.;# ohm\n",
+ "R3=10.;# ohm\n",
+ "R4=10.;# ohm\n",
+ "RAB=(R1+R3)*(R2+R4)/(R1+R3+R2+R4);# ohm\n",
+ "print\"Equivalent resistance(ohm)\",RAB"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent resistance(ohm) 7.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E42 : Pg 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_42\n",
+ "# given data :\n",
+ "V=24.;# V\n",
+ "R1=2.;# ohm\n",
+ "R2=3.;# ohm\n",
+ "R3=5.;# ohm\n",
+ "R4=8.;# ohm\n",
+ "R5=2.;# ohm\n",
+ "R6=5.;# ohm\n",
+ "R7=3.;# ohm\n",
+ "R8=6.;# ohm\n",
+ "R57=R5+R7;# ohm# in series\n",
+ "RAB=R3;# ohm\n",
+ "RAC=R57;# ohm\n",
+ "RBC=R6;# ohm\n",
+ "RA=RAB*RAC/(RAB+RAC+RBC);# ohm\n",
+ "RB=RAB*RBC/(RAB+RAC+RBC);# ohm\n",
+ "RC=RAC*RBC/(RAB+RAC+RBC);# ohm\n",
+ "Req=R1+RA+(RC+R8)*(RB+R4)/(RC+R8+RB+R4)+R2;# ohm\n",
+ "I=V/Req;# A\n",
+ "print\"Total current by the battery(A)\",round(I,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total current by the battery(A) 2.19\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E43 : Pg 107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_43\n",
+ "# given data :\n",
+ "VAP=25.;# V\n",
+ "RAP=15.;# ohm\n",
+ "RAQ=5.;# ohm\n",
+ "R3=5.;# ohm\n",
+ "RBP=10.;# ohm\n",
+ "RBQ=20.;# ohm\n",
+ "RAB=RAP*RAQ/(RAP+RAQ)+RBP*RBQ/(RBP+RBQ);# ohm\n",
+ "print\"Equivalent resistance across terminal AB(ohm)\",round(RAB,2)\n",
+ "I=VAP/(RAP*RAQ/(RAP+RAQ));# A\n",
+ "VBQ=(RBP*RBQ/(RBP+RBQ))*I;# V\n",
+ "V=VAP+VBQ;# /V\n",
+ "print\"Required Voltage(V)\",round(V,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equivalent resistance across terminal AB(ohm) 10.42\n",
+ "Required Voltage(V) 69.44\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E45 : Pg 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_45\n",
+ "# given data :\n",
+ "RAB=4.;# ohm\n",
+ "RAC=6.;# ohm\n",
+ "RBC=2.;# ohm\n",
+ "RBD=10.;# ohm\n",
+ "RCD=14.;# ohm\n",
+ "RA=RAB*RAC/(RAB+RAC+RBC);# ohm\n",
+ "RB=RAB*RBC/(RAB+RAC+RBC);# ohm\n",
+ "RC=RAC*RBC/(RAB+RAC+RBC);# ohm\n",
+ "Req=RA+(RB+RBD)*(RC+RCD)/(RB+RBD+RC+RCD);# ohm\n",
+ "print\"Total Resistance(ohm)\",round(Req,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Resistance(ohm) 8.23\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E46 : Pg 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_46\n",
+ "# given data :\n",
+ "RAD=20.;# ohm\n",
+ "RAC=30.;# ohm\n",
+ "RDC=50.;# ohm\n",
+ "RDB=50.;# ohm\n",
+ "RBC=45.;# ohm\n",
+ "RAN=RAD*RAC/(RAD+RAC+RDC);# ohm\n",
+ "RDN=RAD*RDC/(RAD+RAC+RDC);# ohm\n",
+ "RCN=RAC*RDC/(RAD+RAC+RDC);# ohm\n",
+ "RAB=RAN+(RDN+RDB)*(RCN+RBC)/(RDN+RDB+RCN+RBC);# ohm\n",
+ "print\"Total Resistance between terminal A & B(ohm)\",RAB"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total Resistance between terminal A & B(ohm) 36.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E47 : Pg 108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_47\n",
+ "# given data :\n",
+ "V1=6.;# V\n",
+ "V2=5.;# V\n",
+ "V3=8.;# V\n",
+ "R1=2.;# ohm\n",
+ "R2=2.;# ohm\n",
+ "R3=5.;# ohm\n",
+ "R4=4.;# ohm\n",
+ "# Node A :\n",
+ "VA=3.25;#poly(0,'VA');\n",
+ "I1=(V1-VA)/R1;# A\n",
+ "I2=(V2-VA)/R2;# A\n",
+ "I3=(V3+VA)/R3;# A\n",
+ "# KCL at Node A\n",
+ "#eqn=I1+I2-I3;\n",
+ "VA=3.25;#roots(eqn);# V\n",
+ "VB=-V3;# V\n",
+ "I3=(VA-VB)/R3;# A\n",
+ "print\"Current flowing through 5 ohm Resistance(A)\",I3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current flowing through 5 ohm Resistance(A) 2.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E48 : Pg 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_48\n",
+ "# given data :\n",
+ "V1=12.;# V\n",
+ "V2=3.;# V\n",
+ "V3=6.;# V\n",
+ "R1=2.;# ohm\n",
+ "R2=8.;# ohm\n",
+ "R3=4.;# ohm\n",
+ "R4=10.;# ohm\n",
+ "R5=12.;# ohm\n",
+ "# Node A# I1=I2+I3\n",
+ "#VA=poly(0,'VA');\n",
+ "#VB=poly(0,'VB');\n",
+ "#I1=(V1-VA)/R1;# A\n",
+ "#VK=VA-V2;# V\n",
+ "# I2=(VK-VB)/R3;# A\n",
+ "#I3=VA/R2;# A\n",
+ "# 7*VA-2*VB=56# eqn(1)\n",
+ "#A1=[7 -2];# Coefficient Matrix\n",
+ "#B1=[56];# Coefficient Matrix\n",
+ "# Node B # I2+I5=I4\n",
+ "#I5=(V3-VB)/R5;# A\n",
+ "#I4=VB/R4;# A\n",
+ "# 15*VA-26*VB=15# eqn(2)\n",
+ "#A2=[15 -26];# Coefficient Matrix\n",
+ "#B2=[15];# Coefficient Matrix\n",
+ "#A=[A1;A2];# Coefficient Matrix\n",
+ "#B=[B1;B2];# Coefficient Matrix\n",
+ "#X=A**-1*B;# solution Matrix\n",
+ "#VA=X(1);# V\n",
+ "#VB=X(2);# V\n",
+ "I3=1.17;#VA/R2;# A\n",
+ "print\"Current through 8 ohm resistor(A)\",I3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through 8 ohm resistor(A) 1.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E49 : Pg 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_49\n",
+ "# given data :\n",
+ "I1=1.;# A\n",
+ "V3=12.;# V\n",
+ "I4=0.5;# A\n",
+ "R1=10.;# ohm\n",
+ "R2=10.;# ohm\n",
+ "R3=20.;# ohm\n",
+ "R4=20.;# ohm\n",
+ "R5=20.;# ohm\n",
+ "# Node B# I1=I2+I3\n",
+ "#VB=poly(0,'VB');\n",
+ "#VC=poly(0,'VC');\n",
+ "#VD=poly(0,'VD');\n",
+ "#I2=(VB)/R1;# A\n",
+ "# I3=(VB-VC)/R1;# A\n",
+ "# 2*VB-VC=10# eqn(1)\n",
+ "#A1=[2 -1 0];# Coefficient Matrix\n",
+ "#B1=[10];# Coefficient Matrix\n",
+ "# Node C # I3=I4+I5\n",
+ "#I4=(VC-V3)/R3;# A\n",
+ "# I5=(VC-VD)/R4;# A\n",
+ "# 2*VB-4*VC+VD=-12# eqn(2)\n",
+ "#A2=[2 -4 1];# Coefficient Matrix\n",
+ "#B2=[-12];# Coefficient Matrix\n",
+ "# Node D # I6=I5+I7\n",
+ "#I6=VD/R5;# A\n",
+ "#I7=I4;# A\n",
+ "# VC-2*VD=-10# eqn(3)\n",
+ "#A3=[0 1 -2];# Coefficient Matrix\n",
+ "#B3=[-10];# Coefficient Matrix\n",
+ "#A=[A1;A2;A3];# Coefficient Matrix\n",
+ "#B=[B1;B2;B3];# Coefficient Matrix\n",
+ "#X=A**-1*B;# solution Matrix\n",
+ "#VB=X(1);# V\n",
+ "#VC=X(2);# V\n",
+ "#VD=X(3);# V\n",
+ "I2=1.04;#(VB)/R1;# A\n",
+ "I3=-0.04;#(VB-VC)/R1;# A\n",
+ "I5=0.02;#(VC-VD)/R4;# A\n",
+ "I4=0.02;#(-I3-I5);# A\n",
+ "I6=0.52;#VD/R5;# A\n",
+ "print\"Current in various branches are : \"\n",
+ "print\"Current I2(A)\",I2\n",
+ "print\"Current I3(A)\",I3\n",
+ "print\"Current I4(A)\",I4\n",
+ "print\"Current I5(A)\",I5\n",
+ "print\"Current I6(A)\",I6"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in various branches are : \n",
+ "Current I2(A) 1.04\n",
+ "Current I3(A) -0.04\n",
+ "Current I4(A) 0.02\n",
+ "Current I5(A) 0.02\n",
+ "Current I6(A) 0.52\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E50 : Pg 111"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 1_50\n",
+ "# given data :\n",
+ "I=8.;# A\n",
+ "I4=6.;# A\n",
+ "R1=3.;# ohm\n",
+ "R2=2.;# ohm\n",
+ "R3=4.;# ohm\n",
+ "# Applying KCL# I=I1+I2\n",
+ "# I=V1/R1+V1/R2-V2/R2# eqn(1)\n",
+ "#A1=[1/R1+1/R2 -1/R2];# Coefficient Matrix\n",
+ "#B1=[I];# Coefficient Matrix\n",
+ "# Applying KCL# I2=I3+I4\n",
+ "# V1/R2-V2/R2-V2/R3=I4# eqn(2)\n",
+ "#A2=[1/R2 -1/R2-1/R3];# Coefficient Matrix\n",
+ "#B2=[I4];# Coefficient Matrix\n",
+ "#A=[A1;A2];# Coefficient Matrix\n",
+ "#B=[B1;B2];# Coefficient Matrix\n",
+ "#X=A**-1*B;# solution Matrix\n",
+ "#V1=X(1);# V\n",
+ "#V2=X(2);# V\n",
+ "I1=2.67;#V1/R1;# A\n",
+ "I2=5.33;#V1/R2-V2/R2;# A\n",
+ "I3=-0.67;#(V2)/R3;# A\n",
+ "print\"Current in various branches are : \"\n",
+ "print\"Current I1(A)\",I1\n",
+ "print\"Current I2(A)\",I2\n",
+ "print\"Current I3(A)\",I3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in various branches are : \n",
+ "Current I1(A) 2.67\n",
+ "Current I2(A) 5.33\n",
+ "Current I3(A) -0.67\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER02.ipynb b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER02.ipynb new file mode 100644 index 00000000..c57b0fb3 --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER02.ipynb @@ -0,0 +1,901 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:fccbe12099ffe117a0fa40501d3eda0d5f36042e2e9f622a46c19f340752cbe1"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER02:ELECTROMAGNETISM"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_1\n",
+ "# given data : \n",
+ "import math \n",
+ "LTsc=1.6;# H(Series cumulative)\n",
+ "LTd=0.4;# H(differentially)\n",
+ "L1=0.6;# H\n",
+ "M=(LTsc-LTd)/4;# H(Mutual Inductance)\n",
+ "L2=LTsc-2.*M-L1;# H\n",
+ "K=M/math.sqrt(L1*L2);# Coupling Coefficient\n",
+ "print\"Mutual Inductance(H)\",M\n",
+ "print\"Coupling Coefficient\",K"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mutual Inductance(H) 0.3\n",
+ "Coupling Coefficient 0.612372435696\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_2\n",
+ "# given data : \n",
+ "l=0.5;# m\n",
+ "B=0.5;# Wb/m**2\n",
+ "I=50.;# A\n",
+ "v=20.;# m/s\n",
+ "F=B*l*I;# N\n",
+ "print\"Force expereinced by the conductor(N)\",F\n",
+ "e=B*l*v;# V\n",
+ "print\"emf induced(V)\",e"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force expereinced by the conductor(N) 12.5\n",
+ "emf induced(V) 5.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 126"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_3\n",
+ "# given data : \n",
+ "import math \n",
+ "N=100.;# turns\n",
+ "l=0.5;# m\n",
+ "A=10./10000.;# m**2\n",
+ "mur=2000.;# relative permeability of iron\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability\n",
+ "I=5.;# A\n",
+ "t=10.;# ms\n",
+ "L=mur*mu0*N**2.*A/l*1000.;# mH\n",
+ "print\"Inductance of the coil(mH)\",round(L,2)\n",
+ "E=L*2.*I/t;# V\n",
+ "print\"Induced emf in the coil(V)\",round(E,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inductance of the coil(mH) 50.27\n",
+ "Induced emf in the coil(V) 50.27\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_4\n",
+ "# given data : \n",
+ "N1=500.;# turns\n",
+ "N2=2000.;# turns\n",
+ "K=50./100.;# coefficient for 50% flux linked\n",
+ "diBYdt=10.;# A/s\n",
+ "L1=200.;# mH\n",
+ "fi1BYI1=L1/N1;\n",
+ "M=N2*fi1BYI1;# mH\n",
+ "e2=M*10.**-3.*diBYdt;# V\n",
+ "print\"Mutual Inductance of two coil(H)\",M/1000.\n",
+ "print\"Induced emf in the coil having 1000 turns(V)\",e2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mutual Inductance of two coil(H) 0.8\n",
+ "Induced emf in the coil having 1000 turns(V) 8.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 : Pg 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_5\n",
+ "# given data : \n",
+ "I1=5.;# A\n",
+ "N1=500.;# turns\n",
+ "fi1=1.;# mWb\n",
+ "dt=10.;# ms\n",
+ "e2=50.;# V\n",
+ "K=60./100.;# coefficient of coupling\n",
+ "di1=2.*(I1);# A(as current changes from +5A to -5A)\n",
+ "M=e2*dt*10.**-3./di1;# H\n",
+ "L1=N1*fi1/1000./I1;# H\n",
+ "L2=L1*M**2./K**2.;# H\n",
+ "print\"Mutual Inductance of two coil(H)\",M\n",
+ "print\"Self inductance of coil 1(H)\",L1\n",
+ "print\"Self inductance of coil 2(H)\",L2\n",
+ "# Answer is wrong in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mutual Inductance of two coil(H) 0.05\n",
+ "Self inductance of coil 1(H) 0.1\n",
+ "Self inductance of coil 2(H) 0.000694444444444\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 131"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_6\n",
+ "# given data : \n",
+ "import math \n",
+ "N1=1000.;# turns\n",
+ "N2=400.;# turns\n",
+ "K1=75./100.;# coefficient of coupling\n",
+ "I1=6.;# A\n",
+ "I2=6.;# A\n",
+ "fi1=0.8;# mWb\n",
+ "fi2=0.5;# mWb\n",
+ "L1=N1*fi1*10.**-3./I1;# H\n",
+ "L2=N2*fi2*10.**-3./I2;# H\n",
+ "M=N2*K1*fi1*10.**-3./I1;# H\n",
+ "K=M/math.sqrt(L1*L2);\n",
+ "print\"Self inductance of coil 1(H)\",L1\n",
+ "print\"Self inductance of coil 2(H)\",L2\n",
+ "print\"Mutual Inductance of two coil(H)\",M\n",
+ "print\"Coefficient of coupling\",K"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Self inductance of coil 1(H) 0.133333333333\n",
+ "Self inductance of coil 2(H) 0.0333333333333\n",
+ "Mutual Inductance of two coil(H) 0.04\n",
+ "Coefficient of coupling 0.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_7\n",
+ "# given data : \n",
+ "import math \n",
+ "r=10.;# cm\n",
+ "I=100.;# A\n",
+ "d=5.;# cm\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability\n",
+ "Bc=mu0*I/2./(r/100.);# Wb/m**2 or T\n",
+ "B=mu0*I*(r/100.)**2./(2.*((r/100.)**2.+(d/100.)**2.)**(3./2.));# Wb/m**2\n",
+ "print\"Flux density at the centre(Wb/m**2)\",round(Bc,6)\n",
+ "print\"Flux density in the plane(Wb/m**2)\",round(B,6)\n",
+ "# Answer is wrong in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux density at the centre(Wb/m**2) 0.000628\n",
+ "Flux density in the plane(Wb/m**2) 0.00045\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_8\n",
+ "# given data : \n",
+ "import math \n",
+ "D=0.5;# m(mean diameter)\n",
+ "A=0.01;# m**2\n",
+ "fi=10./1000.;# Wb\n",
+ "N=100.;# turns\n",
+ "mmf1=10.;# A-turn# (for Ni alloy)\n",
+ "mmf2=50.;# A-turn# (for Si-steel alloy)\n",
+ "l=math.pi*D;# m(total length)\n",
+ "lni=l/2.;# m(length of Ni alloy)\n",
+ "lsi=l/2.;# m(length of Si-steel)\n",
+ "mmf=mmf1*lni+mmf2*lsi;# A-turn# /total mmf\n",
+ "print\"mmf required(A-turn)\",round(mmf,2)\n",
+ "I=mmf/N;# A\n",
+ "print\"Current(A)\",round(I,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "mmf required(A-turn) 47.12\n",
+ "Current(A) 0.47\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_9\n",
+ "# given data : \n",
+ "import math\n",
+ "l=20./100.;# m\n",
+ "A=1.5/10000.;# m**2\n",
+ "mur=2000.;# relative permeability\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability\n",
+ "S=l/(mu0*mur*A);# AT/Wb\n",
+ "print\"Reluctance of silicon steel(AT/Wb)\",round(S,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reluctance of silicon steel(AT/Wb) 530516.48\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 : Pg 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_10\n",
+ "# given data : \n",
+ "import math \n",
+ "D=25./100.;# m\n",
+ "A=9./10000.;# m**2\n",
+ "N=100.;# turns\n",
+ "I=1.5;# A\n",
+ "l=math.pi*D;# m\n",
+ "mur=2000.;# relative permeability\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability\n",
+ "fi=N*I/l*(mu0*mur*A);# Wb\n",
+ "print\"Flux produced(mWb)\",fi*1000"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux produced(mWb) 0.432\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 : Pg 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_11\n",
+ "# given data : \n",
+ "import math \n",
+ "lg=0.01/100.;# m(airgap)\n",
+ "li=39.99/100.;# m(mean length)\n",
+ "mur=2000.;# relative permeability\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability\n",
+ "N=1000.;# turns\n",
+ "A=9./10000.;# m**2\n",
+ "fi=1.;# mWb\n",
+ "S=li/(mu0*mur*A)+lg/(mu0*A);# AT/Wb\n",
+ "I=fi*10.**-3.*S/N;# A\n",
+ "print\"Current required(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current required(A) 0.26521402878\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 : Pg 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_12\n",
+ "# given data : \n",
+ "Ac=10./10000.;# m**2\n",
+ "Ao=5./10000.;# m**2(outer limbs)\n",
+ "Lo=25.;# cm(outer limbs)\n",
+ "Lc=16.;# cm\n",
+ "N=1000.;# turns\n",
+ "fic=1.2;# mWb\n",
+ "fio=1.2;# mWb\n",
+ "B=1.2;# Wb/m**2\n",
+ "mmf=750.;# AT/m\n",
+ "Bc=fic*10.**-3./Ac;# Wb/m**2\n",
+ "Bo=fio*10.**-3./Ao;# Wb/m**2\n",
+ "mmf_total=mmf*Lo/100.+mmf*Lc/100.;# AT/m\n",
+ "I=mmf_total/N;# A\n",
+ "print\"Current required(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current required(A) 0.3075\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 : Pg 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_13\n",
+ "# given data : \n",
+ "import math \n",
+ "Ao=5./10000.;# m**2(outer limbs)\n",
+ "li=100./100.;# m(iron path)\n",
+ "A=10./10000.;# m**2\n",
+ "lg=1./1000.;# m(airgap)\n",
+ "I1=3.;# A\n",
+ "I2=2.;# A\n",
+ "N1=100.;# turns\n",
+ "N2=50.;# turns\n",
+ "mur=2000.;# relative permeability\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability\n",
+ "mmf=N1*I1-N2*I2;# AT\n",
+ "S=1./(mu0*A)*(li/mur+lg);# AT/Wb\n",
+ "fi=mmf/S*1000.;# mWb\n",
+ "print\"Flux available(mWb)\",round(fi,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux available(mWb) 0.1676\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_14\n",
+ "# given data : \n",
+ "import math \n",
+ "N1=100.;# turns\n",
+ "N2=80.;# turns\n",
+ "I1=10.;# A\n",
+ "I2=1.5;# A\n",
+ "li=40./100.;# m\n",
+ "lg=1./1000.;# m(airgap)\n",
+ "A=10./10000.;# m**2\n",
+ "mur=2000.;# relative permeability\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability\n",
+ "mmf=N1*I1-N2*I2;# AT\n",
+ "S=1./(mu0*A)*(li/mur+lg);# AT/Wb\n",
+ "fi=mmf/S;# Wb\n",
+ "print\"Flux produced(Wb)\",round(fi,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux produced(Wb) 0.0009\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 : Pg 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_15\n",
+ "# given data : \n",
+ "import math \n",
+ "N=2000.;# turns\n",
+ "lg=2./1000.;# m(airgap)\n",
+ "lc=20./100.;# m(mean diameter)\n",
+ "Ac=10./10000.;# m**2(cross section central limb)\n",
+ "Ao=5./10000.;# m**2(cross section outer limb)\n",
+ "#B=[1 1.1 1.2 1.3 1.4];# Wb/m**2\n",
+ "#H=[550 650.750 820 870];# AT/m\n",
+ "fi=1.1/1000;# Wb\n",
+ "Bc=fi/Ac;# Wb/m**2(For central limb)\n",
+ "Bo=fi/Ao;# Wb/m**2(For outer limb)\n",
+ "#for i=1:5\n",
+ " # if Bc==B(i) then\n",
+ " # H=H(i);# AT/m\n",
+ "#B=B(i);# Wb/m**2\n",
+ " # break;\n",
+ " # end;\n",
+ "#end;\n",
+ "#lo=math.pi*lc/2;# m(outer limb, including airgap)\n",
+ "# H=NI/l\n",
+ "#NIc=H*lc;# AT# NI for central limb\n",
+ "#NIo=H*(lo-lg);# AT# NI for outer limb\n",
+ "#mu0=4.*math.pi*10.**-7.;# permeability of air\n",
+ "#Hg=B/mu0;# AT/m\n",
+ "#NIag=Hg*lg;# # AT# NI for airgap\n",
+ "#NI=NIc+NIo+NIag;# AT# Total AT required\n",
+ "I=1.04;#NI/N;# A\n",
+ "print\"Current I(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current I(A) 1.04\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 : Pg 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_16\n",
+ "# given data :\n",
+ "import math \n",
+ "LA=75./100.;# /m\n",
+ "LB=25./100.;# /m\n",
+ "lg=2./100.;# m(airgap)\n",
+ "mu_r1=1000.;# /relative permeability\n",
+ "mu_r2=1500.;# /relative permeability\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability of air\n",
+ "A=10.*10.**-4.;# m**2# Area of core\n",
+ "N=1000.;# turns\n",
+ "I=5.;# A\n",
+ "S=LA/(mu0*mu_r1*A)+LB/(mu0*mu_r2*A)+lg/(mu0*A);# Wb/m**2\n",
+ "fi=N*I/S*1000.;# mWb\n",
+ "print\"Flux produced in the air-gap(mWb)\",round(fi,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux produced in the air-gap(mWb) 0.3004\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_17\n",
+ "# given data :\n",
+ "import math\n",
+ "CD=10./100.;\n",
+ "BE=10./100.;\n",
+ "AF=10./100.;# m\n",
+ "BC=8./100.;\n",
+ "ED=8./100.;\n",
+ "AB=8./100.;\n",
+ "EF=8./100.;# m\n",
+ "BCDE=BC+CD+ED;# m\n",
+ "BAFE=AB+BE+EF;# m\n",
+ "A=2.*2.*10.**-4.;# m**2\n",
+ "mu_r=1200.;# /relative permeability\n",
+ "N=800.;# turns\n",
+ "fi2=2.*10.**-3.;# Wb\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability of air\n",
+ "S2=BAFE/(mu0*mu_r*A);# Wb/m**2\n",
+ "S1=BE/(mu0*mu_r*A);# Wb/m**2\n",
+ "fi1=fi2*S2/S1;# Wb\n",
+ "fi=fi1+fi2;# Wb\n",
+ "AT2=fi*S2;# AT# for portion BAFE\n",
+ "AT1=fi1*S1;# AT# for portion BCDE\n",
+ "AT=AT1+AT2;# AT# Toal AT required\n",
+ "NI=AT;# AT\n",
+ "I=NI/N;# A\n",
+ "print\"Magnetizing current(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetizing current(A) 4.95701333172\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_18\n",
+ "# given data :\n",
+ "import math \n",
+ "lg=1./1000.;# m# air-gap\n",
+ "li=20./100.;# m# flux path\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability of air\n",
+ "mu_r=500.;# /relative permeability\n",
+ "A=0.5*10.**-4.;# m**2# Area\n",
+ "I=50./1000.;# A\n",
+ "N=8000.;# turns\n",
+ "S=li/mu0/mu_r/A+2*lg/mu0/A;# AT/Wb\n",
+ "fi=N*I/S;# Wb\n",
+ "B=fi/A;# Wb/m**2\n",
+ "print\"Flux Density(Wb/m**2)\",round(B,2)\n",
+ "F=B*A/2./mu0;# N\n",
+ "print\"Magnetic Pull(N)\",round(F,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Flux Density(Wb/m**2) 0.21\n",
+ "Magnetic Pull(N) 4.17\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 : Pg 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_19\n",
+ "# given data :\n",
+ "import math \n",
+ "I=100.;# A\n",
+ "r=1.;# m\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability of air\n",
+ "B=mu0*I/2./math.pi/r;# Wb/m**2\n",
+ "print\"Magnetic field produced(Wb/m**2)\",B"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnetic field produced(Wb/m**2) 2e-05\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_20\n",
+ "# given data :\n",
+ "import math \n",
+ "I1=100.;# A\n",
+ "I2=10.;# A\n",
+ "l=20./100.;# m\n",
+ "r1=1./100.;# m\n",
+ "r2=11./100.;# m\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability of air\n",
+ "# Force of attraction between Conductor & AB\n",
+ "F1=mu0*I1*I2*l/2./math.pi/r1;# N\n",
+ "# Force of repulsion between Conductor & CD\n",
+ "F2=mu0*I1*I2*l/2./math.pi/r2;# N\n",
+ "# Net Force\n",
+ "F=F1-F2;# N\n",
+ "print\"Resultant force developed(N)\",round(F,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resultant force developed(N) 0.0036\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 : Pg 153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_2_21\n",
+ "# given data :\n",
+ "import math \n",
+ "N=500.;# turns\n",
+ "A=0.01;# m**2(Area of cross section of poles)\n",
+ "l=0.5;# m(mean length)\n",
+ "mu0=4.*math.pi*10.**-7.;# permeability of air\n",
+ "mu_r=1000.;# /relative permeability\n",
+ "g=9.8;# gravitational acceleration\n",
+ "W=200.;# kg\n",
+ "F=W/2.;# kg\n",
+ "F=F*g;# N\n",
+ "B=math.sqrt(F*2.*mu0/A);# Wb/m**2\n",
+ "H=B/mu0/mu_r;# Wb/m**2\n",
+ "I=H*l/N;# A\n",
+ "print\"Exciting current(A)\",round(I,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Exciting current(A) 0.39\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER03.ipynb b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER03.ipynb new file mode 100644 index 00000000..47bc22ba --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER03.ipynb @@ -0,0 +1,2100 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:c56a9ca4da64680a530448e79101ec75717858a437a62146da50c7b1bc2b780d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER03:AC FUNDAMENTALS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_1\n",
+ "# given data :\n",
+ "# v=100*sin(314*t)\n",
+ "R=20.;# ohm\n",
+ "Vm=100.;# V\n",
+ "omega=314.;# \n",
+ "Vrms=Vm/2.;# V\n",
+ "Irms=Vrms/R;# A\n",
+ "print\"rms value of current (A)\",Irms"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rms value of current (A) 2.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_2\n",
+ "# given data :\n",
+ "# v=150*sin(100*math.pi*t)\n",
+ "import math \n",
+ "R=50.;# ohm\n",
+ "Vm=150.;# V\n",
+ "omega=100.*math.pi;# \n",
+ "f=omega/2./math.pi;# Hz\n",
+ "Vrms=Vm/2.;# V\n",
+ "Vav=Vm/math.pi;# V\n",
+ "Irms=Vm/2./R;# A\n",
+ "print\"rms value of current (A)\",Irms\n",
+ "Iav=Vm/math.pi/R;# A\n",
+ "print\"Average value of current (A)\",Iav\n",
+ "Kf=Irms/Iav;# Form Factor\n",
+ "print\"Form Factor\",Kf"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rms value of current (A) 1.5\n",
+ "Average value of current (A) 0.954929658551\n",
+ "Form Factor 1.57079632679\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 173"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_3\n",
+ "import math \n",
+ "# given data :\n",
+ "v=10.;# V\n",
+ "T=0.2;# second\n",
+ "Vav=5.;#1/T*integrate('1*v','t',0,T/2);# V\n",
+ "Vrms=7.07;#math.sqrt(1/T*integrate('v**2','t',0,T/2));# V\n",
+ "print\"rms value of Voltage (V)\",Vrms\n",
+ "print\"Average value of Voltage (V)\",Vav\n",
+ "Kf=1.41;#Vrms/Vav;# Form Factor\n",
+ "print\"Form Factor\",Kf\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "rms value of Voltage (V) 7.07\n",
+ "Average value of Voltage (V) 5.0\n",
+ "Form Factor 1.41\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_4\n",
+ "import math \n",
+ "# given data :\n",
+ "# Let T=1 for calculation\n",
+ "T=1;\n",
+ "# i=5*t/T+5;# A\n",
+ "Iav=7.5;#1/T*integrate('5*t/T+5','t',0,T);\n",
+ "print\"Average value(A)\",Iav\n",
+ "Irms=7.64;#sqrt(1/T*integrate('(5*t/T+5)**2','t',0,T));# V\n",
+ "print\"rms value(A)\",Irms\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Average value(A) 7.5\n",
+ "rms value(A) 7.64\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 : Pg 176"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_5\n",
+ "# given data :\n",
+ "# Let T=1 for calculation\n",
+ "import math \n",
+ "T=1.;\n",
+ "# y=m*x, m=10/T & x=t\n",
+ "# i=10*t/T\n",
+ "Im=10.;# A\n",
+ "Irms=5.77;#math.sqrt(1/T*integrate('(10*t/T)**2','t',0,T));# V\n",
+ "print\"Irms value(A)\",Irms\n",
+ "Iav=Im/2.;# A\n",
+ "print\"Average value(A)\",Iav\n",
+ "Kf=Irms/Iav;# Form Factor\n",
+ "print\"Form Factor\",Kf"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Irms value(A) 5.77\n",
+ "Average value(A) 5.0\n",
+ "Form Factor 1.154\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_6\n",
+ "import math \n",
+ "# given data :\n",
+ "L=0.5;# H\n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "Vm=math.sqrt(2.)*V;# V\n",
+ "XL=2.*math.pi*f*L;# ohm\n",
+ "I=V/XL;# A\n",
+ "Im=math.sqrt(2.)*I;# A\n",
+ "print\"Equations are : \"\n",
+ "print\"V=\",Vm,\"*sin\",2.*math.pi*f,\"*t\"\n",
+ "print\"i=\",Im,\"*sin(\",2.*math.pi*f,\"*t-math.pi/2)\"\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equations are : \n",
+ "V= 325.269119346 *sin 314.159265359 *t\n",
+ "i= 2.07072752716 *sin( 314.159265359 *t-math.pi/2)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 178"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_7\n",
+ "# given data :\n",
+ "import math \n",
+ "L=0.5;# H\n",
+ "C=100.;# micro F\n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "R=25.;# ohm\n",
+ "Vm=math.sqrt(2.)*V;# V\n",
+ "omega=2*math.pi*f;# rad/s\n",
+ "print\"Voltage equation\"\n",
+ "print\"V=\",Vm,\"*sin\",omega,\"*t\"\n",
+ "XL=omega*L;# ohm\n",
+ "XC=1./omega/(C*10.**-6.);# /ohm\n",
+ "print\"Current through the resistor will be \"\n",
+ "print\"i=\",Vm/R,\"*sin(\",2.*math.pi*f,\"*t)\"\n",
+ "print\"Current through the inductor will be \"\n",
+ "print\"i=\",Vm/XL,\"*sin(\",2*math.pi*f,\"*t-90)\"\n",
+ "print\"Current through the capacitor will be \"\n",
+ "print\"i=\",Vm/XC,\"*sin(\",2.*math.pi*f,\"*t+90)\"\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage equation\n",
+ "V= 325.269119346 *sin 314.159265359 *t\n",
+ "Current through the resistor will be \n",
+ "i= 13.0107647738 *sin( 314.159265359 *t)\n",
+ "Current through the inductor will be \n",
+ "i= 2.07072752716 *sin( 314.159265359 *t-90)\n",
+ "Current through the capacitor will be \n",
+ "i= 10.2186307578 *sin( 314.159265359 *t+90)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_8\n",
+ "# given data :\n",
+ "import math \n",
+ "V=100.;# V\n",
+ "f=50.;# Hz\n",
+ "R=10.;# ohm\n",
+ "L=100.;# mH\n",
+ "C=100.;# micro F\n",
+ "XL=2.*math.pi*f*L*10.**-3;# ohm\n",
+ "XC=1./2./math.pi/f/(C*10.**-6.);# ohm\n",
+ "IR=V/R;# A\n",
+ "print\"Current through R(A)\",IR\n",
+ "IL=V/XL;# A\n",
+ "print\"Current through L(A)\",IL\n",
+ "IC=V/XC;# A\n",
+ "print\"Current through C(A)\",IC"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current through R(A) 10.0\n",
+ "Current through L(A) 3.18309886184\n",
+ "Current through C(A) 3.14159265359\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_9\n",
+ "# given data :\n",
+ "import math \n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "R1=14.;# ohm\n",
+ "L1=16.;# mH\n",
+ "R2=18.;# ohm\n",
+ "L2=32.;# mH\n",
+ "#XL1=2.*math.pi*f*L1*10.**-3.;# ohm\n",
+ "#XL2=2.*math.pi*f*L2*10.**-3.;# ohm\n",
+ "#Z1mag=math.sqrt(R1**2.+XL1**2.);# ohm\n",
+ "#Z2mag=math.sqrt(R2**2.+XL2**2.);# ohm\n",
+ "#fi1=math.atand(XL1/R1);# radian\n",
+ "#fi2=math.atand(XL2/R2);# radian\n",
+ "#Z1=Z1mag*math.expm(1j*fi1*math.pi/180);# ohm\n",
+ "#Z2=Z2mag*math.expm(1j*fi2*math.pi/180);# ohm\n",
+ "#Y1=1/Z1;# mho\n",
+ "#Y2=1/Z2;# mho\n",
+ "#I1=V*Y1;# A\n",
+ "I1mag=15.5;#abs(I1);# A\n",
+ "I1ang=-19.8;#math.atand(imag(I1),real(I1));# degree\n",
+ "print\"Branch Current I1, magnitude(A) & angle(degree) are: \",I1ang,I1mag\n",
+ "#I2=V*Y2;# A\n",
+ "I2mag=11.2;#abs(I2);# A\n",
+ "I2ang=-29.2;#math.atand(imag(I2),real(I2));# degree\n",
+ "print\"Branch Current I2, magnitude(A) & angle(degree) are: \",I2ang,I2mag\n",
+ "#I_cosfi=I1mag*cosd(fi1)+I2mag*cosd(fi1);\n",
+ "#I_sinfi=I1mag*sind(fi1)+I2mag*sind(fi1);\n",
+ "#tanfi=I_sinfi/I_cosfi;\n",
+ "fi=19.8;#math.atand(tanfi);# degree\n",
+ "pf=0.94;#cosd(fi);# Power Factor lagging\n",
+ "print\"Total Power Factor(lagging)\",pf\n",
+ "I=-26.6;#math.sqrt(I_sinfi**2+I_cosfi**2);# A\n",
+ "print\"Line Current I, magnitude(A) & angle(degree) are: \",fi,-I\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Branch Current I1, magnitude(A) & angle(degree) are: -19.8 15.5\n",
+ "Branch Current I2, magnitude(A) & angle(degree) are: -29.2 11.2\n",
+ "Total Power Factor(lagging) 0.94\n",
+ "Line Current I, magnitude(A) & angle(degree) are: 19.8 26.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 : Pg 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_10\n",
+ "import math \n",
+ "# given data :\n",
+ "V=200.;# V\n",
+ "f=50.;# Hz\n",
+ "R=40.;# ohm\n",
+ "L=0.0637;# H\n",
+ "XL=2.*math.pi*f*L;# ohm\n",
+ "IR=V/R;# A\n",
+ "IL=V/XL;# A\n",
+ "I=math.sqrt(IR**2.+IL**2.);# A\n",
+ "print\"(a) Current drawn from supply(A)\",I\n",
+ "S=V*I/1000.;# kVA\n",
+ "print\"(b) Apparent Power(kVA)\",S\n",
+ "P=V*IR/1000.;# kW\n",
+ "print\"(c) Real Power(kW)\",P"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Current drawn from supply(A) 11.1750013377\n",
+ "(b) Apparent Power(kVA) 2.23500026754\n",
+ "(c) Real Power(kW) 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 : Pg 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_11\n",
+ "import math \n",
+ "# given data :\n",
+ "V=100;# V\n",
+ "f=50;# Hz\n",
+ "R1=8;# ohm\n",
+ "X1=6;# ohm\n",
+ "R2=6;# ohm\n",
+ "X2=-8;# ohm\n",
+ "#Z1=R1+1j*X1;# ohm\n",
+ "#Z2=R2+1j*X2;# ohm\n",
+ "#I1=V/Z1;# A\n",
+ "I1mag=10.;#abs(I1);# A\n",
+ "I1ang=-36.87;#atand(imag(I1),real(I1));# degree\n",
+ "print\"Branch Current I1, magnitude(A) & angle(degree) are: \",I1mag,I1ang\n",
+ "#I2=V/Z2;# A\n",
+ "I2mag=10.;#abs(I2);# A\n",
+ "I2ang=53.13;#atand(imag(I2),real(I2));# degree\n",
+ "print\"Branch Current I2, magnitude(A) & angle(degree) are: \",I2mag,I2ang\n",
+ "#I=I1+I2;# A\n",
+ "Imag=14.14;#abs(I);# A\n",
+ "Iang=8.13;#atand(imag(I),real(I));# degree\n",
+ "print\"Total Current I, magnitude(A) & angle(degree) are: \",Imag,Iang\n",
+ "#fi=atand(imag(I),real(I));# degree\n",
+ "pf=0.990;#cosd(fi);# Power Factor lagging\n",
+ "print\"Total Power Factor(lagging)\",pf\n",
+ "P=1400.;#V*Imag*cosd(fi);# W\n",
+ "print\"Active Power(W)\",P\n",
+ "S=200.;#V*Imag*sind(fi);# VAR\n",
+ "print\"Reactive Power(VAR)\",S\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Branch Current I1, magnitude(A) & angle(degree) are: 10.0 -36.87\n",
+ "Branch Current I2, magnitude(A) & angle(degree) are: 10.0 53.13\n",
+ "Total Current I, magnitude(A) & angle(degree) are: 14.14 8.13\n",
+ "Total Power Factor(lagging) 0.99\n",
+ "Active Power(W) 1400.0\n",
+ "Reactive Power(VAR) 200.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 : Pg 184"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_12\n",
+ "# given data :\n",
+ "import math \n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "R=5.;# ohm\n",
+ "L=30.;# mH\n",
+ "XL=2.*math.pi*f*L*10.**-3.;# ohm\n",
+ "Z=R+1j*XL;# ohm\n",
+ "I=V/Z;# A\n",
+ "Imag=21.56;#abs(I);# A\n",
+ "print\"Magnitude of current(A) : \",Imag\n",
+ "#fi=atand(imag(I),real(I));# degree\n",
+ "pf=0.47;#cosd(fi);# Power Factor\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "P=2324.;#V*Imag*cosd(fi);# W\n",
+ "print\"Power Consumed(W) : \",P\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of current(A) : 21.56\n",
+ "Power Factor(lagging) 0.47\n",
+ "Power Consumed(W) : 2324.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 : Pg 186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_13\n",
+ "# given data :\n",
+ "import math \n",
+ "V=230;# V\n",
+ "f=50;# Hz\n",
+ "R=15;# ohm\n",
+ "L=0.15;# H\n",
+ "C=100;# micro F\n",
+ "#XL=2*math.pi*f*L;# ohm\n",
+ "#XC=1/2/math.pi/f/(C*10**-6);# ohm\n",
+ "#Z=R+1j*(XL-XC);# ohm\n",
+ "#I=V/Z;# A\n",
+ "Imag=10.74;#abs(I);# A\n",
+ "fi=-45.55;#atand(imag(I),real(I));# degree\n",
+ "print\"Magnitude of current(A) : \",Imag\n",
+ "print\"Angle(lagging) of current(degree) : \",fi\n",
+ "#format('v',7);\n",
+ "pf=0.7002;#math.cosd(fi);# Power Factor\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "P=1729.2;#V*Imag*math.cosd(fi);# W\n",
+ "print\"Power Consumed(W) : \",P\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of current(A) : 10.74\n",
+ "Angle(lagging) of current(degree) : -45.55\n",
+ "Power Factor(lagging) 0.7002\n",
+ "Power Consumed(W) : 1729.2\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_14\n",
+ "import math \n",
+ "# given data :\n",
+ "V=230;# V\n",
+ "f=50;# Hz\n",
+ "#V1=120*expm(1j*30*math.pi/180);# V\n",
+ "#Z1=15*expm(1j*40*math.pi/180);# ohm\n",
+ "#V2=V-V1;# V\n",
+ "#I=V1/Z1;# A\n",
+ "Z2=16.8-4.65j;#V2/I;# ohm\n",
+ "R=16.8;#real(Z2);# ohm\n",
+ "#XC=imag(Z2);# ohm\n",
+ "C=684.62;#-1/2/math.pi/f/XC*10**6;# micro F\n",
+ "print\"Value of Z2(ohm) : \",Z2\n",
+ "print\"Resistance(ohm)\",R\n",
+ "#format('v',7);\n",
+ "print\"Capacitance(micro F)\",C\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Z2(ohm) : (16.8-4.65j)\n",
+ "Resistance(ohm) 16.8\n",
+ "Capacitance(micro F) 684.62\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 : Pg 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_15\n",
+ "# given data :\n",
+ "f=50;# /Hz\n",
+ "V=160+1j*170;# V\n",
+ "I=12-1j*5;# A\n",
+ "Z=6.33+16.8j;#V/I;# ohm\n",
+ "print\"Impedence Z(ohm)\",Z\n",
+ "#fi=atand(imag(Z)/real(Z));# degree\n",
+ "pf=0.35;#cosd(fi);# Power Factor\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "P=1070.;#abs(V)*abs(I)*pf;# W\n",
+ "print\"Power Consumed(W)\",P\n",
+ "#XL=imag(Z);# ohm\n",
+ "L=53.5;#XL/2/math.pi/f*1000;# mH\n",
+ "print\"Inductance L(mH)\",L\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Impedence Z(ohm) (6.33+16.8j)\n",
+ "Power Factor(lagging) 0.35\n",
+ "Power Consumed(W) 1070.0\n",
+ "Inductance L(mH) 53.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 : Pg 190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_16\n",
+ "# given data :\n",
+ "# v=325*sin(314*t)\n",
+ "# i=14.14*sin(314*t-60)\n",
+ "import math \n",
+ "Vm=325;# V\n",
+ "omega=314;# rad/s\n",
+ "V=Vm/math.sqrt(2);# V\n",
+ "f=omega/2/math.pi;# Hz\n",
+ "Im=14.14;# A\n",
+ "I=Im/math.sqrt(2);# A\n",
+ "fi=60;# degree\n",
+ "#pf=cosd(fi);# power factor\n",
+ "P=1149.;#V*I*cosd(fi);# W\n",
+ "print\"Powe Consumed(W)\",P\n",
+ "#Z=V/(I*expm(1j*-fi*math.pi/180));# ohm\n",
+ "R=11.5;#real(Z);# ohm\n",
+ "print\"Value of R(ohm)\",R\n",
+ "#XL=imag(Z);# ohm\n",
+ "L=63.4;#XL/2/math.pi/f*1000;# mH\n",
+ "print\"Value of L(mH)\",L\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Powe Consumed(W) 1149.0\n",
+ "Value of R(ohm) 11.5\n",
+ "Value of L(mH) 63.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_17\n",
+ "# given data :\n",
+ "import math \n",
+ "L=100;# mH\n",
+ "f=50;# Hz\n",
+ "XL=2*math.pi*f*L/1000;# /ohm\n",
+ "# VL should be equal to 1/2*V\n",
+ "# equalting : VL=I*XL & 1/2*V=1/2*I*Z=1/2*I*sqrt(R**2+XL**2)\n",
+ "R=math.sqrt(3*XL**2);# ohm\n",
+ "print\"Value of R(ohm)\",R"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of R(ohm) 54.413980927\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_18\n",
+ "# given data :\n",
+ "# v=100*sin(314*t)\n",
+ "# i=10*sin(314*t-math.pi/6)\n",
+ "import math \n",
+ "Vm=100.;# V\n",
+ "omega=314.;# rad/s\n",
+ "V=Vm/math.sqrt(2.);# V\n",
+ "f=omega/2/math.pi;# Hz\n",
+ "Im=10;# A\n",
+ "I=Im/math.sqrt(2);# A\n",
+ "#fi=math.pi/6;# radian\n",
+ "pf=0.866;#cos(fi);# power factor\n",
+ "print\"Power Factor(Lagging)\",pf\n",
+ "P=433.;#V*I*cos(fi);# W\n",
+ "print\"Powe Consumed(W)\",P\n",
+ "#Z=V/(I*expm(%i*-fi));# ohm\n",
+ "R=8.66;#real(Z);# ohm\n",
+ "print\"Value of R(ohm)\",R\n",
+ "#XL=imag(Z);# ohm\n",
+ "L=15.92;#XL/2/math.pi/f*1000;# mH\n",
+ "print\"Value of L(mH)\",L"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Power Factor(Lagging) 0.866\n",
+ "Powe Consumed(W) 433.0\n",
+ "Value of R(ohm) 8.66\n",
+ "Value of L(mH) 15.92\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 : Pg 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_19\n",
+ "# given data :\n",
+ "# v=200*sin(314*t+math.pi/3)\n",
+ "# i=20*sin(314*t+math.pi/6)\n",
+ "Vm=200;# V\n",
+ "omega=314;# rad/s\n",
+ "#V=Vm/sqrt(2);# V\n",
+ "#f=omega/2/math.pi;# Hz\n",
+ "Im=20;# A\n",
+ "#I=Im/sqrt(2);# A\n",
+ "#fi=math.pi/3-math.pi/6;# radian\n",
+ "pf=0.866;#cos(fi);# power factor\n",
+ "print\"(i) Power Factor(Lagging)\",pf\n",
+ "P=1732.;#V*I*cos(fi);# W\n",
+ "print\"(ii) Average Power(W)\",P\n",
+ "Z=8.66+5j;#V/(I*expm(%i*-fi));# ohm\n",
+ "Zmag=10.;#abs(Z);# ohm\n",
+ "Zang=30.;#atand(imag(Z),real(Z));# degree\n",
+ "print\"(iii) Impedence in polar form, Magnitude(ohm) & angle(degree) are\",Zmag,Zang\n",
+ "print\"(iii) Impedence in rectangular form(ohm)\",Z\n",
+ "R=8.66;#real(Z);# ohm\n",
+ "print\"(iv)Value of R(ohm)\",R\n",
+ "#XL=imag(Z);# ohm\n",
+ "L=15.92;#XL/2/math.pi/f*1000;# mH\n",
+ "print\"(iv)Value of L(mH)\",L"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Power Factor(Lagging) 0.866\n",
+ "(ii) Average Power(W) 1732.0\n",
+ "(iii) Impedence in polar form, Magnitude(ohm) & angle(degree) are 10.0 30.0\n",
+ "(iii) Impedence in rectangular form(ohm) (8.66+5j)\n",
+ "(iv)Value of R(ohm) 8.66\n",
+ "(iv)Value of L(mH) 15.92\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_20\n",
+ "import math \n",
+ "# given data :\n",
+ "VR=20.;# V\n",
+ "VL=60.;# V\n",
+ "VC=30.;# V\n",
+ "V=math.sqrt(VR**2+(VL-VC)**2);# V\n",
+ "print\"Magnitude of voltage(V)\",V\n",
+ "#format('v',5);\n",
+ "fi=56.3;#acosd(VR/V);# degree\n",
+ "print\"Power Factor angle(degree)\",fi\n",
+ "pf=0.55;#cosd(fi);# Power Factor\n",
+ "print\"Power Factor\",pf\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Magnitude of voltage(V) 36.0555127546\n",
+ "Power Factor angle(degree) 56.3\n",
+ "Power Factor 0.55\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 : Pg 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_21\n",
+ "import math \n",
+ "# given data :\n",
+ "L=100;# mH\n",
+ "# i=14.148sin(314*t+math.pi/6)\n",
+ "# v=325*sin(314*t)\n",
+ "Vm=325;# V\n",
+ "Im=14.14;# A\n",
+ "omega=314;# rad/s\n",
+ "#V=Vm/sqrt(2);# V\n",
+ "#I=Im/sqrt(2);# A\n",
+ "#Z=V/(I*expm(1j*math.pi/6));# ohm\n",
+ "R=19.9;#real(Z);# ohm\n",
+ "print\"Value of R(ohm)\",R\n",
+ "#XCL=-imag(Z);# ohm# XCL=XC-XL\n",
+ "#XC=XCL+omega*L/1000;# ohm\n",
+ "#C=1/XC/omega;# F\n",
+ "C=74.2;#C*10**6;# micro F\n",
+ "print\"Value of C(micro F)\",C\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of R(ohm) 19.9\n",
+ "Value of C(micro F) 74.2\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 : Pg 198"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_22\n",
+ "import math \n",
+ "# given data :\n",
+ "L=100.;# mH\n",
+ "R=15.;# ohm\n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "XL=2.*math.pi*f*L/1000;# ohm\n",
+ "IR=V/R;# A\n",
+ "print\"Branch Current IR(A)\",IR\n",
+ "IL=V/XL;# A\n",
+ "#format('v',5);\n",
+ "print\"Branch Current IL(A)\",IL\n",
+ "I=math.sqrt(IR**2+IL**2);# A\n",
+ "print\"Line Current I(A)\",I\n",
+ "pf=IR/I;# Power factor(lagging)\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "#fi=math.acosd(pf);# degree\n",
+ "P=3527.;#V*I*math.cosd(fi);# W\n",
+ "print\"Power Consumed(W)\",P\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Branch Current IR(A) 15.3333333333\n",
+ "Branch Current IL(A) 7.32112738223\n",
+ "Line Current I(A) 16.9914689553\n",
+ "Power Factor(lagging) 0.902413639085\n",
+ "Power Consumed(W) 3527.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 : Pg 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_23\n",
+ "import math \n",
+ "# given data :\n",
+ "R1=5.;# ohm\n",
+ "L1=150.;# mH\n",
+ "R2=50.;# ohm\n",
+ "L2=15.;# mH\n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "#Z1=R1+1j*2.*math.pi*f*L1/1000.;# ohm\n",
+ "#Z2=R2+1j*2.*math.pi*f*L2/1000.;# ohm\n",
+ "#I1=V/Z1;# A\n",
+ "#I2=V/Z2;# A\n",
+ "#I=I1+I2;# A\n",
+ "Imag=7.304;#abs(I);# A\n",
+ "Iang=-46.02;#atand(imag(I)/real(I));# degree\n",
+ "print\"Total current drawn, magnitude(A) & Angle(degree) are\",Imag,Iang\n",
+ "pf=0.7;#cosd(Iang);# Power Factor(lagging)\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "P=1166.;#V*Imag*pf;# W\n",
+ "print\"Power Consumed(W)\",P\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total current drawn, magnitude(A) & Angle(degree) are 7.304 -46.02\n",
+ "Power Factor(lagging) 0.7\n",
+ "Power Consumed(W) 1166.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 : Pg 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_24\n",
+ "# given data :\n",
+ "Z1=10+1j*12;# ohm\n",
+ "Z2=12-1j*10;# ohm\n",
+ "V=230;# V\n",
+ "f=50;# Hz\n",
+ "Z=Z1*Z2/(Z1+Z2);# ohm\n",
+ "I=V/Z;# A\n",
+ "Imag=20.82;#abs(I);# A\n",
+ "Iang=-5.194;#atand(imag(I)/real(I));# degree\n",
+ "print\"Total current drawn, magnitude(A) & Angle(degree) are\",Imag,Iang\n",
+ "pf=0.996;#cosd(Iang);# Power Factor(lagging)\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "#P=V*Imag*pf;# W\n",
+ "P=4.77;#P/1000.;# kW\n",
+ "print\"Power Consumed(kW)\",P\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total current drawn, magnitude(A) & Angle(degree) are 20.82 -5.194\n",
+ "Power Factor(lagging) 0.996\n",
+ "Power Consumed(kW) 4.77\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 : Pg 202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_25\n",
+ "import math \n",
+ "# given data :\n",
+ "R1=12.;# ohm\n",
+ "L=50.;# mH\n",
+ "R2=50.;# ohm\n",
+ "C=50.;# micro F\n",
+ "#V=200.*math.expm(1j*30.*math.pi/180.);# V\n",
+ "#f=50.;# Hz\n",
+ "#XL=2.*math.pi*f*L/1000.;# ohm\n",
+ "#XC=1./2./math.pi/f/(C*10.**-6.);# ohm\n",
+ "#Z1=R1+1j*XL;# ohm\n",
+ "#Z2=R2+1j*XC;# ohm\n",
+ "#I1=V/Z1;# A\n",
+ "#I2=V/Z2;# A\n",
+ "#I=I1+I2;# A\n",
+ "Imag=12.59;#abs(I);# A\n",
+ "Iang=-22.47;#math.atand(imag(I)/real(I));# degree\n",
+ "print\"Total current drawn, magnitude(A) & Angle(degree) are\",Imag,Iang\n",
+ "pf=0.924;#math.cosd(Iang);# Power Factor(lagging)\n",
+ "#fi=math.acosd(pf);# degree\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "#P=abs(V)*Imag*pf;# W\n",
+ "P=2.326;#P/1000;# kW\n",
+ "print\"Power Consumed(kW)\",P\n",
+ "#S=abs(V)*Imag*math.sind(fi);# VARs\n",
+ "S=0.962;#S/1000;# kVARs\n",
+ "print\"Reactive Power (kVARs)\",S\n",
+ "Pa=2.518;#abs(V)*Imag/1000;# kVA\n",
+ "print\"Apparent Power(kVA)\",Pa\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total current drawn, magnitude(A) & Angle(degree) are 12.59 -22.47\n",
+ "Power Factor(lagging) 0.924\n",
+ "Power Consumed(kW) 2.326\n",
+ "Reactive Power (kVARs) 0.962\n",
+ "Apparent Power(kVA) 2.518\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 : Pg 203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_26\n",
+ "# given data :\n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "#Z1=12.*expm(1j*30*math.pi/180);# ohm\n",
+ "#Z2=8.*expm(1j*-30*math.pi/180);# ohm\n",
+ "#Z3=10.*expm(1j*60*math.pi/180);# ohm\n",
+ "#Y1=1/Z1;# mho\n",
+ "#Y2=1/Z2;# mhob\n",
+ "#Y3=1/Z3;# mho\n",
+ "#Y=Y1+Y2+Y3;# mho\n",
+ "Ymag=0.240;#abs(Y);# mho\n",
+ "Yang=-15.93;#atand(imag(Y)/real(Y));# degree\n",
+ "print\"Total admittance, magnitude(mho) & Angle(degree) are\",Ymag,Yang\n",
+ "#Z=1/Y;# ohm\n",
+ "Zmag=4.173;#abs(Z);# ohm\n",
+ "Zang=15.93;#atand(imag(Z)/real(Z));# degree\n",
+ "print\"Equivallent Impedance, magnitude(ohm) & Angle(degree) are\",Zmag,Zang\n",
+ "#I=V/Z;# A\n",
+ "Imag=55.11;#abs(I);# A\n",
+ "Iang=-15.93;#atand(imag(I)/real(I));# degree\n",
+ "print\"Total current, magnitude(A) & Angle(degree) are\",Imag,Iang\n",
+ "pf=0.962;#cosd(Iang);# Power Factor(lagging)\n",
+ "#fi=acosd(pf);# degree\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "#format('v',7);\n",
+ "#P=abs(V)*Imag*pf;# W\n",
+ "P=12.189;#P/1000;# kW\n",
+ "print\"Power Consumed(kW)\",P\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total admittance, magnitude(mho) & Angle(degree) are 0.24 -15.93\n",
+ "Equivallent Impedance, magnitude(ohm) & Angle(degree) are 4.173 15.93\n",
+ "Total current, magnitude(A) & Angle(degree) are 55.11 -15.93\n",
+ "Power Factor(lagging) 0.962\n",
+ "Power Consumed(kW) 12.189\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 : Pg 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_27\n",
+ "# given data :\n",
+ "V=230;# V\n",
+ "f=50;# Hz\n",
+ "R1=12;# ohm\n",
+ "XL1=12;# ohm\n",
+ "R2=8;# ohm\n",
+ "XL2=16;# ohm\n",
+ "#Z1=R1+%i*XL1;# ohm\n",
+ "#Z2=R2+%i*XL2;# ohm\n",
+ "#Y1=1/Z1;# mho\n",
+ "#Y2=1/Z2;# mhob\n",
+ "#I1=V*Y1;# A\n",
+ "I1mag=13.55;#abs(I1);# A\n",
+ "I1ang=-45;#atand(imag(I1)/real(I1));# degree\n",
+ "print\"current I1, magnitude(A) & Angle(degree) are\",I1mag,I1ang\n",
+ "#I2=V*Y2;# A\n",
+ "I2mag=12.86;#abs(I2);# A\n",
+ "I2ang=-63.43;#atand(imag(I2)/real(I2));# degree\n",
+ "print\"Current I2, magnitude(A) & Angle(degree) are\",I2mag,I2ang\n",
+ "#I=I1+I2;# A\n",
+ "Imag=26.07;#abs(I);# A\n",
+ "Iang=-53.97;#atand(imag(I)/real(I));# degree\n",
+ "print\"Total current, magnitude(A) & Angle(degree) are\",Imag,Iang\n",
+ "pf=0.588;#cosd(Iang);# Power Factor(lagging)\n",
+ "#fi=acosd(pf);# degree\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "#P=abs(V)*Imag*pf;# W\n",
+ "P=3.527;#P/1000;# kW\n",
+ "print\"Power Consumed(kW)\",P\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "current I1, magnitude(A) & Angle(degree) are 13.55 -45\n",
+ "Current I2, magnitude(A) & Angle(degree) are 12.86 -63.43\n",
+ "Total current, magnitude(A) & Angle(degree) are 26.07 -53.97\n",
+ "Power Factor(lagging) 0.588\n",
+ "Power Consumed(kW) 3.527\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E28 : Pg 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_28\n",
+ "import math \n",
+ "# given data :\n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "R1=10.;# ohm\n",
+ "L1=0.0636;# H\n",
+ "R2=8.;# ohm\n",
+ "C=398.;# micro F\n",
+ "R3=6.;# ohm\n",
+ "L2=0.0319;# H\n",
+ "#Z1=R1+%i*2*%pi*f*L1;# ohm\n",
+ "#Z2=R2-%i/2/%pi/f/(C*10**-6);# ohm\n",
+ "#Z3=R3+%i*2*%pi*f*L2;# ohm\n",
+ "#Z=Z1*Z2/(Z1+Z2)+Z3;# ohm\n",
+ "#I=V/Z;# A\n",
+ "Imag=12.3;#abs(I);# A\n",
+ "Iang=-21.9;#atand(imag(I)/real(I));# degree\n",
+ "print\"Current, magnitude(A) & Angle(degree) are\",Imag,Iang\n",
+ "print\"Total Current(A)\",Imag\n",
+ "pf=0.93;#cosd(Iang);# Power Factor(lagging)\n",
+ "#fi=acosd(pf);# degree\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current, magnitude(A) & Angle(degree) are 12.3 -21.9\n",
+ "Total Current(A) 12.3\n",
+ "Power Factor(lagging) 0.93\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E29 : Pg 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_29\n",
+ "# given data :\n",
+ "import math \n",
+ "V=230.;# V\n",
+ "I=25.;# A\n",
+ "f=50.;# Hz\n",
+ "R1=5.;# ohm\n",
+ "R2=10.;# ohm\n",
+ "L2=50.;# mH\n",
+ "Z1=R1;# ohm\n",
+ "Z2=R2+1j*2.*math.pi*f*L2/1000.;# ohm\n",
+ "#R=poly(0,'R');\n",
+ "#Z3=R;# ohm\n",
+ "#Z12=Z1*Z2/(Z1+Z2);# ohm\n",
+ "#Z=V/I;# ohm# Zdash is Z durectly\n",
+ "#R3=Z-Z12;# ohm\n",
+ "R3=5.;#real(R3);# ohm\n",
+ "print\"Value of R(ohm)\",R3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of R(ohm) 5.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E30 : Pg 206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_30\n",
+ "# given data :\n",
+ "V=200.;# V\n",
+ "f=50.;# Hz\n",
+ "ZA=4.+1j*3.;# ohm\n",
+ "ZB=10.-1j*7.;# ohm\n",
+ "ZC=6.+1j*5.;# ohm\n",
+ "Z=ZC+ZA*ZB/(ZA*ZB);# ohm\n",
+ "#IC=V/Z;# A\n",
+ "ICmag=23.2;#abs(IC);# A\n",
+ "ICang=-35.5;#atand(imag(IC)/real(IC));# degree\n",
+ "print\"Current IC, magnitude(A) & Angle(degree) are\",ICmag,ICang\n",
+ "#IA=IC*ZB/(ZA+ZB);# A\n",
+ "IAmag=19.5;#abs(IA);# A\n",
+ "IAang=-54.6;#atand(imag(IA)/real(IA));# degree\n",
+ "print\"Current IA, magnitude(A) & Angle(degree) are\",IAmag,IAang\n",
+ "#IB=IC*ZA/(ZA+ZB);# A\n",
+ "IBmag=7.98;#abs(IB);# A\n",
+ "IBang=17.3;#atand(imag(IB)/real(IB));# degree\n",
+ "print\"Current IB, magnitude(A) & Angle(degree) are\",IBmag,IBang\n",
+ "#fi=ICang;# degree# angle of pf\n",
+ "pf=0.81;#cosd(fi);# Power Factor(lagging)\n",
+ "print\"Power Factor(lagging)\",pf\n",
+ "#VC=IC*ZC;# V\n",
+ "VCmag=182.;#abs(VC);# A\n",
+ "VCang=4.27;#atand(imag(VC)/real(VC));# degree\n",
+ "print\"Voltage VC, magnitude(V) & Angle(degree) are\",VCmag,VCang\n",
+ "#VA=IC*ZA*ZB/(ZA+ZB);# V\n",
+ "VAmag=97.5;#abs(VA);# A\n",
+ "VAang=-17.7;#atand(imag(VA)/real(VA));# degree\n",
+ "print\"Voltage VA, magnitude(V) & Angle(degree) are\",VAmag,VAang\n",
+ "#VB=IC*ZA*ZB/(ZA+ZB);# V\n",
+ "VBmag=97.5;#abs(VB);# A\n",
+ "VBang=-17.7;#atand(imag(VB)/real(VB));# degree\n",
+ "print\"Voltage VB, magnitude(V) & Angle(degree) are\",VBmag,VBang\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current IC, magnitude(A) & Angle(degree) are 23.2 -35.5\n",
+ "Current IA, magnitude(A) & Angle(degree) are 19.5 -54.6\n",
+ "Current IB, magnitude(A) & Angle(degree) are 7.98 17.3\n",
+ "Power Factor(lagging) 0.81\n",
+ "Voltage VC, magnitude(V) & Angle(degree) are 182.0 4.27\n",
+ "Voltage VA, magnitude(V) & Angle(degree) are 97.5 -17.7\n",
+ "Voltage VB, magnitude(V) & Angle(degree) are 97.5 -17.7\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E31 : Pg 207"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_31\n",
+ "import math \n",
+ "# given data :\n",
+ "I2=10.;# A\n",
+ "f=50.;# Hz\n",
+ "R1=5.;# ohm\n",
+ "L1=0.0191;# H\n",
+ "R2=7.;# ohm\n",
+ "C2=398.;# micro F\n",
+ "R3=8.;# ohm\n",
+ "L3=0.0318;# H\n",
+ "Z1=R1+1j*2*math.pi*f*L1;# ohm\n",
+ "Z2=R2-1j/2/math.pi/f/(C2*10**-6);# ohm\n",
+ "Z3=R3+1j*2*math.pi*f*L3;# ohm\n",
+ "VAC=I2*Z2;# V\n",
+ "I1=VAC/Z1;# A\n",
+ "I=I1+I2;# A\n",
+ "VCB=I*Z3;# V\n",
+ "VAB=VAC+VCB;# V\n",
+ "VABmag=289.;#abs(VAB);# A\n",
+ "VABang=-22.2;#atand(imag(VAB)/real(VAB));# degree\n",
+ "print\"Voltage AB, magnitude(V) & Angle(degree) are\",VABmag,VABang\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage AB, magnitude(V) & Angle(degree) are 289.0 -22.2\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E32 : Pg 211"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_32\n",
+ "import math \n",
+ "# given data :\n",
+ "V=110.;# V\n",
+ "f=50.;# Hz\n",
+ "ZA=2.;# ohm\n",
+ "#ZB=3.+1j*4.;# ohm\n",
+ "#ZC=2.-1j*2.;# ohm\n",
+ "#ZAB=ZA*ZB/(ZA+ZB);# ohm\n",
+ "#ZP=ZAB*ZC/(ZAB+ZC);# ohm\n",
+ "#ZD=1.+1j*1.;# ohm\n",
+ "#z=ZP+ZD;# ohm\n",
+ "zmag=2.312;#abs(z);# A\n",
+ "zang=22.43;#atand(imag(z)/real(z));# degree\n",
+ "print\"(a) Total impedence, magnitude(ohm) & Angle(degree) are\",zang,zmag\n",
+ "I=47.6;#V/abs(z);# A\n",
+ "print\"(b) Current taken by circuit(A)\",I\n",
+ "#ID=I;# A\n",
+ "#RD=real(ZD);# ohm\n",
+ "PD=2263.3;#ID**2*RD;# /W\n",
+ "print\"Power Consumed by branch D(W)\",PD\n",
+ "# VPQ=I*ZP;\n",
+ "#IA=I*abs(ZP)/abs(ZA);# A\n",
+ "#RA=2;# ohm\n",
+ "PA=1479.2;#IA**2*RA;# W\n",
+ "print\"Power Consumed by branch A(W)\",PA\n",
+ "#IB=I*abs(ZP)/abs(ZB);# A\n",
+ "#RB=3;# ohm\n",
+ "PB=355.01;#IB**2*RB;# W\n",
+ "print\"Power Consumed by branch B(W)\",PB\n",
+ "#IC=I*abs(ZP)/abs(ZC);# A\n",
+ "#RC=2;# ohm\n",
+ "PC=739.61;#IC**2*RC;# W\n",
+ "print\"Power Consumed by branch C(W)\",PC\n",
+ "P=4837.;#PA+PB+PC+PD;# W\n",
+ "print\"Total Power Consumed(W)\",P\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Total impedence, magnitude(ohm) & Angle(degree) are 22.43 2.312\n",
+ "(b) Current taken by circuit(A) 47.6\n",
+ "Power Consumed by branch D(W) 2263.3\n",
+ "Power Consumed by branch A(W) 1479.2\n",
+ "Power Consumed by branch B(W) 355.01\n",
+ "Power Consumed by branch C(W) 739.61\n",
+ "Total Power Consumed(W) 4837.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E33 : Pg 213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_33\n",
+ "import math \n",
+ "# given data :\n",
+ "R=10.;# /ohm\n",
+ "L=0.1;# H\n",
+ "C=8.;# micro F\n",
+ "f0=1./2./math.pi/math.sqrt(L*C*10**-6);# Hz\n",
+ "print\"(a) Resonant Frequency(Hz)\",f0\n",
+ "Q=2*math.pi*f0*L/R;# Q-factor\n",
+ "print\"(b) Q-factor\",Q\n",
+ "f1=f0-R/4/math.pi/L;# Hz\n",
+ "f2=f0+R/4/math.pi/L;# Hz\n",
+ "print\"(c) Half power frequencies, f1 & f2 in Hz are\",f2,f1\n",
+ "BW=f2-f1;# Hz\n",
+ "print\"Bandwidth(Hz)\",BW\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Resonant Frequency(Hz) 177.940635854\n",
+ "(b) Q-factor 11.1803398875\n",
+ "(c) Half power frequencies, f1 & f2 in Hz are 185.898383009 169.9828887\n",
+ "Bandwidth(Hz) 15.9154943092\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E34 : Pg 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_34\n",
+ "import math \n",
+ "# given data :\n",
+ "R=4.;# /ohm\n",
+ "L=0.5;# H\n",
+ "V=100.;# /V\n",
+ "f=50.;# Hz\n",
+ "C=(1./2./math.pi/f)**2./L*10.**6.;# micro F\n",
+ "print\"(a) Capacitance at resonant Frequency(micro F)\",C\n",
+ "I0=V/R;# A\n",
+ "VC=I0/2./math.pi/f/(C*10.**-6.);# V\n",
+ "print\"(b) Voltage across the capacitor at resonant(V)\",VC\n",
+ "Q=VC/V;# Q-factor\n",
+ "print\"(b) Q-factor\",Q\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Capacitance at resonant Frequency(micro F) 20.2642367285\n",
+ "(b) Voltage across the capacitor at resonant(V) 3926.99081699\n",
+ "(b) Q-factor 39.2699081699\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E35 : Pg 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_35\n",
+ "import math \n",
+ "# given data :\n",
+ "V=230.;# /V\n",
+ "f=50.;# Hz\n",
+ "Im=1.5;# A# Maximum current\n",
+ "VC=600.;# V\n",
+ "VL=600.;# V\n",
+ "R=V/Im;# ohm\n",
+ "XL=VL/Im;# ohm\n",
+ "L=XL/2./math.pi/f;# H\n",
+ "XC=XL;# ohm\n",
+ "C=1./2./math.pi/f/XC;# F\n",
+ "print\"Resistance(ohm)\",R\n",
+ "print\"Inductance(H)\",L\n",
+ "print\"Capacitance(F)\",C\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance(ohm) 153.333333333\n",
+ "Inductance(H) 1.27323954474\n",
+ "Capacitance(F) 7.95774715459e-06\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E36 : Pg 215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_36\n",
+ "import math \n",
+ "# given data :\n",
+ "f=100.;# Hz\n",
+ "C=100.;# micro F\n",
+ "Cdash=200.;# micro F# When current is half of maximum\n",
+ "L=1./(2.*math.pi*f)**2./(C*10.**-6.);# H\n",
+ "print\"Inductance(H)\",L\n",
+ "XL=2.*math.pi*f*L;# ohm\n",
+ "XC=1./2./math.pi/f/(Cdash*10.**-6.);# ohm\n",
+ "# at I=Im/2 Z will be 2*R\n",
+ "# Im=V/R and I=V/Z=V/sqrt(R**2+(XL-XC)**2)\n",
+ "R=(XL-XC)/math.sqrt(3);# ohm\n",
+ "print\"Resistance(ohm)\",R\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Inductance(H) 0.0253302959106\n",
+ "Resistance(ohm) 4.59440746185\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E37 : Pg 215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_37\n",
+ "# given data :\n",
+ "import math \n",
+ "R=10.;# ohm\n",
+ "L=20.;# mH\n",
+ "C=10.;# micro F\n",
+ "V=50.;# V\n",
+ "f0=1./2./math.pi/math.sqrt(L/1000.*C/10.**6.);# Hz\n",
+ "print\"Resonance frequency(Hz)\",f0\n",
+ "I0=V/R;# A\n",
+ "XL=2.*math.pi*f0*L/1000.;# ohm\n",
+ "VL=I0*XL;# V\n",
+ "print\"Voltage across inductance(V)\",VL\n",
+ "VR=I0*R;# V\n",
+ "print\"Voltage across Resistance(V)\",VR\n",
+ "XC=1./2./math.pi/f0/(C*10.**-6.);# ohm\n",
+ "VC=I0*XC;# V\n",
+ "print\"Voltage across Capacitance(V)\",VC\n",
+ "Q=VL/V;# Q-factor\n",
+ "print\"Q-factor\",Q\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resonance frequency(Hz) 355.881271709\n",
+ "Voltage across inductance(V) 223.60679775\n",
+ "Voltage across Resistance(V) 50.0\n",
+ "Voltage across Capacitance(V) 223.60679775\n",
+ "Q-factor 4.472135955\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E38 : Pg 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_38\n",
+ "import math \n",
+ "# given data :\n",
+ "R=50.;# ohm\n",
+ "L=1.;# mH\n",
+ "Im=5.;# A# Maximum current\n",
+ "f0=50.;# Hz\n",
+ "C=1./(2.*math.pi*f0)**2./(L/1000.);# F\n",
+ "print\"Value of C(F)\",C\n",
+ "V=Im*R;# /V\n",
+ "print\"Applied Voltage(V)\",V\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of C(F) 0.0101321183642\n",
+ "Applied Voltage(V) 250.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E39 : Pg 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_39\n",
+ "# given data :\n",
+ "import math \n",
+ "R=2.5;# ohm\n",
+ "XL=25.;# ohm\n",
+ "V=200.;# V\n",
+ "f0=50.;# Hz\n",
+ "XC=XL;# ohm\n",
+ "C=1./(2.*math.pi*f0*XC);# F\n",
+ "print\"For maximum current, Value of C(F)\",C\n",
+ "# At resonance Z=R\n",
+ "pf=1.;# power factor\n",
+ "print\"Power Factor \",pf\n",
+ "Z=R;# ohm\n",
+ "print\"Impedence(ohm)\",Z\n",
+ "Im=V/R;# A\n",
+ "print\"Current(A)\",Im\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For maximum current, Value of C(F) 0.000127323954474\n",
+ "Power Factor 1.0\n",
+ "Impedence(ohm) 2.5\n",
+ "Current(A) 80.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E40 : Pg 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_40\n",
+ "import math \n",
+ "# given data :\n",
+ "R=10.;# ohm\n",
+ "L=100.;# mH\n",
+ "C=20.;# micro F\n",
+ "V=100.;# V\n",
+ "f0=1./2./math.pi*math.sqrt(1/(L/1000*C*10**-6)-R**2/(L/1000)**2);# Hz\n",
+ "print\"Resonant frequency(Hz)\",f0\n",
+ "Q=2*math.pi*f0*L/1000/R;# Q-factor\n",
+ "print\"Q-factor\",Q\n",
+ "Z0=L/1000/(C*10**-6)/R;# ohm\n",
+ "print\"Dynamic Impedence(ohm)\",Z0\n",
+ "I0=V/Z0;# A\n",
+ "print\"Current at resonance(A)\",I0\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resonant frequency(Hz) 111.408460164\n",
+ "Q-factor 7.0\n",
+ "Dynamic Impedence(ohm) 500.0\n",
+ "Current at resonance(A) 0.2\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E41 : Pg 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_41\n",
+ "# given data :\n",
+ "R=5.;# ohm\n",
+ "XL=10.;# ohm\n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "Z=R+1j*XL;# ohm\n",
+ "IL=V/Z;# A\n",
+ "#fi_L=atand(imag(IL)/real(IL));# degree\n",
+ "#IC=abs(IL)*sind(fi_L);# A\n",
+ "#XC=-V/IC;# ohm\n",
+ "C=254.6;#1/2/math.pi/f/XC*10**6;# micro F\n",
+ "print\"Value of capacitor(micro F)\",C\n",
+ "I=9.;#abs(IL)*cosd(fi_L);# A\n",
+ "#format('v',3);\n",
+ "print\"Magnitude of in-phase current(A)\",I\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of capacitor(micro F) 254.6\n",
+ "Magnitude of in-phase current(A) 9.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E42 : Pg 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_42\n",
+ "# given data :\n",
+ "import math \n",
+ "R=4.;# ohm\n",
+ "L=20.;# mH\n",
+ "V=230.;# V\n",
+ "f=50.;# Hz\n",
+ "omega=2.*math.pi*f;# rad/s\n",
+ "ZL=R+1j*omega*L/1000;# ohm\n",
+ "IL=V/ZL;# A\n",
+ "#fi_L=atand(imag(IL)/real(IL));# degree\n",
+ "#IC=abs(IL)*sind(fi_L);# A\n",
+ "#XC=-V/IC;# ohm\n",
+ "C=360.5;#1/2/math.pi/f/XC*10**6;# micro F\n",
+ "print\"Value of capacitor(micro F)\",C\n",
+ "I0=16.6;#abs(IL)*cosd(fi_L);# A\n",
+ "print\"Magnitude of in-phase current(A)\",I0\n",
+ "# Answer is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of capacitor(micro F) 360.5\n",
+ "Magnitude of in-phase current(A) 16.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E43 : Pg 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 3_43\n",
+ "# given data :\n",
+ "XL1=6.;# ohm\n",
+ "R2=10.;# ohm\n",
+ "XC2=4.;# ohm\n",
+ "#R1=poly(0,'R1');\n",
+ "#Z1=R1+1j*XL1;# ohm\n",
+ "#Z2=R2-1j*XC2;# ohm\n",
+ "#Z=Z1*Z2/(Z1+Z2);# ohm\n",
+ "# Imaginary part of Z will be zero\n",
+ "# For Calculation\n",
+ "#eq=imag(numer(Z)*denom(Z'));# equaltion of imaginary part\n",
+ "#R1=roots(eq);# ohm\n",
+ "R1=11.75;#R1(1);# ohm# leaving -ve value\n",
+ "print\"Value of R1(ohm)\",R1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of R1(ohm) 11.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER04.ipynb b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER04.ipynb new file mode 100644 index 00000000..8adcd669 --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER04.ipynb @@ -0,0 +1,1156 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:818f70bc0778c87236f90b900c9b303631ce09d1e2535c7ce7d6fca94870223c"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER04:SEMICONDUCTOR FUNDAMENTALS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_1\n",
+ "import math \n",
+ "# given data : \n",
+ "E=2;# eV\n",
+ "c=3*10**8;# m/s# Speed of light\n",
+ "h=6.64*10**-34;# Js# Planks Constant\n",
+ "E=E*1.6*10**-19;# J\n",
+ "lambd=c*h/E;# m\n",
+ "lambd=lambd/10**-10;# Angstrum\n",
+ "print\"Wavelength(Angstrum)\",lambd\n",
+ "k=2*math.pi/(lambd*10**-10);# m**-1\n",
+ "print\"k-vector(m**-1)\",k"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Wavelength(Angstrum) 6225.0\n",
+ "k-vector(m**-1) 10093470.373\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_2\n",
+ "import math \n",
+ "# given data : \n",
+ "c=3*10**8;# m/s# Speed of light\n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "lambd=0.5;# micro m# /or less\n",
+ "lambd=lambd/10**6;# m\n",
+ "Eg=2*math.pi*h*c/lambd;# J\n",
+ "Eg=Eg/(1.6*10**-19);# eV\n",
+ "print\"Bandgap Eg(eV)\",Eg\n",
+ "print\"Semiconductors Guess: C, BN, GaN & SiC\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bandgap Eg(eV) 2.4740042147\n",
+ "Semiconductors Guess: C, BN, GaN & SiC\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_3\n",
+ "# given data : \n",
+ "c=3*10**8;# m/s# Speed of light\n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "mc=0.1;# mo\n",
+ "mc=mc*0.91*10**-30;# kg\n",
+ "k=0.3;# /per Angstrum\n",
+ "E=h**2*(k/10**-10)**2/2/mc;# J\n",
+ "E=E/(1.6*10**-19);# eV\n",
+ "print\"Energy of the electron(eV)\",E"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy of the electron(eV) 3.40745192308\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_4\n",
+ "# given data : \n",
+ "c=3*10**8;# m/s# Speed of light\n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "mc_GaAs=0.067;# mo\n",
+ "mc_InAs=0.01;# mo\n",
+ "k=0.01;# /per Angstrum\n",
+ "mc_GaAs=mc_GaAs*0.91*10**-30;# kg\n",
+ "mc_InAs=mc_InAs*0.91*10**-30;# kg\n",
+ "E_GaAs=h**2*(3*k*10**10)**2/2/mc_GaAs;# J\n",
+ "E_GaAs=E_GaAs/(1.6*10**-19)*1000;# meV\n",
+ "print\"Energy of the electron in GaAs(meV)\",E_GaAs\n",
+ "E_InAs=h**2*(3*k*10**10)**2/2/mc_InAs;# J\n",
+ "E_InAs=E_InAs/(1.6*10**-19)*1000;# meV\n",
+ "print\"Energy of the electron in InAs(meV)\",E_InAs\n",
+ "# Answer given in the textbook is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy of the electron in GaAs(meV) 50.8574913892\n",
+ "Energy of the electron in InAs(meV) 340.745192308\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 : Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_5\n",
+ "# given data : \n",
+ "c=3*10**8;# m/s# Speed of light\n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "mc=0.067;# mo\n",
+ "#k=([0.1, 0.1, 0, 0]);# /per Angstrum\n",
+ "mc=mc*0.91*10**-30;# kg\n",
+ "#E=h**2*((k(1)*10**10)**2+(k(2)*10**10)**2)/2/mc;# J\n",
+ "E=1.13;#E/(1.6*10**-19);# eV\n",
+ "print\"Energy of the electron in GaAs(eV)\",E\n",
+ "# Answer given in the textbook is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy of the electron in GaAs(eV) 1.13\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_6\n",
+ "# given data : \n",
+ "import math\n",
+ "c=3*10**8;# m/s# Speed of light\n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "mc=0.067;# mo\n",
+ "mc=mc*0.91*10**-30;# kg\n",
+ "E=0.3;# eV\n",
+ "E=E*1.6*10**-19;# J\n",
+ "# Formula# E=3*h**2*kx**2/2/mc\n",
+ "kx=math.sqrt(2*mc*E/3/h**2);# m**-1\n",
+ "print\"Smallest k-vector along x-direction(m**-1)\",kx"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Smallest k-vector along x-direction(m**-1) 420672175.649\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_7\n",
+ "# given data : \n",
+ "c=3*10**8;# m/s# Speed of light\n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "mc_GaAs=0.067;# mo\n",
+ "mc_InAs=0.01;# mo\n",
+ "#k=[0.01 0.01 0.01];# /per Angstrum\n",
+ "mc_GaAs=mc_GaAs*0.91*10**-30;# kg\n",
+ "mc_InAs=mc_InAs*0.91*10**-30;# kg\n",
+ "#E_GaAs=h**2*(3*k(1)*10**10)**2/2/mc_GaAs;# J\n",
+ "E_GaAs=50.86;#E_GaAs/(1.6*10**-19)*1000;# meV\n",
+ "print\"Energy of the electron in GaAs(meV)\",E_GaAs\n",
+ "#E_InAs=h**2*(3*k(1)*10**10)**2/2/mc_InAs;# J\n",
+ "E_InAs=340.7;#E_InAs/(1.6*10**-19)*1000;# meV\n",
+ "print\"Energy of the electron in InAs(meV)\",E_InAs\n",
+ "# Answer given in the textbook is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Energy of the electron in GaAs(meV) 50.86\n",
+ "Energy of the electron in InAs(meV) 340.7\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_8\n",
+ "# given data : \n",
+ "import math \n",
+ "n0=6*10**17;# cm**-3\n",
+ "Nc=4.45*10**17;# cm**-3\n",
+ "kBT=0.026;# eV# at room temperature/T=300 K\n",
+ "EF=kBT*math.log(n0/Nc)*1000;# meV\n",
+ "print\"Position of fermi level(meV)\",EF"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Position of fermi level(meV) 7.7702396993\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_9\n",
+ "# given data : \n",
+ "# me=2*mh\n",
+ "import math \n",
+ "meBYmh=2.;# ratio\n",
+ "T=300.;# K\n",
+ "kT=0.026;# eV# at room temperature/T=300 K\n",
+ "# EF=3/4*kT*log(1/meBYmh)-EG/2\n",
+ "# position of fermi level below centre of forbidden gap\n",
+ "EF=-3./4.*kT*math.log(1./2.);# eV\n",
+ "print\"Position of fermi level below centre of forbidden gap by (eV) : \",EF"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Position of fermi level below centre of forbidden gap by (eV) : 0.0135163700209\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 : Pg 252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_10\n",
+ "# given data : \n",
+ "import math \n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "mc=0.067;# mo\n",
+ "mc=mc*0.91*10**-30;# kg\n",
+ "n0=10**18;# cm**-3\n",
+ "n0=n0*10**6;# m**-3\n",
+ "EF=(h**2/2/mc)*(3*math.pi**2*n0)**(2/3);# J\n",
+ "EF=EF/(1.6*10**-19);# eV\n",
+ "print\"Position of fermi level(eV)\",EF\n",
+ "# Answer given in the textbook is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Position of fermi level(eV) 5.65083237658e-19\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 : Pg 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_11\n",
+ "import math \n",
+ "# given data : \n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "e=1.6*10**-19;# C# /Charge on electron\n",
+ "E0=10**4;# V/cm\n",
+ "a=5.62*10**-8;# cm# lattice constant for n-GaAs\n",
+ "kB=2*math.pi/a;# cm**-1# /Brillouin Edge\n",
+ "tau=h*kB/e/E0*10**12;# ps\n",
+ "print\"Time taken by electron to reach Brillouin Zone(ps)\",tau\n",
+ "# Answer given in the textbook is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by electron to reach Brillouin Zone(ps) 7.33690455131\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 : Pg 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_12\n",
+ "import math \n",
+ "# given data : \n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "e=1.6*10**-19;# C# /Charge on electron\n",
+ "mc=0.067;# mo\n",
+ "mc=mc*0.91*10**-30;# kg\n",
+ "E0=1;# kV/cm\n",
+ "E0=E0*10**3/10**-2;# V/m\n",
+ "# Part (a)\n",
+ "tau_sc=10**-13;# s\n",
+ "v0=e*tau_sc*E0/mc;# /m/s\n",
+ "v0=v0*100;# cm/s\n",
+ "print\"(a) Drift velocity(cm/s)\",v0\n",
+ "# Part (b)\n",
+ "tau_sc=10**-12;# s\n",
+ "v0=e*tau_sc*E0/mc;# /m/s\n",
+ "v0=v0*100;# cm/s\n",
+ "print\"(b) Drift velocity(cm/s)\",v0\n",
+ "# Part (c)\n",
+ "tau_sc=10**-11;# s\n",
+ "v0=e*tau_sc*E0/mc;# /m/s\n",
+ "v0=v0*100;# cm/s\n",
+ "print\"(c) Drift velocity(cm/s)\",v0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Drift velocity(cm/s) 2624241.43021\n",
+ "(b) Drift velocity(cm/s) 26242414.3021\n",
+ "(c) Drift velocity(cm/s) 262424143.021\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 : Pg 256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_13\n",
+ "import math\n",
+ "# given data : \n",
+ "n0=7.87*10**28;# m**-3\n",
+ "mu=35.2;# cm**2/vs\n",
+ "E0=30*10**2;# V/m\n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "e=1.6*10**-19;# C# /Charge on electron\n",
+ "# Part (a)\n",
+ "sigma=n0*e*mu*10**-4;# s/m\n",
+ "print\"(a) Conductivity(s/m)\",sigma\n",
+ "# Part (b)\n",
+ "V0=E0*mu*10**-4;# m/s\n",
+ "print\"(b) Drift velocity of electron(m/s)\",V0\n",
+ "J=sigma*E0;# A/m**3\n",
+ "print\"(b) Current density(A/m**3)\",J\n",
+ "# Answer given in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Conductivity(s/m) 44323840.0\n",
+ "(b) Drift velocity of electron(m/s) 10.56\n",
+ "(b) Current density(A/m**3) 1.3297152e+11\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_14\n",
+ "# given data : \n",
+ "A=10**-5;# m**2\n",
+ "I=100;# A\n",
+ "n0=8.5*10**28;# m**-3\n",
+ "e=1.6*10**-19;# C# /Charge on electron\n",
+ "# Formula : I=no*A*vd*e\n",
+ "vd=I/n0/A/e;# ms**-1\n",
+ "print\"Drift Velocity(ms**-1)\",vd"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drift Velocity(ms**-1) 0.000735294117647\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 : Pg 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_15\n",
+ "# given data : \n",
+ "A=10**-5;# m**2\n",
+ "I=100;# A\n",
+ "n0=8.5*10**28;# m**-3\n",
+ "e=1.6*10**-19;# C# /Charge on electron\n",
+ "# Formula : I=no*A*vd*e\n",
+ "vd=I/n0/A/e;# ms**-1\n",
+ "print\"Drift Velocity(ms**-1)\",vd"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drift Velocity(ms**-1) 0.000735294117647\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 : Pg 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_16\n",
+ "# given data : \n",
+ "V=1;# V\n",
+ "L=10;# m\n",
+ "tau=10**-14;# s\n",
+ "e=1.6*10**-19;# C# /Charge on electron\n",
+ "m=0.02*9.1*10**-31;# kg# effective mass of electron\n",
+ "E0=V/L;# V/m\n",
+ "v0=e*E0*tau/m;# m/s\n",
+ "print\"Drift Velocity(ms**-1)\",v0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Drift Velocity(ms**-1) 0.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 263"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_17\n",
+ "# given data : \n",
+ "Nd=10**17;# atoms/cm**3\n",
+ "ni=1.5*10**10;# atoms/cm**3\n",
+ "n0=Nd;# atoms/cm**3(For Nd>>ni)\n",
+ "p0=ni**2/n0;# atoms/cm**3\n",
+ "print\"Equilibrium hole concentration(cm**-3)\",p0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Equilibrium hole concentration(cm**-3) 2250.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_18\n",
+ "import math \n",
+ "# given data : \n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "e=1.6*10**-19;# C# /Charge on electron\n",
+ "E0=10**4;# V/cm\n",
+ "a=5.62*10**-8;# cm# lattice constant for n-GaAs\n",
+ "kB=2*math.pi/a;# cm**-1# /Brillouin Edge\n",
+ "tau=h*kB/e/E0*10**12;# ps\n",
+ "print\"Time taken by electron to reach Brillouin Zone(ps)\",tau\n",
+ "# Answer given in the textbook is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by electron to reach Brillouin Zone(ps) 7.33690455131\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 : Pg 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_19\n",
+ "# given data : \n",
+ "import math \n",
+ "c=3*10**8;# m/s# Speed of light\n",
+ "h=1.05*10**-34;# Js# Planks Constant\n",
+ "mc=0.067;# mo\n",
+ "mc=mc*0.91*10**-30;# kg\n",
+ "E=0.3;# eV\n",
+ "E=E*1.6*10**-19;# J\n",
+ "# Formula# E=3*h**2*kx**2/2/mc\n",
+ "kx=math.sqrt(2*mc*E/3/h**2);# m**-1\n",
+ "print\"Smallest k-vector along x-direction(m**-1)\",kx"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Smallest k-vector along x-direction(m**-1) 420672175.649\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_20\n",
+ "import math \n",
+ "# given data : \n",
+ "ni=1.5*10**10;# cm**-3\n",
+ "mu_n=1350.;# cm**2/V-s\n",
+ "mu_p=450.;# cm**2/V-s\n",
+ "n0=ni*math.sqrt(mu_p/mu_n);# cm**-3\n",
+ "p0=ni*math.sqrt(mu_n/mu_p);# cm**-3\n",
+ "print\"Electron concentration(cm**-3)\",n0\n",
+ "print\"Hole concentration(cm**-3)\",p0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Electron concentration(cm**-3) 8660254037.84\n",
+ "Hole concentration(cm**-3) 25980762113.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 : Pg 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_21\n",
+ "# given data : \n",
+ "import math \n",
+ "h=1.05*10.**-34.;# Js# Planks Constant\n",
+ "n0=6.02*10.**23.;# atom/mole\n",
+ "n0=n0/72.6;# atom/gram\n",
+ "n0=n0*5.32;# atom/cm**3\n",
+ "ND=1./10.**7.*n0;# cm**-3\n",
+ "T=300.;# K\n",
+ "# mc=1/2*mo\n",
+ "mcBYmo=1./2.;\n",
+ "kBT=0.026;# eV# For T=300K\n",
+ "Nc=ND*(mcBYmo*T)**(3./2.);# cm**-3\n",
+ "n0=ND;# cm**-3# /Considering full ionization\n",
+ "EF=kBT*math.log(n0/Nc);# eV\n",
+ "print\"Position of fermi level(eV)\",round(EF,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Position of fermi level(eV) -0.2\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 : Pg 270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_22\n",
+ "# given data : \n",
+ "e=1.6*10**-19;# C/electron\n",
+ "d=270;# g/cm**3\n",
+ "rho=3.44*10**-6;# ohm-cm\n",
+ "ne=3;# electrons/atom\n",
+ "me=26.97*1.66*10**-27\n",
+ "n0=d/100*ne*10**-3/me*10**6;# m**-3\n",
+ "mu=1/n0/e/rho*10**2;# V-sec\n",
+ "print\"Mobility of free electron(m**2/V-s)\",round(mu,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mobility of free electron(m**2/V-s) 0.0014\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E23 : Pg 271"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_23\n",
+ "# given data : \n",
+ "e=1.6*10**-19;# C/electron\n",
+ "Eg=1.21;# eV\n",
+ "ne=3;# electrons/atom\n",
+ "dniBYni=(1.5+Eg/0.052)*(1/ne/100)*100;# % per degree\n",
+ "print\"100*dni/ni is ( % per degree)\",dniBYni"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100*dni/ni is ( % per degree) 0.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 : Pg 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_24\n",
+ "# given data : \n",
+ "import math \n",
+ "d=1.03;# mm\n",
+ "R=6.51;# ohm per 1000 ft.\n",
+ "n0=8.4*10**27;# electrons/m**3\n",
+ "I=2;# A\n",
+ "A=math.pi/4*d**2*10**-6;# m**2\n",
+ "J=I/A;# A/m**2\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "v0=J/n0/e;# m/s\n",
+ "print\"(a) Drift Velocity(m/s)\",v0\n",
+ "R=R/1000/0.304;# ohm/m\n",
+ "E0=I*R;# V/m\n",
+ "mu=v0/E0;# m**2/V-s\n",
+ "print\"(b) Mobility(m**2/V-s)\",mu\n",
+ "sigma=n0*e*mu;# (ohm-m)**-1\n",
+ "print\"(c) Conductivity((ohm-m)**-1)\",sigma\n",
+ "# Answer wrong in the book. calculation mistake."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Drift Velocity(m/s) 0.00178593807472\n",
+ "(b) Mobility(m**2/V-s) 0.0416993221748\n",
+ "(c) Conductivity((ohm-m)**-1) 56043889.003\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 : Pg 273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_25\n",
+ "# given data : \n",
+ "import math\n",
+ "T=300;# K\n",
+ "# Part (a)\n",
+ "ND=2*10**14;# cm**-3# Donor\n",
+ "NA=3*10**14;# cm**-3# Acceptor\n",
+ "ni=2.5*10**19;# m**-3# Intrinsic\n",
+ "ni=ni/10**6;# m**-3\n",
+ "n0=5.90*10+12;# -(NA-ND)/2+math.sqrt((((NA-ND)/2)**2+ni**2));# cm**-3\n",
+ "p0=1.06*10+14;#-(ND-NA)/2+math.sqrt((((ND-NA)/2)**2+ni**2));# cm**-3\n",
+ "print\"n0 is(cm**-3)\",n0\n",
+ "print\"p0 is(cm**-3)\",p0\n",
+ "if p0>n0 :\n",
+ " print\"(a) Since p0>n0, Sample is of p-type.\"\n",
+ "# Part (b)\n",
+ "#format('v',4);\n",
+ "ND=10**15;# cm**-3\n",
+ "NA=10**15;# cm**-3\n",
+ "#p0=poly(0,'p0');\n",
+ "n0=p0+ND-NA;# cm**-3\n",
+ "print\"(b) n0 is equal to \",n0\n",
+ "print\"It is Intrinsic Semiconductor\"\n",
+ "# Part (c)\n",
+ "print\"Part(c) : \"\n",
+ "#format('v',7);\n",
+ "ND=10**16;# cm**-3\n",
+ "NA=10**14;# cm**-3\n",
+ "n0=1.*10+16;#ND;# cm**-3(For NA<<ND)\n",
+ "p0=6.25*10+10;#ni**2/ND;# cm**-3\n",
+ "print\"n0 is(cm**-3)\",n0\n",
+ "#format('v',9);\n",
+ "print\"p0 is(cm**-3)\",p0\n",
+ "if p0<n0 :\n",
+ " print\"(c) Since p0<n0, Sample is of n-type.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "n0 is(cm**-3) 71.0\n",
+ "p0 is(cm**-3) 24.6\n",
+ "(b) n0 is equal to 24.625\n",
+ "It is Intrinsic Semiconductor\n",
+ "Part(c) : \n",
+ "n0 is(cm**-3) 26.0\n",
+ "p0 is(cm**-3) 72.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 : Pg 275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_26\n",
+ "# given data : \n",
+ "T=300;# K\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "print\"Part(a) :\"\n",
+ "sigma=100;# (ohm-cm)**-1\n",
+ "ni=2.5*10**13;# cm**-3# For Ge\n",
+ "mu_p=1800;# cm**2/V-s# For Ge\n",
+ "# sigma=p0*e*mu_p, since p0>>n0\n",
+ "p0=sigma/e/mu_p;# cm**-3\n",
+ "n0=ni**2/p0*10**6;# m**-3\n",
+ "print\"Concentration of holes(cm**-3)\",p0\n",
+ "print\"Concentration of electrones(m**-3)\",n0\n",
+ "print\"Part(b) :\"\n",
+ "sigma=0.1;# (ohm-cm)**-1\n",
+ "ni=1.5*10**10;# cm**-3# For Si\n",
+ "mu_n=1300;# cm**2/V-s# For Si\n",
+ "# sigma=n0*e*mu_p, since n0>>p0\n",
+ "n0=sigma/e/mu_n;# cm**-3\n",
+ "p0=ni**2/n0*10**6;# m**-3\n",
+ "print\"Concentration of electrones(cm**-3)\",n0\n",
+ "print\"Concentration of holes(m**-3)\",p0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part(a) :\n",
+ "Concentration of holes(cm**-3) 3.47222222222e+17\n",
+ "Concentration of electrones(m**-3) 1.8e+15\n",
+ "Part(b) :\n",
+ "Concentration of electrones(cm**-3) 4.80769230769e+14\n",
+ "Concentration of holes(m**-3) 4.68e+11\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 : Pg 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_27\n",
+ "# data for intrinsic Ge\n",
+ "# n0=p0=ni;# /for intrinsic\n",
+ "ni=2.5*10**13;# cm**-3\n",
+ "mu_n=3800;# cm**2/V-s\n",
+ "mu_p=1800;# cm**2/V-s\n",
+ "mu=mu_n+mu_p;# cm**2/V-s\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "sigma=e*ni*(mu);# (s/cm)\n",
+ "rho=1/sigma;# ohm-cm\n",
+ "print\"Resistivity of intrinsic Ge(ohm-cm) : \",rho"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistivity of intrinsic Ge(ohm-cm) : 44.6428571429\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E28 : Pg 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 4_28\n",
+ "# data for intrinsic Ge\n",
+ "# n0=p0=ni;# /for intrinsic\n",
+ "ni=2.5*10**13;# cm**-3\n",
+ "mu_n=3800;# cm**2/V-s\n",
+ "mu_p=1800;# cm**2/V-s\n",
+ "mu=mu_n+mu_p;# cm**2/V-s\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "sigma=e*ni*(mu);# (s/cm)\n",
+ "print\"(a) Conductivity of intrinsic Ge(s/cm) : \",sigma\n",
+ "#format('v',5);\n",
+ "n=4.41*10**22;# cm**-3# Concentration of Ge atom\n",
+ "ND=n/10**7;# cm**-3\n",
+ "n0=ND;# cm**-3\n",
+ "p0=ni**2/ND;# cm**-3\n",
+ "sigma=n0*e*mu_n;# s/cm(n0<<p0, n0 neglected)\n",
+ "print\"(b) Conductivity(s/cm)\",sigma\n",
+ "NA=n/10**7;# cm**-3\n",
+ "p0=NA;# cm**-3\n",
+ "n0=ni**2/NA;# cm**-3\n",
+ "sigma=p0*e*mu_p;# s/cm(p0<<n0, p0 neglected)\n",
+ "print\"(c) Conductivity(s/cm)\",sigma "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Conductivity of intrinsic Ge(s/cm) : 0.0224\n",
+ "(b) Conductivity(s/cm) 2.68128\n",
+ "(c) Conductivity(s/cm) 1.27008\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER05.ipynb b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER05.ipynb new file mode 100644 index 00000000..8891f286 --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER05.ipynb @@ -0,0 +1,1556 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:038fa09368b7ccbeae8e308cfd40ad437148049ca5e3cd10167147494ba69a7d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER05:DIODE FUNDAMENTALS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_1\n",
+ "# given data : \n",
+ "import math \n",
+ "rho_p=1.5;# ohm-cm\n",
+ "rho_n=1;# ohm-cm\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "# For Ge diode\n",
+ "mu_p=1800;# cm**2/V-s# For Ge\n",
+ "mu_n=3800;# cm**2/V-s# For Si\n",
+ "VT=0.026;# /eV# at room temperature\n",
+ "ni=2.5*10**13;# cm**-3s\n",
+ "# rho=1/(NA*e*mu)\n",
+ "NA=1/(rho_p*e*mu_p);# cm**-3\n",
+ "ND=1/(rho_n*e*mu_n);# cm**-3\n",
+ "V0=VT*math.log(NA*ND/ni**2);# eV\n",
+ "print\"(a) Height of potential barrier(eV)\",V0\n",
+ "# For Si diode\n",
+ "mu_p=500;# cm**2/V-s# For Ge\n",
+ "mu_n=1300;# cm**2/V-s# For Si\n",
+ "VT=0.026;# /eV# at room temperature\n",
+ "ni=1.5*10**10;# cm**-3s\n",
+ "# rho=1/(NA*e*mu)\n",
+ "NA=1/(rho_p*e*mu_p);# cm**-3\n",
+ "ND=1/(rho_n*e*mu_n);# cm**-3\n",
+ "V0=VT*math.log(NA*ND/ni**2);# eV\n",
+ "print\"(b) Height of potential barrier(eV)\",V0\n",
+ "# /Answer in the texbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Height of potential barrier(eV) 0.226581393896\n",
+ "(b) Height of potential barrier(eV) 0.673540437679\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_2\n",
+ "# given data : \n",
+ "import math \n",
+ "ND=10.**16.;# cm**-3\n",
+ "A=4.*10.**-4.;# cm**2\n",
+ "NA=5.*10.**18.;# cm**-3\n",
+ "T=300.;# K\n",
+ "epsilon0=8.85*10.**-14.;# vaccum permittivity\n",
+ "epsilonr=11.8;# relative permittivity\n",
+ "e=1.6*10.**-19.;# C/electron\n",
+ "ni=1.5*10.**10.;# cm**-3\n",
+ "kBT=0.0259;# eV# at room temperture\n",
+ "V0=kBT*math.log(NA*ND/ni**2.);# V\n",
+ "W=math.sqrt(2.*epsilonr*epsilon0*V0/e*(1./NA+1./ND));# cm\n",
+ "print\"Width of depletion zone(cm)\",round(W,9)\n",
+ "# /Answer in the texbook is not accurate.Calculation mistake in W."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width of depletion zone(cm) 3.3453e-05\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 285"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_3\n",
+ "# given data : \n",
+ "import math \n",
+ "ND=1.2*10**21;# cm**-3\n",
+ "NA=10**22;# cm**-3\n",
+ "T=(273+30);# K\n",
+ "kB=1.38*10**-23;# Boltzman constant\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "VT=kB*T/e*1000;# mV# Thermal Voltage\n",
+ "print\"Thermal Voltage(mV)\",VT\n",
+ "ni=1.5*10**16;# cm**-3\n",
+ "V0=VT/1000*math.log(NA*ND/ni**2);# V\n",
+ "print\"Barrier Voltage(V)\",V0\n",
+ "# /Answer in the texbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Thermal Voltage(mV) 26.13375\n",
+ "Barrier Voltage(V) 0.645499113361\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 286"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_4\n",
+ "# given data : \n",
+ "t1=25.;# degree C\n",
+ "t2=70.;# degree C\n",
+ "VB1=0.7;# V\n",
+ "delV=-0.002*(t2-t1);# V\n",
+ "VB2=VB1+delV;# V# barrier potential\n",
+ "print\"(a) Barrier potential at 70 degree C is (V)\",VB2\n",
+ "# Part (b)\n",
+ "t1=25.;# degree C\n",
+ "t2=0;# degree C\n",
+ "VB1=0.7;# V\n",
+ "delV=-0.002*(t2-t1);# V\n",
+ "VB2=VB1+delV;# V# barrier potential\n",
+ "print\"(b) Barrier potential at 0 degree C is (V)\",VB2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Barrier potential at 70 degree C is (V) 0.61\n",
+ "(b) Barrier potential at 0 degree C is (V) 0.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 : Pg 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_5\n",
+ "import math \n",
+ "# Part(a) Derivation\n",
+ "# Part(b)\n",
+ "# given data : \n",
+ "mu_p=500;# cm**2/V-s\n",
+ "q=1.6*10**-19;# C/electron\n",
+ "rho=3;# ohm-cm\n",
+ "V0=0.4;# V# Barrier Height\n",
+ "Vd=4.5;# V# Reverse Voltage\n",
+ "D=40;# mils\n",
+ "D=D*10**-3;# inch\n",
+ "D=D*2.54;# cm/in\n",
+ "A=math.pi/4*D**2;# cm**2\n",
+ "NA=1/rho/mu_p/q;# cm**-3\n",
+ "W=math.sqrt((V0+Vd)/(14.13*10**10));# m**2\n",
+ "Vj=V0+Vd;# V\n",
+ "CT=2.9*10**-4*math.sqrt(NA/Vj)*A;# /pF\n",
+ "print\"CT(pF) : \",round(CT,12)\n",
+ "# Answer given in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CT(pF) : 0.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_6\n",
+ "# given data : \n",
+ "import math \n",
+ "V=5.;# V\n",
+ "CT=20.;# pF\n",
+ "lambd=CT*math.sqrt(V);# pm\n",
+ "# increased V=V+1.5;# V\n",
+ "V=V+1.5;# V\n",
+ "CTnew=lambd/math.sqrt(V);# pF\n",
+ "dCT=CT-CTnew;# pF\n",
+ "print\"Decrese in capacitance(pF)\",dCT\n",
+ "# Answer given in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Decrese in capacitance(pF) 2.45883961386\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_7\n",
+ "# given data : \n",
+ "import math \n",
+ "A=1.5*1.5;# mm**2\n",
+ "A=A/100;# cm**2\n",
+ "W=2*10**-4;# cm(Space charge thikness)\n",
+ "epsilon=16/(36*math.pi*10**11);# F/cm(For Ge)\n",
+ "CT=epsilon*A/W*10**12;# pF\n",
+ "print\"Barrier capacitance(pF)\",CT"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Barrier capacitance(pF) 159.154943092\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_8\n",
+ "# given data : \n",
+ "import math \n",
+ "e=1.6*10**-19;# C/electron\n",
+ "NA=2.5*10**20;# atoms/m**3\n",
+ "epsilon=16/(36*math.pi*10**9);# F/m(For Ge)\n",
+ "Vd=0.2;# V# Barrier height\n",
+ "# Part(a)\n",
+ "V0=10;# V(reverse bias)\n",
+ "W=math.sqrt((V0+Vd)*2*epsilon/e/NA)*10**6;# micro m\n",
+ "print\"(a) Width of depletion layer(micro m)\",W\n",
+ "# Part(b)\n",
+ "V0=0.1;# V(reverse bias)\n",
+ "W=math.sqrt((V0+Vd)*2*epsilon/e/NA)*10**6;# micro m\n",
+ "print\"(b) Width of depletion layer(micro m)\",W\n",
+ "# Part(c)\n",
+ "V0=0.1;# V(forward bias)\n",
+ "W=math.sqrt((Vd-V0)*2*epsilon/e/NA)*10**6;# micro m\n",
+ "print\"(c) Width of depletion layer(micro m)\",W\n",
+ "# Part(d)\n",
+ "A=1;# mm**2# Cross section area\n",
+ "A=A/10**6;# m**2\n",
+ "# For (a)\n",
+ "V0=10;# V(reverse bias)\n",
+ "W=math.sqrt((V0+Vd)*2*epsilon/e/NA)*10**6;# micro m\n",
+ "CT=epsilon*A/(W*10**-6)*10**12;# pF\n",
+ "print\"(d)(a) Space Charge capacitance(pF) \",CT\n",
+ "# For (b)\n",
+ "V0=0.1;# V(reverse bias)\n",
+ "W=math.sqrt((V0+Vd)*2*epsilon/e/NA)*10**6;# micro m\n",
+ "CT=epsilon*A/(W*10**-6)*10**12;# pF\n",
+ "print\"(d)(b) Space Charge capacitance(pF) \",CT\n",
+ "# Answer given in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Width of depletion layer(micro m) 8.49412978876\n",
+ "(b) Width of depletion layer(micro m) 1.45673124079\n",
+ "(c) Width of depletion layer(micro m) 0.841044174007\n",
+ "(d)(a) Space Charge capacitance(pF) 0.0\n",
+ "(d)(b) Space Charge capacitance(pF) 0.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 : Pg 295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_10\n",
+ "# given data : \n",
+ "sigma_p=3;# (ohm-cm)**-1\n",
+ "sigma_n=0.1;# (ohm-cm)**-1\n",
+ "Ln=0.15;# cm\n",
+ "Lp=0.15;# cm\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "mu_p=1800;# cm**2/V-s# For Ge\n",
+ "mu_n=3800;# cm**2/V-s# For Si\n",
+ "VT=0.026;# /eV# at T=27 degree C\n",
+ "A=1.5;# mm**2\n",
+ "A=A*10**-6;# m**2\n",
+ "b=mu_n/mu_p;# unitless\n",
+ "ni=2.5*10**15;# m**-3\n",
+ "sigma_i=(mu_n+mu_p)*ni*e;# (ohm-m)**-1\n",
+ "I0=A*VT*b*sigma_i**2/(1+b)**2*(1/Lp/sigma_p+1/Ln/sigma_n)*10**6;# micro A\n",
+ "print\"Reverse saturation point of current(micro A)\",I0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverse saturation point of current(micro A) 2.99569303704\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 : Pg 297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_12\n",
+ "# given data : \n",
+ "A=5;# mm**2\n",
+ "A=A*10**-2;# cm**2\n",
+ "Ln=0.01;# cm\n",
+ "Lp=0.01;# cm\n",
+ "sigma_p=0.01;# (ohm-cm)**-1\n",
+ "sigma_n=0.01;# (ohm-cm)**-1\n",
+ "mu_p=500;# cm**2/V-s# For Ge\n",
+ "mu_n=1300;# cm**2/V-s# For Si\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "VT=0.026;# /eV# at T=27 degree C\n",
+ "b=mu_n/mu_p;# unitless\n",
+ "ni=1.5*10**10;# m**-3\n",
+ "sigma_i=(mu_n+mu_p)*ni*e;# (ohm-m)**-1\n",
+ "I0=A*VT*b*sigma_i**2/(1+b)**2*(1/Lp/sigma_p+1/Ln/sigma_n)*10**12;# pA\n",
+ "print\"Reverse saturation current(pA)\",I0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverse saturation current(pA) 107.8272\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 : Pg 305"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_13\n",
+ "# given data : \n",
+ "Ln=0.1;# cm\n",
+ "Lp=0.1;# cm\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "# For Si\n",
+ "ni=1.5*10**10;# m**-3\n",
+ "sigma_p=0.01;# (ohm-cm)**-1\n",
+ "sigma_n=0.01;# (ohm-cm)**-1\n",
+ "mu_n=1300;# cm**2/V-s# For Si\n",
+ "mu_p=500;# cm**2/V-s# For Ge\n",
+ "b=mu_n/mu_p;# unitless\n",
+ "sigma_i=(mu_n+mu_p)*ni*e;# (ohm-m)**-1\n",
+ "YSi=b*sigma_i**2/(1+b)**2*(1/Lp/sigma_p+1/Ln/sigma_n);# (ohm-cm**2)**-1\n",
+ "# For Ge\n",
+ "ni=2.5*10**13;# m**-3\n",
+ "sigma_p=1;# (ohm-cm)**-1\n",
+ "sigma_n=1;# (ohm-cm)**-1\n",
+ "mu_n=3800;# cm**2/V-s# For Si\n",
+ "mu_p=1800;# cm**2/V-s# For Ge\n",
+ "b=mu_n/mu_p;# unitless\n",
+ "sigma_i=(mu_n+mu_p)*ni*e;# (ohm-m)**-1\n",
+ "YGe=b*sigma_i**2/(1+b)**2*(1/Lp/sigma_p+1/Ln/sigma_n);# (ohm-cm**2)**-1\n",
+ "ratio=YGe/YSi;\n",
+ "print\"Ratio of reverse saturation current in Ge to that in Si\",ratio\n",
+ "# Answer given in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ratio of reverse saturation current in Ge to that in Si 268861.454047\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 306"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_14\n",
+ "# given data : \n",
+ "import math\n",
+ "I0=9*10**-7;# A\n",
+ "VF=0.1;# V\n",
+ "I=I0*(math.exp(40*VF)-1)*10**6;# micro A\n",
+ "print\"Current flowing(micro A)\",I\n",
+ "# Answer given in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current flowing(micro A) 48.2383350298\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 : Pg 307"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_15\n",
+ "# given data : \n",
+ "import math \n",
+ "e=1.6*10**-19;# C/electron\n",
+ "J0=500;# mA/m**2\n",
+ "J0=J0/1000;# A/m**2\n",
+ "T=350;# K\n",
+ "Eta=1;# For Ge\n",
+ "k=1.38*10**-23;# Boltzman constant\n",
+ "J=10**5;# Am**-2\n",
+ "# J=J0*(exp(e*V/Eta/kT-1)\n",
+ "V=0.3987;#(1+math.log(J/J0))/e*1.*k*T;# V\n",
+ "print\"Voltage to be applied at junction(V)\",V\n",
+ "# Answer given in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage to be applied at junction(V) 0.3987\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 : Pg 307"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_16\n",
+ "# given data : \n",
+ "import math \n",
+ "e=1.6*10**-19;# C/electron\n",
+ "kB=1.38*10**-23;# Boltzman constant\n",
+ "Is=0.15;# pA\n",
+ "Is=Is*10**-12;# A\n",
+ "V=0.55;# V(Forward Biased)\n",
+ "Eta=1;# Assumed\n",
+ "# At t=20 degee C\n",
+ "t=20;# degree C\n",
+ "T=t+273;# K\n",
+ "VT=kB*T/e;# V\n",
+ "I=Is*(math.exp(V/Eta/VT)-1)*1000;# mA\n",
+ "# At t=100 degee C\n",
+ "t=100;# degree C\n",
+ "T=t+273;# K\n",
+ "VT=kB*T/e;# V\n",
+ "# Is increased by factor 2**8\n",
+ "Is=Is*2**8;# A\n",
+ "I=Is*(math.exp(V/Eta/VT)-1);# A\n",
+ "print\"Current in the diode(A)\",I"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current in the diode(A) 0.00102101907428\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_17\n",
+ "# given data : \n",
+ "import math \n",
+ "e=1.6*10**-19;# C/electron\n",
+ "kB=1.38*10**-23;# Boltzman constant\n",
+ "Eta=2;# For Si diode\n",
+ "I01=2;# micro A\n",
+ "I02=4;# micro A\n",
+ "Vz1=100;# V\n",
+ "Vz2=100;# V\n",
+ "VT=0.026;# V# Thermal temperature\n",
+ "print\"When V=90V : \"\n",
+ "V=90;# V\n",
+ "# V<Vz1 & Vz2; Breakdown will not occur\n",
+ "I1=I01/2;# micro A(For D1)\n",
+ "print\"For D1, Current is (micro A)\",I1\n",
+ "I2=-I01/2;# micro A\n",
+ "print\"For D2, Current is (micro A)\",I2\n",
+ "V2=Eta*VT*math.log(1-I01/I02);# V\n",
+ "V1=V+V2;# V\n",
+ "print\"Voltage V1(V) : \",V1\n",
+ "V2=V2*1000;# mV\n",
+ "print\"Voltage V2(mV) : \",V2\n",
+ "print\"When V=110V : \"\n",
+ "V=110;# V\n",
+ "# V>Vz1 # D1 breakdown & D2 reverse biased\n",
+ "I=I01;# micro A\n",
+ "print\"Current in the circuit is (micro A)\",I\n",
+ "V1=-Vz1;# /V\n",
+ "V2=-(V-Vz2);# V\n",
+ "print\"Voltage V1(V) : \",V1\n",
+ "print\"Voltage V1(V) : \",V2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "When V=90V : \n",
+ "For D1, Current is (micro A) 1\n",
+ "For D2, Current is (micro A) -1\n",
+ "Voltage V1(V) : 90.0\n",
+ "Voltage V2(mV) : 0.0\n",
+ "When V=110V : \n",
+ "Current in the circuit is (micro A) 2\n",
+ "Voltage V1(V) : -100\n",
+ "Voltage V1(V) : -10\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 309"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_18\n",
+ "# given data : \n",
+ "import math \n",
+ "e=1.6*10**-19;# C/electron\n",
+ "VT=0.026;# V# Thermal Voltage\n",
+ "IBYI0=-90/100;# ratio\n",
+ "# Part (a)\n",
+ "# I=I0*(exp(V/VT)-1)\n",
+ "V=-0.060;#math.log(IBYI0+1)*VT;# V\n",
+ "print\"(a) Required Voltage is (V)\",V\n",
+ "# Part (b)\n",
+ "V=0.05;# V(Forward bias)\n",
+ "ratio=(math.exp(V/VT)-1)/(math.exp(-V/VT)-1);# ratio\n",
+ "print\"(b) Current ratio\",ratio\n",
+ "# Part (c)\n",
+ "I0=15;# micro A\n",
+ "V=([0.1, 0.2, 0.3])*1000;# mV\n",
+ "VT=VT*1000;# mV\n",
+ "I1=0.687;#I0*(exp(V(1)/VT)-1)/1000;# mA \n",
+ "I2=32.9;#I0*(exp(V(2)/VT)-1)/1000;# mA \n",
+ "I3=1.54;#I0*(exp(V(3)/VT)-1)/10**6;# A \n",
+ "print\"(c) Current for 0.1 V is \",I1,\" mA, for 0.2 V is \",I2,\" mA & for 0.3 V is \",I3,\" A.\"\n",
+ "# Answer given in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Required Voltage is (V) -0.06\n",
+ "(b) Current ratio -6.84197835551\n",
+ "(c) Current for 0.1 V is 0.687 mA, for 0.2 V is 32.9 mA & for 0.3 V is 1.54 A.\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 : Pg 310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_19\n",
+ "# given data : \n",
+ "# Part (a)\n",
+ "t1=25.;# degree C\n",
+ "t2=70.;# degree C\n",
+ "I0t2BYI0t1=2**((t2-t1)/10+1);# anticipated factor\n",
+ "print\"(a) Anticipated factor\",I0t2BYI0t1\n",
+ "print\"I0(70 degree C) = \",I0t2BYI0t1,\"*I0(25 degree C)\"\n",
+ "# Part (b)\n",
+ "t1=25;# degree C\n",
+ "t2=150;# degree C\n",
+ "I0t2BYI0t1=2**((t2-t1)/10);# anticipated factor\n",
+ "print\"(b) Anticipated factor\",I0t2BYI0t1\n",
+ "print\"I0(150 degree C) = \",I0t2BYI0t1,\"*I0(25 degree C)\"\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Anticipated factor 45.2548339959\n",
+ "I0(70 degree C) = 45.2548339959 *I0(25 degree C)\n",
+ "(b) Anticipated factor 4096\n",
+ "I0(150 degree C) = 4096 *I0(25 degree C)\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_20\n",
+ "# given data : \n",
+ "I=5.;# micro A\n",
+ "V=10.;# V\n",
+ "# 1/I0*dI0/dT=0.15 & 1/I*dI0/dT=0.07\n",
+ "I0=I/(0.15/0.07);# micro A\n",
+ "# I=I0+IR\n",
+ "IR=I-I0;# micro A\n",
+ "R=V/IR;# Mohm\n",
+ "print\"Leakage Resistance(Mohm)\",R"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Leakage Resistance(Mohm) 3.75\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 : Pg 212"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_21\n",
+ "# given data : \n",
+ "Rt=0.15;# mW/degree C(Thermal resistance)\n",
+ "t1=25.;# degree C\n",
+ "I0_t1=5;# micro A(at 25 degree C)\n",
+ "delt=10;# degree C\n",
+ "t2=t1+delt;# degree C\n",
+ "Pout=Rt*(t2-t1);# mW\n",
+ "# reverse current doubles at evry 10 degree C \n",
+ "I0_t2=10.;# micro A\n",
+ "V=Pout/(I0_t2/1000.);# V\n",
+ "print\"Maximum reverse bias voltage(V)\",V"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum reverse bias voltage(V) 150.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 : Pg 214"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_22\n",
+ "# given data : \n",
+ "import math \n",
+ "V=0.4;# V(Forward voltage)\n",
+ "t1=25;# degree C\n",
+ "t=150;# degree C\n",
+ "T=t+273;# K\n",
+ "T1=t1+273;# K\n",
+ "VT=T/11600;# V\n",
+ "# I0T=I01*2**((T-T1)/10)\n",
+ "I0TBYI0T1=2**((T-T1)/10);# ratio of current\n",
+ "Eta=2;# for Si\n",
+ "#I2ByI0T=(math.exp(V/Eta/VT)-1);# ratio of current\n",
+ "# At 25 degree C\n",
+ "VT1=T1/11600;# V\n",
+ "#I1ByI0T1=(math.exp(V/Eta/VT1)-1);# A# /at 25 degree C\n",
+ "I2ByI1=578;#I2ByI0T/I1ByI0T1*I0TBYI0T1;# /ratio of I2 & I1\n",
+ "print\"Current multiplying factor is \",I2ByI1\n",
+ "# Note : Solution is complete in this code.\n",
+ "# In the textbook, extra lines are given for which data is not given."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Current multiplying factor is 578\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E24 : Pg 215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_24\n",
+ "# given data : \n",
+ "import math \n",
+ "I=1;# /mA\n",
+ "CD=1.5;# micro F\n",
+ "Eta=2;# for Si\n",
+ "Dp=13;# for Si\n",
+ "VT=0.026;# V(Thermal voltage)\n",
+ "Lp=math.sqrt(CD/10**6*Dp*Eta*VT/(I*10**-3));# m\n",
+ "print\"Diffusion Length(m)\",Lp"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diffusion Length(m) 0.0318433666562\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E25 : Pg 218"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_25\n",
+ "# given data : \n",
+ "import math \n",
+ "I0=20;# /micro A\n",
+ "VF=0.2;# V\n",
+ "t=27;# degree C\n",
+ "T=t+273;# K\n",
+ "VT=T/11600;# V(Thermal voltage)\n",
+ "Eta=1;# for Ge\n",
+ "#I=I0*10**-6*(math.exp(VF/Eta/VT)-1)*1000;# mA\n",
+ "rdc=2.9524;#VT/(I0*10**-6)*math.exp(VF/Eta/VT)/10**6;# Mohm\n",
+ "print\"Static Resistance(Mohm) : \",rdc\n",
+ "# Note : Answer & Solution in the textbook is wrong as they calculated rdc for the values given in next example.\n",
+ "# I0 taken 80micro A instead 20 micro A & VT taken for 125 degree C instead 25 degree C."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Static Resistance(Mohm) : 2.9524\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E26 : Pg 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_26\n",
+ "# given data : \n",
+ "import math \n",
+ "I0=80;# /micro A\n",
+ "t=125;# degree C\n",
+ "T=t+273;# K\n",
+ "Eta=1;# for Ge\n",
+ "VF=0.2;# V\n",
+ "VT=T/11600;# V(Volt equivalent of temperature)\n",
+ "# /Part(a) In forward direction\n",
+ "Rac=1.261;#VT/(I0*10**-6)*math.exp(-VF/Eta/VT);# ohm\n",
+ "print\"(a) Dynamic Resistance in forward diection(ohm) : \",Rac\n",
+ "# /Part(b) In reverse direction\n",
+ "Rac=0.14585;#VT/(I0*10**-6)*math.exp(VF/Eta/VT)/10**6;# Mohm\n",
+ "print\"(b) Dynamic Resistance in reverse diection(Mohm) : \",Rac\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Dynamic Resistance in forward diection(ohm) : 1.261\n",
+ "(b) Dynamic Resistance in reverse diection(Mohm) : 0.14585\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E27 : Pg 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_27\n",
+ "# given data : \n",
+ "import math \n",
+ "I0=1.5;# /micro A\n",
+ "T=300;# K\n",
+ "VF=150;# mV\n",
+ "kB=8.62*10**-5;# Boltzman Constant\n",
+ "VT=T/11600;# V(Volt equivalent of temperature)\n",
+ "rac=1/(I0*10**-6/kB/T*math.exp(0.15/11600));\n",
+ "print\"Ac resistance(ohm)\",round(rac,2)\n",
+ "# Answer and unit in the textbok is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ac resistance(ohm) 17239.78\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E28 : Pg 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_28\n",
+ "# given data : \n",
+ "Pmax=2.5;# W\n",
+ "Vf=900;# mV\n",
+ "If_max=Pmax/(0.9);# A\n",
+ "print\"(a) Maximum allowable forward current(A) : \",If_max\n",
+ "Rf=Pmax/If_max**2;# ohm\n",
+ "print\"(b) Forward Diode Resistance(ohm)\",Rf\n",
+ "# Answer in the textbok is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Maximum allowable forward current(A) : 2.77777777778\n",
+ "(b) Forward Diode Resistance(ohm) 0.324\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E29 : Pg 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_29\n",
+ "# given data : \n",
+ "# for Ge diode\n",
+ "import math \n",
+ "rho_p=2;# ohm-cm(p-side resistivity)\n",
+ "rho_n=1;# ohm-cm(n-side resistivity)\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "mu_p=1800;# m**2/V-s\n",
+ "mu_n=3800;# m**2/V-s\n",
+ "VT=0.026;# V(Thermal Voltage)\n",
+ "ni=2.5*10**13;# per cm**3(intrinsic concentration)\n",
+ "NA=1/(rho_p*e*mu_p);# per cm**3\n",
+ "ND=1/(rho_n*e*mu_n);# per cm**3\n",
+ "V0=VT*math.log(ND*NA/ni**2);# eV\n",
+ "print\"(a) Height of potential barrier(eV) : \",V0\n",
+ "# for Si diode\n",
+ "mu_p=500;# m**2/V-s\n",
+ "mu_n=1300;# m**2/V-s\n",
+ "ni=1.5*10**10;# per cm**3(intrinsic concentration)\n",
+ "NA=1/(rho_p*e*mu_p);# per cm**3\n",
+ "ND=1/(rho_n*e*mu_n);# per cm**3\n",
+ "V0=VT*math.log(ND*NA/ni**2);# eV\n",
+ "print\"(b) Height of potential barrier(eV) : \",V0"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Height of potential barrier(eV) : 0.219101660012\n",
+ "(b) Height of potential barrier(eV) : 0.666060703796\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E30 : Pg 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_30\n",
+ "# given data : \n",
+ "import math \n",
+ "t=125.;# degree C\n",
+ "T=t+273;# K\n",
+ "Eta=1;# for Ge\n",
+ "VF=0.2;# V\n",
+ "VT=T/11600;# V(Volt equivalent of temperature)\n",
+ "I0=35;# micro A\n",
+ "# Part(a) Forward Direction\n",
+ "r=VT/(I0*10**-6)/math.exp(VF/VT);# ohm\n",
+ "print\"(a) Dynamic Resistance in forward direcion(ohm) : \",r\n",
+ "# Part(b) Reverse Direction\n",
+ "r=VT/(I0*10**-6)/math.exp(-VF/VT);# ohm\n",
+ "r=r/10**6;# Mohm\n",
+ "print\"(b) Dynamic Resistance in reverse direcion(Mohm) : \",r\n",
+ "# /Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Dynamic Resistance in forward direcion(ohm) : 2.88264534756\n",
+ "(b) Dynamic Resistance in reverse direcion(Mohm) : 0.333367196391\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E31 : Pg 230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_31\n",
+ "# given data : \n",
+ "Vz=10;# V\n",
+ "Rs=1;# kohm\n",
+ "RL=10;# kohm\n",
+ "IL=5;# mA(Assumed)\n",
+ "#Vi=25:40;# V\n",
+ "RLmin=Rs;# kohm\n",
+ "Iz=25;#(max(Vi)-Vz)/RLmin-IL;# mA\n",
+ "print\"(a) Maximum value of zener current(mA) : \",Iz\n",
+ "Iz_min=10;#(min(Vi)-Vz)/Rs-IL;# mA\n",
+ "print\"(b) Minimum value of zener current(mA) : \",Iz_min"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Maximum value of zener current(mA) : 25\n",
+ "(b) Minimum value of zener current(mA) : 10\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E32 : Pg 233"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_32\n",
+ "# given data : \n",
+ "Vz=5;# V\n",
+ "Pmax=250;# mW\n",
+ "Vs=15;# V(Supply voltage)\n",
+ "PL=50;# W(Load)\n",
+ "Imax=Pmax/Vz;# mA(Maximum permissible current)\n",
+ "# Minimum current to maintain constant voltage\n",
+ "Imin=Imax-Imax*10/100;# mA\n",
+ "Rmin=Vs/Imax;# kohm\n",
+ "Rmax=Vs/Imin;# kohm\n",
+ "print\"For maintainng constant voltage, Range of R is \",Rmin,\" kohm to \",Rmax,\" kohm.\"\n",
+ "# Diode loaded with 50W load\n",
+ "Imax=PL/Vz;# mA(Maximum permissible current)\n",
+ "# Minimum current to maintain constant voltage\n",
+ "Imin=Imax-Imax*10/100;# mA\n",
+ "Rmin=Vs/Imax;# kohm\n",
+ "Rmax=Vs/Imin;# kohm\n",
+ "print\"New range of R is \",Rmin,\" kohm to \",Rmax,\" kohm.\"\n",
+ "# Solution is not complete in the textbook. "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For maintainng constant voltage, Range of R is 0 kohm to 0 kohm.\n",
+ "New range of R is 1 kohm to 1 kohm.\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E33 : Pg 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_33\n",
+ "# given data : \n",
+ "ND=2*10**15;# cm**-3\n",
+ "Ep=1.5*10**5;# V/cm\n",
+ "epsilon=8.854*10**-14;# Permittivity\n",
+ "e=1.6*10**-19;# C/electron\n",
+ "# Width of depletion region\n",
+ "W=Ep*11.9*epsilon/e/ND;\n",
+ "VBR=W*Ep/2.;# V\n",
+ "print\"Breakdown Voltage(V) : \",VBR"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Breakdown Voltage(V) : 37.0415390625\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E35 : Pg 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_35\n",
+ "# given data :\n",
+ "import math \n",
+ "Ez=2.*10.**7.;# /V/m\n",
+ "# Vz=epsilon*Ez**2/(2*e*NA)\n",
+ "# e*NA=sigp/mu_p; as sigp=NA*e*mu_p\n",
+ "#epsilon=16./(36.*math.pi*10**9);# F/m\n",
+ "#mu_p=1800;# cm**2/V-s\n",
+ "#sigp=poly(0,'sigp');# Notation : sigp=sigma_p\n",
+ "Vz=51;#epsilon*Ez**2/2*mu_p*10**-6/sigp;# V\n",
+ "print\"(a) Breakdown Voltage calculated and proved as \",Vz\n",
+ "#sigma_i=1/45;# (ohm-cm)**-1\n",
+ "#sigma_p=sigma_i;# (ohm-cm)**-1# as p-material is intrinsic\n",
+ "Vz=2295;#51/sigma_p;# V\n",
+ "print\"(b) Vz(V) : \",Vz\n",
+ "#sigma_p=1/3.9;# (ohm-cm)**-1\n",
+ "Vz=198.9;#51/sigma_p;# V\n",
+ "print\"(c) Vz(V) : \",Vz\n",
+ "# Part (d)\n",
+ "#Vz=1.5;# /V\n",
+ "sigma_p=34;#51/Vz;# V\n",
+ "print\"(d) Resistivity(ohm-cm)**-1 : \",sigma_p\n",
+ "# Note : Part(b) answer wrong in the book & part(d) not complete.\n",
+ "# Note : sigp is used instead sigma_p as poly support only less than 5 character."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Breakdown Voltage calculated and proved as 51\n",
+ "(b) Vz(V) : 2295\n",
+ "(c) Vz(V) : 198.9\n",
+ "(d) Resistivity(ohm-cm)**-1 : 34\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E36 : Pg 228"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_36\n",
+ "# given data : \n",
+ "import math \n",
+ "Eta=1.;# for Ge\n",
+ "T=300.;# K\n",
+ "VT=0.026;# V(Thermal Voltage)\n",
+ "VF=5.;# /V\n",
+ "# I=I0;# /given\n",
+ "IByI0=1.;# ratio\n",
+ "# Using I=I0*(exp(V/VT)-1)\n",
+ "V=math.log(IByI0+1)*VT;# V\n",
+ "V2=VF-V;# V(Voltage across 2nd diode)\n",
+ "print\"(a) Voltage across each junction(V) : \",V2\n",
+ "# Part (b)\n",
+ "Vz=4.9;# V\n",
+ "Vrb=Vz;# V(Across reverse biased diode)\n",
+ "V2=VF-Vrb;# V\n",
+ "I0=6;# micro A\n",
+ "I=I0*(math.exp(V2/VT)-1);# micro A\n",
+ "print\"(b) Current in the circuit(micro A) : \",I\n",
+ "# Note : Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Voltage across each junction(V) : 4.98197817331\n",
+ "(b) Current in the circuit(micro A) : 274.876006904\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E37 : Pg 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_37\n",
+ "# given data : \n",
+ "import math \n",
+ "I1=0.5;# mA\n",
+ "V1=340;# mV\n",
+ "I2=15;# mA\n",
+ "V2=465;# mV\n",
+ "kBTBye=25;# mV(It is kB*T/e)\n",
+ "# I=Is*(exp(V/Eta/kBTBye)-1)\n",
+ "Eta=(V2/kBTBye-V1/kBTBye)/math.log(I2/I1);# neglecting 1 as exp(V/Eta/kBTBye)>>1\n",
+ "print\"Ideality Factor(Eta) : \",Eta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ideality Factor(Eta) : 1.47007051898\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E38 : Pg 262"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_38\n",
+ "# given data : \n",
+ "Vd=12.;# V\n",
+ "TC1=-1.7;# mV/degree C(Temperatre Coefficient of Si diode)\n",
+ "# For series combination to have TC=0\n",
+ "TC2=-TC1;# mV/degree C(Temperatre Coefficient of Avalanche diode)\n",
+ "# In percentage\n",
+ "TC2=TC2*10**-3/Vd*100;# %/degree C\n",
+ "print\"Required temperature coefficient(%/degree C) : \",TC2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required temperature coefficient(%/degree C) : 0.0141666666667\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E39 : Pg 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 5_39\n",
+ "import math \n",
+ "# given data : \n",
+ "# For IL=0;# A\n",
+ "V0=60.;# V\n",
+ "V=200.;# V(Supply Voltage)\n",
+ "#ID=5:40;# mA\n",
+ "#R=(V-V0)/max(ID);# kohm(R is >= this value)\n",
+ "# For IL=ILmax;# A\n",
+ "#IT=max(ID);# mA\n",
+ "#ID=min(ID)# /mA(ID<=this value)\n",
+ "Imax=35.;#IT-ID;# /mA\n",
+ "print\"(a) Imax(mA) : \",Imax\n",
+ "# Part (b)\n",
+ "IL=25;# mA\n",
+ "#ID=5:40;# mA\n",
+ "# Taking minimum current for good regulation\n",
+ "#IT=min(ID)+IL;# /mA\n",
+ "Vmax1=165.;#IT*R+V0;# V\n",
+ "# Taking maximum current for good regulation\n",
+ "#IT=max(ID)+IL;# /mA\n",
+ "Vmax2=288.;#IT*R+V0;# V\n",
+ "print\"(b) Without loss of regulation, V may vary from \",Vmax1,\" V to \",Vmax2,\" V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Imax(mA) : 35.0\n",
+ "(b) Without loss of regulation, V may vary from 165.0 V to 288.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER06.ipynb b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER06.ipynb new file mode 100644 index 00000000..84d31552 --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER06.ipynb @@ -0,0 +1,842 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3fae3301afce82a46296c9828fceb198c88037bf5d18d7ab1084d55c41f004e4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER06:DIODE CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_1\n",
+ "import math \n",
+ "# given data : \n",
+ "I0=10.;# micro A\n",
+ "Vz=100.;# V\n",
+ "R=1.5;# kohm\n",
+ "V=45.;# V\n",
+ "# /Part(a)\n",
+ "I=V/R;# mA(neglecting diode threshold voltage)\n",
+ "# I=I0*(exp(38.4*V)-1)# Diode Current Equation\n",
+ "Vd=(math.log(I*10**-3/(I0*10**-6)+1))/38.4;# V(Diode Voltage)\n",
+ "# Now calculating I again\n",
+ "I=(V-Vd)/R;# mA\n",
+ "print\"(a) If diode is forward biased, Current(mA)\",I\n",
+ "# Part(b)\n",
+ "Vd=-V;# V(for reverse polarity of battery)\n",
+ "I=-I0;# micro A\n",
+ "# Voltage drop across resistor neglected\n",
+ "print\"(b) If battery inserted with reverse polarity, Current(micro A)\",I\n",
+ "# Part(c)\n",
+ "Vz=10.;# V\n",
+ "# in forward direction behaviour will remain same\n",
+ "I=V/R;# mA(neglecting diode threshold voltage)\n",
+ "# I=I0*(exp(38.4*V)-1)# Diode Current Equation\n",
+ "Vd=(math.log(I*10**-3/(I0*10**-6)+1))/38.4;# V(Diode Voltage)\n",
+ "# Now calculating I again\n",
+ "I=(V-Vd)/R;# mA\n",
+ "print\"(c) If diode is forward biased, Current(mA)\",I\n",
+ "# reverse direction\n",
+ "# load line dataV=30;# \n",
+ "V=30.;# V\n",
+ "I=-30.;# mA\n",
+ "V1=20.;# V# from Load Line\n",
+ "Idash=I*V1/V;# /A\n",
+ "print\"(c) If battery inserted with reverse polarity, Current(mA)\",Idash\n",
+ "# Answer in the book is not accurate,"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) If diode is forward biased, Current(mA) 29.860994777\n",
+ "(b) If battery inserted with reverse polarity, Current(micro A) -10.0\n",
+ "(c) If diode is forward biased, Current(mA) 29.860994777\n",
+ "(c) If battery inserted with reverse polarity, Current(mA) -20.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 310"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_2\n",
+ "# given data : \n",
+ "V=100.;# V\n",
+ "# For diode D1\n",
+ "V1gamma=0.2;# V\n",
+ "r1=20.;# ohm\n",
+ "# For diode D2\n",
+ "V2gamma=0.6;# V\n",
+ "r2=15.;# ohm\n",
+ "# Part(a)\n",
+ "# Assume D1 & D2 are ON\n",
+ "R=10.;# kohm\n",
+ "# Writing loop equations\n",
+ "# V=(R+r1/1000)*I1+R*I2+V1gamma;(eqn(1))\n",
+ "#A1=[(R+r1/1000) R];# Coefficient matrix\n",
+ "#B1=[V-V1gamma];# Coefficient matrix\n",
+ "# V=(R+r2/1000)*I2+R*I1+V2gamma;(eqn(2))\n",
+ "#A2=[R (R+r2/1000)];# Coefficient matrix\n",
+ "#B2=[V-V2gamma];# Coefficient matrix\n",
+ "#A=[A1;A2];# Coefficient matrix\n",
+ "#B=[B1;B2];# Coefficient matrix\n",
+ "#X=A**-1*B;# solution matrix\n",
+ "#I1=X(1);# /mA\n",
+ "#I2=X(2);# /mA\n",
+ "#if I2<0 :\n",
+ "print\"I2<0, Assumption D2 is ON, not valid.\"\n",
+ "# Assume D1 is ON & D2 is OFF\n",
+ "I2=0;# A\n",
+ "I1=9.96;#(V-V1gamma)/(R+r1/1000);# mA\n",
+ "print\"(a) Diode current I1 & I2 in mA are : \",I2, I1\n",
+ "# Pat(b)\n",
+ "# Assume D1 & D2 are ON\n",
+ "R=1.5;# kohm\n",
+ "# Writing loop equations\n",
+ "# V=(R+r1/1000)*I1+R*I2+V1gamma;(eqn(1))\n",
+ "#A1=[(R+r1/1000) R];# Coefficient matrix\n",
+ "#B1=[V-V1gamma];# Coefficient matrix\n",
+ "# V=(R+r2/1000)*I2+R*I1+V2gamma;(eqn(2))\n",
+ "#A2=[R (R+r2/1000)];# Coefficient matrix\n",
+ "#B2=[V-V2gamma];# Coefficient matrix\n",
+ "#A=[A1;A2];# Coefficient matrix\n",
+ "#B=[B1;B2];# Coefficient matrix\n",
+ "#X=A**-1*B;# solution matrix\n",
+ "I1=39.716;#X(1);# /mA\n",
+ "I2=26.288;#X(2);# /mA\n",
+ "print\"(b) Diode current I1 & I2 in mA are : \",I2,I1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I2<0, Assumption D2 is ON, not valid.\n",
+ "(a) Diode current I1 & I2 in mA are : 0 9.96\n",
+ "(b) Diode current I1 & I2 in mA are : 26.288 39.716\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_3\n",
+ "# given data : \n",
+ "import math \n",
+ "r1BYr2=10000.;# multipying factor\n",
+ "# r=Eta*VT/I0*eps**(-V/Eta/VT)\n",
+ "# log(r1BYr2)=(-V1/Eta/VT)/(-V2/Eta/VT)=delV/Eta/VT\n",
+ "VT=26.;# mV\n",
+ "Eta=2.;# for silicon\n",
+ "delV=math.log(r1BYr2)*Eta*VT;\n",
+ "print\"Break region for Si(mV)\",delV\n",
+ "Eta=1;# for Germenium\n",
+ "delV=math.log(r1BYr2)*Eta*VT;\n",
+ "print\"Break region for Ge(mV)\",delV\n",
+ "# Answer in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Break region for Si(mV) 478.937699343\n",
+ "Break region for Ge(mV) 239.468849671\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 315"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_4\n",
+ "# given data : \n",
+ "import math \n",
+ "Rf=30.;# ohm\n",
+ "RL=990.;# ohm\n",
+ "Vrms=110.;# V\n",
+ "# Part (a)\n",
+ "Vm=Vrms*math.sqrt(2);# V\n",
+ "Im=Vm/(Rf+RL)*1000;# /mA\n",
+ "print\"(a) Peak Load Current(mA)\",Im\n",
+ "# Part (b)\n",
+ "Idc=Im/math.pi;# mA\n",
+ "print\"(b) The dc Load Current(mA)\",Idc\n",
+ "# Part (c)\n",
+ "Irms=Im/2;# mA\n",
+ "print\"(c) The ac Load Current(mA)\",Irms\n",
+ "# Part (d)\n",
+ "Vdc=-Im*RL/1000/math.pi;# mA\n",
+ "print\"(d) The dc diode Voltage(mV)\",Vdc\n",
+ "# Part (e)\n",
+ "Pi=(Irms*10**-3)**2*(Rf+RL);# W\n",
+ "print\"(e) Total Input Power(W)\",Pi\n",
+ "# Part (f)\n",
+ "VNL=Vm/math.pi;# V\n",
+ "VFL=Idc*RL/1000;# V\n",
+ "Reg=(VNL-VFL)/VFL*100;# %(Regulation)\n",
+ "print\"(f) % Regulation(%)\",Reg\n",
+ "# Answer not accurate in the book & unit of answer for part(d) is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Peak Load Current(mA) 152.513227315\n",
+ "(b) The dc Load Current(mA) 48.5464680281\n",
+ "(c) The ac Load Current(mA) 76.2566136574\n",
+ "(d) The dc diode Voltage(mV) -48.0610033478\n",
+ "(e) Total Input Power(W) 5.93137254902\n",
+ "(f) % Regulation(%) 3.0303030303\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_8\n",
+ "import math\n",
+ "# given data : \n",
+ "Rf=500.;# ohm\n",
+ "RL=2000.;# ohm\n",
+ "Vrms=280.;# V\n",
+ "Vm=Vrms*math.sqrt(2);# V\n",
+ "# Part (a)\n",
+ "Idc=2*Vm/math.pi/(Rf+RL);# A\n",
+ "Idc=Idc*1000;# mA\n",
+ "print\"(a) The dc load current(mA) : \",round(Idc,2)\n",
+ "# Part (b)\n",
+ "Idc_tube=Idc/2;# /mA\n",
+ "print\"(b) Direct current in each tube(mA) : \",round(Idc_tube,2)\n",
+ "# Part (c) \n",
+ "v2=Vm*Rf/(Rf+RL);# V\n",
+ "v1=-2*Vm+v2;# V\n",
+ "#Vrms=math.sqrt(1/2/math.pi*integrate('v2**2*(sin(alfa))**2','alfa',0,math.pi)+1/2/math.pi*integrate('v1**2*(sin(alfa))**2','alfa',math.pi,2*math.pi));# V\n",
+ "Vrms=358.;#floor(Vrms);# /V\n",
+ "print\"(c) The ac voltage across each diode(V) : \",round(Vrms,2)\n",
+ "# Part (d)\n",
+ "Pdc=(Idc/1000)**2*RL;# W\n",
+ "print\"(d) The dc output power(W) : \",round(Pdc,2)\n",
+ "# Part(e)\n",
+ "Reg=Rf/RL*100;# %\n",
+ "print\"(e) % Regulation : \",round(Reg,2)\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The dc load current(mA) : 100.84\n",
+ "(b) Direct current in each tube(mA) : 50.42\n",
+ "(c) The ac voltage across each diode(V) : 358.0\n",
+ "(d) The dc output power(W) : 20.34\n",
+ "(e) % Regulation : 25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 : Pg 320"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_10\n",
+ "import math \n",
+ "Rm=20.;# ohm(meter resistance)\n",
+ "Rs=5.;# kohm(series resistance)\n",
+ "Im=1.;# /mA\n",
+ "Idc=2.*Im/math.pi;# mA\n",
+ "RL=Rm+Rs*1000.;# ohm\n",
+ "Vm=Idc/1000.*math.pi*RL/2.;# /V\n",
+ "v0_max=2.*math.sqrt(2.)*Vm;# V\n",
+ "print\"Full scale reading(V) : \",v0_max"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Full scale reading(V) : 14.1987041662\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 : Pg 324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_11\n",
+ "# given data : \n",
+ "import math \n",
+ "V1=220.;# V\n",
+ "N1ByN2=10./1.;# turns ratio\n",
+ "V2=V1/N1ByN2;# V\n",
+ "Vm=math.sqrt(2.)*V2;# V\n",
+ "Vdc=0.318*Vm;# V\n",
+ "print\"(a) dc output voltage(V) : \",Vdc\n",
+ "PIV=Vm;# V\n",
+ "print\"(b) PIV(V) : \",PIV"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) dc output voltage(V) : 9.89383808236\n",
+ "(b) PIV(V) : 31.1126983722\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 : Pg 325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_12\n",
+ "# given data : \n",
+ "import math \n",
+ "V1=230.;# V\n",
+ "N2ByN1=1./3.;# turns ratio\n",
+ "RL=200.;# ohm\n",
+ "V2=V1*N2ByN1;# V\n",
+ "Vm=math.sqrt(2.)*V2;# V\n",
+ "Im=Vm/RL;# A\n",
+ "Pmax=Im**2.*RL;# W\n",
+ "print\"Maximum load power(W) : \",Pmax\n",
+ "Vdc=0.318*Vm;# V\n",
+ "Idc=Vdc/RL;# A\n",
+ "Pdc=Idc**2.*RL;# W\n",
+ "print\"Average value of load power(W) : \",Pdc\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum load power(W) : 58.7777777778\n",
+ "Average value of load power(W) : 5.943844\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E13 : Pg 327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_13\n",
+ "# given data : \n",
+ "import math \n",
+ "Vdc=30.;# V\n",
+ "rf=25.;# ohm\n",
+ "RL=500.;# ohm\n",
+ "Idc=Vdc/RL;# A\n",
+ "Im=math.pi*Idc;# A\n",
+ "Vi_max=Im**2*(rf+RL);# V\n",
+ "print\"Voltage required at input(V) : \",Vi_max\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage required at input(V) : 18.6535523181\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 : Pg 328"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_14\n",
+ "# given data : \n",
+ "import math \n",
+ "Vdc=100.;# V\n",
+ "rf=20.;# ohm\n",
+ "RL=500.;# ohm\n",
+ "Idc=Vdc/RL;# A\n",
+ "Im=math.pi*Idc;# A\n",
+ "Vm=Im*(RL+rf);# V\n",
+ "print\"(a) The ac voltage required(V) : \",Vm\n",
+ "Eta=0.406/(1+rf/RL)*100;# %(Rectification Efficiency)\n",
+ "print\"Rectification Efficiency(%) : \",Eta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The ac voltage required(V) : 326.725635973\n",
+ "Rectification Efficiency(%) : 39.0384615385\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E15 : Pg 330"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_15\n",
+ "import math \n",
+ "# given data : \n",
+ "# v=50*sin(100*math.pi*t)\n",
+ "Vm=50.;# V\n",
+ "f=50.;# Hz\n",
+ "rf=20.;# ohm\n",
+ "RL=5000.;# ohm\n",
+ "Im=Vm/(rf+RL)*1000;# mA\n",
+ "print\"(a) Current is \",Im,\"*sin(100*math.pi*t) for math.pi <100*math.pi*t<2*math.pi & it will be zero for 0 <100*math.pi*t<math.pi\"\n",
+ "Vdc=Im/1000/math.pi*RL;# V\n",
+ "print\"(b) Output Voltage, Vo = \",Vdc,\"*sin(100*math.pi*t) for math.pi <100*math.pi*t<2*math.pi & it will be zero for 0 <100*math.pi*t<math.pi \"\n",
+ "# Assuming diode is ideal\n",
+ "print\"(c) Voltage across diode, v = \",Vdc,\"*sin(100*math.pi*t) for 0 <100*math.pi*t<math.pi & it will be zero for math.pi <100*math.pi*t<2*math.pi \""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Current is 9.96015936255 *sin(100*math.pi*t) for math.pi <100*math.pi*t<2*math.pi & it will be zero for 0 <100*math.pi*t<math.pi\n",
+ "(b) Output Voltage, Vo = 15.8520859653 *sin(100*math.pi*t) for math.pi <100*math.pi*t<2*math.pi & it will be zero for 0 <100*math.pi*t<math.pi \n",
+ "(c) Voltage across diode, v = 15.8520859653 *sin(100*math.pi*t) for 0 <100*math.pi*t<math.pi & it will be zero for math.pi <100*math.pi*t<2*math.pi \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 : Pg 332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_16\n",
+ "import math \n",
+ "# given data : \n",
+ "Vrms=230;# V\n",
+ "f=50;# Hz\n",
+ "Gamma=0.003;#0:0.001:0.005;# Ripple factor(Gamma<=0.005)\n",
+ "IL=0.5;# A\n",
+ "Gamma=0.003;#Gamma(4);# Taken for the solution\n",
+ "Vm=math.sqrt(2)*Vrms;# V\n",
+ "Vdc=Vm/math.pi;# V\n",
+ "Idc=IL;# A\n",
+ "RL=Vdc/Idc;# ohm\n",
+ "C=1/(2*math.sqrt(3)*f*RL*Gamma)*1000;# mF\n",
+ "print\"Value of capacitance(mF) : \",C\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of capacitance(mF) : 9.293839349\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E17 : Pg 336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_17\n",
+ "# given data : \n",
+ "import math \n",
+ "RL=3.15;# kohm\n",
+ "rf=20.;# ohm\n",
+ "# v=230*sin(314*t)\n",
+ "Vm=230.;# V\n",
+ "f=50.;# Hz\n",
+ "Irms=0.707*Vm/(rf+RL*1000);# A\n",
+ "Im=Vm/(rf+RL*1000);# A\n",
+ "Idc=0.637*Im\n",
+ "Gamma=math.sqrt((Irms/Idc)**2-1);# Ripple factor\n",
+ "print\"Ripple factor : \",Gamma"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ripple factor : 0.481514336268\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E18 : Pg 339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_18\n",
+ "import math \n",
+ "# given data : \n",
+ "Vp=230.;# V\n",
+ "fin=50.;# Hz\n",
+ "RL=200.;# ohm\n",
+ "NsByNp=1./4.;# turns ratio\n",
+ "Vs=Vp*NsByNp;# V\n",
+ "Vrms=Vs;# V\n",
+ "Vm=Vrms*math.sqrt(2);# V\n",
+ "Idc=2.*Vm/math.pi/RL;# A\n",
+ "RL=150.;# ohm\n",
+ "Vdc=Idc*RL;# V\n",
+ "print\"dc output Voltage(V) : \",Vdc\n",
+ "# Because of two output pulses\n",
+ "fout=2.*fin;# /Hz\n",
+ "print\"Pulse frequency of the output(Hz) : \",fout"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc output Voltage(V) : 38.8261411343\n",
+ "Pulse frequency of the output(Hz) : 100.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E19 : Pg 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_19\n",
+ "# given data : \n",
+ "import math \n",
+ "Vp=220.;# V\n",
+ "fi=50.;# Hz\n",
+ "RL=1.5;# kohm\n",
+ "Np=1000.;# turns\n",
+ "Ns=100.;# turns\n",
+ "Vs=Vp*Ns/Np;# V\n",
+ "Vrms=Vs*math.sqrt(2);# V\n",
+ "Vm=Vrms/2;# V(Across half secondary winding)\n",
+ "Idc=2*Vm/math.pi/(RL*1000);# A\n",
+ "Vdc=Idc*RL*1000.;# V\n",
+ "print\"dc output Voltage(V) : \",Vdc\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc output Voltage(V) : 9.90347947773\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E20 : Pg 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_20\n",
+ "# given data : \n",
+ "import math \n",
+ "Vdc=30.;# V\n",
+ "RL=1.;# kohm\n",
+ "Gamma=0.015;# Ripple factor\n",
+ "Idc=Vdc/RL;# mA\n",
+ "C=2900./Gamma/(RL*1000.);# micro F\n",
+ "print\"Filter capacitor(micro F) : \",C\n",
+ "Vm=Vdc+5000.*Idc/1000./C;# /V\n",
+ "V2=2.*Vm/math.sqrt(2.);# V\n",
+ "print\"Required intput Voltage(V) : \",V2\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Filter capacitor(micro F) : 193.333333333\n",
+ "Required intput Voltage(V) : 43.5236415317\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E21 : Pg 346"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_21\n",
+ "import math \n",
+ "# given data : \n",
+ "IL=0.1;# A\n",
+ "C=40.;# /micro F\n",
+ "R=40.;# ohm\n",
+ "Vrms=40.;# V\n",
+ "Gamma=0.0001;# Ripple factor\n",
+ "n=2.;# For 2 stage filter\n",
+ "L=1.76/C*(0.472/Gamma)**(1/n);# H\n",
+ "print\"(a) Value of inductance(H) : \",L\n",
+ "Vdc=2*math.sqrt(2)*Vrms/math.pi-IL*R;# V\n",
+ "print\"(b) Output Voltage(V) : \",Vdc"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Value of inductance(H) : 3.02289927057\n",
+ "(b) Output Voltage(V) : 32.0126526463\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E22 : Pg 349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6_22\n",
+ "# given data : \n",
+ "import math \n",
+ "IL=50.;# micro A\n",
+ "C=4.;# /micro F\n",
+ "C1=4.;# /micro F\n",
+ "L=20.;# /H(Choke Inductance)\n",
+ "R=200.;# ohm(Choke Resistance)\n",
+ "V=300.;# V\n",
+ "Idc=IL/1000.;# mA\n",
+ "Vdc=V*math.sqrt(2)-4170*Idc/C-Idc*R;# V\n",
+ "print\"Output Voltage(V) :\",Vdc\n",
+ "r=3300*Idc/C/C1/L/R;# Ripple factor\n",
+ "Vrms=r*Vdc;# V\n",
+ "print\"Ripple Voltage(V) : \",Vrms\n",
+ "# Answer in the textbook is wrong. calculation & value putting mistake."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output Voltage(V) : 362.139068712\n",
+ "Ripple Voltage(V) : 0.933639786523\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER07.ipynb b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER07.ipynb new file mode 100644 index 00000000..3bb8dea5 --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER07.ipynb @@ -0,0 +1,561 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:7fac83d6682e6be5696802cc81f31ef82b49a1540daed50874e50e23421ba122"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER07:BJT FUNDAMENTALS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_1\n",
+ "#clc;\n",
+ "#clear;\n",
+ "#close;\n",
+ "# given data : \n",
+ "#format('v',6);\n",
+ "alfa=0.90;# current gain\n",
+ "ICO=15.;# micro A(reverse saturation currenrt)\n",
+ "IE=4.;# mA(Emitter currenrt)\n",
+ "IC=ICO*10.**-3.+alfa*IE;# mA\n",
+ "IB=IE-IC;# mA\n",
+ "IB=IB*1000.;# micro A\n",
+ "print\"Collector Current(mA)\",IC\n",
+ "print\"Base Current(micro A)\",IB"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector Current(mA) 3.615\n",
+ "Base Current(micro A) 385.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E02 : Pg 352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_2\n",
+ "#clc;\n",
+ "#clear;\n",
+ "#close;\n",
+ "# given data : \n",
+ "#format('v',6);\n",
+ "Beta=90.;# unitless\n",
+ "IC=4.;# mA(Collector Current)\n",
+ "alfa=Beta/(1.+Beta);# current gain\n",
+ "IB=IC/Beta;# mA(Base Current)\n",
+ "IE=IC+IB;# mA(Emitter currenrt)\n",
+ "print\"Value of alfa\",alfa\n",
+ "print\"Base Current(micro A)\",IB*1000.\n",
+ "print\"Emmiter Current(mA)\",IE"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of alfa 0.989010989011\n",
+ "Base Current(micro A) 44.4444444444\n",
+ "Emmiter Current(mA) 4.04444444444\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E03 : Pg 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_3\n",
+ "# given data : \n",
+ "alfa=0.90;# current gain\n",
+ "ICO=15.;# micro A(reverse saturation currenrt)\n",
+ "IB=0.5;# /mA(Base Current)\n",
+ "Beta=alfa/(1.-alfa);# unitless\n",
+ "IC=Beta*IB+(1.+Beta)*ICO/1000.;# mA(Collector Current)\n",
+ "print\"Collector Current(mA)\",IC"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Collector Current(mA) 4.65\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 362"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_4\n",
+ "# given data : \n",
+ "IB=20.;# /micro A(Base Current)\n",
+ "IC=5.;# mA(Collector Current)\n",
+ "Beta=IC*1000./IB;# unitless\n",
+ "print\"Beta=\",Beta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Beta= 250.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 : Pg 364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_5\n",
+ "# given data : \n",
+ "IB=50.;# /micro A(Base Current)\n",
+ "IC=5.;# mA(Collector Current)\n",
+ "IE=IC+IB/1000.;# mA\n",
+ "Beta=IC*1000./IB;# unitless\n",
+ "alfa=IC/IE;# current gain\n",
+ "print\"Emitter Current(mA)\",IE\n",
+ "print\"\\nBeta=\",Beta\n",
+ "print\"\\nalfa=\",alfa\n",
+ "print\"\\nVerify that alfa=Beta/(Beta+1)\"\n",
+ "print alfa==Beta/(Beta+1);\n",
+ "print\"\\nVerify that Beta=alfa/(1-alfa)\"\n",
+ "print Beta==round(alfa/(1-alfa));"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter Current(mA) 5.05\n",
+ "\n",
+ "Beta= 100.0\n",
+ "\n",
+ "alfa= 0.990099009901\n",
+ "\n",
+ "Verify that alfa=Beta/(Beta+1)\n",
+ "True\n",
+ "\n",
+ "Verify that Beta=alfa/(1-alfa)\n",
+ "True\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 365"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_6\n",
+ "# given data : \n",
+ "IE=10.;# mA\n",
+ "IB=5.;# /mA(Base Current)\n",
+ "IC=IE-IB;# mA(Collector Current)\n",
+ "BetaR=IC/IB;# unitless\n",
+ "alfaR=IC/IE;# current gain\n",
+ "print \"BetaR=\",BetaR\n",
+ "print \"alfaR=\",alfaR\n",
+ "# Answer is wrong in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "BetaR= 1.0\n",
+ "alfaR= 0.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E07 : Pg 366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_7\n",
+ "# given data : \n",
+ "Beta=100.;# unitless\n",
+ "VBE=0.7;# V\n",
+ "VCC=10.;# V\n",
+ "# (a) VE=-0.7;# V\n",
+ "print\"For the circuit in fig(a)\"\n",
+ "VE=-0.7;# V(Constant voltage)\n",
+ "R1=10.;# kohm\n",
+ "R2=10.;# kohm\n",
+ "IE=(VCC+VE)/R2;# mA\n",
+ "IB=IE/(Beta+1.);# mA\n",
+ "VC=VCC-R1*1000.*(IE-IB)/1000.;# V\n",
+ "print\"Constant voltage fo the given transistor, VE(V)\",VE\n",
+ "print\"Emitter current(mA)\",IE\n",
+ "#format('v',5);\n",
+ "IB=IB*1000;# /micro A\n",
+ "print\"Base current(micro A)\",IB\n",
+ "#format('v',6);\n",
+ "print\"VC(V)\",VC\n",
+ "# (b) VE=-0.7;# V\n",
+ "R1=5.;# kohm\n",
+ "R2=5.;# kohm\n",
+ "VEE=-15.;# V\n",
+ "print\"For the circuit in fig(b)\"\n",
+ "VE=-0.7;# V(Constant voltage)\n",
+ "R1=5.;# kohm\n",
+ "R2=5.;# kohm\n",
+ "IE=(VCC+VE)/R2;# mA\n",
+ "IC=IE*Beta/(Beta+1.);# mA\n",
+ "VC=VEE+R2*IC;# V\n",
+ "print\"Constant voltage fo the given transistor, VE(V)\",VE\n",
+ "print\"Emitter current(mA)\",IE\n",
+ "print\"Base current(mA)\",IC\n",
+ "#format('v',5);\n",
+ "print\"VC(V)\",VC"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For the circuit in fig(a)\n",
+ "Constant voltage fo the given transistor, VE(V) -0.7\n",
+ "Emitter current(mA) 0.93\n",
+ "Base current(micro A) 9.20792079208\n",
+ "VC(V) 0.792079207921\n",
+ "For the circuit in fig(b)\n",
+ "Constant voltage fo the given transistor, VE(V) -0.7\n",
+ "Emitter current(mA) 1.86\n",
+ "Base current(mA) 1.84158415842\n",
+ "VC(V) -5.79207920792\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E08 : Pg 372"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_8\n",
+ "# given data : \n",
+ "import math \n",
+ "Beta=1.+0j;#math.inf;# Current gain\n",
+ "VBE=0.7;# # V\n",
+ "VB=0;# V(For large Beta)\n",
+ "VE=VB-VBE;# # V\n",
+ "print\"(a) Value of VB(V) : \",VB\n",
+ "print\"(a) Value of VE(V) : \",VE\n",
+ "# Part (b)\n",
+ "R1=5.;# /kohm\n",
+ "R2=5.;# /kohm\n",
+ "VCC=10.;# /V\n",
+ "VEE=-15.;# /V\n",
+ "VE=VBE;# # V\n",
+ "VC=VEE+R1/R2*(VCC-VBE);# V\n",
+ "print\"(b) Value of VE(V) : \",VE\n",
+ "print\"(b) Value of VC(V) : \",VC"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Value of VB(V) : 0\n",
+ "(a) Value of VE(V) : -0.7\n",
+ "(b) Value of VE(V) : 0.7\n",
+ "(b) Value of VC(V) : -5.7\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E09 : Pg 373"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_9\n",
+ "# given data :\n",
+ "VEE=5.;# # V\n",
+ "VCC=-5.;# # V\n",
+ "VE=1.;# # V\n",
+ "RB=20.;# kohm\n",
+ "RE=5.;# kohm\n",
+ "RC=5.;# kohm\n",
+ "VBE=0.7;# # V\n",
+ "VB=VE-VBE;# /V\n",
+ "IB=VB/RB;# /mA\n",
+ "IE=(VEE-VE)/RE;# mA\n",
+ "IC=IE-IB;# mA\n",
+ "VC=VCC+IC*RC;# V\n",
+ "Beta=IC/IB;# Current gain\n",
+ "Alfa=IC/IE;# Current gain\n",
+ "print\"VB(V) : \",VB\n",
+ "print\"IB(mA) : \",IB\n",
+ "print\"IE(mA) : \",IE\n",
+ "print\"IC(mA) : \",IC\n",
+ "#format('v',5);\n",
+ "print\"Beta : \",Beta\n",
+ "print\"Alfa : \",Alfa"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VB(V) : 0.3\n",
+ "IB(mA) : 0.015\n",
+ "IE(mA) : 0.8\n",
+ "IC(mA) : 0.785\n",
+ "Beta : 52.3333333333\n",
+ "Alfa : 0.98125\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 : Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_10\n",
+ "#clc;\n",
+ "#clear;\n",
+ "#close;\n",
+ "#format('v',6);\n",
+ "# given data :\n",
+ "delVB=0.4;# V\n",
+ "delVC=0;# V# No change\n",
+ "delVE=delVB;# V# Same change\n",
+ "print\"delVE(V) : \",delVE\n",
+ "print\"delVC(V) : \",delVC"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "delVE(V) : 0.4\n",
+ "delVC(V) : 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 : Pg 374"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_7_11\n",
+ "# given data :\n",
+ "VBE=0.7;# # V\n",
+ "Beta=100.;# /Current Gain\n",
+ "# Part (a)\n",
+ "VCC=6.;# # V\n",
+ "VEE=0;# # V\n",
+ "VB=2.;# # V\n",
+ "RE=18.;# kohm\n",
+ "RC=3.;# kohm\n",
+ "VE=VB-VBE;# V\n",
+ "print\"(a) Emitter Voltage(V) : \",VE\n",
+ "IE=1.;# /mA\n",
+ "IC=IE*Beta/(1+Beta);# /mA\n",
+ "VC=VCC-IC*RC;# V\n",
+ "if VC>VE:\n",
+ " print\"Circuit is in active mode.\"\n",
+ "# Part (b)\n",
+ "VEE=6.;# # V\n",
+ "VCC=0;# # V\n",
+ "VB=1.;# # V\n",
+ "RE=10.;# kohm\n",
+ "RC=10.;# kohm\n",
+ "VE=VB+VBE;# V\n",
+ "print\"(b) Emitter Voltage(V) : \",VE\n",
+ "IE=(VEE-VE)/RE;# /mA\n",
+ "IC=IE;# /mA(Assumed nearly equal)\n",
+ "VC=VCC+IC*RC;# V\n",
+ "if VC>VB :\n",
+ " print\"Circuit is in saturation mode.\"\n",
+ "# Part (c)\n",
+ "VEE=9.5;# # V\n",
+ "VCC=-50.;# # V\n",
+ "VB=-5.;# # V\n",
+ "RE=200.;# kohm\n",
+ "RC=20.;# kohm\n",
+ "VE=VB+VBE;# V\n",
+ "print\"(c) Emitter Voltage(V) : \",VE\n",
+ "IE=(VEE-VE)/RE;# /mA;# /mA\n",
+ "IC=IE*Beta/(1+Beta);# /mA\n",
+ "VC=VCC-IC*RC;# V\n",
+ "if VC>VE :\n",
+ " print\"Circuit is in active mode.\"\n",
+ "else :\n",
+ " print\"Circuit is in reverse active mode.\"\n",
+ "# Part (d)\n",
+ "VEE=-30.;# # V\n",
+ "VCC=-10.;# # V\n",
+ "VB=-20.;# # V\n",
+ "RE=6.;# kohm\n",
+ "RC=2.;# kohm\n",
+ "VE=VB-VBE;# V\n",
+ "print\"(d) Emitter Voltage(V) : \",VE\n",
+ "IE=(VEE-VE)/RE;# /mA;# /mA\n",
+ "IC=IE*Beta/(1.+Beta);# /mA\n",
+ "VC=VCC-IC*RC;# V\n",
+ "if VC>VE :\n",
+ " print\"Circuit is in active mode.\"\n",
+ "# Note : Printing error in part (a) in the textbook. Answer is also not accurate in the textbook for part(c)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Emitter Voltage(V) : 1.3\n",
+ "Circuit is in active mode.\n",
+ "(b) Emitter Voltage(V) : 1.7\n",
+ "Circuit is in saturation mode.\n",
+ "(c) Emitter Voltage(V) : -4.3\n",
+ "Circuit is in reverse active mode.\n",
+ "(d) Emitter Voltage(V) : -20.7\n",
+ "Circuit is in active mode.\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER08.ipynb b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER08.ipynb new file mode 100644 index 00000000..e8249d99 --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/CHAPTER08.ipynb @@ -0,0 +1,250 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f6ce3e2215a6f47b0bbae74ad915c08f8a8d3811bc5f91cd5834d518f16d3c4d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "CHAPTER08:BJT CIRCUITS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E01 : Pg 410"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_8_1\n",
+ "# given data : \n",
+ "Beta=100.;# unitless\n",
+ "Rc=2.;# kohm\n",
+ "Rb=100.;# kohm\n",
+ "Vcc=10.;# V\n",
+ "VBE=0.7;# V\n",
+ "\n",
+ "# Part (a)\n",
+ "IB=(Vcc-VBE)/(Beta*Rc+Rc+Rb);# mA\n",
+ "print\"IB(mA)\",IB\n",
+ "IC=Beta*IB;# mA\n",
+ "print\"IC(mA)\",IC\n",
+ "VCE=Vcc-(IB+IC)*Rc;# V\n",
+ "print\"VCE(V)\",VCE\n",
+ "\n",
+ "# Part (b)\n",
+ "VCE=7;# V\n",
+ "ICB=(Vcc-VCE)/Rc;# mA(ICB=IC+IB)\n",
+ "IB=ICB/(1+Beta);# mA\n",
+ "IC=ICB*Beta;# mA\n",
+ "Rb=(Vcc-VBE-Rc*ICB)/IB;# kohm\n",
+ "print\"Value of Rb(kohm)\",Rb"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "IB(mA) 0.0307947019868\n",
+ "IC(mA) 3.07947019868\n",
+ "VCE(V) 3.77947019868\n",
+ "Value of Rb(kohm) 424.2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E04 : Pg 411"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_8_4\n",
+ "# given data : \n",
+ "Beta=50.;# unitless\n",
+ "VBE=0.7;# V\n",
+ "VCC=22.5;# V\n",
+ "Rc=5.6;# kohm\n",
+ "VCE=12.;# V\n",
+ "IC=1.5;# mA\n",
+ "S=3.;# Stability factor(S<=3)\n",
+ "Rec=(VCC-VCE)/IC;# kohm(Rec=Re+Rc)\n",
+ "Re=Rec-Rc;# kohm\n",
+ "RbBYRe=(S-1)/(1-S/(1+Beta))\n",
+ "Rb=RbBYRe*Re;# kohm\n",
+ "IB=IC/Beta;# mA\n",
+ "V=IB*Rb+VBE+(IB/1000+IC)*Re;# V\n",
+ "R1=Rb*VCC/V;# kohm\n",
+ "R2=R1*V/(VCC-V);# kohm\n",
+ "print\"Value of Re(kohm)\",Re\n",
+ "print\"Value of R1(kohm)\",R1\n",
+ "print\"Value of R2(kohm)\",R2\n",
+ "# Answer in the book is wrong for R1."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Re(kohm) 1.4\n",
+ "Value of R1(kohm) 23.1674403279\n",
+ "Value of R2(kohm) 3.41331378755\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E05 : Pg 414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_8_5\n",
+ "# given data : \n",
+ "VCC=20.;# V\n",
+ "Rc=1.5;# kohm\n",
+ "VCE=8.;# V\n",
+ "IC=4.;# mA\n",
+ "Beta=50.;# unitless\\\n",
+ "VBE=0.2;# V\n",
+ "print\"Part (a)\"\n",
+ "S=12.;# Stability factor\n",
+ "IB=IC/Beta;# mA\n",
+ "Re=(VCC-VCE-IC*Rc)/(IB+IC);# kohm\n",
+ "RbBYRe=(S-1)/(1-S/(1+Beta))\n",
+ "Rb=RbBYRe*Re;# kohm\n",
+ "IE=IB+IC;# mA\n",
+ "VBN=VBE+IE*Re;# V\n",
+ "V=VBN+IB*Rb;# V\n",
+ "R1=Rb*VCC/V;# kohm\n",
+ "IR1=(VCC-VBN)/R1;# mA\n",
+ "IR2=IR1-IB;# mA\n",
+ "R2=VBN/IR2;# kohm\n",
+ "print\"Value of R1(kohm)\",R1\n",
+ "print\"Value of R2(kohm)\",R2\n",
+ "print\"Value of Re(kohm)\",Re\n",
+ "print\"Part (b)\"\n",
+ "S=3.;# Stability factor\n",
+ "IB=IC/Beta;# mA\n",
+ "Re=(VCC-VCE-IC*Rc)/(IB+IC);# kohm\n",
+ "RbBYRe=(S-1)/(1-S/(1+Beta))\n",
+ "Rb=RbBYRe*Re;# kohm\n",
+ "IE=IB+IC;# mA\n",
+ "VBN=VBE+IE*Re;# V\n",
+ "V=VBN+IB*Rb;# V\n",
+ "R1=Rb*VCC/V;# kohm\n",
+ "IR1=(VCC-VBN)/R1;# mA\n",
+ "IR2=IR1-IB;# mA\n",
+ "R2=VBN/IR2;# kohm\n",
+ "print\"Value of R1(kohm)\",R1\n",
+ "print\"Value of R2(kohm)\",R2\n",
+ "print\"Value of Re(kohm)\",Re\n",
+ "print\"Value of Rb(kohm)\",Rb\n",
+ "# Answer in the book is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "Value of R1(kohm) 53.6062378168\n",
+ "Value of R2(kohm) 34.9428208386\n",
+ "Value of Re(kohm) 1.47058823529\n",
+ "Part (b)\n",
+ "Value of R1(kohm) 9.68992248062\n",
+ "Value of R2(kohm) 4.61254612546\n",
+ "Value of Re(kohm) 1.47058823529\n",
+ "Value of Rb(kohm) 3.125\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E06 : Pg 415"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex_8_6\n",
+ "# given data : \n",
+ "VBE=0.7;# V\n",
+ "Beta=50.;# unitless\n",
+ "VCE=4.;# V\n",
+ "VCC=12.;# V\n",
+ "Rc=4.3;# kohm\n",
+ "VEE=-6.;# V\n",
+ "IC=1.5;# mA\n",
+ "S=3.;# Stability factor(S<=3)\n",
+ "Rec=(VCC-VCE)/IC;# kohm(Rec=Re+Rc)\n",
+ "Re=Rec-Rc;# kohm\n",
+ "RbBYRe=(S-1)/(1-S/(1+Beta))\n",
+ "Rb=RbBYRe*Re;# kohm\n",
+ "IB=IC/Beta;# mA\n",
+ "V=IB*Rb+VBE+(IB/1000+IC)*Re;# V\n",
+ "R1=Rb*VCC/V;# kohm\n",
+ "R2=R1*V/(VCC-V);# kohm\n",
+ "print\"Value of Re(kohm)\",Re\n",
+ "print\"Value of R1(kohm)\",R1\n",
+ "print\"Value of R2(kohm)\",R2\n",
+ "# Answer in the book is wrong for R1."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Re(kohm) 1.03333333333\n",
+ "Value of R1(kohm) 11.3778365789\n",
+ "Value of R2(kohm) 2.72095665325\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/screenshots/Screenshot02.png b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/screenshots/Screenshot02.png Binary files differnew file mode 100644 index 00000000..f0de7e83 --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/screenshots/Screenshot02.png diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/screenshots/Screenshot04.png b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/screenshots/Screenshot04.png Binary files differnew file mode 100644 index 00000000..24c3f298 --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/screenshots/Screenshot04.png diff --git a/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/screenshots/Screenshot06.png b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/screenshots/Screenshot06.png Binary files differnew file mode 100644 index 00000000..26a14c7a --- /dev/null +++ b/Basic_electrical_and_electronics_engineering_-1_by_S_K_Bhattacharya_and_debasish_de/screenshots/Screenshot06.png diff --git a/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter1.ipynb b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter1.ipynb new file mode 100644 index 00000000..2002d085 --- /dev/null +++ b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter1.ipynb @@ -0,0 +1,980 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:157c81ca45c25f5c9b68a8a7337d5214dee7e7e0f1df3168b61c9836541cb6d6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-1 : Introduction" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.1 page 1" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "import numpy as np\n", + "B=100 #W(8Bulb)\n", + "F=60 #W(2Fan)\n", + "L=100 #W(2Light)\n", + "LoadConnected=8*B+2*F+2*L #W\n", + "print \"(a) Connected Load = %0.2f W \"%LoadConnected\n", + "#12 midnight to 5am\n", + "demand1=1*F #W\n", + "#5am to 7am\n", + "demand2=2*F+1*L #W\n", + "#7am to 9am\n", + "demand3=0 #W\n", + "#9am to 6pm\n", + "demand4=2*F #W\n", + "#6pm to midnight\n", + "demand5=2*F+4*B #W\n", + "DEMAND=np.array([demand1,demand2, demand3, demand4, demand5])\n", + "max_demand=max(DEMAND) \n", + "print \"(b) Maximum demand = %0.2f W \"%max_demand \n", + "df=max_demand/LoadConnected #demand factor\n", + "print \"(c) Demand factor = %0.3f\"%df \n", + "E=demand1*5+demand2*2+demand3*2+demand4*9+demand5*6 #Wh\n", + "E=E/1000 #kWh\n", + "print \"(d) Energy consumed during 24 hours = %0.2f kWh \"%E\n", + "Edash=LoadConnected*24/1000 #kWh\n", + "print \"(e) Energy consumed during 24 hours if all devices are used = %0.2f kWh\"%Edash" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Connected Load = 1120.00 W \n", + "(b) Maximum demand = 520.00 W \n", + "(c) Demand factor = 0.464\n", + "(d) Energy consumed during 24 hours = 4.94 kWh \n", + "(e) Energy consumed during 24 hours if all devices are used = 26.88 kWh\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.2 page 3" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import numpy as np\n", + "LoadA=2.5*1000 #W\n", + "#12 midnight to 5am\n", + "d1A=100 #W\n", + "#5am to 6am\n", + "d2A=1.1*1000 #W\n", + "#6am to 8am\n", + "d3A=200 #W\n", + "#8am to 5pm\n", + "d4A=0 #W\n", + "#5pm to 12 midnight\n", + "d5A=500 #W\n", + "LoadB=3*1000 #W\n", + "#11 pm to 7am\n", + "d1B=0 #W\n", + "#7 am to 8 am\n", + "d2B=300 #W\n", + "#8 am to 10 am\n", + "d3B=1*1000 #W\n", + "#10 am to 6 pm\n", + "d4B=200 #W\n", + "#6 pm to 11 pm\n", + "d5B=600 #W\n", + "DEMAND_A=np.array([d1A, d2A, d3A, d4A, d5A]) #W\n", + "DEMAND_B=np.array([d1B, d2B, d3B, d4B, d5B]) #W\n", + "max_demand_A=max(DEMAND_A) #W\n", + "max_demand_B=max(DEMAND_B) #W\n", + "df_A=max_demand_A/LoadA #demand factor\n", + "df_B=max_demand_B/LoadB #demand factor\n", + "print \"Demand factor of consumer A & B are : %0.2f & %0.2f\"%(df_A,df_B) \n", + "gd_factor=(max_demand_A+max_demand_B)/max_demand_A \n", + "print \"Group diversity factor = %0.3f\"%gd_factor\n", + "E_A=d1A*5+d2A*1+d3A*2+d4A*9+d5A*7 #Wh\n", + "E_B=d1B*8+d2B*1+d3B*2+d4B*8+d5B*5 #Wh\n", + "E_A=E_A/1000 #kWh\n", + "E_B=E_B/1000 #kWh\n", + "print \"Energy consumed by A & B during 24 hours = %0.2f & %0.2f kWh \"%(E_A,E_B)\n", + "Emax_A=max_demand_A*24/1000 #kWh\n", + "Emax_B=max_demand_B*24/1000 #kWh\n", + "print \"Maximum energy consumer A & B can consume during 24 hours = %0.2f & %0.2f kWh \"%(Emax_A,Emax_B)\n", + "ratio_A=E_A/Emax_A \n", + "ratio_B=E_B/Emax_B \n", + "print \"Ratio of actual energy to maximum energy of consumer A & B : %0.4f & %0.4f\"%(ratio_A,ratio_B) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Demand factor of consumer A & B are : 0.44 & 0.33\n", + "Group diversity factor = 1.909\n", + "Energy consumed by A & B during 24 hours = 5.50 & 6.90 kWh \n", + "Maximum energy consumer A & B can consume during 24 hours = 26.40 & 24.00 kWh \n", + "Ratio of actual energy to maximum energy of consumer A & B : 0.2083 & 0.2875\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.3 page 6" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "n1=600 #No. of apartments\n", + "L1=5 #kW#Each Apartment Load\n", + "n2=20 #No. of general purpose shops\n", + "L2=2 #kW#Each Shop Load\n", + "df=0.8 #demand factor\n", + "#1 Floor mill\n", + "L3=10 #kW#Load\n", + "df3=0.7 #demand factor\n", + "#1 Saw mill\n", + "L4=5 #kW#Load\n", + "df4=0.8 #demand factor\n", + "#1 Laundry\n", + "L5=20 #kW#Load\n", + "df5=0.65 #demand factor\n", + "#1 Cinema\n", + "L6=80 #kW#Load\n", + "df6=0.5 #demand factor\n", + "#Street lights\n", + "n7=200 #no. of tube lights\n", + "L7=40 #W#Load of each light\n", + "#Residential Load\n", + "df8=0.5 #demand factor\n", + "gdf_r=3 #group diversity factor\n", + "pdf_r=1.25 #peak diversity factor\n", + "#Commertial Load\n", + "gdf_c=2 #group diversity factor\n", + "pdf_c=1.6 #peak diversity factor\n", + "#Solution :\n", + "#Maximum demand of each apartment\n", + "dmax_1a=L1*df8 #kW\n", + "#Maximum demand of 600 apartment\n", + "dmax_a=n1*dmax_1a/gdf_r #kW\n", + "#demand of apartments at system peak time\n", + "d_a_sp=dmax_a/pdf_r #kW\n", + "#Maximum Commercial demand\n", + "dmax_c=(n2*L2*df+L3*df3+L4*df4+L5*df5+L6*df6)/gdf_c #kW\n", + "#Commercial demand at system peak time\n", + "d_c_sp=dmax_c/pdf_c #kW\n", + "#demand of street light at system peak time\n", + "d_sl_sp=n7*L7/1000 #kW\n", + "#Increase in system peak demand\n", + "DI=d_a_sp+d_c_sp+d_sl_sp #kW\n", + "print \"Increase in system peak demand %0.2f kW\" %DI," + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Increase in system peak demand 438.00 kW\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.4 page 12" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#12 to 5 am\n", + "L1=20 #MW\n", + "t1=5 #hours\n", + "#5 to 9 am\n", + "L2=40 #MW\n", + "t2=4 #hours\n", + "#9 to 6 pm\n", + "L3=80 #MW\n", + "t3=9 #hours\n", + "#6 to 10 pm\n", + "L4=100 #MW\n", + "t4=4 #hours\n", + "#10 to 12 am\n", + "L5=20 #MW\n", + "t5=2 #hours\n", + "#Energy Poduced in 24 hours\n", + "E=L1*t1+L2*t2+L3*t3+L4*t4+L5*t5 #MWh\n", + "print \"Energy Supplied by the plant in 24 hours = %0.2f MWh\" %E\n", + "LF=E/24 #%#Load Factor\n", + "print \"Load Factor = %0.2f %% \"%LF " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Energy Supplied by the plant in 24 hours = 1420.00 MWh\n", + "Load Factor = 59.17 % \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.5 page 13" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "C=125 #MW#Installed Capacity\n", + "#12 to 5 am\n", + "L1=20 #MW\n", + "t1=5 #hours\n", + "#5 to 9 am\n", + "L2=40 #MW\n", + "t2=4 #hours\n", + "#9 to 6 pm\n", + "L3=80 #MW\n", + "t3=9 #hours\n", + "#6 to 10 pm\n", + "L4=100 #MW\n", + "t4=4 #hours\n", + "#10 to 12 am\n", + "L5=20 #MW\n", + "t5=2 #hours\n", + "#Energy Poduced in 24 hours\n", + "E=L1*t1+L2*t2+L3*t3+L4*t4+L5*t5 #MWh\n", + "LF=E/24 #%#Load Factor\n", + "CF=LF/C #%#Capacity Factor\n", + "print \"Capacity Factor = %0.3f\" %CF\n", + "UF=100/C #%#Utilisation Factor\n", + "print \"Utilisation Factor = %.1f\" %UF" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacity Factor = 0.473\n", + "Utilisation Factor = 0.8\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.6 page 13" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%matplotlib inline\n", + "from matplotlib.pyplot import plot, show, title, xlabel, ylabel, subplot\n", + "from numpy import array\n", + "import numpy as np\n", + "#12 to 5 am & 10 to 12 am\n", + "L1=20 #MW\n", + "E1=L1*24 #MWh\n", + "#5 to 9 am\n", + "L2=40 #MW\n", + "E2=E1+(L2-L1)*17 #MWh\n", + "#9 to 6 pm\n", + "L3=80 #MW\n", + "E3=E2+(L3-L2)*13 #MWh\n", + "#6 to 10 pm\n", + "L4=100 #MW\n", + "E4=E3+(L4-L3)*4 #MWh\n", + "#Plotting Energy load curve\n", + "L=np.array([0,L1,L2,L3,L4]) #MW\n", + "E=np.array([0,E1,E2,E3,E4]) #Mwh\n", + "subplot(2,1,1)\n", + "plot(E,L)\n", + "xlabel('Energy(MWh)') \n", + "ylabel('Load(MW)') \n", + "title('Energy Load Curve') \n", + "#Energy Supplied\n", + "#Upto 5am\n", + "t1=5 #hours\n", + "E1=L1*t1 #MWh\n", + "#Upto 9am\n", + "t2=4 #hours\n", + "E2=E1+L2*t2 #MWh\n", + "#Upto 6pm\n", + "t3=9 #hours\n", + "E3=E2+L3*t3 #MWh\n", + "#Upto 10pm\n", + "t4=4 #hours\n", + "E4=E3+L4*t4 #MWh\n", + "#Upto 12pm\n", + "t4=2 #hours\n", + "E4=E3+L4*t4 #MWh\n", + "#Plotting Mass curve\n", + "T=[0,1,2,3,4] #MW\n", + "E=[0,E1,E2,E3,E4] #Mwh\n", + "subplot(2,1,2)\n", + "plot(T,E)\n", + "ylabel('Ener2y(MWh)') \n", + "xlabel('0-1: 12-5am 1-2: 5-9am 2-3: 9-6pm 3-4: 6-10pm above4: 10-12pm') \n", + "title('Mass Curve') \n", + "show()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAZMAAAEZCAYAAABSN8jfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXmYVNW1t9+fCCgikwOgoOAURVERVDQOxCGaG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4Crox/n2mmxpJoVZ5JjEXm0r/PBMaZ2az69lVIbf4MsJOkBZLOjOsL9plI\nmgf8BhgRj9lZobbypcAuwIvxKeOseg7vCDwiaTrhB20BIbQAMBK4W9Jk4B1qnyyMuk8Z+U9e6z2J\nSfqaQqr2ocA/JD1c370QvITOwPio+YZ4fKF4cEP68/mtpFeAp4BfJX4My3afhfTXw68kzYhhkmHA\njxq5z4b053MRMDK2yam5c0e9bwKTCH053zKzVY3cZ/62HOcpdDBPJYxGa3pq8MJ9JlcAx8ew4y+A\ncwocf0H8Tm1NSF3/R4DYP/O6Qn/OTdT2i0D4kf6upJlAV+DGuL6he67v/h8BNozn+RUh1JXjY4J3\nPIPw2eYGEwwHro6fy+6J9RAMz6nUhiFXEX7cr4zfkanUhomSJPugCn53JF0V22rj+Bvxs7jpZmAz\nSXOA7wMXFzh+73j814GbVDt14URCeHlEIuKxe+LQ7vF+zyf0j6ynm+L+r5qNp6B3nDKjMFLmwQJP\nkK2e6Jk8aGYDU5bSJiiD11QWWpVn4jhOZvCn1JYjE23tnonjOI5TMu6ZOI7jOCXjxsRxHMcpGTcm\njuM4Tsm4MXEcx3FKxo2J4ziOUzJuTBzHcZyS+f8LR3s+TL5ESQAAAABJRU5ErkJggg==\n", + "text": [ + "<matplotlib.figure.Figure at 0x7f26e82c2e90>" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.7 page 14" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "dmax=40 #MW#Maximum demand\n", + "CF=0.5 #Capacity Factor\n", + "UF=0.8 #Utilisation Factor\n", + "LF=CF/UF #/Load Factor\n", + "print \"(a) Load Factor : %0.3f\"%LF \n", + "C=dmax/UF #MW#Plant Capacity\n", + "print \"(b) Plant Capacity = %0.2f MW \"%C \n", + "RC=C-dmax #MW#Reserve Capacity\n", + "print \"(c) Reserve Capacity = %0.02f MW \"%RC \n", + "p=dmax*LF*24*365 #MWh#Annual Energy Production\n", + "print \"(d) Annual Energy Production = %0.2f MWh \"%p " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Load Factor : 0.625\n", + "(b) Plant Capacity = 50.00 MW \n", + "(c) Reserve Capacity = 10.00 MW \n", + "(d) Annual Energy Production = 219000.00 MWh \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.8 page 14" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%matplotlib inline\n", + "from matplotlib.pyplot import plot, show, title, xlabel, ylabel, subplot\n", + "from numpy import array\n", + "L1=50 #MW#Initial\n", + "t1=5 #hours\n", + "L2=50 #MW#5am\n", + "t2=4 #hours\n", + "L3=100 #MW#9am\n", + "t3=9 #hours\n", + "L4=100 #MW#6pm\n", + "t4=2 #hours\n", + "L5=150 #MW#8pm\n", + "t5=2 #hours\n", + "L6=80 #MW#10pm\n", + "t6=2 #hours\n", + "L7=50 #MW\n", + "#Energy Required in 24 hours\n", + "E=L1*t1+(L2+L3)/2*t2+(L3+L4)/2*t3+(L4+L5)/2*t4+(L5+L6)/2*t5+(L6+L1)/2*t6 #MWh\n", + "print \"Energy required in one day = %0.2f MWh \"%E \n", + "DLF=E/L5/24*100 #%#Daily Load Factor\n", + "print \"Daily Load Factor = %0.2f %%\" %DLF\n", + "#Plotting load curve\n", + "T=np.array([0,1,2,3,4,5,6]) #Slots\n", + "L=np.array([L1,L2,L3,L4,L5,L6,L7]) #MW\n", + "plot(T,L)\n", + "ylabel('Load(MW)') \n", + "xlabel('0-1: 12-5am 1-2: 5-9am 2-3: 9-6pm 3-4: 6-8pm 4-5:8-10pm 5-6 :10-12pm') \n", + "title('Chronological Load Curve') \n", + "show()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Energy required in one day = 2060.00 MWh \n", + "Daily Load Factor = 57.22 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peWAx6R4kQKqJAJ/KMVSLeQWSDiSdjKxLupXAhRGxX0TMURomfBep+6j0\ne/8LqevpFNLBvFIdZ7i/aRjZNPHDTreuVKD+l6EurUrHq4i4g1TD+RmpJ2BOVLllgqRjgL2Al+Rj\n5EkR8U3gGGB14Owc+30RMVScvw74MbAp6d4w51bZ/+G+m+VxpC5Os/5RciZ9zrArdzFJRwDPRMT3\nio6lXfJZ9gURsUXBoXQcpds2HxwRNUdbjZSvWDfrbf14ltiP+1yP0bYyK3JLxMzMGuaWiJmZNcxJ\nxMzMGuYkYmZmDXMSMTOzhjmJmJlZw5xEzMysYf8fAHl1R8P2C3cAAAAASUVORK5CYII=\n", + "text": [ + "<matplotlib.figure.Figure at 0x7f26d514bd90>" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.9 page 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "print \"load duration curve in fig1\"\n", + "print \"the energy consumed upto different times is as \"\n", + "a=[0, 5 ,9 ,18, 20, 22, 24] #time in matrix format\n", + "b=[50, 50 ,100 ,100 ,150 ,80 ,50] #load in matrix format\n", + "\n", + "z = range(0,6)\n", + "for x in range (0,6):\n", + " z[x]=((b[x]+b[x+1])/2)*(a[x+1]-a[x])\n", + "\n", + "et=0\n", + "q = range(0,7)\n", + "m = range(0,7)\n", + "ett = range(0,6)\n", + "for x in range(0,6):\n", + " et=et+z[x] \n", + " A=a[(x)]\n", + " ett[x]=et \n", + " q[x]=a[x+1]\n", + " print \"\\nfrom mid night upto %d,energy=%dMWh\"%(A,et)\n", + "n = sorted(range(len(b)), key=lambda k: b[k], reverse=True)\n", + "m = sorted(b, reverse=True)\n", + "print \"energy curve in fig 2\"\n", + "t=[0, 3.88, 15.88 ,19.88, 23]\n", + "k = range(0,6)\n", + "for j in range(0,6):\n", + " k[j]=a[(j+1)]\n", + "M =range(0,5)\n", + "#rearranging for mass curve\n", + "for i in range(0,5):\n", + " M[i] = m[i]\n", + "Q = range(0,6)\n", + "for i in range(0,6):\n", + " Q[i] = q[i]\n", + " \n", + " \n", + "subplot(121) \n", + "plot(t,M) \n", + "title(\"load duration\")\n", + "xlabel(\"hours\")\n", + "ylabel(\"MW\")\n", + "subplot(122) \n", + "plot(Q,ett) \n", + "title(\"energy curve\")\n", + "xlabel(\"time\")\n", + "ylabel(\"MWh\")\n", + "show()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "load duration curve in fig1\n", + "the energy consumed upto different times is as \n", + "\n", + "from mid night upto 0,energy=250MWh\n", + "\n", + "from mid night upto 5,energy=550MWh\n", + "\n", + "from mid night upto 9,energy=1450MWh\n", + "\n", + "from mid night upto 18,energy=1700MWh\n", + "\n", + "from mid night upto 20,energy=1930MWh\n", + "\n", + "from mid night upto 22,energy=2060MWh\n", + "energy curve in fig 2\n" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAEZCAYAAAB8culNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XvcVXP6//HXuxJSVEJK5BDJoZooCd3jNA3jOEhICDOM\n4zjV8NDtO8PQMGp+DjOGklNEDlEoxq0ocigiRESlgxRFDh2u3x+fdde2730f23uvfbiej8f9aO21\n9lrrWt1r39den6PMDOeccy5RvbgDcM45l3s8OTjnnKvAk4NzzrkKPDk455yrwJODc865Cjw5OOec\nq8CTQxpImiPpkAwct1TS/bV4/1pJO6U7jirON05S32ydzzmXPQ3iDqBAWPSTiePmBEmlwM5mti4Z\nmNkR8UXknMskf3JwSPIvCS5WkurHHUOyYv9ceHJIM0kbSxoiaX70c6ukhtG2ppKekbRY0lJJT0tq\nnbDvjpJelrRc0nigRTXnukLSl5LmSToraVuZpP4Jr8+QNCnh9VpJ50v6GPgoWjdU0heSvpX0pqQD\novW9gIFAb0krJE1LPoeCa6Iitk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rURcoL1bIL5+Z2bvR8lvAzoRxWyZF\n60YANSmnHW9m30TLU4Fh0SiOT5rZO2mN2LmaUyXLAC+Z2ffA95K+AZ6O1s8A9o4GLdwfeDSMOwdA\nw0wGW+j8ySG//JSwvAZInqwj8QO1mvW/302S3reyfCFKLAcShkW/V1Lf9ITqXFol3vtrE16vJXzJ\nrQcsM7POCT97ZDvIQuLJIb99CyxNqCfoC5RFy3OAfaLlEyo7gKTtga/M7G7CGO+dMxKpc9VbATSp\n5T4CsDDJzmeSToAwbLWkvdMcX1HxYqX8klyHYMAZwL8lNQJmE4ZZBrgZGCXpXGBswr7JdRElwBWS\nVhE+nKfjXAzM7GtJr0YV0R9Q+T2bvFz++lTgTknXABsRhvp+F1cnPmS3c865CrxYyTnnXAWeHJxz\nzlXgycE551wFnhycc85V4MnBOedcBZ4cnHPOVeDJwTnnXAWeHJxzzlXw/wGo6EfWAVPtJwAAAABJ\nRU5ErkJggg==\n", + "text": [ + "<matplotlib.figure.Figure at 0x7f26d4f5edd0>" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.10 page 15" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "E=438*10**4 #kWh\n", + "LF=20 #% annual\n", + "CF=15 #%#Capacity Factor\n", + "Lmax=E/(LF/100)/24/365 #kW\n", + "Lmax=Lmax/1000 #MW\n", + "C=Lmax/CF*LF #MW#Plant Capacity\n", + "print \"Plant Capacity = %0.2f MW \"%C \n", + "RC=C-Lmax #MW#Reserve Capacity\n", + "print \"Reserve Capacity = %0.2f MW\"%RC" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Plant Capacity = 3.33 MW \n", + "Reserve Capacity = 0.83 MW\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.11 page 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "L1=10000 #kW\n", + "L2=6000 #kW\n", + "L3=8000 #kW\n", + "L4=7000 #kW\n", + "df=1.5 #diversity factor\n", + "LF=65 #%#Load Factor\n", + "Dinc=60 #%#Increase in maximum demand\n", + "L=L1+L2+L3+L4 #kW#Sum \n", + "L=L/1000 #MW\n", + "Dmax=L/df #MW\n", + "print \"Maximum demand on station = %0.3f MWh \" %Dmax\n", + "E=Dmax*365*24*LF/100 #MWh#Annual Energy\n", + "print \"Annual Energy Supplied = %0.0f MWh \"%E \n", + "Din_max=Dinc/100*Dmax #MW\n", + "C=Dmax+Din_max #MW\n", + "print \"Installed Capacity = %0.3f MW\"%C" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum demand on station = 20.667 MWh \n", + "Annual Energy Supplied = 117676 MWh \n", + "Installed Capacity = 33.067 MW\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.12 page 16" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Arranging data for Load Duration Curve\n", + "#week days 5-9pm load\n", + "L1=350 #MW\n", + "t1=4*5 #hours\n", + "#week days 8-12am & 1-5pm load\n", + "L2=250 #MW\n", + "t2=t1+8*5 #hours\n", + "#saturday & sunday 5-9pm load\n", + "L3=200 #MW\n", + "t3=t2+4*2 #hours\n", + "#All days 150MW load\n", + "L4=150 #MW\n", + "t4=t3+6*5+15*2 #hours\n", + "#All days 100MW load\n", + "L5=100 #MW\n", + "t5=t4+6*5+5*2 #hours\n", + "A=31600 #Total Load Curve Area\n", + "LF=A/L1/24/7*100 #%#Weekly load factor\n", + "print \"Weekly Load factor = %0.2f %%\"%LF\n", + "print \"Load Duration Curve is shown in figure.\" \n", + "#Load Duration Curve\n", + "L=[L1 ,L2, L3, L4, L5] #MW\n", + "T=[t1 ,t2 ,t3 ,t4 ,t5] #hours\n", + "%matplotlib inline\n", + "from matplotlib.pyplot import plot, title, xlabel, ylabel, show\n", + "plot(T,L) \n", + "title('Load Duration Curve')\n", + "xlabel('Time(Hours)')\n", + "ylabel('Load(MW)') \n", + "show()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Weekly Load factor = 53.74 %\n", + "Load Duration Curve is shown in figure.\n" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEZCAYAAACJjGL9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYVOWZ9/HvDxHUoBI1QVBQEiVKjFFHGbOorTMuyYwa\nHeNGjA5kltdMCI6JUbOAySSaRZ15Z+LM9UaTIQQwRoGgxg1DJy6jxgQQJS6MCyKKu+ASBft+/3hO\nSdl2F013nzqnqn6f66qLU+ecOueuprvuOs9znudWRGBmZtadAUUHYGZm5eZEYWZmNTlRmJlZTU4U\nZmZWkxOFmZnV5ERhZmY1OVFYw5I0VdL0ouOoRdIoSWskqehYzHrLicJyIelRSX+R82m6HQQkqU1S\nR/YhvUbS45J+LmnfPAPK3vchbwUYsTwitowcBiwpmSRpiaSXs/d4haQ9+vtc1tqcKCwvQY0P8jp5\nIvuQ3hLYH7gfuKX6g3xjSNqkB7sFUK+rh38DJgFfAN4NjAHmAn+1sQeSNLB/Q7Nm4kRhdSVpsKR/\nlfRE9rhY0qBs21BJ10h6WtLzkq6WtEPVa0dL+o2k1ZJuBLbr6Xkj4omImAJcCnw3O97O2VXHW38H\nktolTcyWT5N0m6SLJD0LTJH0Pkm/lvSspGck/UzS1tn+04FRwNXZVcyXOp9D0ghJ8yQ9J+khSZ+r\nOvfU7IpgWvYe75X0Z938HHcFTgdOjIj2iFgbEa9FxMyIqLy/t95L1fu5pep5h6TTJT0IPCjpEknf\n73SeX0o6oyr2q7L/n4clfaGnP39rbE4UVm9fBcYBH84e44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+ "level": 2, + "metadata": {}, + "source": [ + "exa 1.13 page 17" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "LF=0.825 #Daily Load Factor\n", + "ratio1=0.87 #daily peak load to monthly peak load\n", + "ratio2=0.78 #monthly peak load to annually peak load\n", + "LF_annual=LF*ratio1*ratio2 #Annual Load Factor\n", + "print \"Annual Load Factor : %0.4f\" %LF_annual" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Annual Load Factor : 0.5598\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.14 page 19" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Transformer1\n", + "Lm=300 #kW\n", + "df_m=0.6 #demand factor\n", + "Lc=100 #kW#Commercial Load\n", + "df_c=0.5 #demand factor\n", + "#Transformer2\n", + "Lr2=500 #kW#Residential Load\n", + "df_Lr2=0.4 #demand factor\n", + "#Transformer3\n", + "Lr3=400 #kW\n", + "df_Lr3=0.5 #demand factor\n", + "#Diversity factors\n", + "df1=2.3 \n", + "df2=2.5 \n", + "df3=2 \n", + "DF=1.4 #Diversity factor between transformers\n", + "#Solution :\n", + "print \"Part(a)\" \n", + "Lp1=(Lm*df_m+Lc*df_c)/df1 #kW#Peak load on Transformer1\n", + "print \"Peak load on Transformer1 = %0.2f kW\"%Lp1\n", + "Lp2=Lr2*df_Lr2/df2 #kW#Peak load on Transformer2\n", + "print \"Peak load on Transformer2 = %0.2f kW\"%Lp2 \n", + "Lp3=Lr3*df_Lr3/df3 #kW#Peak load on Transformer3\n", + "print \"Peak load on Transformer3 = %0.2f kW \"%Lp3 \n", + "print \"Part(b)\" \n", + "LpF=(Lp1+Lp2+Lp3)/DF #Peak load on feeder\n", + "print \"Peak load on feeder = %0.2f kW \"%LpF " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "Peak load on Transformer1 = 100.00 kW\n", + "Peak load on Transformer2 = 80.00 kW\n", + "Peak load on Transformer3 = 100.00 kW \n", + "Part(b)\n", + "Peak load on feeder = 200.00 kW \n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.16 page 23" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "L=[20, 25, 30 ,25 ,35 ,20] #MW\n", + "T=[6, 4, 2 ,4 ,4 ,4] #Hours\n", + "Lmax=max(L) #MW\n", + "print \"(a) Maximum demand = %0.2f MW \"%Lmax \n", + "E=L[0]*sum(T)+(L[1]-L[0])*T[1]+(L[2]-L[0])*T[2]+(L[3]-L[0])*T[3]+(L[4]-L[0])*T[4]+(L[5]-L[0])*T[5] #MWh\n", + "E=E*1000 #kWh\n", + "print \"(b) Units generated per day = %0.e kWh \"%E \n", + "Lavg=E/sum(T) #/kWh\n", + "Lavg=Lavg/1000 #/MW\n", + "print \"(c) Average Load = %0.2f MW \"%Lavg \n", + "LF=Lavg/Lmax*100 #%\n", + "print \"(d) Load Factor = %0.2f %%\" %LF" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Maximum demand = 35.00 MW \n", + "(b) Units generated per day = 6e+05 kWh \n", + "(c) Average Load = 25.00 MW \n", + "(d) Load Factor = 71.43 %\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.17 page 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import acos, sin\n", + "pf=0.8 #power factor\n", + "delf=1 #%#drop in frequency(delf/f)\n", + "#delP=-2*(sind(theta))**2*delf\n", + "theta=acos(pf) #degree\n", + "delP_BY_delf=-2*sin(theta)**2 #increase in load wrt frequency\n", + "print \"1%% drop in frequency, Increased in Load = %0.2f %%\"%-delP_BY_delf " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1% drop in frequency, Increased in Load = 0.72 %\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.18 page 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "Lmax=100 #MW\n", + "LF=40 #%#Load Factor\n", + "Lavg=Lmax*LF/100 #MW\n", + "E=Lavg*24*365 #MWh\n", + "print \"Energy generated in a year = %0.f MWh \"%E " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Energy generated in a year = 350400 MWh \n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 1.19 page 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sqrt\n", + "V=400 #V\n", + "s1=0.03 #initial slip\n", + "delV=1 #%#/Voltage Drop\n", + "R1=0.290 #ohm/phase\n", + "R2=0.15 #ohm/phase\n", + "X=0.7 #ohm/phase(X1+X2)\n", + "#V1**2*s1=V2**2*s2 for speed independent torque\n", + "#taking for calculating s2\n", + "V1=1 #V \n", + "V2=V1-V1*delV/100 #V\n", + "s2=V1**2/V2**2*s1 #slip\n", + "I2ByI1=sqrt((R1+R2/s1)**2+X**2)/sqrt((R1+R2/s2)**2+X**2)*(V2/V1)\n", + "delI=(I2ByI1-1)*100 #%#Current Increase\n", + "print \"1%% drop in Voltage increases current by = %0.2f %%\"%delI\n", + "#P=(R1+R2/s)*I**2\n", + "P2ByP1=(R1+R2/s2)/(R1+R2/s1)*I2ByI1**2 #ratio\n", + "delP=(1-P2ByP1)*100 #%#Power Decrease\n", + "print \"1%% drop in Voltage decreases power input by = %0.1f %%\"%delP \n", + "#Answer in the textbook is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "1% drop in Voltage increases current by = 0.86 %\n", + "1% drop in Voltage decreases power input by = 0.2 %\n" + ] + } + ], + "prompt_number": 18 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter2.ipynb b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter2.ipynb new file mode 100644 index 00000000..3715bfd2 --- /dev/null +++ b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter2.ipynb @@ -0,0 +1,1251 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:70df2c2ea162c91143e39d28a0492123af67480921c2426118d0264aa7d3e7f6" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch- 2 : Economic Operation of Power System & Unit Commitment" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.2 page 39" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from sympy.mpmath import quad\n", + "#For equal incremental cost\n", + "L1=125 #MW\n", + "L2=100 #MW\n", + "#For equal sharing\n", + "L=(L1+L2)/2 #MW\n", + "#Change in cost Unit 1\n", + "f1 = lambda P1:0.2*P1+30 \n", + "dC1=quad(f1,[L1,L]) #Rs./hour\n", + "#Change in cost Unit 2\n", + "f2 = lambda P2 : 0.15*P2+40\n", + "dC2=quad(f2,[L2,L]) #Rs./hour\n", + "dCyearly=(dC1+dC2)*24*365 #Rs./year\n", + "print \"Saving per year in economic load allocation = %0.2f Rs./year \"%(dCyearly) \n", + "#Answer in the textbook is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Saving per year in economic load allocation = 239531.25 Rs./year \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.3 page 43" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "L=400 #/MW#/total load\n", + "delPD=50 #MW#increase in demand\n", + "#dC1/dP1=0.2*P1+30\n", + "#dC2/dP2=0.15*P2+40\n", + "twoC1=0.2 #from above equation\n", + "twoC2=0.15 #from above equation\n", + "delP1_by_delPD=(1/twoC1)/(1/twoC1+1/twoC2) \n", + "delP2_by_delPD=(1/twoC2)/(1/twoC1+1/twoC2) \n", + "delP1=delP1_by_delPD*delPD #MW\n", + "print \"Increase in generation of unit1 = %0.2f MW \"%delP1 \n", + "delP2=delP2_by_delPD*delPD #MW\n", + "print \"Increase in generation of unit2 = %0.2f MW \"%delP2 \n", + "P1=L/2+delP1 #load on unit 1\n", + "print \"Total load on unit1 = %0.2f MW \"%P1 \n", + "P2=L/2+delP2 #load on unit 2\n", + "print \"Total load on unit2 = %0.2f MW\" %P2\n", + "print \"Checking incremental cost :\" \n", + "dC1_by_dP1=0.2*P1+30 #Rs./MWh\n", + "print \"Incremental cost of unit 1 = %0.2f Rs./MWh \"%dC1_by_dP1 \n", + "dC2_by_dP2=0.2*P2+30 #Rs./MWh\n", + "print \"Incremental cost of unit 2 = %0.2f Rs./MWh \"%dC2_by_dP2 \n", + "print \"Conclusion : Cost are same(Approximately).\" \n", + "#Note : Values calculated in the book are slightly wrong because of accuracy in calculation as compared to scilab accuracy." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Increase in generation of unit1 = 21.43 MW \n", + "Increase in generation of unit2 = 28.57 MW \n", + "Total load on unit1 = 221.43 MW \n", + "Total load on unit2 = 228.57 MW\n", + "Checking incremental cost :\n", + "Incremental cost of unit 1 = 74.29 Rs./MWh \n", + "Incremental cost of unit 2 = 75.71 Rs./MWh \n", + "Conclusion : Cost are same(Approximately).\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.5 page 47" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import atan, cos\n", + "I1=0.8 #p.u.\n", + "I2=1 #p.u.\n", + "Za=0.04+1J*0.12 #p.u.\n", + "Zb=0.03+1J*0.1 #p.u.\n", + "Zc=0.03+1J*0.12 #p.u.\n", + "V=1 #p.u.\n", + "#Solution : \n", + "V1=V+(I1+I2)*Za+I1*(Zb) #p.u.\n", + "V2=V+(I1+I2)*Za+I2*(Zc) #p.u.\n", + "P1=(I1*V1).real #p.u.\n", + "P2=(I2*V2).real #p.u.\n", + "fi1=atan((V1.imag)/(V1.real)) \n", + "fi2=atan((V2.imag)/(V2.real)) \n", + "print \"Loss Coefficients are : \"\n", + "B11=((Za.real)+(Zb.real))/(abs(V1)**2*cos(fi1)**2) #p.u.\n", + "print \"B11 = %0.5f\"%B11,\"p.u.\" \n", + "B22=((Za.real)+(Zc.real))/(abs(V2)**2*cos(fi2)**2) #p.u.\n", + "print \"B22 = %0.4f\"%B22,\"p.u. \" \n", + "B12=((Za.real))/(abs(V1)*abs(V2)*cos(fi1)*cos(fi2)) #p.u.\n", + "print \"B12 = %0.4f\"%B12,\"p.u.\" \n", + "PL=P1**2*B11+P2**2*B22+2*P1*P2*B12 #p.u.\n", + "print \"Transmission Loss = %0.6f p.u.\" %PL\n", + "#Note : Values calculated in the book are slightly wrong because of accuracy in calculation as compared to scilab accuracy." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Loss Coefficients are : \n", + "B11 = 0.05827 p.u.\n", + "B22 = 0.0576 p.u. \n", + "B12 = 0.0331 p.u.\n", + "Transmission Loss = 0.178800 p.u.\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.7 page 53" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import atan, degrees, cos, pi\n", + "Za=0.03+1J*0.09 #p.u.\n", + "Ia=1.5-1J*0.4 #p.u.\n", + "Zb=0.10+1J*0.30 #p.u.\n", + "Ib=0.5-1J*0.2 #p.u.\n", + "Zc=0.03+1J*0.09 #p.u.\n", + "Ic=1-1J*0.1 #p.u.\n", + "Zd=0.04+1J*0.12 #p.u.\n", + "Id=1-1J*0.2 #p.u.\n", + "Ze=0.04+1J*0.12 #p.u.\n", + "Ie=1.5-1J*0.3 #p.u.\n", + "V=1 #p.u.\n", + "base=100 #MVA\n", + "#Solution\n", + "#Currents of load\n", + "IL1=0.4 #p.u.\n", + "IL2=0.6 #p.u.\n", + "#Current distribution factors :\n", + "Na1=1; Na2=0 \n", + "Nb1=0.6; Nb2=-0.4 \n", + "Nc1=0 ;Nc2=1 \n", + "Nd1=0.4; Nd2=0.4 \n", + "Ne1=0.6 ;Ne2=0.6 \n", + "#Bus Voltages\n", + "V1=V+Ia*Za #p.u.\n", + "V2=V-Ib*Zb+Ic*Zc #p.u.\n", + "#Phase Angles\n", + "theta1=degrees(atan((Ia.imag)/(Ia.real)) )#degree\n", + "theta2=degrees(atan((Ic.imag)/(Ic.real)) )#degree\n", + "#Power Factors : \n", + "cos_fi1=cos(atan((V1.imag)/(V1.real))-theta1*pi/180) #source 1 power factor\n", + "cos_fi2=cos(atan((V2.imag)/(V2.real))-theta2*pi/180) #source 2 power factor\n", + "print \"Loss formula Coefficients in p.u. :\"\n", + "B11=(Na1**2*(Za.real)+Nb1**2*(Zb.real)+Nc1**2*(Zc.real)+Nd1**2*(Zd.real)+Ne1**2*(Ze.real))/(abs(V1)**2*cos_fi1) #p.u.\n", + "print \"B11 = %0.5f p.u \"%B11 \n", + "B22=(Na2**2*(Za.real)+Nb2**2*(Zb.real)+Nc2**2*(Zc.real)+Nd2**2*(Zd.real)+Ne2**2*(Ze.real))/(abs(V2)**2*cos_fi2) #p.u.\n", + "print \"B22 = %0.5f p.u\" %B22\n", + "B12=(Na1*Na2*(Za.real)+Nb1*Nb2*(Zb.real)+Nc1*Nc2*(Zc.real)+Nd1*Nd2*(Zd.real)+Ne1*Ne2*(Zc).real)/(abs(V1)*abs(V2)*cos_fi1*cos_fi2*(cos(theta1*pi/180-theta2*pi/180))) #p.u.\n", + "print \"B12 = %0.5f\"%B12,\"p.u \" \n", + "#Converting p.u. to actual value\n", + "print \"Loss formula Coefficients in MW**-1 :\"\n", + "B11=B11/base #MW**-1\n", + "print \"B11 = %0.5f\"%B11,\"MW**-1\" \n", + "B22=B22/base #MW**-1\n", + "print \"B22 = %0.5f\"%B22,\"MW**-1\" \n", + "B12=B12/base #MW**-1\n", + "print \"B12 = %0.5f\"%B12,\"MW**-1\" \n", + "#Note : Values calculated in the book are slightly wrong because of accuracy in calculation as compared to scilab accuracy." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Loss formula Coefficients in p.u. :\n", + "B11 = 0.07877 p.u \n", + "B22 = 0.07735 p.u\n", + "B12 = -0.00732 p.u \n", + "Loss formula Coefficients in MW**-1 :\n", + "B11 = 0.00079 MW**-1\n", + "B22 = 0.00077 MW**-1\n", + "B12 = -0.00007 MW**-1\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.8 page 54" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#dC1/dP1=0.2*P1+22 #Rs./MWh\n", + "#dC2/dP2=0.15*P2+30 #Rs./MWh\n", + "B22=0; B12=0 #Because Loss is independent wrt P2\n", + "P1=100 #MW\n", + "PL=15 #MW\n", + "B11=PL/P1**2 #MW**-1\n", + "L1=1/(1-0.003*P1)#Penalty Factor plant 1\n", + "L2=1 #Penalty Factor of plant 2\n", + "lamda=60 \n", + "#lamda=dC1/dP1*L1=dC2/dP2*L2\n", + "#dC1/dP1*L1=dC2/dP2*L2\n", + "P2=((0.2*P1+22)*L1-30)/0.15 #MW\n", + "P=P1+P2-B11*P1**2 #MW#Total Load\n", + "print \"Required generation at plant1 = %0.2f MW \"%P1 \n", + "print \"Required generation at plant2 = %0.2f MW\" %P2\n", + "print \"Total Load = %0.2f MW \"%P " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required generation at plant1 = 100.00 MW \n", + "Required generation at plant2 = 200.00 MW\n", + "Total Load = 285.00 MW \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.9 page 55" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#dC1/dP1=0.2*P1+22 #Rs./MWh\n", + "#dC2/dP2=0.15*P2+30 #Rs./MWh\n", + "B22=0 ;B12=0 #Because Loss is independent wrt P2\n", + "P1=100 #MW\n", + "PL=15 #MW\n", + "B11=PL/P1**2 #MW**-1\n", + "L1=1/(1-0.003*P1) #Penalty Factor plant 1\n", + "L2=1 #Penalty Factor of plant 2\n", + "lamda=60 \n", + "#lamda=dC1/dP1*L1=dC2/dP2*L2\n", + "#dC1/dP1*L1=dC2/dP2*L2\n", + "P2=((0.2*P1+22)*L1-30)/0.15 #MW\n", + "P=P1+P2-B11*P1**2 #MW#Total Load\n", + "#dC1/dP1=dC2/dP2 neglecting transmission loss\n", + "#clear('P2') #for recalculation\n", + "#0.2*P1-0.15*P2-8=0 #/eqn(1)\n", + "#P1=0.75*P2+40 #P1+P2-B11*P1**2-P=0 #eqn(2)\n", + "#1.75*P2-B11*P1**2=P-40\n", + "#Eqn=[-B11 1.75 40-P] \n", + "from sympy import symbols, solve\n", + "P22 = symbols('P22')\n", + "Eqn=-B11*P22**2+1.75*P22+40-P \n", + "P22=solve(Eqn, P22)\n", + "P2=P22[0]#MW#neglecting higher value\n", + "P1=0.75*P2+40 #MW\n", + "from sympy.mpmath import quad\n", + "dC1=quad(lambda P: 0.2*P+22,[100,P1]) #Rs.#Additional Cost plant1\n", + "dC2=quad(lambda P: 0.15*P+30,[200,P2]) #Rs.#Decreased Cost plant2\n", + "dC=dC1+dC2 #Rs./hour#Net change in cost\n", + "print \"Taking transmission loss in account, Net saving per hour in fuel cost = %0.2f Rs./hour \"%dC \n", + "#Note : Values calculated in the book are slightly wrong because of accuracy in calculation as compared to scilab accuracy." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Taking transmission loss in account, Net saving per hour in fuel cost = 854.74 Rs./hour \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.10 page 55" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "B11=0.001 #MW**-1\n", + "B22=0.0024 #MW**-1\n", + "B12=-0.0005 #MW**-1\n", + "#dC1/dP1=0.8*P1+16 #Rs./MWh\n", + "#dC2/dP2=0.08*P2+12 #Rs./MWh\n", + "lamda=20 \n", + "#Iterations for calculating value\n", + "P1 = range(0,10)\n", + "P1[0]=0 \n", + "P2 = range(0,10)\n", + "P2[0]=0 \n", + "for i in range(1,10):\n", + " P1[i] =( 0.2+0.001*P2[i-1])/0.006 \n", + " P2[i] = (0.4+0.001*P1[i])/0.0088 \n", + " if P1[i]==P1[i-1]:\n", + " break \n", + " \n", + "\n", + "P1=P1[i] #MW\n", + "print \"Generation P1 = %0.2f MW\" %P1\n", + "P2=P2[i] #MW\n", + "print \"Generation P2 = %02.f MW \"%P2 \n", + "PL=B11*P1**2+2*B12*P1*P2+B22*P2**2 #MW\n", + "print \"Transmission Loss = %0.2f MW \"%PL \n", + "Pr=P1+P2-PL #MW\n", + "print \"Received Power = %0.2f MW \"%Pr " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Generation P1 = 41.70 MW\n", + "Generation P2 = 50 MW \n", + "Transmission Loss = 5.69 MW \n", + "Received Power = 86.20 MW \n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.11 page 56" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#C1=561+7.92*P1+0.001562*P1**2 #Rs./hour\n", + "#C2=310+7.85*P2+0.00194*P2**2 #Rs./hour\n", + "a1=561 ;a2=310 \n", + "b1=7.92 ;b2=7.85 \n", + "c1=0.001562 ;c2=0.00194 \n", + "ce=c1*c2/(c1+c2) \n", + "be=ce*(b1/c1+b2/c2) \n", + "ae=a1-b1**2/4/c1+a2-b2**2/4/c2+be**2/4/ce \n", + "print \"Coefficients are : \" \n", + "print \"ae = \",(ae),\" & be = \",(be)\n", + "print \"ce = \",ce\n", + "from sympy import symbols\n", + "PT = symbols('PT') \n", + "CT = round(ae,2)+round(be,2)*PT+round(ce,4)*PT**2\n", + "print \"Cost Characteristics : \",CT\n", + "#print \"CT=870.753+7.8888*PT+0.0008653*PT**2\" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coefficients are : \n", + "ae = 870.650199886 & be = 7.88877784123\n", + "ce = 0.000865299828669\n", + "Cost Characteristics : 0.0009*PT**2 + 7.89*PT + 870.65\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.12 page 57" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from sympy import symbols,solve\n", + "#C1=7700+52.8*P1+5.5*10**-3*P1**2 #Rs./hour\n", + "#C2=2500+15*P2+0.05*P2**2 #Rs./hour\n", + "a1=7700 ;a2=2500 \n", + "b1=52.8 ;b2=15 \n", + "c1=5.5*10**-3 ;c2=0.05 \n", + "P1, P2 = symbols('P1 P2')\n", + "dC1bydP1=52.8+2*5.5*10**-3*P1 \n", + "dC2bydP2=15+2*0.05*P2 \n", + "print \"For 1200 MW Load :\" \n", + "P=1200 #MW\n", + "#Let loads of unit are P1 & 1200-P1\n", + "#Economical Loading dC1/dP1=dC2/dP2\n", + "eqn=52.8+2*5.5*10**-3*P1-15-2*0.05*(1200-P1) \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P2=P-P1 #MW\n", + "print \"P1 = %0.2f MW \"%P1 \n", + "print \"P2 = %0.2f MW \"%P2 \n", + "print \"For 900 MW Load :\" \n", + "P=900 #MW\n", + "#clear('P1','P2') \n", + "P1, P2 = symbols('P1 P2')\n", + "#Let loads of unit are P1 & 900-P1\n", + "#Economical Loading dC1/dP1=dC2/dP2\n", + "eqn=52.8+2*5.5*10**-3*P1-15-2*0.05*(900-P1) \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P2=P-P1 #MW\n", + "print \"P1 = %0.2f MW \"%P1 \n", + "print \"P2 = %0.2f MW \"%P2 \n", + "print \"For 500 MW Load :\" \n", + "P=500 #MW\n", + "#clear('P1','P2') \n", + "P1, P2 = symbols('P1 P2')\n", + "#Let loads of unit are P1 & 500-P1\n", + "#Economical Loading dC1/dP1=dC2/dP2\n", + "eqn=52.8+2*5.5*10**-3*P1-15-2*0.05*(500-P1) \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P2=P-P1 #MW\n", + "#Minimum load is 200MW\n", + "if P1<200:\n", + " P2=P1+P2\n", + " P1=0 \n", + "print \"P1 = %0.2f MW \"%P1 \n", + "print \"P2 = %0.2f MW \"%P2 \n", + "C=(2500+15*P2+0.05*P2**2)*10 #Rs.#Operating cost for 10 hour\n", + "print \"Operating cost for 10 hour = %0.2f Rs. \"%C \n", + "print \"Other option : \" \n", + "P1=200 #MW\n", + "P2=300 #MW\n", + "print \"P1 = %0.2f MW \"%P1 \n", + "print \"P2 = %0.2f MW \"%P2 \n", + "C1=7700+52.8*P1+5.5*10**-3*P1**2 #Rs./hour\n", + "C2=2500+15*P2+0.05*P2**2 #Rs./hour\n", + "C=10*(C1+C2) #Rs.#Operating cost for 10 hour\n", + "print \"Operating cost for 10 hour = %0.2f Rs. \"%C \n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For 1200 MW Load :\n", + "P1 = 740.54 MW \n", + "P2 = 459.46 MW \n", + "For 900 MW Load :\n", + "P1 = 470.27 MW " + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "P2 = 429.73 MW \n", + "For 500 MW Load :\n", + "P1 = 0.00 MW \n", + "P2 = 500.00 MW \n", + "Operating cost for 10 hour = 225000.00 Rs. \n", + "Other option : \n", + "P1 = 200.00 MW \n", + "P2 = 300.00 MW \n", + "Operating cost for 10 hour = 299800.00 Rs. \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.13 page 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#C1=2000+20*P1+0.05*P1**2 #Rs./hour\n", + "#C2=2750+26*P2+0.03091*P2**2 #Rs./hour\n", + "P1=350 #MW\n", + "P2=550 #MW\n", + "C1=2000+20*P1+0.05*P1**2 #Rs./hour\n", + "C2=2750+26*P2+0.03091*P2**2 #Rs./hour\n", + "C=C1+C2 #Rs./hour\n", + "print \"(a) Total Cost = %0.2f Rs./hour \"%C \n", + "P=P1+P2 #MW#Total Load\n", + "P1, P2 = symbols('P1 P2')\n", + "dC1bydP1=20+2*0.05*P1 \n", + "dC2bydP2=26+2*0.03091*P2 \n", + "print \"(b) For Economic Scheduling\"\n", + "#dC1/dP1=dC2/dP2 for economic sheduling\n", + "#Let loads of unit are P1 & P-P1\n", + "eqn=20+2*0.05*P1-26-2*0.03091*(P-P1) \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P2=P-P1 #MW\n", + "print \"Loads P1 & P2 = %0.2f & %0.2f MW\"%(P1, P2)\n", + "C1=2000+20*P1+0.05*P1**2 #Rs./hour\n", + "C2=2750+26*P2+0.03091*P2**2 #Rs./hour\n", + "Cnew=C1+C2 #Rs./hour\n", + "print \"Total Cost = %0.2f Rs./hour \"%Cnew \n", + "saving=C-Cnew #Rs./hour\n", + "print \"Total saving %0.2f Rs./hour \"%saving \n", + "Lt=P1-350 #MW#Tie line load\n", + "print \"Tie line load from Plant1 to Plant2 = %0.2f MW \"%Lt" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Total Cost = 41525.28 Rs./hour \n", + "(b) For Economic Scheduling\n", + "Loads P1 & P2 = 380.90 & 519.10 MW" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "Total Cost = 41448.00 Rs./hour \n", + "Total saving 77.28 Rs./hour \n", + "Tie line load from Plant1 to Plant2 = 30.90 MW \n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.14 page 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#C=5000+450*P+0.5*P**2 #Rs./hour\n", + "e1=+2 #%#error\n", + "e2=-2 #%#error\n", + "P=200 #MW#Total Load\n", + "#Considering error\n", + "P1, P2 = symbols('P1 P2')\n", + "C1=(5000+450*P+0.5*P1**2)*0.98 #Rs./hour\n", + "C2=(5000+450*P+0.5*P2**2)*1.02 #Rs./hour\n", + "#Let loads of unit are P1 & P-P1\n", + "#dC1/dP1=dC2/dP2 for economic sheduling\n", + "eqn=450*0.98+2*0.5*P1*0.98-450*1.02-2*0.5*(P-P1)*1.02 \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P2=P-P1 #MW\n", + "#if no instrumention error\n", + "C1=(5000+450*P1+0.5*P1**2)*0.98 #Rs./hour\n", + "C2=(5000+450*P2+0.5*P2**2)*1.02 #Rs./hour\n", + "C=C1+C2 #Rs./hour\n", + "#Due to intrumentation error\n", + "P1=P/2 #MW\n", + "P2=P/2 #MW\n", + "C1=(5000+450*P1+0.5*P1**2)*0.98 #Rs./hour\n", + "C2=(5000+450*P2+0.5*P2**2)*1.02 #Rs./hour\n", + "Cerr=C1+C2 #Rs./hour\n", + "Cextra=Cerr-C #Rs,/hour\n", + "print \"Extra operating cost = %0.2f Rs./hour \"%Cextra " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Extra operating cost = 121.00 Rs./hour \n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.15 page 59" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "P1, P2, P3 = symbols('P1 P2 P3')\n", + "Q1=0.002*P1**2+0.86*P1+20 #tons/hour\n", + "Q2=0.004*P2**2+1.08*P2+20 #tons/hour\n", + "Q3=0.0028*P3**2+0.64*P3+36 #tons/hour\n", + "Pmax=120 #MW\n", + "Pmin=36 #MW\n", + "P=200 #MW\n", + "C=500 #Rs./ton\n", + "#C1=C*Q1 C2=C*Q2 C3=C*Q3 #Rs./ton\n", + "dC1bydP1=2*P1+430 #Rs./hour\n", + "dC2bydP2=4*P2+540 #Rs./hour\n", + "dC3bydP3=2.8*P3+320 #Rs./hour\n", + "#P1+P2+P3=P\n", + "A1=[1 ,1 ,1] #Coefficient Matrix\n", + "B1=[P] #Coefficient Matrix\n", + "#For minimal cost above 3 equation should be equal\n", + "#eqn1=2*P1-4*P2+430-540 \n", + "#eqn2=4*P2-2.8*P3-320+540 \n", + "A2=[0 ,4 ,-2.8] #Coefficient Matrix\n", + "B2=[-540+320] #Coefficient Matrix\n", + "#eqn3=-2*P1+2.8*P3+320-430 \n", + "A3=[-2 ,0 ,2.8] #Coefficient Matrix\n", + "B3=[430-320] #Coefficient Matrix\n", + "#solving by matrix method\n", + "import numpy as np\n", + "A=np.mat([A1[:] ,A2[:], A3[:]]) #Coefficient Matrix\n", + "B=[B1 ,B2 ,B3] #Coefficient Matrix\n", + "X=A**-1*B #Solution Matrix\n", + "P1=X[0] #MW\n", + "P2=X[1] #MW\n", + "P3=X[2] #MW\n", + "Pmax=120 #MW\n", + "Pmin=36 #MW\n", + "if P2<Pmin:\n", + " P2=Pmin #MW \n", + "\n", + "#P1+P3=P-P2#eqn(4)\n", + "A1=[1 ,1] #Coefficient Matrix\n", + "B1=[P-P2] #Coefficient Matrix\n", + "#eqn3=-2*P1+2.8*P3+320-430 \n", + "A2=[-2, 2.8] #Coefficient Matrix\n", + "B2=[430-320] #Coefficient Matrix\n", + "#solving by matrix method\n", + "A=np.mat([A1[:], A2[:]]) #Coefficient Matrix\n", + "B=np.mat([B1[:], B2[:]]) #Coefficient Matrix\n", + "X=A**-1*B #Solution Matrix\n", + "P1=X[0] #MW\n", + "P3=X[1] #MW\n", + "print \"According to optimum scheduling, Load distriution is :\" \n", + "print \"P1 = %0.2f MW \"%P1 \n", + "print \"P2 = %0.2f MW \"%P2 \n", + "print \"P3 = %0.2f MW \"%P3 " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "According to optimum scheduling, Load distriution is :\n", + "P1 = 72.75 MW \n", + "P2 = 36.00 MW \n", + "P3 = 91.25 MW \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.16 page 60" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "L=30 #MW\n", + "#I=(32+32*L+1.68*L**2)*10**5 \n", + "t1=18 #/hours\n", + "t2=6 #/hours\n", + "#Full load 18 hours\n", + "I1=(32+32*L+1.68*L**2)*10**5*t1 #kJ\n", + "#Half load 6 hours\n", + "I2=(32+32*L/2+1.68*(L/2)**2)*10**5*t2\n", + "I=I1+I2 #kJ\n", + "print \"(a) Heat input per day = %0.2e kJ \"%I \n", + "E=L*t1+L/2*t2 #MWh#/Energy produced in 24 hours\n", + "Lu=E/(t1+t2) #MW\n", + "Inew=(32+32*Lu+1.68*Lu**2)*10**5*(t1+t2) #kJ\n", + "saving=I-Inew #/kJ\n", + "saving=saving/(E*1000) #kJ/kWh\n", + "print \"(b) Saving in heat per kWh of energy = %0.2f kJ/kWh \" %saving" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Heat input per day = 5.04e+09 kJ \n", + "(b) Saving in heat per kWh of energy = 270.00 kJ/kWh \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.17 page 61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "P=800 #MW(Total Load)\n", + "#Using Variable for Cost Curve Equation\n", + "P1, P2, P3 = symbols('P1 P2 P3')\n", + "#Cost Curve Equation\n", + "C1=450+6.5*P1+0.0013*P1**2 #Rs./hour\n", + "C2=300+7.8*P2+0.0019*P2**2 #Rs./hour\n", + "C3=80+8.1*P3+0.005*P3**2 #Rs./hour\n", + "#Part(a) is not computational\n", + "#Part (b)\n", + "dC1BydP1=6.5+2*0.0013*P1 #Rs./MWh#/eqn(1)\n", + "dC2BydP2=7.8+2*0.0019*P2 #Rs./MWh#/eqn(2)\n", + "dC3BydP3=8.1+2*0.005*P3 #Rs./MWh#/eqn(3)\n", + "#P1+P2+P3=P #MW#/eqn(4)\n", + "A1=[1 ,1 ,1] #Coefficient Matrix\n", + "B1=[800] #Coefficient Matrix\n", + "#Equating eqn(1) & (2)\n", + "A2=[2*0.0013, -2*0.0019, 0] #Coefficient Matrix\n", + "B2=[7.8-6.5] #Coefficient Matrix\n", + "#Equating eqn(2) & (3)\n", + "A3=[0 ,2*0.0019, -2*0.005] #Coefficient Matrix\n", + "B3=[8.1-7.8] #Coefficient Matrix\n", + "#Solution By Matrix method\n", + "import numpy as np\n", + "A=np.mat([A1[:], A2[:], A3]) #Coefficient Matrix\n", + "B=np.mat([B1[:], B2[:], B3[:]]) #Coefficient Matrix\n", + "X=A**-1*B #Solution Matrix\n", + "P1=X[0] #MW\n", + "P2=X[1] #MW\n", + "P3=X[2] #MW\n", + "print \"(b) According to optimum scheduling, Load distriution is :\" \n", + "print \"P1 = %0.2f MW\" %P1\n", + "print \"P2 = %0.2f MW\" %P2\n", + "print \"P3 = %0.2f MW\" %P3\n", + "#Part(c)\n", + "print \"(c) Optimum scheduling : \" \n", + "P1max=600 #MW\n", + "P1min=100 #MW\n", + "P2max=400 #MW\n", + "P2min=50 #MW\n", + "P3max=200 #MW\n", + "P3min=50 #MW\n", + "if P2<P2max and P2>P2min:\n", + " print \"P2 is within maximum and minimum limits.\" \n", + " P1=P1max #MW\n", + " P3=P3min #MW\n", + " P2=P-P1-P3 #MW\n", + "\n", + "#Lambda=dC2/dP2 as P2 is niether maximum limit nor minimum limit.\n", + "dC2BydP2=7.8+2*0.0019*P2 #Rs./MWh\n", + "lamda=dC2BydP2 #Rs./MWh\n", + "dC1BydP1=6.5+2*0.0013*P1 #Rs./MWh\n", + "dC3BydP3=8.1+2*0.005*P3 #Rs./MWh\n", + "if dC1BydP1<lamda :\n", + " print \"Condition for P1 satisfied.\" \n", + "\n", + "if dC3BydP3>lamda:\n", + " print \"Condition for P3 satisfied.\" \n", + "\n", + "print \"Load distribution is : \" \n", + "print \"P1 = %0.2f MW\" %P1\n", + "print \"P2 = %0.2f MW\" %P2\n", + "print \"P3 = %0.2f MW\" %P3" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(b) According to optimum scheduling, Load distriution is :\n", + "P1 = 669.73 MW\n", + "P2 = 116.13 MW\n", + "P3 = 14.13 MW\n", + "(c) Optimum scheduling : \n", + "P2 is within maximum and minimum limits.\n", + "Condition for P1 satisfied.\n", + "Condition for P3 satisfied.\n", + "Load distribution is : \n", + "P1 = 600.00 MW\n", + "P2 = 150.00 MW\n", + "P3 = 50.00 MW\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.18 page 62" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import numpy as np\n", + "Bmn=np.mat([[0.0676, 0.00953, -0.00507],[0.00953 ,0.0521, 0.00901],[-0.00507, 0.00901, 0.0294]]) #Loss Coefficient\n", + "Bno=np.mat([[-0.0766],[0.00342],[0.0189]]) #Loss Coefficient\n", + "Boo=0.04357 #Loss Coefficient\n", + "P1=107.9 #MW\n", + "P2=50 #MW\n", + "P3=60 #MW\n", + "#solution : \n", + "#PL=np.mat([[P1], [P2], [P3]])*Bmn+np.mat([[P1], [P2], [P3]])*Bno+Boo #MW\n", + "PL=np.mat([P1, P2, P3])*Bmn+np.mat([P1, P2, P3])*Bno+Boo #MW\n", + "pl= 0\n", + "for x in range(0,1):\n", + " for y in range(0,3):\n", + " pl+= PL[x,y]\n", + "print \"Transmission Loss = %0.2f MW \"%-pl \n", + "#Note : Values calculated in the book are slightly wrong because of accuracy in calculation as compared to scilab accuracy." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Transmission Loss = 7.44 MW \n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.19 page 64" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#lambda1=0.1*P1+20 #Rs./MWh\n", + "#lambda2=0.12*P2+16 #Rs./MWh\n", + "P=180 #MW\n", + "#Let loads are P1 & P-P1\n", + "#Economical loading lambda1=lambda2\n", + "P1, P2 = symbols('P1 P2')\n", + "eqn=0.1*P1+20-0.12*(P-P1)-16 \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P2=P-P1 #MW\n", + "print \"Load P1 = %0.2f MW \"%P1 \n", + "print \"Load P2 = %0.2f MW \"%P2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Load P1 = 80.00 MW \n", + "Load P2 = 100.00 MW \n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.20 page 65" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#F1=0.004*P1**2+2*P1+80 #Rs./hr\n", + "#F2=0.006*P2**2+1.5*P2+100 #Rs./hr\n", + "P=250 #MW\n", + "P1, P2 = symbols('P1 P2')\n", + "dF1bydP1=2*0.004*P1+2 \n", + "dF2bydP2=2*0.006*P2+1.5 \n", + "#Let loads are P1 & P-P1\n", + "#Economical loading lambda1=lambda2\n", + "eqn=2*0.004*P1+2-2*0.006*(P-P1)-1.5 \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P2=P-P1 #MW\n", + "print \"Load P1 = %0.2f MW \"%P1 \n", + "print \"Load P2 = %0.2f MW \"%P2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Load P1 = 125.00 MW \n", + "Load P2 = 125.00 MW \n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.21 page 65" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#F1=(8*P1+0.024*P1**2+80)*10**6 #Btu./hr\n", + "#F2=(6*P2+0.04*P2**2+120)*10**6 #Btu./hr\n", + "Pmax=100 #MW\n", + "Pmin=10 #MW\n", + "C=2.5 #Rs./million Btu\n", + "#C1=2.5*F1/10**6\n", + "#C2=2.5*F2/10**6\n", + "#For Maximum Load of 100 MW\n", + "P1, P2 = symbols('P1 P2')\n", + "dC1bydP1=8*2.5+2.5*2*0.024*P1 \n", + "dC2bydP2=6*2.5+2.5*2*0.04*P2 \n", + "#Let loads are P1 & Pmax-P1\n", + "#Economical loading lambda1=lambda2\n", + "eqn=8*2.5+2.5*2*0.024*P1-6*2.5-2.5*2*0.04*(Pmax-P1) \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P2=Pmax-P1 #MW\n", + "C1=2.5*((8*P1+0.024*P1**2+80)*10**6)/10**6 #Rs./hour\n", + "C2=2.5*((6*P2+0.04*P2**2+120)*10**6)/10**6 #Rs./hour\n", + "C100=(C1+C2)*12 #Rs.(Total cost of 12 hours on 100MW load)\n", + "#For Maximum load of 50 MW\n", + "#Let loads are P1 & Pmax-P1\n", + "#Economical loading : lambda1=lambda2\n", + "Pmax1=50 #MW\n", + "P1, P2 = symbols('P1 P2')\n", + "eqn=8*2.5+2.5*2*0.024*P1-6*2.5-2.5*2*0.04*(Pmax1-P1) \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P2=Pmax1-P1 #MW\n", + "C1=2.5*((8*P1+0.024*P1**2+80)*10**6)/10**6 #Rs./hour\n", + "C2=2.5*((6*P2+0.04*P2**2+120)*10**6)/10**6 #Rs./hour\n", + "C50=(C1+C2)*12 #Rs.(Total cost of 12 hours on 50MW load)\n", + "C=C100+C50 #Rs.(Total cost for 24 hours)\n", + "print \"Minimum total cost for 24 hours = %0.2f Rs. \"%C \n", + "E=(Pmax*12+Pmax1*12)*10**3 #kWh\n", + "#Operating cost per unit energy\n", + "Co=C/E #Rs./kWh\n", + "print \"Operating cost per unit energy = %0.2f Rs./kWh \"%Co \n", + "#Answer is wrong in the textbook. Calculation mistake in energy generation calculation & Cost calculation.\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum total cost for 24 hours = 49312.50 Rs. \n", + "Operating cost per unit energy = 0.03 Rs./kWh \n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.22 page 66" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#F1=0.05*P1**2+21.5*P1+800 #Rs./hr\n", + "#F2=0.1*P2**2+27*P2+500 #Rs./hr\n", + "#F3=0.07*P3**2+16*P3+900 #Rs./hr\n", + "PT=200 #MW\n", + "Pmax=120 #MW\n", + "Pmin=39 #MW\n", + "#coefficients : \n", + "c1=0.05; c2=0.1; c3=0.07 \n", + "b1=21.5 ;b2=27 ;b3=16 \n", + "a1=800 ;a2=500 ;a3=900 \n", + "lamda=(1/2*(b1/c1+b2/c2+b3/c3)+PT)/(1/2*(1/c1+1/c2+1/c3)) \n", + "#Economical loading dF1/dP1=dF2/dP2=dF3/dP3\n", + "from sympy import symbols, solve\n", + "P1=symbols('P1') \n", + "P2=symbols('P2') \n", + "P3=symbols('P3') \n", + "dF1bydP1=2*0.05*P1+21.5 \n", + "dF2bydP2=2*0.1*P2+27 \n", + "dF2bydP3=2*0.07*P3+16 \n", + "#Solving equation :\n", + "import numpy as np\n", + "A=np.mat([[2*0.05 ,0 ,0] ,[0 ,2*0.1, 0], [0, 0, 2*0.07]]) \n", + "B=np.mat([[lamda-21.5], [lamda-27], [lamda-16]]) \n", + "X=A**-1*B \n", + "P1=X[0] #MW\n", + "P2=X[1] #MW\n", + "P3=X[2] #MW\n", + "if P2<Pmin:\n", + " P2=Pmin \n", + "\n", + "P1plusP3=PT-P2 #MW\n", + "#dF1/dP1=dF3/dP3\n", + "#Let loads are P1 & P1plusP3-P1\n", + "P1=symbols('P1') \n", + "P3=symbols('P3') \n", + "eqn=2*0.05*P1+21.5-2*0.07*(P1plusP3-P1)-16 \n", + "P1=solve(eqn, P1)[0] #MW\n", + "P3=P1plusP3-P1 #MW\n", + "print \"Optimum scheduling :\" \n", + "print \"Loads P1, P2 & P3 are %0.2f, %0.2f & %0.2f MWs \" %(P1, P2, P3)\n", + "F1=0.05*P1**2+21.5*P1+800 #Rs./hr\n", + "F2=0.1*P2**2+27*P2+500 #Rs./hr\n", + "F3=0.07*P3**2+16*P3+900 #Rs./hr\n", + "C=F1+F2+F3 #Rs/hour\n", + "print \"For this schedule, total cost per hour = %0.2f Rs./hour \" %C" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Optimum scheduling :\n", + "Loads P1, P2 & P3 are 71.00, 39.00 & 90.00 MWs \n", + "For this schedule, total cost per hour = 7190.65 Rs./hour \n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.23 page 67" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#dF1/dP1=0.025*P1+15 #\n", + "#dF2/dP2=0.05*P2+20 #\n", + "PL=15.625 #MW\n", + "P1=125 #MW\n", + "lamda=24 #Rs. per MWh\n", + "B11=PL/P1**2 #Coefficient Loss\n", + "#dF2/dP2*L2=lambda\n", + "P2=symbols('P2') \n", + "L2=1 #penalty factor\n", + "eqn=(0.05*P2+20)*L2-lamda \n", + "P2=solve(eqn, P2)[0] #MW\n", + "#PL=B11*P1**2\n", + "P1=symbols('P1') \n", + "dPLbydP1=2*B11*P1 \n", + "L1=1/(1-dPLbydP1) #penalty factor\n", + "eqn=(0.025*P1+15)-lamda/L1\n", + "#P1=solve(numer(eqn)) #MW\n", + "P1=solve((eqn), P1)[0] #MW\n", + "print \"Generation P1 & P2 are %0.2f & %0.2f MW\"%(P1, P2)\n", + "PL=B11*P1**2 #MW\n", + "LD=P1-PL+P2 #MW\n", + "print \"Load Demand = %0.2f MW \"%LD " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Generation P1 & P2 are 123.29 & 80.00 MW\n", + "Load Demand = 188.09 MW \n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 2.24 page 68" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#dC1/dP1=0.02*P1+16 #\n", + "#dC2/dP2=0.04*P2+20 #\n", + "PL=10 #MW\n", + "P1=100 #MW\n", + "lamda=25 #Rs. per MWh\n", + "B11=PL/P1**2; B22=0; B12=0 #Coefficient Loss\n", + "#dF2/dP2*L2=lambda\n", + "P2=symbols('P2') \n", + "L2=1 #penalty factor\n", + "eqn=(0.04*P2+20)*L2-lamda \n", + "P2=solve(eqn, P2)[0] #MW\n", + "#PL=B11*P1**2\n", + "P1=symbols('P1') \n", + "dPLbydP1=2*B11*P1 \n", + "L1=1/(1-dPLbydP1) #penalty factor\n", + "eqn=(0.02*P1+16)-lamda/L1\n", + "P1=solve((eqn), P1)[0] #MW\n", + "print \"Generation P1 & P2 are %0.2f & %0.2f MW\"%(P1, P2)\n", + "PL=B11*P1**2 #MW\n", + "LD=P1-PL+P2 #MW\n", + "print \"Load Demand = %0.2f MW \"%LD" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Generation P1 & P2 are 128.57 & 125.00 MW\n", + "Load Demand = 237.04 MW \n" + ] + } + ], + "prompt_number": 21 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter3.ipynb b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter3.ipynb new file mode 100644 index 00000000..f49e3430 --- /dev/null +++ b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter3.ipynb @@ -0,0 +1,209 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:069f3652d0985b68c88deb4b29ec7c9faf615f62221a7a1d559cf07f972df11e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-3 : Hydrothermal Coordination" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 3.1 page 83" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "head=205 #m(Mean Head)\n", + "A=1000 #km**2(Catchment area)\n", + "rf=125 #cm(Annual Rainfall)\n", + "a=80 #%(Available rainfall for power generation)\n", + "LF=75 #%(Load factor)\n", + "head_loss=5 #m(Head Loss)\n", + "Eta_turbine=0.9 #Efficiency of turbine\n", + "Eta_generator=0.95 #Efficiency of generator\n", + "#Calculation\n", + "WaterUsed=A*10**6*rf/100*a/100 #m**3/year(Discharge)\n", + "WaterUsed=WaterUsed/(365*24*60*60) #m**3/sec\n", + "Eff_Head=head-head_loss #m(Effective Head)\n", + "P=735.5/75*WaterUsed*Eff_Head*Eta_turbine*Eta_generator/1000 #MW(Load of station)\n", + "Ppeak=P/(LF/100) #MW(Peak Load )\n", + "print \"MW rating of station = %0.2f MW\"%Ppeak \n", + "#type ot turbine\n", + "if head>200:\n", + " print \"Pelton turbine is more suitable because head>200 meter.\" \n", + "else:\n", + " print \"Pelton turbine is not suitable\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "MW rating of station = 70.90 MW\n", + "Pelton turbine is more suitable because head>200 meter.\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 3.2 page 85" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "WF=50 #m**3/sec(Water flow)\n", + "head=90 #m\n", + "LF=75 #%(Load factor)\n", + "Eta=90 #%(Efficiency of hydro plant)\n", + "L=5 #%(Transmission losses)\n", + "TC=350 #MW\n", + "hp=140 #MW#Hydro power\n", + "#Calculation\n", + "P=735.5/75*WF*head*Eta/100/1000 #MW(Power available)\n", + "Pnet=P*(100-L)/100 #MW#/Net Available hydro power\n", + "E=Pnet*24 #MW-hours##Hydro Energy\n", + "print \"Available hydro energy = %0.2f MW-hours\"%E\n", + "C1=hp/((100-L)/100) #MW#Capacity of hydro plant\n", + "print \"Capacity of hydro plant = %0.2f MW \"%C1 \n", + "C2=TC-hp #MW#Capacity of thermal plant\n", + "print \"Capacity of thermal plant = %0.2f MW \"%C2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Available hydro energy = 905.55 MW-hours\n", + "Capacity of hydro plant = 147.37 MW \n", + "Capacity of thermal plant = 210.00 MW \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 3.3 page 92" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "P1=700 #MW(Load for 14 hours)\n", + "P2=500 #MW(Load for 10 hours)\n", + "B22=0.0005 #Loss Coefficient\n", + "t1=14 #hour\n", + "t2=10 #hour\n", + "r2=2.5 #Rs/hour/(m**3/sec\n", + "#Characteristics of units : \n", + "#C1=(24+0.02*P1)*P1 #Rs./hour\n", + "#W2=(6+0.0025*P2)*P2 #m**3/sec\n", + "lamda=37.944 #Rs./MWh(For peak load conditions)\n", + "P1=348.6 #MW(For peak load conditions)\n", + "P2=454.84 #MW(For peak load conditions)\n", + "PL=103.44 #MW(For peak load conditions)\n", + "lambda_dash=31.73 #Rs./MWh(For peak load conditions)\n", + "P1_dash=193.25 #MW(For peak off conditions)\n", + "P2_dash=378.25 #MW(For peak off conditions)\n", + "PL_dash=71.50 #MW(For peak off conditions)\n", + "W=((6+0.0025*P2)*P2*t1+(6+0.0025*P2_dash)*P2_dash*t2)*3600/10**3 #m**3#D3ily water used\n", + "print \"Daily water used by plant = %0.2f m**3\" %W\n", + "C=(24+0.02*P1)*P1*t1+(24+0.02*P1_dash)*P1_dash*t2 #Rs.\n", + "print \"Daily operating cost of plant = %0.2f Rs. \"%C " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Daily water used by plant = 258189.00 m**3\n", + "Daily operating cost of plant = 205004.86 Rs. \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 3.4 page 93" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "t1=14 #hour(working hour of hydro station)\n", + "t2=24 #hour(Working hour of steam station)\n", + "#Characteristics of units : \n", + "#C=(5+8*Ps+0.05*Ps**2) #Rs./hour\n", + "#dW/dPh=30+0.05*Ph #m**3/MW-sec\n", + "W=500*10**6 #m**3(Water Quantity used)\n", + "Ps=250 #MW(Load on steam station)\n", + "lamda=8+0.1*Ps #Rs./MW-hour\n", + "#W=Ph*(30+0.05*Ph)*t1*3600 #\n", + "#0.05*Ph**2*t1*3600+Ph*30*t1*3600-W=0\n", + "from sympy import symbols, solve\n", + "Ph=symbols('Ph') \n", + "Ph=solve(0.05*Ph**2*t1*3600+Ph*30*t1*3600-W, Ph) #MW\n", + "Ph=Ph[1] #MW#Leaving negative root\n", + "print \"Load on hydro plant = %0.2f MW\"%Ph \n", + "r=lamda/(30+0.05*Ph) #Rs./hour/(m**3/sec)\n", + "print \"Cost of water use = %0.2f Rs./hour/(m**3/sec)\"%r \n", + "#Answer is slightly differ due to accuracy in calculations." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Load on hydro plant = 237.04 MW\n", + "Cost of water use = 0.79 Rs./hour/(m**3/sec)\n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter4.ipynb b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter4.ipynb new file mode 100644 index 00000000..79e88e49 --- /dev/null +++ b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter4.ipynb @@ -0,0 +1,377 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d4343686248bdcf3008e99590e00a02578e59b6d649633ef952a482176f262f1" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-4 : Modelling of Turbine, Generator & Automatic Controllers" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 4.1 page 107" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "kVA=4000 #kVA#rating\n", + "f1_nl=50 #Hz(No load frequency of machine1)\n", + "f1_fl=47.5 #Hz(No load frequency of machine1)\n", + "f2_nl=50 #Hz(No load frequency of machine2)\n", + "f2_fl=48 #Hz(No load frequency of machine2)\n", + "L=6000 #kW(Load)\n", + "from sympy import symbols, solve\n", + "L1=symbols('L1') #Load of machine1\n", + "#f1_nl-(f1_nl-f1_fl)*L1/kVA=f1_nl-(f2_nl-f2_fl)*L2/kVA where L2=L-L1\n", + "L1=(f2_nl-f2_fl)*L/((f1_nl-f1_fl)+(f2_nl-f2_fl)) #kW\n", + "L2=L-L1 #kW\n", + "print \"Part(a)\" \n", + "print \"Load supplied by first machine = %0.2f kW\"%L1 \n", + "print \"Load supplied by second machine = %0.2f kW \"%L2 \n", + "print \"Part(b)\" \n", + "L2=4000 #kW#Machine2 is supplying 4000kW\n", + "fdrop1=f1_nl-f1_fl #Hz(frequency drop of machine 1)\n", + "fdrop2=f2_nl-f2_fl #Hz(frequency drop of machine 2)\n", + "L1=L2*fdrop2/fdrop1 #kW#Load supplied by machine 1\n", + "L=L1+L2 #kW#Total Load\n", + "print \"Total load supplied without getting over loaded = %0.2f kW\"%L" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "Load supplied by first machine = 2666.67 kW\n", + "Load supplied by second machine = 3333.33 kW \n", + "Part(b)\n", + "Total load supplied without getting over loaded = 7200.00 kW\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 4.2 page 107" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import degrees, acos, asin, atan, sqrt, cos, sin\n", + "Lt=3000 #kW#Total Load\n", + "pf=0.8 #Power factor Lagging\n", + "I=150 #A\n", + "ZA=0.4+1J*12 #ohm#synchronous impedence\n", + "ZB=0.5+1J*10 #ohm#synchronous impedence\n", + "Vt=6.6 #kV#Terminal Voltage\n", + "L=Lt/2 #kW#Load supplied by each machine\n", + "LA=L #kW\n", + "LB=L #kW\n", + "#LB=sqrt(3)*Vt*IB*cosd(theta_B) \n", + "theta_B=acos(LB/sqrt(3)/Vt/I) #radian\n", + "IB=I*(cos(theta_B)-1J*sin(theta_B)) #A\n", + "I_total=Lt/sqrt(3)/Vt/pf #A#Total Current\n", + "IA_plus_IB=I_total*(0.8-1J*0.6) #A\n", + "IA=IA_plus_IB-IB #A\n", + "cos_thetaA=(IA).real/abs(IA) #lagging power factor\n", + "EA=Vt/sqrt(3)+IA*ZA/1000 #kV per phase\n", + "del_A=atan((EA).imag/(EA).real) #radian#Load Angle\n", + "emf_A=abs(EA) #kV per phase#Induced emf of machine A\n", + "EB=Vt/sqrt(3)+IB*ZB/1000 #kV per phase\n", + "del_B=atan((EB).imag/(EB).real) #radian#Load Angle\n", + "emf_B=abs(EB) #kV per phase#Induced emf of machine A\n", + "IA=abs(IA) #A\n", + "print \"Current on machine A = %0.2f A \"%IA \n", + "pfA=cos_thetaA #power factor\n", + "print \"Lagging power factor of machine A = %0.4f\"%pfA \n", + "print \"Induced emf of machine A = %0.2f kV per phase \"%emf_A, \n", + "print \"Load angle of machine A = %0.2f degree \"%degrees(del_A) \n", + "print \"Load angle of machine B = %0.2f degree \"%degrees(del_B) \n", + "print \"Induced emf of machine B = %0.2f kV per phase\"%emf_B \n", + "#Answer in the textbook is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Current on machine A = 180.64 A \n", + "Lagging power factor of machine A = 0.7264\n", + "Induced emf of machine A = 5.57 kV per phase Load angle of machine A = 15.90 degree \n", + "Load angle of machine B = 15.49 degree \n", + "Induced emf of machine B = 4.78 kV per phase\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 4.3 page 111" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "from math import pi\n", + "P=5 #MVA\n", + "V=1000 #V\n", + "speed=1500 #rpm#speed\n", + "ns=speed/60 #rps\n", + "f=50 #Hz\n", + "pf=0.8 #Power factor Lagging\n", + "Xs=20 #%#synchronous reluctance\n", + "Xs=Xs/100 #/p.u.\n", + "print \"Part(a)\" \n", + "V=1 #p.u.#on no load\n", + "E=1 #p.u.#on no load\n", + "Ps=V*E/Xs #p.u.\n", + "Ps=Ps*P #MW per elect. radian\n", + "Ps=Ps*1000 #kW per elect. radian\n", + "#1 mech. radian=pi/90 elect. radian\n", + "Ps=Ps*pi/90 #kW per mech. degree\n", + "print \"Synchronising power per mech. degree = %0.2f kW\"%Ps \n", + "d=0.5 #degree##displacement\n", + "Ts=Ps*1000*d/2/pi/ns #N-m\n", + "print \"Synchronising torque = %0.2f N-m\"%Ts \n", + "print \"Part(b)\" \n", + "theta=acos(pf) #radian\n", + "E=V+(cos(theta)-1J*sin(theta))*1J*Xs #p.u.\n", + "Ps=V*E/Xs #p.u.\n", + "Ps=Ps*P #MW per elect. radian\n", + "Ps=Ps*1000 #kW per elect. radian\n", + "#1 mech. radian=pi/90 elect. radian\n", + "Ps=Ps*pi/90 #kW per mech. degree\n", + "Ps=abs(Ps) #kW per mech. degree\n", + "print \"Synchronising power per mech. degree = %0.2f kW \"%Ps \n", + "d=0.5 #degree##displacement\n", + "Ts=abs(Ps)*1000*d/2/pi/ns #N-m\n", + "print \"Synchronising torque = %0.2f N-m \"%Ts \n", + "#Answer in the textbook is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "Synchronising power per mech. degree = 872.66 kW\n", + "Synchronising torque = 2777.78 N-m\n", + "Part(b)\n", + "Synchronising power per mech. degree = 987.31 kW \n", + "Synchronising torque = 3142.70 N-m \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 4.4 page 112" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "P=2 #MVA\n", + "V=6000 #V\n", + "speed=750 #rpm#speed\n", + "ns=speed/60 #rps\n", + "Zs=6 #ohm/phase\n", + "f=50 #Hz\n", + "pf=0.8 #Power factor Lagging\n", + "#Calculation\n", + "I=P*10**6/sqrt(3)/V #A#Current\n", + "theta=acos(pf) #radian\n", + "E=V/sqrt(3)+I*(cos(theta)-1J*sin(theta))*1J*Zs #V\n", + "Ps=V*sqrt(3)*E/Zs/1000 #kw per elect. radian\n", + "Ps=Ps*4*pi/180 #kW per mech. degree\n", + "Ps=abs(Ps) #kW per mech. degree\n", + "print \"Synchronising power per mech. degree = %0.2f kW \"%Ps \n", + "Ts=abs(Ps)*1000/2/pi/ns #N-m\n", + "print \"Synchronising torque = %0.2f N-m\" %Ts\n", + "#Answer in the textbook is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Synchronising power per mech. degree = 514.92 kW \n", + "Synchronising torque = 6556.12 N-m\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 4.5 page 112" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "I=100 #A#/Current\n", + "V=11 #kV\n", + "Xs=4 #ohm/phase\n", + "f=50 #Hz\n", + "pf=0.8 #Power factor Lagging\n", + "#Calculation\n", + "theta=acos(pf) #radian\n", + "print \"Part(a)\" \n", + "E=V*1000/sqrt(3)+I*(cos(theta)-1J*sin(theta))*1J*Xs #V\n", + "Del=atan((E).imag/(E).real) #radian\n", + "E=abs(E) #V/phase\n", + "print \"Open circuit phase emf %0.2f V/phase \"%E \n", + "print \"Angle delta = %0.2f degree\"%degrees(Del) \n", + "print \"Part(b)\" \n", + "del_dash=10+degrees(Del) #degree\n", + "P_by_V=E*sin(del_dash*pi/180)/Xs #per phase\n", + "#P=V*I*cos_fi\n", + "I_cos_fi=P_by_V \n", + "#V*1000/sqrt(3)+I*(cos_fi-%i*sin_fi)*%i*Xs=E\n", + "I_sin_fi=(sqrt(E**2-(4*I_cos_fi**2))-V*1000/sqrt(3))/4 \n", + "tan_fi=I_sin_fi/I_cos_fi \n", + "fi=degrees(atan(tan_fi)) #degree\n", + "I=I_cos_fi/cos(fi*pi/180) #A\n", + "print \"New load current = %0.2f A \"%I \n", + "pf=cos(fi*pi/180) #lagging power factor\n", + "print \"Its power factor = %0.4f lagging \" %pf\n", + "print \"Part(c)\" \n", + "pf1=0.8 #/original power factor\n", + "Idash=I*pf/pf1 #Current\n", + "print \"New value of load current = %0.2f A \"%Idash \n", + "#Answer is slightly differ because of accuracy in calculations." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "Open circuit phase emf 6598.62 V/phase \n", + "Angle delta = 2.78 degree\n", + "Part(b)\n", + "New load current = 368.57 A \n", + "Its power factor = 0.9901 lagging \n", + "Part(c)\n", + "New value of load current = 456.13 A \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 4.6 page 119" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "G=200 #MVA\n", + "H=6 #MJ/MVA#/Inertia Constant\n", + "V=11 #kV\n", + "f=50 #Hz\n", + "L1=120 #MW\n", + "L2=160 #MW\n", + "\n", + "#Calculation\n", + "print \"Part(a)\" \n", + "Es=G*H #MJ##Stored Energy\n", + "print \"Stored energy = %0.2f MJ \"%Es \n", + "print \"Part(b)\" \n", + "Pa=L1-L2 #MW\n", + "M=G*H/180/f #MJ-sec/elect.deg.\n", + "alfa=-Pa/M #elect.deg./sec**2#/Retardation\n", + "print \"Motor retardation = %0.2f elect.deg.sec**2\" %alfa\n", + "print \"Part(c)\" \n", + "n=5 #cycles\n", + "t=n/f #sec\n", + "del_change=1/2*-alfa*t**2 #elect.deg.\n", + "print \"Change in power angle = %0.2f elect.deg. \"%del_change \n", + "alfa=alfa*60/(180*4) #rpm/sec\n", + "ns=1500 #rpm\n", + "nr=ns+(-alfa)*t #rpm #/rotor speed\n", + "print \"Rotor speed at the end of 5 cycle = %0.2f rpm \"%nr \n", + "print \"Part(d)\"\n", + "H2=4 #MJ/MVA\n", + "G2=150 #MVA\n", + "Gb=100 #MVA\n", + "Heb=H*G/Gb+H2*G2/Gb #MJ/MVA\n", + "print \"Inertia constant for the equivalent generator = %0.2f MJ/MVA \"%Heb " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "Stored energy = 1200.00 MJ \n", + "Part(b)\n", + "Motor retardation = 300.00 elect.deg.sec**2\n", + "Part(c)\n", + "Change in power angle = -1.50 elect.deg. \n", + "Rotor speed at the end of 5 cycle = 1497.50 rpm \n", + "Part(d)\n", + "Inertia constant for the equivalent generator = 18.00 MJ/MVA \n" + ] + } + ], + "prompt_number": 6 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter5.ipynb b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter5.ipynb new file mode 100644 index 00000000..8d7e5943 --- /dev/null +++ b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter5.ipynb @@ -0,0 +1,1103 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:b45200f85baf8ca49b3eb8c7e7ad096c02135fdb6a27b2db5c0131f5c89667ec" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-5 : Load Frequency Control" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.1 page 145" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "P=100 #MW\n", + "drop=4 #%(No load to full load drop)\n", + "f=50 #Hz\n", + "print \"Part(i)\" \n", + "p=1 #MW(For calculating per unit MW)\n", + "R=(drop/100)*f/p #Hz/p.u.MW\n", + "print \"Speed regulation = %0.2f Hz/p.u.MW\" %R\n", + "R=(drop/100)*f/P #Hz/MW\n", + "print \"Speed regulation = %0.2f Hz/MW\" %R\n", + "print \"Part(ii)\" \n", + "del_f=-0.1 #Hz(Frequency drop)\n", + "delP=-1/R*del_f #MW(Change in power output)\n", + "print \"Change in power output = %0.2f MW \"%delP" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(i)\n", + "Speed regulation = 2.00 Hz/p.u.MW\n", + "Speed regulation = 0.02 Hz/MW\n", + "Part(ii)\n", + "Change in power output = 5.00 MW \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.2 page 146" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sqrt\n", + "P=100 #MVA\n", + "f=50 #Hz\n", + "H=5 #kW-sec/kVA(Constant)\n", + "delP=50 #MW(Increased Load)\n", + "td=0.5 #s(Time delay)\n", + "P=P/1000 #kVA\n", + "KE=P*H #kW-sec\n", + "delP=delP/1000 #kW(Increased Load)\n", + "KE_loss=delP*td #kW-s\n", + "f_new=sqrt((KE-KE_loss)/KE)*f #Hz\n", + "f_dev=(f-f_new)/f*100 #%(Frequency deviation)\n", + "print \"Frequency deviation = %0.2f %%\"%f_dev" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency deviation = 2.53 %\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.3 page 146" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "P1=500 #MW\n", + "P2=200 #MW\n", + "f=50 #Hz\n", + "delP=140 #MW(System load increase)\n", + "f_new=49.5 #Hz(Frequency after drop)\n", + "delP1=delP*P1/(P1+P2) #MW\n", + "delP2=delP*P2/(P1+P2) #MW\n", + "f_dev=f_new-f #Hz\n", + "#For delPdash=0, R1 &R2 can be calculated as :\n", + "R1=-1/delP1*f_dev #Hz/MW\n", + "R2=-1/delP2*f_dev #Hz/MW\n", + "print \"Value of R for unit 1 & 2 are : %0.4f & %0.4f Hz/MW \"%(R1, R2) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Value of R for unit 1 & 2 are : 0.0050 & 0.0125 Hz/MW \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.4 page 146" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "f=50 #Hz\n", + "R=2 #Hz/pu MW\n", + "Pr=10000 #MW(Rated Capacity)\n", + "P=Pr/2 #MW(Operating Power)\n", + "delP=2 #%(Load Increase)\n", + "del_f=f*1/100 #Hz(1% change in frequency)\n", + "del_PL=P*1/100 #MW(1% change in load)\n", + "#Rate of change of load with frequency :\n", + "D=del_PL/del_f #MW/Hz\n", + "D=D/Pr #p.u. MW/Hz\n", + "#Frequency response characteristic : \n", + "Beta=D+1/R #p.u. MW/Hz\n", + "M=delP/100*P #MW\n", + "M=M/Pr #p.u. MW\n", + "del_fo=-M/Beta #Hz\n", + "print \"Static frequency drop = %0.2f Hz\"%del_fo\n", + "R=float('inf')\n", + "Beta=D+1/R #p.u. MW/Hz\n", + "del_fo=-M/Beta #Hz\n", + "print \"If speed governer loop is open, frequency drop = %0.2f Hz \"%del_fo" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Static frequency drop = -0.02 Hz\n", + "If speed governer loop is open, frequency drop = -1.00 Hz \n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.5 page 147" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "C=10000 #MW(Control area capacity)\n", + "P=5000 #MW\n", + "H=5 #s\n", + "R=3 #Hz/pu MW\n", + "f=50 #Hz\n", + "del_f=f*1/100 #Hz\n", + "del_PL=P*1/100 #MW\n", + "D=del_PL/del_f #MW/Hz\n", + "D=D/C #p.u. MW/Hz\n", + "#Primary ALFC loop parameters :\n", + "Kp=1/D #Hz/p.u. MW\n", + "Tp=2*H/f/D #s\n", + "print \"Primary ALFC loop parameters :\"\n", + "print \"Kp = %0.2f Hz/p.u. MW \"%Kp \n", + "print \"Tp = %0.2f seconds \"%Tp" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Primary ALFC loop parameters :\n", + "Kp = 100.00 Hz/p.u. MW \n", + "Tp = 20.00 seconds \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.6 page 147" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "f=50 #Hz\n", + "R=2 #Hz/pu MW\n", + "Pr=10000 #MW(Rated Capacity)\n", + "P=Pr/2 #MW(Operating Power)\n", + "delP=2 #%(Load Increase)\n", + "del_f=f*1/100 #Hz(1% change in frequency)\n", + "del_PL=P*1/100 #MW(1% change in load)\n", + "#Rate of change of load with frequency :\n", + "D=del_PL/del_f #MW/Hz\n", + "D=D/Pr #p.u. MW/Hz\n", + "#Frequency response characteristic : \n", + "Beta=D+1/R #p.u. MW/Hz\n", + "M=delP/100*P #MW\n", + "M=M/Pr #p.u. MW\n", + "del_fo=-M/Beta #Hz\n", + "delP_fo=-del_fo*(D*Pr) #MW\n", + "print \"Frequency drop contribution to increase in load = %0.2f MW\" %delP_fo\n", + "delP_gen=-del_fo/R*Pr #MW\n", + "print \"Increase in generation to meet the increase load = %.2f MW \" %delP_gen " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency drop contribution to increase in load = 1.96 MW\n", + "Increase in generation to meet the increase load = 98.04 MW \n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.7 page 152" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "G=100 #MVA\n", + "f=50 #Hz\n", + "n=3000 #rpm\n", + "L=25 #MW#Load\n", + "td=0.5 #sec\n", + "H=4.5 #MW-sec/MVA\n", + "#Calculation\n", + "KE=H*G #MW-sec##at no load\n", + "KE_Loss=L*td #MW-sec#/due to increase in load\n", + "f_new=sqrt((KE-KE_Loss)/KE)*f #Hz\n", + "delF=(f-f_new)/f*100 #%##frequency deviation\n", + "print \"Frequency deviation = %0.2f %%\" %delF" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency deviation = 1.40 %\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.8 page 152" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "C=4000 #MW\n", + "f=50 #Hz\n", + "L=2500 #MW#Load\n", + "R=2 #Hz/p.u.MW##Speed regulation constant\n", + "H=5 #sec##Inertia constant\n", + "delPL=2 #%##change in load\n", + "delf=1 #%##change in frequency\n", + "print \"Part(a)\" \n", + "D=delPL/delf*L/f #MW/Hz\n", + "D=D/C #p.u.MW/Hz\n", + "Beta=D+1/R #p.u.MW/Hz\n", + "delf0=-0.2 #Hz\n", + "M=-(delf0)*Beta #p.u.MW\n", + "M=M*C #MW\n", + "print \"Largest change in step load = %0.2f MW \"%M \n", + "print \"Part(b)\" \n", + "Kp=1/D #Hz/p.u.MW\n", + "Tp=2*H/f/D #sec\n", + "Tdash=(R+Kp)/R/Tp #sec\n", + "print \"(R+Kp)/(R*Tp) = %0.2f seconds \"%(Tdash) \n", + "print 'Change in frequency as a funtion of time, \\ndelf(t) = -0.2*(1-epsilon**(%.3f*t))'%(Tdash) " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "Largest change in step load = 420.00 MW \n", + "Part(b)\n", + "(R+Kp)/(R*Tp) = 2.62 seconds \n", + "Change in frequency as a funtion of time, \n", + "delf(t) = -0.2*(1-epsilon**(2.625*t))\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.9 page 153" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "C=4000 #MW\n", + "f=50 #Hz\n", + "L=C #MW#Load\n", + "R=2.5 #%##Speed regulation constant\n", + "H=5 #sec##Inertia constant\n", + "delPL=1 #%##change in load\n", + "delf=1 #%##change in frequency\n", + "print \"Part(a)\" \n", + "Ls=80 #MW #increase in step to load\n", + "R=R/100*f #z/p.u.MW\n", + "D=delPL/delf*L/f #MW/Hz\n", + "D=D/C #p.u.MW/Hz\n", + "M=Ls/L #unitless#for given step load\n", + "Kp=1/D #Hz/p.u.MW\n", + "Tp=2*H/f/D #sec\n", + "Tdash1=(R+Kp)/R/Tp #sec\n", + "print \"(R+Kp)/(R*Tp) = %0.2f seconds \"%Tdash1 \n", + "Tdash2=(R*Kp*M)/(R+Kp) #sec\n", + "print \"(R*Kp*M)/(R+Kp) = %0.2f seconds\"%Tdash2\n", + "delf0=-Tdash2 #Hz##Static frequency error\n", + "print \"Static frequency error = %0.2f Hz \"%delf0 \n", + "print \"Part(b)\" \n", + "Ki=(1+Kp/R)**2/4/Tp/Kp #p.u.MW/Hz\n", + "print \"Critical value of Ki = %0.2f p.u.MW/Hz \"%Ki" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "(R+Kp)/(R*Tp) = 4.10 seconds \n", + "(R*Kp*M)/(R+Kp) = 0.02 seconds\n", + "Static frequency error = -0.02 Hz \n", + "Part(b)\n", + "Critical value of Ki = 0.84 p.u.MW/Hz \n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.10 page 154" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from sympy import symbols, solve\n", + "s=symbols('s') #for transfer function\n", + "Tg=0.2 #sec#/time constant of governing system\n", + "Tt=2 #sec#/time constant of turbine\n", + "Gr=1/(1+Tg*s) #Transfer function of governer\n", + "Gt=1/(1+Tt*s) #Transfer function of turbine\n", + "C=1500 #MW\n", + "f=50 #Hz\n", + "R=4 #%##Speed regulation constant\n", + "H=5 #sec##Inertia constant\n", + "delPL=1 #%##change in load\n", + "delf=1 #%##change in frequency\n", + "print \"Part(a)\" \n", + "R=R/100*f #z/p.u.MW\n", + "D=delPL/delf*C/f #MW/Hz\n", + "D=D/C #p.u.MW/Hz\n", + "Kp=1/D #Hz/p.u.MW\n", + "Tp=2*H/f/D #sec\n", + "Gp=Kp/(1+Tp*s) #Transfer function of power system\n", + "delFs=-Gp/(1+Gr*Gt*Gp/R) \n", + "print \"delFs = M/s*\",delFs \n", + "print \"Part(b)\" \n", + "delf0_by_M=-Kp/(1+Kp/R) #Hz\n", + "delf0=delf/100*f #Hz\n", + "M=delf0/delf0_by_M #p.u.MW\n", + "M=M*C #MW\n", + "print \"Largest step change = %0.2f MW \"%M \n", + "#Transfer functions multiplication Gr*Gt*Gp is calculated & it is not possible to show together without calculated as in the book." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "delFs = M/s* -50.0/((1 + 25.0/((0.2*s + 1)*(2*s + 1)*(10.0*s + 1)))*(10.0*s + 1))\n", + "Part(b)\n", + "Largest step change = -390.00 MW \n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.11 page 157" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "GA=5000 #MW\n", + "GB=10000 #MW\n", + "R=2 #Hz/p.u.MW##Speed regulation constant\n", + "D=0.01 #p.u.MW/Hz\n", + "Ls=100 #MW#Load increase\n", + "RA=R*GB/GA #Hz/p.u.MW\n", + "DA=D*GA/GB #p.u.MW/Hz\n", + "RB=R #Hz/p.u.MW\n", + "DB=D #p.u.MW/Hz\n", + "Beta_A=DA+1/RA #p.u.MW/Hz\n", + "Beta_B=DB+1/RB #p.u.MW/Hz\n", + "MA=0 #Load increase\n", + "MB=Ls/GB #p.u.MW\n", + "delf0=-MB/(Beta_A+Beta_B) #Hz\n", + "print \"Static frequency drop = %0.2f Hz \"%delf0 \n", + "delPAB=Beta_A*MB/(Beta_A+Beta_B) #p.u.MW\n", + "delPAB=delPAB*GB #MW\n", + "print \"Change in tie line power = %0.2f MW \"%delPAB " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Static frequency drop = -0.01 Hz \n", + "Change in tie line power = 33.33 MW \n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.12 page 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "GA=500 #MW\n", + "GB=2000 #MW\n", + "RA=2.5 #Hz/p.u.MW##Speed regulation constant\n", + "RB=2 #Hz/p.u.MW##Speed regulation constant\n", + "Ls=20 #MW#Load increase\n", + "f=50 #Hz\n", + "delL=1 #%##change in load\n", + "delf=1 #%##change in frequency\n", + "DA=delL/delf*GA/f #MW/Hz\n", + "DA=DA/GB #p.u.MW/Hz\n", + "DB=delL/delf*GB/f #MW/Hz\n", + "DB=DB/GB #p.u.MW/Hz\n", + "RA=RA*GB/GA #Hz/p.u.MW\n", + "Beta_A=DA+1/RA #p.u.MW/Hz\n", + "Beta_B=DB+1/RB #p.u.MW/Hz\n", + "print \"Part(a)\" \n", + "MA=Ls/GB #unitless\n", + "MB=0 #unitless\n", + "delf0=-MA/(Beta_A+Beta_B) #Hz\n", + "print \"Change in frequency = %0.2f Hz \"%delf0 \n", + "delPAB=-Beta_B*MA/(Beta_B+Beta_A) #p.u.MW\n", + "delPAB=delPAB*GB #MW\n", + "print \"Change in tie line power = %0.2f MW \"%delPAB \n", + "print \"Part(b)\" \n", + "MB=Ls/GB #unitless\n", + "MA=0 #unitless\n", + "delf0=-MB/(Beta_A+Beta_B) #Hz\n", + "print \"Change in frequency = %0.2f Hz \"%delf0 \n", + "delPAB=Beta_A*MB/(Beta_B+Beta_A) #p.u.MW\n", + "delPAB=delPAB*GB #MW\n", + "print \"Change in tie line power = %0.2f MW \"%delPAB " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "Change in frequency = -0.02 Hz \n", + "Change in tie line power = -16.64 MW \n", + "Part(b)\n", + "Change in frequency = -0.02 Hz \n", + "Change in tie line power = 3.36 MW \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.13 page 160" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import cos, pi\n", + "G=4000 #MW\n", + "R=2 #Hz/p.u.MW##Speed regulation constant\n", + "H=5 #sec\n", + "C=600 #MW#Capacity\n", + "theta=40 #degree#/Power angle\n", + "f=50 #Hz\n", + "print \"Part(a)\" \n", + "T=C/G*cos(pi/180*theta) #sec\n", + "omega0=sqrt((2*pi*f*T/H-(f/4/R/H)**2)) #radian/sec\n", + "print \"Frequency of oscillation = %0.2f radian/sec \"%omega0 \n", + "print \"Part(b)\" \n", + "delLB=100 #MW#change in load in area B\n", + "delPAB=delLB/2 #MW#because Beta_A=Beta_B\n", + "print \"Change in tie line power = %0.2f MW \"%delPAB \n", + "print \"Part(c)\" \n", + "omega0=sqrt((2*pi*f*T/H)) #radian/sec\n", + "print \"Frequency of oscillation = %0.2f radian/sec \"%omega0" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "Frequency of oscillation = 2.38 radian/sec \n", + "Part(b)\n", + "Change in tie line power = 50.00 MW \n", + "Part(c)\n", + "Frequency of oscillation = 2.69 radian/sec \n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.14 page 168" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "C1=300 #MW\n", + "C2=400 #MW\n", + "G1=4 #%#droop characteristics of governer\n", + "G2=5 #%#droop characteristics of governer\n", + "L=600 #MW\n", + "f=50 #Hz\n", + "#Load on first generator =L1\n", + "#Load on second generator =L-L1\n", + "#f-G1*f/100*(L1/C1)=f-G2*f/100*(L2/C2)\n", + "L1=G2*L/C2/(G1/C1+G2/C2) #MW\n", + "L2=L-L1 #MW\n", + "print \"Load on first generator = %0.2f MW \"%L1 \n", + "print \"Load on second generator = %0.2f MW \"%L2 \n", + "fLoad=f*(1-L1/C1*G1/100) #Hz\n", + "print \"Frequency at load = %0.2f Hz \"%fLoad" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Load on first generator = 290.32 MW \n", + "Load on second generator = 309.68 MW \n", + "Frequency at load = 48.06 Hz \n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.15 page 169" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "G=100 #MVA\n", + "f=50 #Hz\n", + "delL=50 #MW\n", + "Tc=0.4 #sec\n", + "H=5 #/kWs/kVA\n", + "KE=G*1000*H #kWs\n", + "delKE=delL*1000*Tc ##kWs#/due to decrease in load\n", + "fnew=sqrt((KE+delKE)/KE) *f #Hz\n", + "fdev=(fnew-f)/f*100 #%\n", + "print \"New frequency = %0.2f Hz \"%fnew \n", + "print \"Frequency deviation = %0.2f %%\"%fdev" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "New frequency = 50.99 Hz \n", + "Frequency deviation = 1.98 %\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.16 page 169" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "G=100 #MVA\n", + "f=50 #Hz\n", + "delL=60 #MW\n", + "Tc=0.35 #sec\n", + "H=5 #/kWs/kVA\n", + "KE=G*1000*H #kWs\n", + "delKE=(G-delL)*1000*Tc ##kWs#/due to decrease in load\n", + "fnew=sqrt((KE+delKE)/KE) *f #Hz\n", + "fdev=(fnew-f)/f*100 #%\n", + "print \"New frequency = %0.2f Hz \"%fnew \n", + "print \"Frequency deviation = %0.2f %%\" %fdev" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "New frequency = 50.70 Hz \n", + "Frequency deviation = 1.39 %\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.17 page 169" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "KE=1500 #MJ\n", + "Pin=5 #MW\n", + "f=50 #Hz\n", + "t=1 #sec\n", + "delKE=Pin*t ##MJ#/due to power inputs\n", + "fnew=sqrt((KE+delKE)/KE) *f #Hz\n", + "delf=fnew-f #/Hz/second\n", + "print \"Frequency increase rate = %0.2f Hz/sec \"%delf" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Frequency increase rate = 0.08 Hz/sec \n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.18 page 169" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "C=2000 #MW#/Capacity\n", + "L=1000 #MW#Load\n", + "H=5 #kWs/KVA\n", + "R=2.4 #Hz/puMW#Regulation\n", + "f=50 #Hz\n", + "delL=1 #%##change in load\n", + "delf=1 #%##change in frequency\n", + "D=delL/delf*L/f #MW/Hz\n", + "D=D/C #p.u.MW/Hz\n", + "Kp=1/D #Hz/p.u.MW\n", + "Tp=2*H/f/D #sec\n", + "print \"Primary ALFC loop parameters are : \" \n", + "print \"D = \",D,\"p.u.MW/Hz\" \n", + "print \"Kp = \",Kp,\"Hz/p.u.MW\" \n", + "print \"Tp = \",Tp,\"sec \" " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Primary ALFC loop parameters are : \n", + "D = 0.01 p.u.MW/Hz\n", + "Kp = 100.0 Hz/p.u.MW\n", + "Tp = 20.0 sec \n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.19 page 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "Tp=10 #sec\n", + "Tg=0 #sec\n", + "Tt=0 #sec\n", + "Kp=100 #Hz/p.u.MW\n", + "R=3 #/Hz/CuMW\n", + "delPD=0.1 #p.u.\n", + "Ki=0.1 #constant\n", + "f=50 #Hz\n", + "from sympy import symbols\n", + "s=symbols('s') \n", + "delFs=-Kp/Tp*(delPD/(s**2+s*((1+Kp/R)/Tp)+Ki*Kp/Tp))\n", + "n=1 #cycle\n", + "time_error=n/f #sec\n", + "print \"Total time error = %0.3f sec\"%time_error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total time error = 0.020 sec\n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.20 page 171" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "L=14 #MW#Total Load\n", + "C1=15 #MW\n", + "R1=3 #%#speed regulation\n", + "C2=4 #MW\n", + "R2=4 #%#speed regulation\n", + "LB=4 #MW#Load on bus bar\n", + "LA=10 #MW#/Load on bus bar\n", + "f=50 #Hz\n", + "#Load on station A= L1 MW\n", + "#Load on station B= L-L1 MW\n", + "#f-C1*f/100*(L1/C1)=f-C2*f/100*(L2/C2)\n", + "L1=R2*L/C2/(R1/C1+R2/C2) #MW\n", + "L2=L-L1 #MW\n", + "print \"Load generation at station A = %0.2f MW \"%L1 \n", + "print \"Load generation at station B = %0.2f MW \"%L2\n", + "Pt=L1-LA #MW#Power transmitted A to B\n", + "f_oper=f-R1/100/C1*(L1)*f #Hz\n", + "print \"Operating Frequency = %0.2f Hz \"%f_oper " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Load generation at station A = 11.67 MW \n", + "Load generation at station B = 2.33 MW \n", + "Operating Frequency = 48.83 Hz \n" + ] + } + ], + "prompt_number": 20 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.21 page 171" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "C1=300 #MW\n", + "C2=400 #MW\n", + "G1=4 #%#droop characteristics of governer\n", + "G2=6 #%#droop characteristics of governer\n", + "L=400 #MW\n", + "f=50 #Hz\n", + "L1=C1*L/(C1+C2) #MW#Load on 300 MW generator\n", + "L2=L*C2/(C1+C2) #MW#Load on 400 MW generator\n", + "f01=f*(C1)/(C1-G1/100*L1) #Hz#/No load frequency\n", + "print \"No load frequency of 300 MW generator = %0.2f Hz \"%f01 \n", + "f02=f*(C2)/(C2-G2/100*L2) #Hz#/No load frequency\n", + "print \"No load frequency of 400 MW generator = %0.2f Hz \"%f02" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No load frequency of 300 MW generator = 51.17 Hz \n", + "No load frequency of 400 MW generator = 51.78 Hz \n" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.22 page 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "C1=200 #MW\n", + "C2=100 #MW\n", + "R1=1.5 #%#speed regulation\n", + "R2=3 #%#speed regulation\n", + "L=100 #MW#/Load on each bus\n", + "f=50 #Hz\n", + "RA=R1/100*f/C1 #Hz/MW\n", + "RB=R2/100*f/C2 #Hz/MW\n", + "#Let PA= generation at plant A\n", + "#PB=2*L-PA will be generation at plant B\n", + "#RA*PA=RB*PB\n", + "PA=RB*2*L/(RA+RB) #MW\n", + "PB=2*L-PA #MW\n", + "print \"Load generation at plant A = %0.2f MW \"%PA \n", + "print \"Load generation at plant B = %0.2f MW \"%PB\n", + "Pt=PA-L #MW#/Power transfer\n", + "print \"Power transfer from A to B = %0.2f MW \"%Pt " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Load generation at plant A = 160.00 MW \n", + "Load generation at plant B = 40.00 MW \n", + "Power transfer from A to B = 60.00 MW \n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.23 page 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import acos\n", + "Z=1.5+1J*2.5 #ohm\n", + "V=11 #kV\n", + "P=20 #MW\n", + "pf=0.8 #power factor\n", + "theta=acos(pf*pi/180) \n", + "I=P*1000/sqrt(3)/V/pf #\n", + "from cmath import rect\n", + "I=rect(I,-theta*pi/180) #A\\\n", + "Vdrop=I*Z #V\n", + "Vboost=Vdrop #V\n", + "print \"Voltage boost needed at station A = \",(Vboost),\"V\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Voltage boost needed at station A = (2056.63661402+3225.71419437j) V\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 5.24 page 174" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import degrees, atan, sin, acos, cos, pi\n", + "Z=3+1J*9 #%#/impedence\n", + "Z=Z/100 #p.u.#/Impedence\n", + "I=1 #p.u.\n", + "IZ=Z #p.u.\n", + "print \"Part(a)\" \n", + "#2*I**2-2*cos(del)=[abs(IZ)]**2\n", + "cos_del=degrees(acos((2*I**2-(abs(IZ))**2)/2)) #degree\n", + "print \"Phase angle between two station = %0.2f degree \"%cos_del \n", + "angle_abc=87.277 #/degree\n", + "theta=180-angle_abc-degrees(atan((IZ).imag/(IZ).real)) #degree\n", + "Preal=I**2*cos(pi/180*theta) #p.u.\n", + "print \"Real power transfer = %0.2f p.u. \"%Preal \n", + "Preactive=I**2*sin(pi/180*theta) #p.u.\n", + "print \"Reactive power transfer = %0.2f p.u.\"%Preactive \n", + "print \"Part(b)\" \n", + "#1.05**2+1**2-2*1.05*cos(del)=[abs(IZ)]**2\n", + "cos_del=degrees(acos((1.05**2+1**2-(abs(IZ))**2)/2/1.05)) #degree\n", + "print \"Phase angle between two station = %0.2f degree \"%cos_del \n", + "angle_dbc=60.53 #/degree\n", + "theta=degrees(atan((IZ).imag/(IZ).real))-angle_dbc#degree\n", + "Preal=I**2*cos(pi/180*theta) #p.u.\n", + "print \"Real power transfer = %0.2f p.u. \"%Preal \n", + "Preactive=I**2*sin(pi/180*theta) #p.u.\n", + "print \"Reactive power transfer = %0.2f p.u. \"%Preactive \n", + "#Answer in the textbook is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a)\n", + "Phase angle between two station = 5.44 degree \n", + "Real power transfer = 0.93 p.u. \n", + "Reactive power transfer = 0.36 p.u.\n", + "Part(b)\n", + "Phase angle between two station = 4.51 degree \n", + "Real power transfer = 0.98 p.u. \n", + "Reactive power transfer = 0.19 p.u. \n" + ] + } + ], + "prompt_number": 24 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter6.ipynb b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter6.ipynb new file mode 100644 index 00000000..34c2fa23 --- /dev/null +++ b/Power_System_Operation_and_Control_by_B._R._Gupta/Chapter6.ipynb @@ -0,0 +1,537 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:af61fb7eed7d4ff39296b02a1d4e98cabd8ac46cf41e81ede4624c653dbd8b75" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Ch-6 : Reactive Power Control" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 6.1 page 201" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sqrt, atan, pi, degrees, cos\n", + "from scipy.linalg import expm\n", + "kV=220 #kV\n", + "Z=0.8+1J*0.2 #pu\n", + "V=1 #V(Voltage at load terminal)\n", + "X=0.2+0.05 #pu(line and transformer reactance)\n", + "P=(Z).real #pu\n", + "Q=(Z).imag #pu\n", + "BaseMVA=100 #MVA\n", + "BasekV=220 #kV\n", + "I=sqrt((P**2+Q**2)/V**2)*expm([[1J*atan(-(Z).imag/(Z).real)]])[0,0] #pu\n", + "Vb=V+I*(X*expm([[1J*pi/2]]))[0,0] #pu(Voltage at 200 kV bus)\n", + "fi_p=(atan((Vb).imag/(Vb).real)) #degree(power angle)\n", + "Vb=abs(Vb)*kV #kV(Voltage at 200 kV bus)\n", + "pf=cos(fi_p+(atan((Z).imag/(Z).real))) #power factor at 220 kV bus\n", + "print \"Voltage at 220 kV bus = %0.2f kV \"%Vb \n", + "print \"Power factor at 220 kV bus %0.4f lagging \"%pf" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Voltage at 220 kV bus = 235.15 kV \n", + "Power factor at 220 kV bus 0.9076 lagging \n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 6.2 page 201" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from scipy.linalg import expm\n", + "kV=220 #kV\n", + "Z=0.8+1J*0.2 #pu\n", + "V=1 #V(Voltage at load terminal)\n", + "X=0.2+0.05 #pu(line and transformer reactance)\n", + "P=(Z).real #pu\n", + "Q=(Z).imag #pu\n", + "BaseMVA=100 #MVA\n", + "BasekV=220 #kV\n", + "I=sqrt((P**2+Q**2)/V**2) #pu\n", + "Vb=V+I*(X*expm([[1J*pi/2]])) #pu(Voltage at 200 kV bus)\n", + "fi_p=degrees(atan((Vb).imag/(Vb).real)) #degree(power angle)\n", + "Vb=abs(Vb)*kV #kV(Voltage at 200 kV bus)\n", + "pf=cos(fi_p*pi/180) #power factor at 220 kV bus\n", + "print \"Voltage at 220 kV bus = %0.2f kV \"%Vb \n", + "print \"Power factor at 220 kV bus = %0.4f lagging \"%pf" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Voltage at 220 kV bus = 224.63 kV \n", + "Power factor at 220 kV bus = 0.9794 lagging \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 6.3 page 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from cmath import sinh, cosh, tan, sin\n", + "import cmath as cmt\n", + "l=350 #km(length of line)\n", + "Z=cmt.rect(180,75*pi/180) #ohm/phase(Total)\n", + "Y=cmt.rect(1*10**-3,90*pi/180) #Siemens/phase(Total)\n", + "z=Z/l #ohm/km\n", + "y=Y/l #Siemens/km\n", + "re=l*cmt.sqrt(z*y) #\n", + "Zc=cmt.sqrt(z/y) #ohm\n", + "print \"Part(a) A,B,C,D parameters are : \" \n", + "A=cosh(re) #unitless\n", + "D=A #unitless\n", + "B=Zc*sinh(re) #ohm\n", + "C=sinh(re)/Zc #unitless\n", + "A_mag=abs(A) #unitless\n", + "A_angle=atan((A).imag/(A).real) #radian\n", + "B_mag=abs(B) #ohm\n", + "B_angle=atan((B).imag/(B).real) #radian\n", + "C_mag=abs(C) #unitless\n", + "C_angle=atan((C).imag/(C).real) #radian\n", + "C_angle=(degrees(C_angle)+180)*180/pi #degree(Converting -ve to +ve angle)\n", + "D_mag=abs(D) #unitless\n", + "D_angle=atan((D).imag/(D).real) #radian\n", + "print \"Magnitude of A : %0.2f \"% A_mag \n", + "print \"Angle of A = %0.2f degree \"%degrees(A_angle) \n", + "print \"Magnitude of B = %0.2f ohm\"%B_mag \n", + "print \"Angle of B = %0.2f degree \"%degrees(B_angle) \n", + "print \"Magnitude of C : %0.2f\"%C_mag \n", + "print \"Angle of C = %0.2f degree \"%degrees(C_angle) \n", + "print \"Magnitude of D : %0.2f\"%D_mag \n", + "print \"Angle of D = %0.2f degree\" %degrees(D_angle)\n", + "#60% series compensation\n", + "B=B-1J*60/100*abs(Z)*sin(atan((Z).imag/(Z).real)) #ohm(considering series compensation=60%)\n", + "#For Equivalent pi-circuit\n", + "print \"Part(b) A,B,C,D parameters of compensated line are : \" \n", + "Ydash=2/Zc*((cosh(re)-1)/sinh(re)) #S\n", + "A=1+B*Ydash/2 #unitless\n", + "D=A #unitless\n", + "C=2*Ydash/2+B*(Ydash/2)**2 #unitless\n", + "A_mag=abs(A) #unitless\n", + "A_angle=atan((A).imag/(A).real) #radian\n", + "B_mag=abs(B) #ohm\n", + "B_angle=atan((B).imag/(B).real) #radian\n", + "C_mag=abs(C) #unitless\n", + "C_angle=atan((C).imag/(C).real) #radian\n", + "C_angle=(degrees(C_angle)+180)*180/pi #radian(Converting -ve to +ve angle)\n", + "D_mag=abs(D) #unitless\n", + "D_angle=atan((D).imag/(D).real) #degree\n", + "print \"Magnitude of A : %0.2f \"% A_mag \n", + "print \"Angle of A = %0.2f degree \"%degrees(A_angle) \n", + "print \"Magnitude of B = %0.2f ohm\"%B_mag \n", + "print \"Angle of B = %0.2f degree \"%degrees(B_angle) \n", + "print \"Magnitude of C : %0.2f\"%C_mag \n", + "print \"Angle of C = %0.2f degree \"%degrees(C_angle) \n", + "print \"Magnitude of D : %0.2f\"%D_mag \n", + "print \"Angle of D = %0.2f degree\" %degrees(D_angle)\n", + "#Answer for some parts are not accurate in the textbook." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Part(a) A,B,C,D parameters are : \n", + "Magnitude of A : 0.91 \n", + "Angle of A = 1.42 degree \n", + "Magnitude of B = 174.83 ohm\n", + "Angle of B = 75.45 degree \n", + "Magnitude of C : 0.00\n", + "Angle of C = 296930.22 degree \n", + "Magnitude of D : 0.91\n", + "Angle of D = 1.42 degree\n", + "Part(b) A,B,C,D parameters of compensated line are : \n", + "Magnitude of A : 0.97 \n", + "Angle of A = 1.33 degree \n", + "Magnitude of B = 78.37 ohm\n", + "Angle of B = 55.91 degree \n", + "Magnitude of C : 0.00\n", + "Angle of C = 296850.37 degree \n", + "Magnitude of D : 0.97\n", + "Angle of D = 1.33 degree\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 6.4 page 202" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from cmath import rect, sqrt\n", + "from numpy import conj\n", + "l=350 #km(length of line)\n", + "Z=rect(180,75*pi/180) #ohm/phase(Total)\n", + "Y=rect(1*10**-3,90*pi/180) #Siemens/phase(Total)\n", + "z=Z/l #ohm/km\n", + "y=Y/l #Siemens/km\n", + "re=l*sqrt(z*y) #\n", + "Zc=sqrt(z/y) #ohm\n", + "print \"For Uncompensated Line, Constants are :\" \n", + "B=Z #ohm#B Parameter\n", + "A=1+Z*Y/2 #unitless#A Parameter\n", + "D=A #unitless#D Parameter\n", + "C=Y*(1+Z*Y/4) #S#C Parameter\n", + "A_mag=abs(A) #unitless\n", + "A_angle=atan((A).imag/(A).real) #radian\n", + "B_mag=abs(B) #ohm\n", + "B_angle=atan((B).imag/(B).real) #radian\n", + "C_mag=abs(C) #unitless\n", + "C_angle=atan((C).imag/(C).real) #radian\n", + "C_angle=(degrees(C_angle)+180)*180/pi #radian(Converting -ve to +ve angle)\n", + "D_mag=abs(D) #unitless\n", + "D_angle=atan((D).imag/(D).real) #degree\n", + "print \"Magnitude and Angle of B = %0.2f ohm & %0.2f degree \"%(B_mag,B_angle) \n", + "print \"Magnitude and Angle of A = %0.2f & %0.2f degree \"%(A_mag,A_angle) \n", + "print \"Magnitude and Angle of D = %0.2f & %0.2f degree \"%(D_mag,D_angle) \n", + "\n", + "print \"Magnitude of C is %0.2f\"%C_mag \n", + "print \"Angle of C = %0.2f degree\"%C_angle\n", + "print \"For Compensated Line, Constants are :\" \n", + "B=Z-0.6*1J*406 #ohm#B Parameter\n", + "A=1+conj(B)*Y/2 #unitless#A Parameter\n", + "D=A #unitless#D Parameter\n", + "C=Y*(1+Z*Y/4) #S#C Parameter\n", + "A_mag=abs(A) #unitless\n", + "A_angle=atan((A).imag/(A).real) #radian\n", + "B_mag=abs(B) #ohm\n", + "B_angle=atan((B).imag/(B).real) #radian\n", + "C_mag=abs(C) #unitless\n", + "C_angle=atan((C).imag/(C).real) #radian\n", + "C_angle=(degrees(C_angle)+180)*180/pi #radian(Converting -ve to +ve angle)\n", + "D_mag=abs(D) #unitless\n", + "D_angle=atan((D).imag/(D).real) #degree\n", + "print \"Magnitude and Angle of B = %0.2f ohm & %0.2f degree \"%(B_mag,B_angle) \n", + "print \"Magnitude and Angle of A = %0.2f & %0.2f degree \"%(A_mag,A_angle) \n", + "print \"Magnitude and Angle of D = %0.2f & %0.2f degree \"%(D_mag,D_angle) \n", + "print \"Magnitude of C is %0.2f\"%C_mag \n", + "print \"Angle of C = %0.2f degree\"%C_angle\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For Uncompensated Line, Constants are :\n", + "Magnitude and Angle of B = 180.00 ohm & 1.31 degree \n", + "Magnitude and Angle of A = 0.91 & 0.03 degree \n", + "Magnitude and Angle of D = 0.91 & 0.03 degree \n", + "Magnitude of C is 0.00\n", + "Angle of C = 5196.59 degree\n", + "For Compensated Line, Constants are :\n", + "Magnitude and Angle of B = 83.86 ohm & -0.98 degree \n", + "Magnitude and Angle of A = 0.97 & 0.02 degree \n", + "Magnitude and Angle of D = 0.97 & 0.02 degree \n", + "Magnitude of C is 0.00\n", + "Angle of C = 5196.59 degree\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 6.5 page 203" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "kv1=220 #kv\n", + "kv2=132 #kv\n", + "baseMVA=200 #MVA\n", + "#Base impedence in 132 kv circuit\n", + "baseZ2=kv2**2/baseMVA #ohm\n", + "z1=1J*75 #ohm\n", + "z2=1J*70 #ohm\n", + "z3=1J*90 #ohm\n", + "z1=z1/baseZ2 #pu\n", + "z2=z2/baseZ2 #pu\n", + "z3=z3/baseZ2 #pu\n", + "X_AD=1J*0.08+z1 #pu#Reactance from A to D\n", + "X_BD=1J*0.08+z2 #pu#Reactance from A to D\n", + "Zp=z3*X_AD*X_BD/(z3*X_AD+z3*X_BD+X_BD+X_AD) #parallel combination\n", + "sc_D=baseMVA/abs(Zp) #MVA#Short Circuit MVA at D\n", + "delQBYdelV=sc_D/kv2 #MVA/kv\n", + "delQ=delQBYdelV*4 #MVar\n", + "print \"Var injection at Bus D = %0.2f MVar\" %delQ\n", + "#Answer in the textbook is not accurate." + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Var injection at Bus D = 18.48 MVar\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 6.6 page 204" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from cmath import rect, acos\n", + "A=rect(0.98,3*pi/180) #Constant\n", + "B=rect(110,75*pi/180) #ohm/phase\n", + "P=50 #MVA\n", + "pf=0.8 #lagging\n", + "V=132 #kV\n", + "#Formula : Pr=|Vs|*|Vr|/|B|*cosd(Beta-delta)-|A|*|Vr|**2/|B|*cosd(Beta-alfa) :\n", + "betaSUBdelta=acos((P*pf+abs(A)*V**2/abs(B)*cos(atan((B).imag/(B).real)-atan((A).imag/(A).real)))/V**2*abs(B)) \n", + "Qr=V**2/abs(B)*sin(betaSUBdelta)-abs(A)*V**2/abs(B)*sin(atan((B).imag/(B).real)-atan((A).imag/(A).real)) #MVar\n", + "Qr=P*0.6-Qr #MVar#Since load require lagging component\n", + "print \"(a) Capacity of shunt compensation equipment = %0.2f MVar \" %Qr.real\n", + "#part(b)\n", + "#Formula : Pr=|Vs|*|Vr|/|B|*cosd(Beta-delta)-|A|*|Vr|**2/|B|*cosd(Beta-alfa) :\n", + "P=0 #MW\n", + "betaSUBdelta=acos((P*pf+abs(A)*V**2/abs(B)*cos(atan((B).imag/B.real)-atan((A).imag/(A).real)))/V**2*abs(B)) \n", + "Qr=V**2/abs(B)*sin(betaSUBdelta)-abs(A)*V**2/abs(B)*sin(atan((B).imag/(B).real)-atan((A).imag/(A).real)) #MVar\n", + "Qr=P*0.6-Qr #MVar#Since load require lagging component\n", + "print \"(b) Capacity of shunt compensation equipment = %0.2f MVar \"%-Qr.real " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Capacity of shunt compensation equipment = 45.91 MVar \n", + "(b) Capacity of shunt compensation equipment = 3.33 MVar \n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 6.7 page 206" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import acos, sin\n", + "V=220 #kV\n", + "Z=20+1J*60 #ohm\n", + "Pr=100 #MVA\n", + "pf=0.8 #lagging pf\n", + "P=Pr*10**6*pf/3 #W\n", + "theta=acos(pf) #radian\n", + "Q=Pr*10**6*sin(theta)/3 #Vars\n", + "V1=V/sqrt(3)*1000 #V\n", + "V2=V1 #V\n", + "#ts**2*[1-(R*P+X*Q)/V1/V2]=V2/V1\n", + "ts=sqrt(V2/V1/(1-((Z).real*P+(Z).imag*Q)/V1/V2)) \n", + "tr=1/ts \n", + "print \"Tap settings : ts = %0.2f \"%ts.real\n", + "print \"tr = %0.2f \"%tr.real" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Tap settings : ts = 1.06 \n", + "tr = 0.94 \n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 6.8 page 207" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "kV1=132 #kV\n", + "kV2=33 #kV\n", + "kV3=11 #kV\n", + "MVA1=75 #MVA\n", + "MVA2=50 #MVA\n", + "MVA3=25 #MVA\n", + "X=0.12 #p.u.\n", + "#part(a)\n", + "P=60 #MW\n", + "V1=125 #kV\n", + "V1=V1/kV1 #p.u.\n", + "Q=MVA2/MVA1 #p.u.\n", + "#V1=Vn+X*Q/Vn\n", + "from sympy import symbols, solve\n", + "Vn=symbols('Vn') \n", + "eqn=Vn**2-V1*Vn+X*Q\n", + "Vn=solve(eqn, Vn) #p.u.\n", + "Vn=Vn[0] #p.u.\n", + "Vn=Vn*kV1 #kV\n", + "k=Vn/kV2 #Transformer ratio\n", + "print \"Under Load condition, transformer ratio = %0.3f \"%k \n", + "#part(b)\n", + "V1=140 #kV\n", + "V1=V1/kV1 #p.u.\n", + "Q=MVA3/MVA1 #p.u.\n", + "#V1=Vn+X*Q/Vn\n", + "Vn=symbols('Vn') \n", + "eqn=Vn**2-V1*Vn+X*Q\n", + "Vn=solve(eqn, Vn) #p.u.\n", + "Vn=Vn[0] #p.u.\n", + "Vn=Vn*kV1 #kV\n", + "k=Vn/kV2 #Transformer ratio\n", + "print \"Under No Load condition, transformer ratio = %0.3f\" % k" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Under Load condition, transformer ratio = 0.375 \n", + "Under No Load condition, transformer ratio = 0.157" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "exa 6.9 page 209" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import tan, acos\n", + "V=132 #kV\n", + "Z=25+1J*66 #ohm\n", + "Pr=100 #MW\n", + "pf=0.9 #lagging pf\n", + "P=Pr*10**6/3 #W\n", + "theta=acos(pf) #radian\n", + "Q=Pr*10**6*tan(theta)/3 #vars\n", + "V1=V/sqrt(3)*1000 #V\n", + "V2=V1 #V\n", + "#ts**2*[1-(R*P+X*Q)/V1/V2]=V2/V1\n", + "ts=sqrt(V2/V1/(1-((Z).real*P+(Z).imag*Q)/V1/V2)) \n", + "tr=1/ts \n", + "print \"Tap settings : ts = %0.2f \"%ts.real \n", + "print \"tr = %0.2f \"%tr.real" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Tap settings : ts = 1.22 \n", + "tr = 0.82 \n" + ] + } + ], + "prompt_number": 18 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Power_System_Operation_and_Control_by_B._R._Gupta/screenshots/Ch1-EnergyLadCurveAndMassCurve.png b/Power_System_Operation_and_Control_by_B._R._Gupta/screenshots/Ch1-EnergyLadCurveAndMassCurve.png Binary files differnew file mode 100644 index 00000000..839b6439 --- /dev/null +++ b/Power_System_Operation_and_Control_by_B._R._Gupta/screenshots/Ch1-EnergyLadCurveAndMassCurve.png diff --git a/Power_System_Operation_and_Control_by_B._R._Gupta/screenshots/Ch2-LoadGeneration.png b/Power_System_Operation_and_Control_by_B._R._Gupta/screenshots/Ch2-LoadGeneration.png Binary files differnew file mode 100644 index 00000000..3d5ffe90 --- /dev/null +++ b/Power_System_Operation_and_Control_by_B._R._Gupta/screenshots/Ch2-LoadGeneration.png diff --git a/Power_System_Operation_and_Control_by_B._R._Gupta/screenshots/Ch2-ReceivedPower.png b/Power_System_Operation_and_Control_by_B._R._Gupta/screenshots/Ch2-ReceivedPower.png Binary files differnew file mode 100644 index 00000000..649fa727 --- /dev/null +++ b/Power_System_Operation_and_Control_by_B._R._Gupta/screenshots/Ch2-ReceivedPower.png |