diff options
Diffstat (limited to 'Elements_of_Electromagnetics/chapter_9.ipynb')
-rw-r--r-- | Elements_of_Electromagnetics/chapter_9.ipynb | 200 |
1 files changed, 200 insertions, 0 deletions
diff --git a/Elements_of_Electromagnetics/chapter_9.ipynb b/Elements_of_Electromagnetics/chapter_9.ipynb new file mode 100644 index 00000000..02dee160 --- /dev/null +++ b/Elements_of_Electromagnetics/chapter_9.ipynb @@ -0,0 +1,200 @@ +{
+ "metadata": {
+ "name": "chapter_9.ipynb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h1>Chapter 9: Maxwells Equations<h1>"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.1, Page number: 375"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "A conducting bar can slide freely over two conducting rails as shown in Figure 9_6. Calcu- \n",
+ "late the induced voltage in the bar \n",
+ "(a) If the bar is stationed at y = 8 cm and B = 4 cos(10^6t) az mWb/m^2 \n",
+ "(b) If the bar slides at a velocity u = 20ay m/s and B = 4az. m Wb/m 2 \n",
+ "(c) If the bar slides at a velocity u = 20ay m/s and B = 4cos(10^6t - y) az\u001f mWb/m^2 '''\n",
+ "\n",
+ "import scipy\n",
+ "import scipy.integrate\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "u2=20\n",
+ "B2=4\n",
+ "l=0.06\n",
+ "#Calculations\n",
+ "\n",
+ "def ansa(x,y): \n",
+ " return 4*10**3\n",
+ "Va, erra = scipy.integrate.dblquad(lambda y , x: ansa(x,y), #in V \n",
+ " 0, 0.06, lambda y: 0, lambda y: 0.08)\n",
+ "\n",
+ "Vb=-u2*B2*l #in mV\n",
+ "\n",
+ "def ansc(x,y): \n",
+ " return 4\n",
+ "psic, errc = scipy.integrate.dblquad(lambda y , x: ansc(x,y), #in mWb \n",
+ " 0, 0.06, lambda y: 0, lambda y: 1)\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'Va =',Va,'sin(10^6t) V'\n",
+ "print 'Vb =',Vb,'mV'\n",
+ "print 'Vc= ',psic*10**3,'cos(10^6t-y) -',psic*10**3,'cos(10^6t) V'\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Va = 19.2 sin(10^6t) V\n",
+ "Vb = -4.8 mV\n",
+ "Vc= 240.0 cos(10^6t-y) - 240.0 cos(10^6t) V\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Example 9.3, Page number: 379"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "The magnetic circuit of Figure 9.8 has a uniform cross section of 10^-3 m^2 . If the circuit is \n",
+ "energized by a current I1(t) = 3 sin(100pit) A in the coil of N1 = 200 turns, find the emf \n",
+ "induced in the coil of N2 = 100 turns. Assume that mu = 500 muo '''\n",
+ "\n",
+ "import scipy\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "n1=200\n",
+ "n2=100 \n",
+ "S=10**-3 #cross section in m^2\n",
+ "muo=4*scipy.pi*10**-7 #permeabiility of free space\n",
+ "mur=500 #relative permeability\n",
+ "r=10*10**-3 #radius in m\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "psiI=n1*muo*mur*S/(2*scipy.pi*r)\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print 'V2 =',psiI*n2*300*scipy.pi,'cos(100pi t) V'\n",
+ "print '= 6Pi cos(100pi t) V'\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "V2 = 188.495559215 cos(100pi t) V\n",
+ "= 6Pi cos(100pi t) V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "<h3>Example 9.5, Page number: 393<h3>"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "'''\n",
+ "Evaluate the complex numbers \n",
+ " \n",
+ "(a) Zl=(j(3-j4)*)/(-I+j6)(2+j)^2 \n",
+ "(b) Z2=((1+j)/(4-j8))^1/2 '''\n",
+ "\n",
+ "import scipy\n",
+ "import cmath\n",
+ "from numpy import *\n",
+ "\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "z3=1j\n",
+ "z4=3+4j \n",
+ "z5=-1+6j \n",
+ "z6=3+4j\n",
+ "z7=1+1j\n",
+ "z8=4-8j\n",
+ "\n",
+ "#Calculations\n",
+ "\n",
+ "z1=(z3*z4/(z5*z6))\n",
+ "z2=scipy.sqrt(z7/z8)\n",
+ "z1r=round(z1.real,4) #real part of z1 rounded to 4 decimal places\n",
+ "z1i=round(z1.imag,4) #imaginary part of z1 rounded to 4 decimal places\n",
+ "z2r=round(z2.real,4) #real part of z2 rounded to 4 decimal places\n",
+ "z2i=round(z2.imag,4) #imaginary part of z2 rounded to 4 decimal places\n",
+ "\n",
+ "absz2=round(abs(z2),4) #absolute value of z2 rounded to 4 decimal places\n",
+ "\n",
+ "ang=scipy.arctan(z2i/z2r)*180/scipy.pi #in degrees\n",
+ "\n",
+ "#Results\n",
+ "\n",
+ "print 'z1 =',z1r,'+',z1i,'j'\n",
+ "print 'z2 ='\n",
+ "print 'mod =',absz2,'and angle=',round(ang,1),'degrees'"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "z1 = 0.1622 + -0.027 j\n",
+ "z2 =\n",
+ "mod = 0.3976 and angle= 54.2 degrees\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |