Electromagnetic Theory 55:170

36
Electromagnetic Theory 55:170 Professor Karl E. Lonngren [[email protected]] 4312 SC office hours: 12:15-1:00 T & Th Kent Hutchinson – teaching assistant

description

Electromagnetic Theory 55:170. Professor Karl E. Lonngren [[email protected]] 4312 SC office hours: 12:15-1:00 T & Th Kent Hutchinson – teaching assistant. Books. References: Fields and Waves in Communication Systems Fundamentals of Electromagnetics with MATLAB 2007. Topics. - PowerPoint PPT Presentation

Transcript of Electromagnetic Theory 55:170

Page 1: Electromagnetic Theory 55:170

Electromagnetic Theory55:170

Professor Karl E. Lonngren[[email protected]

]4312 SC

office hours: 12:15-1:00 T & ThKent Hutchinson – teaching

assistant

Page 2: Electromagnetic Theory 55:170

Books

• References:• Fields and Waves in

Communication Systems• Fundamentals of

Electromagnetics with MATLAB 2007

Page 3: Electromagnetic Theory 55:170

Topics• MATLAB in EM • Electrostatics • Magnetostatics • Maxwell’s equations; boundary conditions• Transmission lines • Plane waves • Waveguides • Cavities • Radiation

Page 4: Electromagnetic Theory 55:170

Grading• Mid-term exam ¼ • Final exam ¼ • Term paper/lecture/movie ¼• Homework ¼

Page 5: Electromagnetic Theory 55:170
Page 6: Electromagnetic Theory 55:170

MATLAB• in the college computers•easy to use & learn•easy to produce 2-d & 3-d plots•ODE & PDE• integrate & differentiate•get pictures -- .m files in 070

web page

Page 7: Electromagnetic Theory 55:170

math• >> MATLAB icon• >> x = 1• x = • 1• >>• complex numbers• >> y = 1+1j (or 1+ 1i)• y =• 1.0000 + 1.0000i• >> z = x - y• z =• 0 - 1.0000i• >>

Page 8: Electromagnetic Theory 55:170

• >> x = 1; SAVE SPACE TRICK “ ; “• >> y = 2;• >> z = x * y; % multiply• >> z• z =• 2• >> w = x / y; % divide• >> w• w =• 0.5000

Page 9: Electromagnetic Theory 55:170

vectors - addition•a = 1ux + 2uy + 3uz

•b = 3ux + 2uy + 1uz•c = a + b •c = 4ux + 4uy + 4uz•a = [1 2 3];•b = [3 2 1];•c = a + b;•c • 4 4 4

Page 10: Electromagnetic Theory 55:170

vectors - dot product•a = 1ux + 2uy + 3uz

•b = 3ux + 2uy + 1uz•a • b = b • a •= 3 + 4 + 3 = 10•a = [1 2 3];•b = [3 2 1];•c = dot(a, b);•c• = 10

Page 11: Electromagnetic Theory 55:170

vectors - cross product

•a = 1ux + 0uy + 0uz ==> a = [1 0 0]

•b = 0ux + 1uy + 0uz ==> b = [0 1 0]

•d = cross (a,b)•d = • 0 0 1

Page 12: Electromagnetic Theory 55:170

vectors - cross product

•a = 1ux + 0uy + 0uz ==> a = [1 0 0]

•b = 0ux + 1uy + 0uz ==> b = [0 1 0]

•e = cross (b, a)•e =• 0 0 -1

Page 13: Electromagnetic Theory 55:170

x

y

z

A BB - A

|B - A| = norm(B -A)

Page 14: Electromagnetic Theory 55:170

• In MATLAB• >>colormap(hot) or cool or • >>whitebg(‘black’) or ‘green’ or • “print screen”• “paint”

Page 15: Electromagnetic Theory 55:170

simple graph

0 2 4 60

2

4

6

#x

>> x = [1 2 3 4 5]

x=

1 2 3 4 5

>> plot(x)

>> xlabel(‘#’)

>> ylabel(‘value’)

Page 16: Electromagnetic Theory 55:170

two valuessemicolon

1 2 3 4 51

2

3

4

5

y

x

>>x=[1 2 3 4 5];

>>y=[5 4 3 2 1];

>>plot(x,y,’*’)

>>xlabel(‘x’)

>>ylabel(‘y’)

Page 17: Electromagnetic Theory 55:170

clear;clfx=0:.1:4*pi;plot(sin(x),'linewidth',3)hold onplot(cos(x),'linewidth',3,'linestyle','--')xlabel('x','fontsize',18)ylabel('V','fontsize',18)set(gca,'fontsize',18)whitebg('black')

0 50 100 150-1

0

1

x

V

Add to graph

Page 18: Electromagnetic Theory 55:170

>>[x,y]=meshgrid(-xa:x:xb,-ya:y:yb)

Page 19: Electromagnetic Theory 55:170

>>[x,y]=meshgrid(-1:.1:1,-2:.4:4);

>>R=(x.^2+(y+1).^2).^.5;

>>Z=(1./R);

>>surf(x,y,Z)

>>view(-37.5-90,30)

Page 20: Electromagnetic Theory 55:170

>>[x,y]=meshgrid(-1:.1:1,-2:.4:4);

>>R=(x.^2+(y+1).^2).^.5;

>>Z=(1./R);

>>surf(x,y,Z)

>>view(-37.5-90,30)

Page 21: Electromagnetic Theory 55:170

>>[x,y]=meshgrid(-1:.1:1,-2:.4:4);

>>R=(x.^2+(y+1).^2).^.5;

>>Z=(1./R);

>>surf(x,y,Z)

>>view(-37.5-90,30)

Page 22: Electromagnetic Theory 55:170

>>[x,y]=meshgrid(-1:.1:1,-2:.4:4);

>>R=(x.^2+(y+1).^2).^.5;

>>Z=(1./R);

>>surf(x,y,Z)

>>view(-37.5-90,30)

Page 23: Electromagnetic Theory 55:170

>>[x,y]=meshgrid(-1:.1:1,-2:.4:4);

>>R=(x.^2+(y+1).^2).^.5;

>>Z=(1./R);

>>surf(x,y,Z)

>>view(-37.5-90,30)

Page 24: Electromagnetic Theory 55:170

>>[x,y]=meshgrid(-2:.2:2,-2:.2:2);>>r1=(x.^2+(y-.5).^2).^.5;>>r2=(x.^2+(y+.5).^2).^.5;>>V=(1./r1)-(1./r2);

Page 25: Electromagnetic Theory 55:170

>>mesh(x,y,V)

>>view(-37.5-90,10)

>>colormap(hot)

Page 26: Electromagnetic Theory 55:170

>>mesh(x,y,V)

>>view(-37.5-90,10)

>>colormap(hot)

Page 27: Electromagnetic Theory 55:170

>>[ex,ey]=gradient(V,.2,.2);

>>quiver(x,y,ex,ey)

>>grid

Page 28: Electromagnetic Theory 55:170

>>[ex,ey]=gradient(V,.2,.2);

>>quiver(x,y,ex,ey)

>>grid

Page 29: Electromagnetic Theory 55:170

divergence

Page 30: Electromagnetic Theory 55:170

curl

Page 31: Electromagnetic Theory 55:170

customize graphs -subplotsIterate labels

Change styles

Page 32: Electromagnetic Theory 55:170

Integration technique

quad (func, xmin, xmax)dblquad (func, xmin, xmax, ymin, ymax)triplequad (func, xmin, xmax, ymin, ymax, zmin, zmax)

func = inline (‘x.*y.*z’)

func = inline (‘x’) quad (func, 0, 1)0.5000

Page 33: Electromagnetic Theory 55:170

movies

Page 34: Electromagnetic Theory 55:170

There are “.m” programs for all of the figures and examples that are included in the book “Fundamentals of Electromagnetics with MATLAB” on the class web page for 55: 070.

Page 35: Electromagnetic Theory 55:170
Page 36: Electromagnetic Theory 55:170

.m files • text editor or unix editor• !vi name.m• [esc] i ---- start typing• [esc] x ---- remove one letter• [esc] dd --- remove one line• [esc] r ---- change one letter• [esc] h ---- return to start• a - [esc] - [shift] zz ---- leave unix