summaryrefslogtreecommitdiff
path: root/Elements_of_Electromagnetics/chapter_6.ipynb
blob: 2e3b83ef1623a0f3dfd5372db57934943bc81fd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
 "metadata": {
  "name": "",
  "signature": "sha256:0404b66522ba62c52bb8d112f6cb8c3bcc64527b3152c58a7bd723197eac9b68"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h1>Chapter 6: Electrostatic Boundary Value Problems<h1>"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 6.12, Page number: 238<h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import scipy\n",
      "\n",
      "#Variable Declaration\n",
      "\n",
      "e0=10**-9/(36*scipy.pi)    #Permittivity of free space in Farad/m\n",
      "er1=4                      #Relative permittivity of material 1 (dimensionless)\n",
      "er2=6                      #Relative permittivity of material 2 (dimensionless)\n",
      "d=5*10** -3                #The spacing between the capacitor plates in m\n",
      "S=30*10** -4               #The surface area of the plates\n",
      "\n",
      "#Calculations\n",
      "\n",
      "#Calculation for Capacitor 1\n",
      "\n",
      "C1=e0*er1*S*2/d            #Capacitance in Farads\n",
      "C2=e0*er2*S*2/d            #Capacitance in Farads\n",
      "Ca=C1*C2/(C1+C2)           #Total capacitance in Farads\n",
      "\n",
      "#Calculation for Capacitor 2\n",
      "\n",
      "C1= e0*er1*S/(2*d)         #Capacitance in Farads\n",
      "C2= e0*er2*S/(2*d)         #Capacitance in Farads\n",
      "Cb= C1+C2                  #Total capacitance in Farads\n",
      "\n",
      "\n",
      "#Results\n",
      "\n",
      "print 'The capacitance of capacitor 1 =',round(Ca*10**12,2),'pF'\n",
      "print 'The capacitance of capacitor 2 =',round(Cb*10**12,2),'pF'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The capacitance of capacitor 1 = 25.46 pF\n",
        "The capacitance of capacitor 2 = 26.53 pF\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}