# 2: Electromagnetic Theory¶

## Example number 2.1, Page number 46¶

In [2]:
#importing modules
from __future__ import division
from sympy import *
import math

#Variable declaration
C = 10;    #Capacitance of the capacitor(pF)
#given V=0.2*sin(120*math.pi*t) in volts

#Calculation
C=C*10**-12;     #Capacitance of the capacitor(F)
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
#I = C*dV/dt
#let dV/dt be a
a=diff(0.2*sin(120*math.pi*t),t)     #dV/dt
#value of dV/dt is 75.398223686155*cos(376.991118430775*t)
#for cosine function peak value occurs when 120*math.pi*t = 0
#therefore value of dV/dt becomes d = 75.398223686155
d = 75.398223686155;    #value of dV/dt
I=C*d;     #displacement current(A)

#Result
print "value of dV/dt is",a
print "displacement current is",I, "A"

value of dV/dt is 75.398223686155*cos(376.991118430775*t)
displacement current is 7.53982236862e-10 A


## Example number 2.2, Page number 46¶

In [3]:
#importing modules
from __future__ import division
from sympy import *
import math

#Variable declaration
epsilon_r = 1;    #Relative electrical permittivity of free space
epsilon_0 = 8.854*10**-12;    #Absolute electrical permittivity of free space(F/m)
#given E=sin(120*math.pi*t) in volts

#Calculation
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
#J2 = epsilon*dE/dt
epsilon=epsilon_0*epsilon_r;
#let dE/dt be a
a=diff(sin(120*math.pi*t),t)     #dE/dt
#value of dE/dt is 376.991118430775*cos(376.991118430775*t)
#for cosine function peak value occurs when 120*math.pi*t = 0
#therefore value of dE/dt becomes d = 376.991118430775
d = 376.991118430775;    #value of dE/dt
J2=epsilon*d;     #displacement current density(A/m**2)

#Result
print "value of dE/dt is",a
print "The peak value of displacement current density is",J2, "A/m**2"

value of dE/dt is 376.991118430775*cos(376.991118430775*t)
The peak value of displacement current density is 3.33787936259e-09 A/m**2


## Example number 2.4, Page number 47¶

In [4]:
#importing modules
from __future__ import division
import math

#Variable declaration
p = 60;    #Power rating of bulb(W)
d = 0.5;    #Distance from the bulb(m)

#Calculation
A=4*math.pi*d**2;    #area(m**2)
P = p/A;    #Value of Poynting vector(W/m**2)
P = math.ceil(P*100)/100;    #rounding off value of P to 1 decimal

#Result
print "The value of Poynting vector is",P, "W/m**2"

The value of Poynting vector is 19.1 W/m**2


## Example number 2.5, Page number 47¶

In [11]:
#importing modules
from __future__ import division
import math

#Variable declaration
E_peak = 6;    #Peak value of electric field intensity(V/m)
c = 3*10**8;    #Speed of electromagnetic wave in free space(m/s)
mew_0 = 4*math.pi*10**-7;    #Absolute permeability of free space(Tm/A)
epsilon_0 = 8.854*10**-12;    #Absolute permittivity of free space(F/m)
mew_r = 1;    #Relative permeability of medium
epsilon_r = 3;    #Relative permittivity of the medium

#Calculation
v = c/math.sqrt(mew_r*epsilon_r);    #Wave velocity(m/s)
v = v/10**8;
v = math.ceil(v*10**4)/10**4;     #rounding off the value of v to 4 decimals
eta = math.sqrt((mew_0/epsilon_0)*(mew_r/epsilon_r));    #Intrinsic impedance of the medium(ohm)
eta = math.ceil(eta*10)/10;     #rounding off the value of v to 1 decimal
H_P = E_peak/eta;     #Peak value of the magnetic intensity(A/m)
H_P = H_P*10**2;
H_P = math.ceil(H_P*10**2)/10**2;     #rounding off the value of v to 2 decimals

#Result
print "The wave velocity is",v,"*10**8 m/s"
print "The intrinsic impedance of the medium is",eta, "ohm"
print "The peak value of the magnetic intensity is",H_P,"*10**-2 A/m"

The wave velocity is 1.7321 *10**8 m/s
The intrinsic impedance of the medium is 217.6 ohm
The peak value of the magnetic intensity is 2.76 *10**-2 A/m

In [ ]: