{
 "metadata": {
  "name": "",
  "signature": "sha256:bf5e27aec09a7e2fac66ac45f02286ce200d91b5616037191e8baebf0befe768"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 7 : Microwave Measurements"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1  Page No : 273"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\n",
      "\n",
      "\n",
      "#Given:\n",
      "c = 3*10**10                   #in cm/s\n",
      "a = 4                          #in cm\n",
      "b = 2.5                        #in cm\n",
      "f = 10*10**9                   #in Hz\n",
      "d = 0.1                        #distance between 2 minimum power points(in cm)\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "#calculations\n",
      "#For TE10 mode:\n",
      "wl_c = 2*a\n",
      "wl_o = c/f\n",
      "wl_g = wl_o/math.sqrt(1-(wl_o/wl_c)**2)\n",
      "S = wl_g/(math.pi*d)\n",
      "\n",
      "\n",
      "#---output---#\n",
      "print 'Voltage standing wave ratio =',round(S,4)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage standing wave ratio = 9.5493\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2  Page No : 274"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "\n",
      "\n",
      "#Given: \n",
      "P_i = 300              #in mW\n",
      "P_r = 10               #in mW\n",
      "\n",
      "#calculations\n",
      "p = math.sqrt(P_r/P_i)\n",
      "S = (1+p)/(1-p)\n",
      "\n",
      "#---output---#\n",
      "print 'Voltage standing wave ratio =',round(S,4)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage standing wave ratio = 1.0\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3  Page No : 279"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given:\n",
      "P_i = 2.5                   #in mW\n",
      "P_r = 0.15                  #in mW\n",
      "\n",
      "#---output---#\n",
      "p = math.sqrt(P_r/P_i)\n",
      "S = (1+p)/(1-p)\n",
      "print 'Voltage standing wave ratio =', round(S,4)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage standing wave ratio = 1.6488\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.4  Page No : 286"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Given:\n",
      "P_i=4.5             #in mW\n",
      "S=2.                 #VSWR\n",
      "C=30.                #in dB\n",
      "\n",
      "#calculations\n",
      "p=(S-1)/(S+1)\n",
      "P_f=P_i/(10**(C/10))\n",
      "P_r=p**2*P_i\n",
      "#---output---#\n",
      "print 'Reflected power (in watts) =',P_r\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reflected power (in watts) = 0.5\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}