{ "metadata": { "name": "", "signature": "sha256:ffa36c37285243e82f8b7c3abbc469b9a273b2bd68fa586a9dc529ef122af349" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Ch-4: Microwave resonators & Waveguide components" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 193 Example 4.1" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "from math import sqrt \n", "#Given\n", "a=5 #cm\n", "a1=a/100 #m\n", "b=2 #cm\n", "b1=b/100 #m\n", "c=15 #cm\n", "c1=c/100 #m\n", "\n", "#(i) Air filled cavity\n", "m=1 \n", "n=0 \n", "p=1 \n", "c=3e8 #for air\n", "fr=(1/2)*c*sqrt((m/a1)**2+(n/b1)**2+(p/c1)**2) #hz\n", "print 'Resonant frequency for an air filled cavity: %0.3f'%(fr/10**9),'Ghz'\n", "\n", "#(ii) Dielctric filled cavity\n", "er=2.56 \n", "fr1=(1/2)*(c/sqrt(er))*sqrt((m/a1)**2+(n/b1)**2+(p/c1)**2) #hz\n", "print 'Resonant frequency for dielectric cavity: %0.3f'%(fr1/10**9),'Ghz'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resonant frequency for an air filled cavity: 3.162 Ghz\n", "Resonant frequency for dielectric cavity: 1.976 Ghz\n" ] } ], "prompt_number": 30 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 193 Example 4.2" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "a=0.38 #cm\n", "a1=a/100 #m\n", "b=0.76 #cm\n", "b1=b/100 #m\n", "f=50e9 \n", "c=3e8 \n", "\n", "#Length for TE102\n", "m=1 \n", "n=0 \n", "p=2 \n", "l=1/sqrt((f/c)**2-(1/(4*b1**2))) #m\n", "print 'Length c: %0.3f'%(l*100),'cm'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Length c: 0.653 cm\n" ] } ], "prompt_number": 31 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 194 Example 4.3" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import pi \n", "#Given\n", "c=3e8 #m/s\n", "a=2.286 #cm\n", "a1=a/100 #m\n", "b=1.024 #cm\n", "b1=b/100 #m\n", "f=10e9 #hz\n", "sig=6e7 \n", "u=4e-7*pi \n", "w=2*pi*f \n", "eet=377 \n", "\n", "#Shortest cavity length\n", "lamc=2*a1 #m\n", "fc=c/lamc #hz\n", "lam=c/f #m\n", "lamg=lam/sqrt(1-(fc/f)**2) #m\n", "sc=lamg/2 #m\n", "print 'Shortest cavity length: %0.3f'%(sc*100), 'cm'\n", "\n", "#Qw of the resonator operating in TE101 mode\n", "rs=sqrt((w*u)/(2*sig)) #ohm\n", "lamr=c/f \n", "x=(((a1*b1)/(sc**2))+((sc**2+a1**2)/(2*sc*a1))+(b1*sc/a1**2)) \n", "qw=(2*pi*eet*a1*b1*sc)/(rs*(lamr**3)*x) \n", "print 'Qw of the resonator operating in TE101 mode %0.3f'%qw" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Shortest cavity length: 1.988 cm\n", "Qw of the resonator operating in TE101 mode 7990.324\n" ] } ], "prompt_number": 32 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 195 Example 4.4" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "c=3e8 #m/s\n", "a=4.8 #cm\n", "a1=a/100 #m\n", "b=2.2 #cm\n", "b1=b/100 #m\n", "f=5e9 #hz\n", "er=2.25 \n", "tandel=4e-4 \n", "sig=5.813e7 \n", "oneby=3e8 \n", "u=4e-7*pi \n", "w=2*pi*f \n", "eet=377 \n", "\n", "#Length at p=1\n", "m=1 \n", "n=0 \n", "p=1 \n", "z=(f*2*sqrt(er))/c \n", "cp1=p/sqrt((z**2)-((m/a1)**2)-((n/b1)**2)) \n", "print 'Length of resonator at p=1: %0.3f'%(cp1*100), 'cm'\n", "\n", "#At p=2\n", "cp2=cp1*2 \n", "print 'Length of resonator at p=2: %0.3f'%(cp2*100), 'cm'\n", "\n", "#Qw\n", "rs=sqrt((w*u)/(2*sig)) #ohm\n", "lamr=c/(f*sqrt(er)) \n", "x=(((a1*b1)/(cp1**2))+((cp1**2+a1**2)/(2*cp1*a1))+(b1*cp1/a1**2)) \n", "qw=(2*pi*(eet/sqrt(er))*a1*b1*cp1)/(rs*(lamr**3)*x) \n", "qd=1/tandel \n", "q=(qw*qd)/(qw+qd) \n", "print 'Q for TE101 mode: %0.3f'%q" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Length of resonator at p=1: 2.200 cm\n", "Length of resonator at p=2: 4.400 cm\n", "Q for TE101 mode: 1925.612\n" ] } ], "prompt_number": 33 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 196 Example 4.5" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "c=3e8 #m/s\n", "a=2 #cm\n", "a1=a/100 #m\n", "b=2.5 #cm\n", "b1=b/100 #m\n", "\n", "print 'TE modes' \n", "h01=3.832 \n", "fr=(c/(2*pi))*sqrt((h01/a1)**2+(pi/b1)**2) #hz\n", "print 'Resonant frequency for mode TE010: %0.3f'%(fr/10**9),'Ghz'\n", "\n", "h11=1.841 \n", "fr1=(c/(2*pi))*sqrt((h11/a1)**2+(pi/b1)**2) #hz\n", "print 'Resonant frequency for mode TE111: %0.3f'%(fr1/10**9),'Ghz'\n", "\n", "h21=3.054 \n", "fr2=(c/(2*pi))*sqrt((h21/a1)**2+(pi/b1)**2) #hz\n", "print 'Resonant frequency for mode TE211: %0.3f'%(fr2/10**9),'Ghz'\n", "\n", "print 'TM modes:' \n", "l1=0 \n", "h011=2.405 \n", "fr3=(c/(2*pi))*sqrt((h011/a1)**2+(pi*l1/b1)**2) #hz\n", "print 'Resonant frequency for mode TM010 %0.3f'%(fr3/10**9),'Ghz'\n", "\n", "l2=1 \n", "fr4=(c/(2*pi))*sqrt((h011/a1)**2+(pi*l2/b1)**2) #hz\n", "print 'resonant frequency for mode TM011: %0.3f'%(fr4/10**9),'Ghz'\n", "\n", "l3=1 \n", "h111=3.832 \n", "fr5=(c/(2*pi))*sqrt((h111/a1)**2+(pi*l3/b1)**2) #hz\n", "print 'Resonant frequency for mode TM111: %0.3f'%(fr5/10**9),'Ghz'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "TE modes\n", "Resonant frequency for mode TE010: 10.940 Ghz\n", "Resonant frequency for mode TE111: 7.438 Ghz\n", "Resonant frequency for mode TE211: 9.442 Ghz\n", "TM modes:\n", "Resonant frequency for mode TM010 5.742 Ghz\n", "resonant frequency for mode TM011: 8.305 Ghz\n", "Resonant frequency for mode TM111: 10.940 Ghz\n" ] } ], "prompt_number": 34 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 196 Example 4.6" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "QTM010=1.202 \n", "QTE101=1.11 \n", "\n", "r=QTM010/QTE101 \n", "print 'Ratio of Qs of cylindrical and rectangular resonators: %0.3f'%r" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Ratio of Qs of cylindrical and rectangular resonators: 1.083\n" ] } ], "prompt_number": 35 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 197 Example 4.7" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Given\n", "f=7.07e9 #hz\n", "a=3 #cm\n", "a1=a/100 #m\n", "sig=5.8e7 \n", "er=2.25 \n", "tandel=4e-4 \n", "ur=1 \n", "n=377 \n", "w=2*pi*f \n", "u=4e-7*pi \n", "\n", "#Q of resonantor\n", "rs=sqrt(w*u/(2*sig)) #ohm\n", "qw=(0.7419*n)/(rs*sqrt(2.25)) \n", "qd=1/tandel \n", "q=(qw*qd)/(qw+qd) \n", "print 'Q of resonator: %0.3f'%q" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Q of resonator: 1931.819\n" ] } ], "prompt_number": 36 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 198 Example 4.8" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "a=5 #cm\n", "a1=a/100 #m\n", "b=4 #cm\n", "b1=b/100 #m\n", "c=10 #cm\n", "c1=c/100 #m\n", "sig=5.8e7 \n", "u0=4e-7*pi \n", "er=3 \n", "eet=377 \n", "\n", "ur=1 \n", "spl=3e8 \n", "tandel=2.5e-4 \n", "\n", "#TE101 mode\n", "m=1 \n", "n=0 \n", "p=1 \n", "fr=(spl/(2*sqrt(er*ur)))*sqrt((m/a1)**2+(n/b1)**2+(p/c1)**2) #hz\n", "print 'Resonant frequency: %0.3f'%(fr/10**9), 'Ghz'\n", "\n", "w=2*pi*fr \n", "rs=sqrt((w*u0)/(2*sig)) #ohm\n", "lamr=spl/(fr*sqrt(er)) \n", "x=(((a1*b1)/(c1**2))+((c1**2+a1**2)/(2*c1*a1))+((b1*c1)/a1**2)) \n", "qw=(2*pi*(eet/sqrt(er))*a1*b1*c1)/(rs*(lamr**3)*x) \n", "print 'Q for TE101 mode: %0.3f'%qw\n", "\n", "qd=1/tandel \n", "q=(qw*qd)/(qw+qd) \n", "print 'Q for lossy dielectric: %0.3f'%q\n", "\n", "#Value of qw is calculated wrong in book as lamr comes to be 0.08 not 0.89 m" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resonant frequency: 1.936 Ghz\n", "Q for TE101 mode: 10916.466\n", "Q for lossy dielectric: 2927.360\n" ] } ], "prompt_number": 40 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 198 Example 4.9" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "c=3e8 #m/s\n", "a=2.286 #cm\n", "a1=a/100 #m\n", "b=1.106 #cm\n", "b1=b/100 #m\n", "\n", "#For fr1=9.3e9 \n", "fr1=9.3e9 #hz\n", "lamr1=c/fr1 #m\n", "c1=(2*a1)/sqrt((((2*a1)/lamr1)**2)-1) \n", "\n", "#For fr2=10.2e9 \n", "fr2=10.2e9 #hz\n", "lamr2=c/fr2 #m\n", "c2=(2*a1)/sqrt((((2*a1)/lamr2)**2)-1) \n", "\n", "r=c1-c2 \n", "print 'Range of piston movement: %0.3f'%(r*100), 'cm'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Range of piston movement: 0.710 cm\n" ] } ], "prompt_number": 41 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 199 Example 4.10" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "a=3 #cm\n", "a1=a/100 #m\n", "d=10 #cm\n", "d1=d/100 #m\n", "df=2.5e6 \n", "er=2.25 \n", "p11=1.841 \n", "c=3e8 #m/s\n", "\n", "#Resonant frequency\n", "fr=(c/2)*(sqrt((p11/a1)**2+(pi/d1)**2)) #hz\n", "print 'Resonant frequency: %0.3f'%(fr/10**9),'Ghz'\n", "\n", "#Q without dielectric\n", "q0=fr/df \n", "print 'Q wirhout dielectric constant: %0.3f'%q0\n", "\n", "# Q with dielectric\n", "fr1=fr/sqrt(er) \n", "qd=1e3 \n", "q=(q0*qd)/(q0+qd) \n", "print 'Q with dielectric constant: %0.3f'%q" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Resonant frequency: 10.341 Ghz\n", "Q wirhout dielectric constant: 4136.446\n", "Q with dielectric constant: 805.313\n" ] } ], "prompt_number": 44 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 200 Example 4.11" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "f=9.375e9 #hz\n", "sig=5.8e7 \n", "eet=377 \n", "c=3e8 #m/s\n", "w=2*pi*f \n", "r=1.5 \n", "u=4e-7*pi \n", "\n", "#Radius\n", "a=c/(f*2.62) #m\n", "print 'Radius of resonantor %0.3f'%(a*100), 'cm'\n", "\n", "#O\n", "rs=sqrt((w*u)/(2*sig)) #ohm\n", "x=1.202*eet \n", "y=rs*(1+(1/r)) \n", "q=x/y \n", "print 'Q of the resonator: %0.3f'%q\n", "\n", "#Answer for Q is calculated as 10875 in book but it is 10763.303" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Radius of resonantor 1.221 cm\n", "Q of the resonator: 10763.303\n" ] } ], "prompt_number": 45 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 215 Example 4.12" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "f=5e9 #hz\n", "sig=5.813e7 \n", "er=2.25 \n", "tandel=4e-4 \n", "c=3e8 #m/s\n", "h01=3.832 \n", "u=4e-7*pi \n", "\n", "#Length of resonator\n", "lamr=c/(f*sqrt(er)) \n", "d=sqrt((((((2*3.832)**2)+(pi*pi))*(lamr*lamr))/(2*2*pi*pi)) )\n", "print 'Length of resonator: %0.3f'%(d*100),'cm'\n", "\n", "#Q of resonator\n", "n=(120*pi)/sqrt(er) \n", "Rs=sqrt((f*u)/sig) \n", "a=d/2 \n", "Qw1=n*(((h01/a)**2+(pi/d)**2)**(3/2))\n", "Qw2=2*Rs*(((h01*h01)/(a*a*a))+((2*pi*pi)/(d*d*d))) \n", "Qw=Qw1/Qw2 \n", "Qd=1/tandel \n", "Q=(Qw*Qd)/(Qw+Qd) \n", "print 'Q of resonator: %0.3f'%Q\n", "\n", "#Value of Qw is calculated wrong in the book, it should be 50057.91 instead of 53473.8\n", "#Hence the value of Q also differs" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Length of resonator: 5.273 cm\n", "Q of resonator: 2381.084\n" ] } ], "prompt_number": 46 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 215 Example 4.13" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#Given\n", "p=100 #mW\n", "#As 2 and 3 are matched terminals\n", "x=1/2 \n", "y=1/sqrt(2) \n", "s=[x,-x, y, -x, 0, y, y, y, 0] \n", "\n", "#Power delivered\n", "#Port 1\n", "p1=p*(1-s[1]**2) \n", "print 'Power at port 1:',p1, 'mW'\n", "\n", "#Port2\n", "p2=p*s[2]**2 \n", "print 'Power at port 2:',p2, 'mW'\n", "\n", "#Port 3\n", "p3=p*s[3]**2 \n", "print 'Power at port 3:' ,p3,'mW'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Power at port 1: 75.0 mW\n", "Power at port 2: 50.0 mW\n", "Power at port 3: 25.0 mW\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 216 Example 4.14" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "p=40 #mW\n", "#Since port 3 is matched\n", "x=sqrt(2) \n", "s=[1, 1, x, 1, 1, -x, x, -x, 0] \n", "r1=40 #ohm\n", "r2=60 #ohm\n", "w=50 #ohm\n", "\n", "#Reflection coefficients\n", "T1=(w-r1)/(w+r1) \n", "T2=(r2-w)/(r2+w) \n", "\n", "#As power is fed into 1 and 2 equally\n", "pd=p/2 \n", "\n", "#Power delivered\n", "#Port 1\n", "p1=pd*(1-T1**2) \n", "print 'Power at port 1: %0.3f'%p1,'mW'\n", "\n", "#Port2\n", "p2=pd*(1-T2**2) \n", "print 'Power at port 2: %0.3f'%p2,'mW'" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Power at port 1: 19.753 mW\n", "Power at port 2: 19.835 mW\n" ] } ], "prompt_number": 48 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 216 Example 4.15" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division \n", "#Given\n", "T1=1/2 \n", "T2=3/5 \n", "T3=0 \n", "T4=4/5 \n", "p=500e-3 #W\n", "#S matrix for magic Tee\n", "x=1/sqrt(2) \n", "s=[0, 0, x, x, 0, 0, x, -x, x ,x, 0, 0, x, -x, 0, 0] \n", "#Using the input output relation\n", "#[b]=[s]*[a]\n", "b=[0.6565, 0.7576, 0.5536, 0.0892] \n", "\n", "#(i) Power transmitted through ports\n", "#Port 1\n", "p1=(1/2)*b[0]**2*(1-T1**2) \n", "print 'Power at port 1: %0.3f'%p1,'W'\n", "\n", "#Port2\n", "p2=(1/2)*(b[1]**2)*(1-(T2**2)) \n", "print 'Power at port 2: %0.3f'%p2, 'W'\n", "\n", "#Port 4\n", "p4=(1/2)*b[3]**2*(1-T4**2) \n", "print 'Power at port 4: %0.3f'%p4,'W'\n", "\n", "#(ii) Power reflected at port 3\n", "#Port 3\n", "p3=p*b[2]**2 \n", "print 'Power at port 3: %0.3f'%p3,'W'\n", "\n", "#(iii) Power absorbed\n", "pabs=p-(p1+p2+p3+p4) \n", "print 'Power absorbed: %0.3f'%pabs,'W'\n", "\n", "#Answer for power absorbed is calculated wrong in book" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Power at port 1: 0.162 W\n", "Power at port 2: 0.184 W\n", "Power at port 4: 0.001 W\n", "Power at port 3: 0.153 W\n", "Power absorbed: 0.000 W\n" ] } ], "prompt_number": 53 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 236 Example 4.18" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from numpy import mat, set_printoptions\n", "#Given\n", "C=10 #dB\n", "D=30 #dB\n", "\n", "#Parameters\n", "bet=10**(-C/20) \n", "x=bet/(10**(D/20)) \n", "a=sqrt(1-(bet*bet)) \n", "#Scattering matrix\n", "#Assuming symmetery\n", "s=mat([[0, a ,x ,(bet*1J)],[ a, 0, (bet*1J), x],[ x ,(bet*1J), 0 ,a],[ (bet*1J) ,x ,a, 0] ])\n", "set_printoptions(precision=3)\n", "print 'Scattering matrix:\\n',s " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Scattering matrix:\n", "[[ 0.000+0.j 0.949+0.j 0.010+0.j 0.000+0.316j]\n", " [ 0.949+0.j 0.000+0.j 0.000+0.316j 0.010+0.j ]\n", " [ 0.010+0.j 0.000+0.316j 0.000+0.j 0.949+0.j ]\n", " [ 0.000+0.316j 0.010+0.j 0.949+0.j 0.000+0.j ]]\n" ] } ], "prompt_number": 57 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 238 Example 4.20" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "vswr=2 \n", "D1=8 #mW\n", "D2=2 #mW\n", "\n", "#Reflection coefficient at arm 4\n", "T=(vswr-1)/(vswr+1) \n", "#Powwe delivered to D1\n", "P=(D1*100)/(1-T**2) \n", "P1=0.99*P \n", "#Power reflected at D1\n", "W1=(P/100)*T*T \n", "#Power reflected at load\n", "W2=D2-W1 \n", "Tt=sqrt((W2*100)/(P1)) \n", "pt=(1+Tt)/(1-Tt) \n", "print 'VSWR:%0.3f'%pt\n", "Pl=P1*(1-(Tt*Tt)) \n", "print 'Power delivered:' ,Pl,'mW'\n", "\n", "#Answer for P1 should be 792 but it is given as 800" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "VSWR:2.008\n", "Power delivered: 791.0 mW\n" ] } ], "prompt_number": 59 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 239 Example 4.21" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from numpy import mat, set_printoptions\n", "#Given\n", "I=30 #dB\n", "Il=0.4 #dB\n", "\n", "S12=10**(I/-20) \n", "S21=10**(Il/-20) \n", "s=mat([[0, S12],[ S21, 0] ])\n", "set_printoptions(precision=3)\n", "print 'Scattering matrix:\\n' ,s" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Scattering matrix:\n", "[[ 0. 0.032]\n", " [ 0.955 0. ]]\n" ] } ], "prompt_number": 60 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 240 Example 4.22" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from numpy import mat, set_printoptions\n", "#Given\n", "I=30 #dB\n", "Il=2 #dB\n", "p=1.3 \n", "\n", "#Elelments\n", "T=(p-1)/(p+1) \n", "S11=T \n", "S22=T \n", "S33=T \n", "S12=10**(-Il/20) \n", "S13=10**(-I/20) \n", "S21=S13 \n", "S32=S13 \n", "S23=S12 \n", "S31=S23 \n", "s=mat([[S11, S21, S31] ,[S12, S22, S32], [S13, S23 ,S33] ])\n", "set_printoptions(precision=3)\n", "print 'Scattering matrix:\\n' ,s" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Scattering matrix:\n", "[[ 0.13 0.032 0.794]\n", " [ 0.794 0.13 0.032]\n", " [ 0.032 0.794 0.13 ]]\n" ] } ], "prompt_number": 61 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 249 Example 4.23" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#Given\n", "f=10e9 #Hz\n", "u=4e-7*pi \n", "c=3e8 #m/s\n", "a=2.29 #cm\n", "a1=a/100 \n", "b=1.02 #cm\n", "b1=b/100 \n", "\n", "#E/H\n", "w=2*pi*f \n", "EbyH=(w*u)/sqrt(((w/c)**2)+((pi/a1)**2)) \n", "lam=c/f \n", "lamc=2*a1 \n", "d=(1/4)*(lam/sqrt(1-((lam/lamc)**2))) \n", "print 'Position: %0.3f'%(d*100), 'cm'\n", "\n", "#Answer for positon is calculated wrong in book" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Position: 0.993 cm\n" ] } ], "prompt_number": 62 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Page Number: 250 Example 4.24" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from numpy import mat, set_printoptions\n", "#Given\n", "#As it is perfectly matched\n", "S12=1/sqrt(2) \n", "S21=S12 \n", "s=mat([[0 ,S12] ,[S21, 0] ])\n", "set_printoptions(precision=3)\n", "print 'Scattering matrix:\\n' , s" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Scattering matrix:\n", "[[ 0. 0.707]\n", " [ 0.707 0. ]]\n" ] } ], "prompt_number": 65 } ], "metadata": {} } ] }