summaryrefslogtreecommitdiff
path: root/Microwave_and_Radar_Engineering/Chapter_3.ipynb
diff options
context:
space:
mode:
authorHardik Ghaghada2014-06-21 14:25:56 +0530
committerHardik Ghaghada2014-06-21 14:25:56 +0530
commit299711403e92ffa94a643fbd960c6f879639302c (patch)
tree009cb02ec85f4a75ac7b64239751f15361df2bfe /Microwave_and_Radar_Engineering/Chapter_3.ipynb
parente1e59ca3a50d9f93e8b7bc0693b8081d5db77771 (diff)
parent7c756fcc12d21693818e58f6936cab5b7c112868 (diff)
downloadPython-Textbook-Companions-299711403e92ffa94a643fbd960c6f879639302c.tar.gz
Python-Textbook-Companions-299711403e92ffa94a643fbd960c6f879639302c.tar.bz2
Python-Textbook-Companions-299711403e92ffa94a643fbd960c6f879639302c.zip
Merge pull request #2 from debashisdeb/master
Removed Problem Statements Completely
Diffstat (limited to 'Microwave_and_Radar_Engineering/Chapter_3.ipynb')
-rw-r--r--Microwave_and_Radar_Engineering/Chapter_3.ipynb1064
1 files changed, 530 insertions, 534 deletions
diff --git a/Microwave_and_Radar_Engineering/Chapter_3.ipynb b/Microwave_and_Radar_Engineering/Chapter_3.ipynb
index 033e0551..116264a3 100644
--- a/Microwave_and_Radar_Engineering/Chapter_3.ipynb
+++ b/Microwave_and_Radar_Engineering/Chapter_3.ipynb
@@ -1,535 +1,531 @@
-{
- "metadata": {
- "name": "Chapter 3"
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter 3: Transmission Lines"
- ]
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example number 3.1, Page number 47"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "#Variable declaration\n",
- "Zo = 100 #o/p impedance(Ohms)\n",
- "s = 5 #VSWR\n",
- "\n",
- "#Calculations\n",
- "Zmax = Zo*s\n",
- "\n",
- "#Results\n",
- "print \"Terminating impedance = \",Zmax,\"Ohms\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Terminating impedance = 500 Ohms\n"
- ]
- }
- ],
- "prompt_number": 2
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.2, Page number 47"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "import math\n",
- "import cmath\n",
- "\n",
- "#Varaible declaration \n",
- "R = 8 #resistance(Ohms)\n",
- "L = 2*10**-3 #inductance(H/km)\n",
- "C = 0.002*10**-6 #capacitance(F)\n",
- "G = 0.07*10**-6 #conductance(s/km)\n",
- "f = 2*10**3 #frequency(Hz)\n",
- "Vs = 2 #input signal(V)\n",
- "l = 500. #line length(km)\n",
- "\n",
- "#Calculations\n",
- "w = 2*math.pi*f\n",
- "x = complex(R,w*L)\n",
- "y = complex(G,w*C)\n",
- "Zo = cmath.sqrt(x/y)\n",
- "gamma = cmath.sqrt(x*y)\n",
- "Is = Vs/Zo.real\n",
- "Il = Is*cmath.exp(-1*gamma*l)\n",
- "P = Il**2*Zo.real\n",
- "\n",
- "#Results\n",
- "print \"Characteristic impedance =\",Zo,\"Ohms\"\n",
- "print \"Attenuation constant =\",round(gamma.real,6),\"NP/km\"\n",
- "print \"Phase constant =\", round(gamma.imag,6),\"rad/km\"\n",
- "print \"Power delivered to the load =\", round((abs(P)/1E-6),2), \"uW\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Characteristic impedance = (1012.50018135-155.813417548j) Ohms\n",
- "Attenuation constant = 0.003987 NP/km\n",
- "Phase constant = 0.025436 rad/km\n",
- "Power delivered to the load = 73.31 uW\n"
- ]
- }
- ],
- "prompt_number": 5
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.3, Page number 48"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "import math\n",
- "\n",
- "#Varaible declaration\n",
- "f = 2*10**3 #frequency(Hz)\n",
- "B = 0.02543 #phase constant(rad/km)\n",
- "\n",
- "#Calculations\n",
- "w = 2*math.pi*f\n",
- "Vp = w/B\n",
- "\n",
- "#Results\n",
- "print \"Phase velocity =\",round((Vp/1E+3),2),\"km/sec\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Phase velocity = 494.16 km/sec\n"
- ]
- }
- ],
- "prompt_number": 24
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.4, Page number 48"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "a) Current drawn from generator\n",
- "b) Power delivered to the load\n",
- "\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration\n",
- "f = 37.5*10**6 #frequency(Hz)\n",
- "V = 200 #Voltage signal(Vrms)\n",
- "r = 200 #internal resistance(Ohms)\n",
- "Zo = 200 #characteristic impedance(Ohms)\n",
- "l = 10 #line length(m)\n",
- "Zl = 100 #resistive load(Ohms)\n",
- "c = 3*10**8 #velocity of propagation(m/s)\n",
- "\n",
- "#Calculations\n",
- "#Part a\n",
- "lamda = c/f\n",
- "Bl = (5*math.degrees(math.pi))/4\n",
- "x = complex(Zl,(Zo*math.tan(Bl)))\n",
- "y = complex(Zo,(Zl*math.tan(Bl)))\n",
- "Zi = Zo*(x/y)\n",
- "Vs = (Zi.real*Zo)/(Zi.real+Zo)\n",
- "Is = Zo/(Zi.real+Zo)\n",
- "\n",
- "#Part b\n",
- "P = Vs*Is\n",
- "\n",
- "#Part c\n",
- "Il = math.sqrt(P/Zl)\n",
- "\n",
- "#Results\n",
- "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
- "print \"Current drawn from generator is\",round(Is,2),\"A\" \n",
- "print \"Power delivered to the load is\",round(P,2),\"W\"\n",
- "print \"Current flowing through the load is\",round(Il,3),\"A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
- "\n",
- "Current drawn from generator is 0.41 A\n",
- "Power delivered to the load is 48.47 W\n",
- "Current flowing through the load is 0.696 A\n"
- ]
- }
- ],
- "prompt_number": 35
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.5, Page number 50"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration\n",
- "zo = 50 #characteristic impedance(Ohms)\n",
- "f = 300*10**6 #frequency(Hz)\n",
- "zl = complex(50,50) #terminating load(Ohms)\n",
- "c = 3*10**8 #velocity of propagation(m/s)\n",
- "\n",
- "#Calculations\n",
- "lamda = c/f\n",
- "rho = (zl-zo)/(zl+zo)\n",
- "phi = cmath.phase(rho)\n",
- "s = (1+abs(rho))/(1-abs(rho))\n",
- "\n",
- "#Results\n",
- "print \"Reflection co-efficient =\",round(abs(rho),3),\"with phase =\",round(math.degrees(phi),2)\n",
- "print \"VSWR =\",round(s,2)"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- " Reflection co-efficient = 0.447 with phase = 63.43\n",
- "VSWR = 2.62\n"
- ]
- }
- ],
- "prompt_number": 46
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.6, Page number 50"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "import math\n",
- "\n",
- "#Variable declaration\n",
- "Zl = 100. #load resistance(Ohms)\n",
- "Zo = 600. #characteristic impedance(Ohms)\n",
- "f = 100*10**6 #frequency(Hz)\n",
- "c = 3*10**8 #velocity of propagation(m/s)\n",
- "\n",
- "#Calculations\n",
- "lamda = c/f\n",
- "l = (lamda*math.atan(math.sqrt(Zl/Zo)))/(2*math.pi)\n",
- "l_dash = (lamda*math.atan(math.sqrt((Zl*Zo)/(Zo-Zl))))/(2*math.pi)\n",
- "\n",
- "#Results\n",
- "print \"The position of the stub is\", round(l,3),\"m\\n\"\n",
- "print \"Please note that the solution for l_dash given in the textbook is incorrect\"\n",
- "print \"Length of stub is\",round(l_dash,3),\"m\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "The position of the stub is 0.185 m\n",
- "\n",
- "Please note that the solution for l_dash given in the textbook is incorrect\n",
- "Length of stub is 0.707 m\n"
- ]
- }
- ],
- "prompt_number": 17
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.7, Page number 50"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration\n",
- "s = 3.2 #VSWR\n",
- "Xmin = 0.237 #minimum voltage(V)\n",
- "Zo = 50 #characteristic impedance(Ohms)\n",
- "\n",
- "#Calculations\n",
- "q = math.tan(math.degrees(2*math.pi*Xmin))\n",
- "x = complex(1,-(s*q))\n",
- "y = complex(s, -q)\n",
- "Zl = Zo*(x/y)\n",
- "\n",
- "#Result\n",
- "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
- "print \"Terminating impedance =\", Zl,\"Ohms\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
- "\n",
- "Terminating impedance = (19.6572514629-23.7885950214j) Ohms\n"
- ]
- }
- ],
- "prompt_number": 27
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.8, Page number 51"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "a)VSWR\n",
- "b) Position of first Vmin and Vmax\n",
- "c) Vmin and Vmax\n",
- "\n",
- "import math\n",
- "\n",
- "#Variable declaration\n",
- "Zo = 50. #characteristic impedance(Ohms)\n",
- "Zl = 100. #load resistance(Ohms)\n",
- "f = 300*10**3 #frequency(Hz)\n",
- "Pl = 50*10**-3 #load power(W)\n",
- "c = 3*10**8 #velocity of propagation(m/s)\n",
- "\n",
- "#Calculations\n",
- "lamda = c/f\n",
- "\n",
- "#Part a\n",
- "rho = (Zl-Zo)/(Zl+Zo)\n",
- "s = (1+abs(rho))/(1-abs(rho))\n",
- "\n",
- "#Part b\n",
- "#Since real Zl>Zo, first Vmax is located at the load\n",
- "Vmin_pos = lamda/4\n",
- "\n",
- "#Part c\n",
- "Vmax = math.sqrt(Pl*Zl)\n",
- "Vmin = Vmax/s\n",
- "\n",
- "#Part d\n",
- "Zin_at_Vmin = Zo/s\n",
- "Zin_at_Vmax = Zo*s\n",
- "\n",
- "\n",
- "#Results\n",
- "print \"VSWR = \", s\n",
- "print \"First Vmax is loacted at load and first Vmin is located at\", Vmin_pos,\"m from the load\"\n",
- "print \"Vmin = \",round(Vmin,2),\"V and Vmax = \",round(Vmax,2),\"V\"\n",
- "print \"Impedance at Vmin is \", Zin_at_Vmin,\"Ohm and impedance at Vmax is\",Zin_at_Vmax,\"Ohm\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "VSWR = 2.0\n",
- "First Vmax is loacted at load and first Vmin is located at 250 m from the load\n",
- "Vmin = 1.12 V and Vmax = 2.24 V\n",
- "Impedance at Vmin is 25.0 Ohm and impedance at Vmax is 100.0 Ohm\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.9, Page number 52"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "a)Transmission loss\n",
- "b)Reflection loss\n",
- "\n",
- "import math\n",
- "\n",
- "#Variable declaration\n",
- "Zo = 600. #characteristic impedance(Ohms)\n",
- "Zs = 50 #source impedance(Ohms)\n",
- "l = 200 #length of line(m)\n",
- "Zl = 500. #load resistance(Ohms)\n",
- "\n",
- "#Calculations\n",
- "rho = (Zl-Zo)/(Zl+Zo)\n",
- "\n",
- "#Part a\n",
- "ref_l = math.log10(1/(1-((abs(rho))**2)))\n",
- "\n",
- "#Part b\n",
- "#Since, the line is lossless,\n",
- "att_l = 0\n",
- "trans_l = ref_l+att_l\n",
- "\n",
- "#Part c\n",
- "ret_l = math.log10(abs(rho))\n",
- "\n",
- "#Results\n",
- "print \"Reflection loss =\",round(ref_l,4),\"dB\"\n",
- "print \"Transmission loss =\",round(trans_l,4),\"dB\"\n",
- "print \"Return loss =\",round(ret_l,3),\"dB (Calculation error in the textbook)\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Reflection loss = 0.0036 dB\n",
- "Transmission loss = 0.0036 dB\n",
- "Return loss = -1.041 dB (Calculation error in the textbook)\n"
- ]
- }
- ],
- "prompt_number": 55
- },
- {
- "cell_type": "heading",
- "level": 2,
- "metadata": {},
- "source": [
- "Example 3.10, Page number 52"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "import cmath\n",
- "import math\n",
- "\n",
- "#Variable declaration\n",
- "l = 10 #length of line(km)\n",
- "zsc = complex(1895.47,2234.29) \n",
- "zoc = complex(216.99,-143.37)\n",
- "f = 1*10**3 #frequency(Hz)\n",
- "\n",
- "#Calculations\n",
- "zo = cmath.sqrt(zsc*zoc)\n",
- "x = cmath.sqrt(zsc/zoc)\n",
- "t = (1+x)/(1-x)\n",
- "gamma = cmath.log(t)/(l*2)\n",
- "B = gamma.imag\n",
- "w = 2*math.pi*f\n",
- "Vp = w/B\n",
- "\n",
- "#Results\n",
- "print \"There is calculation mistake throughout the problem in the textbook\\n\"\n",
- "print \"Characteristic impedance =\",zo,\"Ohms\"\n",
- "print \"Phase velocity =\",round((Vp/1E+3),3),\"*10^3 m/sec\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "There is calculation mistake throughout the problem in the textbook\n",
- "\n",
- "Characteristic impedance = (864.190238563+123.274392427j) Ohms\n",
- "Phase velocity = 45.994 *10^3 m/sec\n"
- ]
- }
- ],
- "prompt_number": 27
- }
- ],
- "metadata": {}
- }
- ]
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:dfa1112ea6b0d370508845e5b6861c8e0c5d67e82e0a759d3e8e0f96252d9846"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Transmission Lines"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 3.1, Page number 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Variable declaration\n",
+ "Zo = 100 #o/p impedance(Ohms)\n",
+ "s = 5 #VSWR\n",
+ "\n",
+ "#Calculations\n",
+ "Zmax = Zo*s\n",
+ "\n",
+ "#Results\n",
+ "print \"Terminating impedance = \",Zmax,\"Ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Terminating impedance = 500 Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.2, Page number 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "import cmath\n",
+ "\n",
+ "#Varaible declaration \n",
+ "R = 8 #resistance(Ohms)\n",
+ "L = 2*10**-3 #inductance(H/km)\n",
+ "C = 0.002*10**-6 #capacitance(F)\n",
+ "G = 0.07*10**-6 #conductance(s/km)\n",
+ "f = 2*10**3 #frequency(Hz)\n",
+ "Vs = 2 #input signal(V)\n",
+ "l = 500. #line length(km)\n",
+ "\n",
+ "#Calculations\n",
+ "w = 2*math.pi*f\n",
+ "x = complex(R,w*L)\n",
+ "y = complex(G,w*C)\n",
+ "Zo = cmath.sqrt(x/y)\n",
+ "gamma = cmath.sqrt(x*y)\n",
+ "Is = Vs/Zo.real\n",
+ "Il = Is*cmath.exp(-1*gamma*l)\n",
+ "P = Il**2*Zo.real\n",
+ "\n",
+ "#Results\n",
+ "print \"Characteristic impedance =\",Zo,\"Ohms\"\n",
+ "print \"Attenuation constant =\",round(gamma.real,6),\"NP/km\"\n",
+ "print \"Phase constant =\", round(gamma.imag,6),\"rad/km\"\n",
+ "print \"Power delivered to the load =\", round((abs(P)/1E-6),2), \"uW\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Characteristic impedance = (1012.50018135-155.813417548j) Ohms\n",
+ "Attenuation constant = 0.003987 NP/km\n",
+ "Phase constant = 0.025436 rad/km\n",
+ "Power delivered to the load = 73.31 uW\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.3, Page number 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "\n",
+ "#Varaible declaration\n",
+ "f = 2*10**3 #frequency(Hz)\n",
+ "B = 0.02543 #phase constant(rad/km)\n",
+ "\n",
+ "#Calculations\n",
+ "w = 2*math.pi*f\n",
+ "Vp = w/B\n",
+ "\n",
+ "#Results\n",
+ "print \"Phase velocity =\",round((Vp/1E+3),2),\"km/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Phase velocity = 494.16 km/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.4, Page number 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "f = 37.5*10**6 #frequency(Hz)\n",
+ "V = 200 #Voltage signal(Vrms)\n",
+ "r = 200 #internal resistance(Ohms)\n",
+ "Zo = 200 #characteristic impedance(Ohms)\n",
+ "l = 10 #line length(m)\n",
+ "Zl = 100 #resistive load(Ohms)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "#Part a\n",
+ "lamda = c/f\n",
+ "Bl = (5*math.degrees(math.pi))/4\n",
+ "x = complex(Zl,(Zo*math.tan(Bl)))\n",
+ "y = complex(Zo,(Zl*math.tan(Bl)))\n",
+ "Zi = Zo*(x/y)\n",
+ "Vs = (Zi.real*Zo)/(Zi.real+Zo)\n",
+ "Is = Zo/(Zi.real+Zo)\n",
+ "\n",
+ "#Part b\n",
+ "P = Vs*Is\n",
+ "\n",
+ "#Part c\n",
+ "Il = math.sqrt(P/Zl)\n",
+ "\n",
+ "#Results\n",
+ "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
+ "print \"Current drawn from generator is\",round(Is,2),\"A\" \n",
+ "print \"Power delivered to the load is\",round(P,2),\"W\"\n",
+ "print \"Current flowing through the load is\",round(Il,3),\"A\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
+ "\n",
+ "Current drawn from generator is 0.41 A\n",
+ "Power delivered to the load is 48.47 W\n",
+ "Current flowing through the load is 0.696 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.5, Page number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "zo = 50 #characteristic impedance(Ohms)\n",
+ "f = 300*10**6 #frequency(Hz)\n",
+ "zl = complex(50,50) #terminating load(Ohms)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "rho = (zl-zo)/(zl+zo)\n",
+ "phi = cmath.phase(rho)\n",
+ "s = (1+abs(rho))/(1-abs(rho))\n",
+ "\n",
+ "#Results\n",
+ "print \"Reflection co-efficient =\",round(abs(rho),3),\"with phase =\",round(math.degrees(phi),2)\n",
+ "print \"VSWR =\",round(s,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Reflection co-efficient = 0.447 with phase = 63.43\n",
+ "VSWR = 2.62\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.6, Page number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zl = 100. #load resistance(Ohms)\n",
+ "Zo = 600. #characteristic impedance(Ohms)\n",
+ "f = 100*10**6 #frequency(Hz)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "l = (lamda*math.atan(math.sqrt(Zl/Zo)))/(2*math.pi)\n",
+ "l_dash = (lamda*math.atan(math.sqrt((Zl*Zo)/(Zo-Zl))))/(2*math.pi)\n",
+ "\n",
+ "#Results\n",
+ "print \"The position of the stub is\", round(l,3),\"m\\n\"\n",
+ "print \"Please note that the solution for l_dash given in the textbook is incorrect\"\n",
+ "print \"Length of stub is\",round(l_dash,3),\"m\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The position of the stub is 0.185 m\n",
+ "\n",
+ "Please note that the solution for l_dash given in the textbook is incorrect\n",
+ "Length of stub is 0.707 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.7, Page number 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "s = 3.2 #VSWR\n",
+ "Xmin = 0.237 #minimum voltage(V)\n",
+ "Zo = 50 #characteristic impedance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "q = math.tan(math.degrees(2*math.pi*Xmin))\n",
+ "x = complex(1,-(s*q))\n",
+ "y = complex(s, -q)\n",
+ "Zl = Zo*(x/y)\n",
+ "\n",
+ "#Result\n",
+ "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
+ "print \"Terminating impedance =\", Zl,\"Ohms\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
+ "\n",
+ "Terminating impedance = (19.6572514629-23.7885950214j) Ohms\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.8, Page number 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zo = 50. #characteristic impedance(Ohms)\n",
+ "Zl = 100. #load resistance(Ohms)\n",
+ "f = 300*10**3 #frequency(Hz)\n",
+ "Pl = 50*10**-3 #load power(W)\n",
+ "c = 3*10**8 #velocity of propagation(m/s)\n",
+ "\n",
+ "#Calculations\n",
+ "lamda = c/f\n",
+ "\n",
+ "#Part a\n",
+ "rho = (Zl-Zo)/(Zl+Zo)\n",
+ "s = (1+abs(rho))/(1-abs(rho))\n",
+ "\n",
+ "#Part b\n",
+ "#Since real Zl>Zo, first Vmax is located at the load\n",
+ "Vmin_pos = lamda/4\n",
+ "\n",
+ "#Part c\n",
+ "Vmax = math.sqrt(Pl*Zl)\n",
+ "Vmin = Vmax/s\n",
+ "\n",
+ "#Part d\n",
+ "Zin_at_Vmin = Zo/s\n",
+ "Zin_at_Vmax = Zo*s\n",
+ "\n",
+ "\n",
+ "#Results\n",
+ "print \"VSWR = \", s\n",
+ "print \"First Vmax is loacted at load and first Vmin is located at\", Vmin_pos,\"m from the load\"\n",
+ "print \"Vmin = \",round(Vmin,2),\"V and Vmax = \",round(Vmax,2),\"V\"\n",
+ "print \"Impedance at Vmin is \", Zin_at_Vmin,\"Ohm and impedance at Vmax is\",Zin_at_Vmax,\"Ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VSWR = 2.0\n",
+ "First Vmax is loacted at load and first Vmin is located at 250 m from the load\n",
+ "Vmin = 1.12 V and Vmax = 2.24 V\n",
+ "Impedance at Vmin is 25.0 Ohm and impedance at Vmax is 100.0 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.9, Page number 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "Zo = 600. #characteristic impedance(Ohms)\n",
+ "Zs = 50 #source impedance(Ohms)\n",
+ "l = 200 #length of line(m)\n",
+ "Zl = 500. #load resistance(Ohms)\n",
+ "\n",
+ "#Calculations\n",
+ "rho = (Zl-Zo)/(Zl+Zo)\n",
+ "\n",
+ "#Part a\n",
+ "ref_l = math.log10(1/(1-((abs(rho))**2)))\n",
+ "\n",
+ "#Part b\n",
+ "#Since, the line is lossless,\n",
+ "att_l = 0\n",
+ "trans_l = ref_l+att_l\n",
+ "\n",
+ "#Part c\n",
+ "ret_l = math.log10(abs(rho))\n",
+ "\n",
+ "#Results\n",
+ "print \"Reflection loss =\",round(ref_l,4),\"dB\"\n",
+ "print \"Transmission loss =\",round(trans_l,4),\"dB\"\n",
+ "print \"Return loss =\",round(ret_l,3),\"dB (Calculation error in the textbook)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reflection loss = 0.0036 dB\n",
+ "Transmission loss = 0.0036 dB\n",
+ "Return loss = -1.041 dB (Calculation error in the textbook)\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3.10, Page number 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import cmath\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "l = 10 #length of line(km)\n",
+ "zsc = complex(1895.47,2234.29) \n",
+ "zoc = complex(216.99,-143.37)\n",
+ "f = 1*10**3 #frequency(Hz)\n",
+ "\n",
+ "#Calculations\n",
+ "zo = cmath.sqrt(zsc*zoc)\n",
+ "x = cmath.sqrt(zsc/zoc)\n",
+ "t = (1+x)/(1-x)\n",
+ "gamma = cmath.log(t)/(l*2)\n",
+ "B = gamma.imag\n",
+ "w = 2*math.pi*f\n",
+ "Vp = w/B\n",
+ "\n",
+ "#Results\n",
+ "print \"There is calculation mistake throughout the problem in the textbook\\n\"\n",
+ "print \"Characteristic impedance =\",zo,\"Ohms\"\n",
+ "print \"Phase velocity =\",round((Vp/1E+3),3),\"*10^3 m/sec\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "There is calculation mistake throughout the problem in the textbook\n",
+ "\n",
+ "Characteristic impedance = (864.190238563+123.274392427j) Ohms\n",
+ "Phase velocity = 45.994 *10^3 m/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ }
+ ],
+ "metadata": {}
+ }
+ ]
} \ No newline at end of file