{ "metadata": { "name": "chapter7.ipynb" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 7: Antenna Synthesis and Continuous Sources" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.1, Page no. 392" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#In this example the values of a1,a2,a3,a4 are found\n", "#the values of z1 z2 z3 are substituted in the equation AF=(z-z1)(z-z2)(z-z3)\n", "a1=-1\n", "a2=1\n", "a3=-1\n", "a4=1\n", "print \"The values of a1, a2, a3 and a4 are %d, %d, %d and %d respectively\"%(a1,a2,a3,a4)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The values of a1, a2, a3 and a4 are -1, 1, -1 and 1 respectively\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7.3, Page no. 398" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np\n", "import scipy.integrate as integrate\n", "a=np.zeros(11)\n", "for m in range(0,11):\n", " a[m]=integrate.quad(lambda x: exp(-1j*m*x) , (-pi/sqrt(2)) , (pi/sqrt(2)))[0]\n", "maxval = a[0]\n", "for i in range(0,11):\n", " if maxval