{"nbformat_minor": 0, "cells": [{"source": "# Chapter 4 : Analysis of Linear Arrays", "cell_type": "markdown", "metadata": {}}, {"source": "## Example 4.1,Page Number 195", "cell_type": "markdown", "metadata": {}}, {"execution_count": 1, "cell_type": "code", "source": "from __future__ import division\nfrom sympy import Symbol\n\nL = Symbol('L') #Defining L as lambda\nl = 10*L \nN = 20 # number of elements\nd = l/N \nBW1 = (2*(L/d)*1/N) #bandwidth\nprint \"Null-to-null BW of broadside array in radians when l = 10*L,N = 20:\",round(BW1,2)\nl = 50*L\nN = 100 # number of elements\nd = l/N\nBW2 = (2*(L/d)*1/N) #bandwidth\nprint \"Null-to-null BW of broadside array in radians when l = 50*L,N = 100:\",round(BW2,2)\nl = 20*L\nN = 50 # number of elements\nd = l/N\nBW3 = (2*(L/d)*1/N) #bandwidth\nprint \"Null-to-null BW of broadside array in radians when l = 20*L,N = 50:\",round(BW3,2)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Null-to-null BW of broadside array in radians when l = 10*L,N = 20: 0.2\nNull-to-null BW of broadside array in radians when l = 50*L,N = 100: 0.04\nNull-to-null BW of broadside array in radians when l = 20*L,N = 50: 0.1\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Example 4.2,Page Number 196", "cell_type": "markdown", "metadata": {}}, {"execution_count": 2, "cell_type": "code", "source": "from __future__ import division\nfrom sympy import Symbol\nfrom math import sqrt\n\nL = Symbol('L') #Defining L as lambda\nl = 10*L \nN = 20 # number of elements\nd = l/N \nBW1 = 2*sqrt((2*(L/d)*1/N)) #bandwidth\nprint \"Null-to-null BW of end-fire array in radians when l = 10*L,N = 20:\",round(BW1,3)\nl = 50*L\nN = 100 # number of elements\nd = l/N\nBW2 = 2*sqrt((2*(L/d)*1/N)) #bandwidth\nprint \"Null-to-null BW of end-fire array in radians when l = 50*L,N = 100:\",round(BW2,3)\nl = 20*L\nN = 50 # number of elements\nd = l/N\nBW3 = 2*sqrt((2*(L/d)*1/N)) #bandwidth\nprint \"Null-to-null BW of end-fire array in radians when l = 20*L,N = 50:\",round(BW3,3)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Null-to-null BW of end-fire array in radians when l = 10*L,N = 20: 0.894\nNull-to-null BW of end-fire array in radians when l = 50*L,N = 100: 0.4\nNull-to-null BW of end-fire array in radians when l = 20*L,N = 50: 0.632\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Example 4.3,Page Number 196", "cell_type": "markdown", "metadata": {}}, {"execution_count": 3, "cell_type": "code", "source": "from __future__ import division\nfrom math import sqrt\n\n#variable declaration\n\nf = 6 #frequency in GHz\nf = 6*10**9 #frequency in Hz\nc = 3*10**8 #speed of light in m/s\nl = 10 # array length in meter\n\n#calculations\nlamda = c/f #wavelength in meter\n# formula : BWFN = 2*lambda/l\nBWFN = 2*(lamda/l) # band width in radians\nD = 2*(l/lamda) # directivity\n\n#result\nprint \"null-to-null Beamwidth of broad side array in radians:\",round(BWFN,2)\nprint \"Directivity:\",round(D,3)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "null-to-null Beamwidth of broad side array in radians: 0.01\nDirectivity: 400.0\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Example 4.4,Page Number 197", "cell_type": "markdown", "metadata": {}}, {"execution_count": 4, "cell_type": "code", "source": "from __future__ import division\nfrom math import pi\n\n#variable declaration\nf = 10 #frequency in Ghz\nf = 10*10**9 #frequency in hertz\nc = 3*10**8 #speed of light in m/s\nlamda = c/f #wavelength in meter\nN = 50 # number of elements\n\n#calculations\nd = 0.5*lamda # element spacing in meter\nBeta = 2*(pi)/lamda # phase shift\nalpha = Beta*d # progressive phase shift in radians\nl = N*d # Array length in meter\n\n\n#result\nprint \"progressive phase shift in radians:\",round(alpha,3)\nprint \"Array length in meter\",round(l,3)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "progressive phase shift in radians: 3.142\nArray length in meter 0.75\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Example 4.5,Page Number 197", "cell_type": "markdown", "metadata": {}}, {"execution_count": 5, "cell_type": "code", "source": "from __future__ import division\nfrom math import pi\nfrom sympy import Symbol\n\n\n#variable declaration\nN = 100 # no. of elements\nLm = Symbol('Lm') # defining Lm as lambda\n\n#calculations\nd = 0.5*Lm\nl = N*d # array length\nBWFN = 114.6 /(l/Lm) # beam width in degrees \nHPBW = BWFN/2 # half power beam width in degrees\nD1 = 2*(l/Lm) # directivity of broad side array\nD2 = 4*(l/Lm) # directivity of end fire array\n\n#result\nprint \"half power beamwidth in degrees:\",round(HPBW,3)\nprint \"null-to-null beamwidth in degrees:\",round(BWFN,3)\nprint \"directivity of broad side array:\",round(D1,1)\nprint \"directivity of end fire array:\",round(D2,1)\n\n# note : answer in the book is mis-printed,the HPBW is not 11.46 it should be 1.146 degrees. \n\n# note: misprint in second step of part a in book correct is l = N*d = 100*0.5*lamda = 50*lamda \n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "half power beamwidth in degrees: 1.146\nnull-to-null beamwidth in degrees: 2.292\ndirectivity of broad side array: 100.0\ndirectivity of end fire array: 200.0\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Example 4.9,Page Number 200", "cell_type": "markdown", "metadata": {}}, {"execution_count": 6, "cell_type": "code", "source": "from __future__ import division\nimport numpy as np\nfrom math import factorial\n\n\n# formula :combination(n,r)=(factorial(n))/(factorial(r)*factorial(n-r))\nprint(\"when n=2\")\nn=2\na_0=factorial(1)/factorial(0)*factorial(1) #relative excitation level 1\na_1=factorial(1)/factorial(1)*factorial(0) #relative excitation level 2\nprint \"relative excitation levels of binomial array at n=2:\",np.array([a_0,a_1])\nprint(\"when n=3\")\nn=3\na_1=factorial(1)/factorial(1)*factorial(0) #relative excitation level 2\na_0=2*a_1 # relative excitation level 1\nprint \"relative excitation levels of binomial array at n=3:\",np.array([a_1,a_0,a_1])\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "when n=2\nrelative excitation levels of binomial array at n=2: [ 1. 1.]\nwhen n=3\nrelative excitation levels of binomial array at n=3: [ 1. 2. 1.]\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Example 4.10,Page Number 200", "cell_type": "markdown", "metadata": {}}, {"execution_count": 7, "cell_type": "code", "source": "from __future__ import division\nfrom math import log10,pi\n\n\n#variable declaration\nd = 30 #separation distance in meter\nf = 10 #frequency in mega hertz\nf = 10*10**6 #frequency in hertz\nc = 3*10**8 #speed of light in m/s\nlamda = c/f #wavelength in meter\nGt = 1.65 #transmitting gain in dB\nGr = 1.65 #receiving gain in dB\n\n#calculations\n\n# basic transmission loss :\n# formula : Lb = 10*log(((4*(pi)*d)**2/(lamda)**2))\nLb = 10*log10((4*(pi)*d)**2/(lamda)**2) # basic transmmision loss in dB\n# actual transmission loss :\nLa = Lb-Gt-Gr # actual transmisson loss in dB\n\n#result\nprint \"basic transmmision loss in dB:\",round(Lb,3)\nprint \"actual transmisson loss in dB:\",round(La,3)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "basic transmmision loss in dB: 21.984\nactual transmisson loss in dB: 18.684\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Example 4.11,Page Number 201", "cell_type": "markdown", "metadata": {}}, {"execution_count": 8, "cell_type": "code", "source": "from __future__ import division\nfrom math import log10,pi\n\n\nf = 0.3 #frequency in Ghz\nf = 0.3*10**9 #frequency in hertz\nc = 3*10**8 #speed of light in m/s\nlamda = c/f #wavelength in meter\nd1 = 1.6 # in Km\nd1 = 1.6*10**3 # in meter\n# formula : Lb = 20*log10((4*(pi)*d)/(lamda))\nLb1 = 20*log10(4*pi*d1/lamda) # basic transmission loss in dB\nprint \"basic transmission loss in dB when d = 1.6Km,f = 0.3GHz:\",round(Lb1,3)\nd2 = 16 # in Km\nd2 = 16*10**3 # in meter\n# formula : Lb = 20*log10((4*(pi)*d)/(lamda))\nLb2 = 20*log10(4*pi*d2/lamda) # basic transmission loss in dB\nprint \"basic transmission loss in dB when d = 16Km,f = 0.3GHz:\",round(Lb2,3)\nd3 = 160 # in Km\nd3 = 160*10**3 # in meter\n# formula : Lb = 20*log10((4*(pi)*d)/(lamda))\nLb3 = 20*log10(4*pi*d3/lamda) # basic transmission loss in dB\nprint \"basic transmission loss in dB when d = 160Km,f = 0.3GHz:\",round(Lb3,3)\nd4 = 320 # in Km\nd4 = 320*10**3 # in meter\n# formula : Lb = 20*log10((4*(pi)*d)/(lamda))\nLb4 = 20*log10(4*pi*d4/lamda) # basic transmission loss in dB\nprint \"basic transmission loss in dB when d = 320Km,f = 0.3GHz:\",round(Lb4,3)\n# when frequency is 3Ghz\n# given :\nf = 3 #frequency in Ghz\nf = 3*10**9 #frequency in hertz\nc = 3*10**8 #speed of light in m/s\nlamda = c/f #wavelength in meter\nd1 = 1.6 # in Km\nd1 = 1.6*10**3 # in meter\n# formula : Lb = 20*log10((4*(pi)*d)/(lamda))\nLb1 = 20*log10(4*pi*d1/lamda) # basic transmission loss in dB\nprint \"basic transmission loss in dB when d = 1.6Km,f = 3GHz:\",round(Lb1,3)\nd2 = 16 # in Km\nd2 = 16*10**3 # in meter\n# formula : Lb = 20*log10((4*(pi)*d)/(lamda))\nLb2 = 20*log10(4*pi*d2/lamda) # basic transmission loss in dB\nprint \"basic transmission loss in dB when d = 16Km,f = 3GHz:\",round(Lb2,3)\nd3 = 160 # in Km\nd3 = 160*10**3 # in meter\n# formula : Lb = 20*log10((4*(pi)*d)/(lamda))\nLb3 = 20*log10(4*pi*d3/lamda) # basic transmission loss in dB\nprint \"basic transmission loss in dB when d = 160Km,f = 3GHz:\",round(Lb3,3)\nd4 = 320 # in Km\nd4 = 320*10**3 # in meter\n# formula : Lb = 20*log10((4*(pi)*d)/(lamda))\nLb4 = 20*log10(4*pi*d4/lamda) # basic transmission loss in dB\nprint \"basic transmission loss in dB when d = 320Km,f = 3GHz:\",round(Lb4,3)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "basic transmission loss in dB when d = 1.6Km,f = 0.3GHz: 86.067\nbasic transmission loss in dB when d = 16Km,f = 0.3GHz: 106.067\nbasic transmission loss in dB when d = 160Km,f = 0.3GHz: 126.067\nbasic transmission loss in dB when d = 320Km,f = 0.3GHz: 132.087\nbasic transmission loss in dB when d = 1.6Km,f = 3GHz: 106.067\nbasic transmission loss in dB when d = 16Km,f = 3GHz: 126.067\nbasic transmission loss in dB when d = 160Km,f = 3GHz: 146.067\nbasic transmission loss in dB when d = 320Km,f = 3GHz: 152.087\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Example 4.12,Page Number 202", "cell_type": "markdown", "metadata": {}}, {"execution_count": 9, "cell_type": "code", "source": "from __future__ import division\nfrom math import log10,pi\n\nGt=10 # transmission gain in dB\nGr=10 # receiving gain in dB\n#when frequency=0.3GHz\n# given :\nf=0.3 #frequency in Ghz\nf=0.3*10**9 #frequency in hertz\nc=3*10**8 #speed of light in m/s\nlamda=c/f #wavelength in meter\nd1=1.6 # in Km\nd1=1.6*10**3 # in meter\n# formula : Lb=20*log10((4*(pi)*d)/(lamda))\nLb1=20*log10(4*pi*d1/lamda) # basic transmission loss in dB\nLa1=Lb1-Gt-Gr # Actual transmission loss in dB \nprint \"Actual transmission loss in dB when d=1.6Km,f=0.3GHz:\",round(La1,2)\nd2=16 # in Km\nd2=16*10**3 # in meter\n# formula : Lb=20*log10((4*(pi)*d)/(lamda))\nLb2=20*log10(4*pi*d2/lamda) # basic transmission loss in dB\nLa2=Lb2-Gt-Gr # Actual transmission loss in dB \nprint \"Actual transmission loss in dB when d=16Km,f=0.3GHz:\",round(La2,2)\nd3=160 # in Km\nd3=160*10**3 # in meter\n# formula : Lb=20*log10((4*(pi)*d)/(lamda))\nLb3=20*log10(4*pi*d3/lamda) # basic transmission loss in dB\nLa3=Lb3-Gt-Gr # Actual transmission loss in dB \nprint \"Actual transmission loss in dB when d=160Km,f=0.3GHz:\",round(La3,2)\nd4=320 # in Km\nd4=320*10**3 # in meter\n# formula : Lb=20*log10((4*(pi)*d)/(lamda))\nLb4=20*log10(4*pi*d4/lamda) # basic transmission loss in dB\nLa4=Lb4-Gt-Gr # Actual transmission loss in dB \nprint \"Actual transmission loss in dB when d=320Km,f=0.3GHz:\",round(La4,2)\n# when frequency is 3Ghz\n# given :\nf=3 #frequency in Ghz\nf=3*10**9 #frequency in hertz\nc=3*10**8 #speed of light in m/s\nlamda=c/f #wavelength in meter\nd1=1.6 # in Km\nd1=1.6*10**3 # in meter\n# formula : Lb=20*log10((4*(pi)*d)/(lamda))\nLb1=20*log10(4*pi*d1/lamda) # basic transmission loss in dB\nLa1=Lb1-Gt-Gr # Actual transmission loss in dB \nprint \"Actual transmission loss in dB when d=1.6Km,f=3GHz:\",round(La1,2)\nd2=16 # in Km\nd2=16*10**3 # in meter\n# formula : Lb=20*log10((4*(pi)*d)/(lamda))\nLb2=20*log10(4*pi*d2/lamda) # basic transmission loss in dB\nLa2=Lb2-Gt-Gr # Actual transmission loss in dB \nprint \"Actual transmission loss in dB when d=16Km,f=3GHz:\",round(La2,2)\nd3=160 # in Km\nd3=160*10**3 # in meter\n# formula : Lb=20*log10((4*(pi)*d)/(lamda))\nLb3=20*log10(4*pi*d3/lamda) # basic transmission loss in dB\nLa3=Lb3-Gt-Gr # Actual transmission loss in dB \nprint \"Actual transmission loss in dB when d=160Km,f=3GHz:\",round(La3,2)\nd4=320 # in Km\nd4=320*10**3 # in meter\n# formula : Lb=20*log10((4*(pi)*d)/(lamda))\nLb4=20*log10(4*pi*d4/lamda) # basic transmission loss in dB\nLa4=Lb4-Gt-Gr # Actual transmission loss in dB \nprint \"Actual transmission loss in dB when d=320Km,f=3GHz:\",round(La4,2)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Actual transmission loss in dB when d=1.6Km,f=0.3GHz: 66.07\nActual transmission loss in dB when d=16Km,f=0.3GHz: 86.07\nActual transmission loss in dB when d=160Km,f=0.3GHz: 106.07\nActual transmission loss in dB when d=320Km,f=0.3GHz: 112.09\nActual transmission loss in dB when d=1.6Km,f=3GHz: 86.07\nActual transmission loss in dB when d=16Km,f=3GHz: 106.07\nActual transmission loss in dB when d=160Km,f=3GHz: 126.07\nActual transmission loss in dB when d=320Km,f=3GHz: 132.09\n"}], "metadata": {"collapsed": false, "trusted": true}}, {"source": "## Example 4.13,Page Number 203", "cell_type": "markdown", "metadata": {}}, {"execution_count": 10, "cell_type": "code", "source": "from __future__ import division\nfrom math import pi\n\n#variable declaration\n\nWt = 15 # radaited power in watt\nf = 60 # in MHz\nf = 60*10**6 # in Hz\nd = 10 # in m\nc = 3*10**8 # in m/s\nlamda = c/f # in meter\nGt = 1.64 # transmitting gain in dB\nGr = 1.64 # receiving gain in dB\n\n\n#calculations\nWr = (Wt*Gt*Gr*(lamda)**2/(4*(pi)*d)**2) # receiving power in watt\n\n#result\nprint \"receiving power in mW:\",round(Wr*1000,3)\n", "outputs": [{"output_type": "stream", "name": "stdout", "text": "receiving power in mW: 63.87\n"}], "metadata": {"collapsed": false, "trusted": true}}], "nbformat": 4, "metadata": {"kernelspec": {"display_name": "Python 2", "name": "python2", "language": "python"}, "language_info": {"mimetype": "text/x-python", "nbconvert_exporter": "python", "version": "2.7.8", "name": "python", "file_extension": ".py", "pygments_lexer": "ipython2", "codemirror_mode": {"version": 2, "name": "ipython"}}}}