{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "

Chapter 5: Point Source and Their Arrays

" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Example 5-6.1, Page number: 90

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "import scipy.integrate\n", "\n", "#Variable declaration\n", "def integrand(theta, phi):\n", " return (math.cos(theta)*math.sin(theta))\n", " #Integrand (unitless)\n", "Um = 1 #Maximum radiation intensity (unitless)\n", "\n", "#Calculation\n", "P = scipy.integrate.dblquad(integrand, 0, 2*math.pi,\n", " lambda x: 0, lambda x: math.pi/2)\n", " #Total power radiated (relative to Um)\n", "D = (4*math.pi)/P[0] #Directivity (unitless)\n", "\n", "#Result\n", "print \"The directivity is \", round(D)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The directivity is 4.0\n" ] } ], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Example 5-6.2, Page number: 91

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "import scipy.integrate\n", "\n", "#Variable declaration\n", "def integrand(theta, phi):\n", " return (math.cos(theta)*math.sin(theta))\n", " #Integrand (unitless)\n", "Um = 1 #Maximum radiation intensity (unitless)\n", "\n", "#Calculation\n", "P = scipy.integrate.dblquad(integrand, 0, 2*math.pi,\n", " lambda x: 0, lambda x: math.pi/2)\n", " #Total power radiated (relative to Um)\n", "D = (4*math.pi)/(2*P[0]) #Directivity (unitless)\n", "\n", "#Result\n", "print \"The directivity is \", round(D)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The directivity is 2.0\n" ] } ], "prompt_number": 2 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Example 5-6.3, Page number: 91

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math, scipy.integrate\n", "\n", "#Variable declaration\n", "def integrand(theta, phi):\n", " return (math.sin(theta)**2)\n", " #Integrand (unitless)\n", "Um = 1 #Maximum radiation intensity (unitless)\n", "\n", "#Calculation\n", "P = scipy.integrate.dblquad(integrand, 0, 2*math.pi,\n", " lambda x: 0, lambda x: math.pi)\n", " #Total radiated power (relative to Um)\n", "D = 4*math.pi/P[0] #Directivity (unitless)\n", "\n", "#Result \n", "print \"The directivity is\", round(D,2)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The directivity is 1.27\n" ] } ], "prompt_number": 3 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Example 5-6.4, Page number: 91

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math, scipy.integrate\n", "\n", "#Variable declaration\n", "def integrand(theta, phi):\n", " return (math.sin(theta)**3)\n", " #Integrand (unitless)\n", "Um = 1 #Maximum radiation intensity (unitless)\n", "\n", "#Calculation\n", "P = scipy.integrate.dblquad(integrand, 0, 2*math.pi,\n", " lambda x: 0, lambda x: math.pi)\n", " #Total radiated power (relative to Um)\n", "D = 4*math.pi/P[0] #Directivity (unitless)\n", "\n", "#Result \n", "print \"The directivity is\", round(D,2)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The directivity is 1.5\n" ] } ], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Example 5-6.5, Page number: 92

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math, scipy.integrate\n", "\n", "#Variable declaration\n", "def integrand(theta, phi):\n", " return (math.sin(theta)*math.cos(theta)**2)\n", " #Integrand (unitless)\n", "Um = 1 #Maximum radiation intensity (unitless)\n", "\n", "#Calculation\n", "P = scipy.integrate.dblquad(integrand, 0, 2*math.pi,\n", " lambda x: 0, lambda x: math.pi/2)\n", " #Total radiated power (relative to Um)\n", "D = 4*math.pi/P[0] #Directivity (unitless)\n", "\n", "#Result \n", "print \"The directivity is\", round(D,2)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The directivity is 6.0\n" ] } ], "prompt_number": 5 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Example 5-6.6, Page number:93

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Variable declaration\n", "lobes = [0.25,0.37,0.46,0.12,0.07] #Normalized power of lobes (unitless)\n", "\n", "#Calculation\n", "ohm_a = 0 #Beam area (sr)\n", "sum_lobes = 0 #Sum of all lobes (unitless)\n", "for i in lobes:\n", " ohm_a += 2*math.pi*(math.pi/36)*(i)\n", " sum_lobes += i\n", "\n", "D = 4*math.pi/ohm_a #Directivity (unitless)\n", "D_db = 10*math.log10(D) #Directivity (in dBi)\n", "e_m = lobes[0]/sum_lobes #Beam efficiency (unitless)\n", "\n", "#Result\n", "print \"The directivity is\", round(D), \"or\", round(D_db,1), \"dBi\"\n", "print \"The beam efficiency is\", round(e_m, 2)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The directivity is 18.0 or 12.6 dBi\n", "The beam efficiency is 0.2\n" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Example 5-21.1, Page number: 146

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Variable declaration\n", "a = 25 #Height of vertical conducting wall (m)\n", "r = 100 #Distance to the receiver (m)\n", "wave_lt = 10e-2 #Transmitter dimension (m)\n", "\n", "#Calculation\n", "k = math.sqrt(2/(r*wave_lt)) #contant (unitless)\n", "S_av = (r*wave_lt)/(4*(math.pi**2)*(a**2)) #Relative signal level (unitless)\n", "S_av_db = 10*math.log10(S_av) #Signal level (in db)\n", "\n", "#Result\n", "print \"The signal level at the receiver is\", round(S_av,5), \"or\", round(S_av_db), \"dB\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The signal level at the receiver is 0.00041 or -34.0 dB\n" ] } ], "prompt_number": 1 } ], "metadata": {} } ] }