{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 6 Aperture and Lens Antenna"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 6.1 Directive gain calculation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The length is 62.5 m\n",
      "The angle ThetaE is 9.14784 degree\n",
      "The angle ThetaH is 12.5216 degree\n",
      "The H plane aperture is 13.7136\n",
      "\n",
      "\n",
      "The HPBWE is 5.6 degree\n",
      "The HPBWH is 4.88567 degree\n",
      "The Directive gain in db is 30.1221 db\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "import math\n",
    "\n",
    "#horn antenna\n",
    "Ae=10;\n",
    "del_a=0.2;\n",
    "p=Ae**2/(8*del_a);\n",
    "del1=0.375;\n",
    "Thetae=2*math.atan((Ae/(2*p)))*180/(math.pi); #flare angle\n",
    "Thetah=2*math.acos(p/(p+del1))*180/(math.pi);\n",
    "Ah=2*p*math.tan(((Thetah*(math.pi)/180)/2));\n",
    "print(\"The length is %g m\"%p);\n",
    "print(\"The angle ThetaE is %g degree\"%Thetae);\n",
    "print(\"The angle ThetaH is %g degree\"%Thetah);\n",
    "print(\"The H plane aperture is %g\"%Ah);\n",
    "HPBWH=67/Ah;\n",
    "HPBWE=56/Ae;\n",
    "Ddb=10*math.log10((7.5*Ae*Ah));\n",
    "print('\\n')\n",
    "print(\"The HPBWE is %g degree\"%HPBWE);\n",
    "print(\"The HPBWH is %g degree\"%HPBWH);\n",
    "print(\"The Directive gain in db is %g db\"%Ddb);   "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 6.2 Effective aperture calculation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The diameter d is 1.4 m\n",
      "The effective aperture is 1.53938 m^2\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "import math\n",
    "\n",
    "#parabolic reflector antenna\n",
    "BWFN=10;\n",
    "f=3*10**9;\n",
    "c=3*10**8;\n",
    "lamda=c/f;\n",
    "d=140*lamda/(BWFN);\n",
    "print(\"The diameter d is %g m\"%d);\n",
    "#For circular parabolidal antenna\n",
    "Ae=((math.pi)*(d**2))/4;\n",
    "print(\"The effective aperture is %g m^2\"%Ae);"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
