developing problem based introductory electromagnetics ......introductory em course. still, with...

23
AC 2008-355: DEVELOPING PROBLEM-BASED INTRODUCTORY ELECTROMAGNETICS COURSE WITH BROADER APPEAL TO STUDENTS Dmitriy Garmatyuk, Miami University Dmitriy Garmatyuk received the Engineer’s degree from Taganrog State University of Radioengineering, Taganrog, Russia, and the Ph.D. degree from University of Nebraska-Lincoln, both in electrical engineering, in 1996 and 2001, respectively. From 2001 to 2005 he worked as a Senior Analog Design Engineer in the Circuit Development Group at Intel Corporation, Folsom, CA. In 2005 he joined the Department of Electrical and Computer Engineering at Miami University, Oxford, OH as Assistant Professor. His graduate research focused on novel aspects of SAR imaging using random noise waveforms. His industrial work experience extended to CMOS analog circuit design and signal integrity in gigabit-speed data architectures. His current research interests are in advanced imaging radar systems and sensor networks and in non-conventional approaches to modeling and solving signal integrity problems in above-10 Gb/s wireline links. He is also interested in improving electromagnetics curriculum on undergraduate level. © American Society for Engineering Education, 2008 Page 13.398.1

Upload: others

Post on 10-Mar-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

AC 2008-355: DEVELOPING PROBLEM-BASED INTRODUCTORYELECTROMAGNETICS COURSE WITH BROADER APPEAL TO STUDENTS

Dmitriy Garmatyuk, Miami UniversityDmitriy Garmatyuk received the Engineer’s degree from Taganrog State University ofRadioengineering, Taganrog, Russia, and the Ph.D. degree from University of Nebraska-Lincoln,both in electrical engineering, in 1996 and 2001, respectively. From 2001 to 2005 he worked as aSenior Analog Design Engineer in the Circuit Development Group at Intel Corporation, Folsom,CA. In 2005 he joined the Department of Electrical and Computer Engineering at MiamiUniversity, Oxford, OH as Assistant Professor. His graduate research focused on novel aspects ofSAR imaging using random noise waveforms. His industrial work experience extended to CMOSanalog circuit design and signal integrity in gigabit-speed data architectures. His current researchinterests are in advanced imaging radar systems and sensor networks and in non-conventionalapproaches to modeling and solving signal integrity problems in above-10 Gb/s wireline links. Heis also interested in improving electromagnetics curriculum on undergraduate level.

© American Society for Engineering Education, 2008

Page 13.398.1

Page 2: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

Developing Problem-Based Introductory Electromagnetics

Course with Broader Appeal to Students

Abstract

This paper features course material being designed at Miami University under the National

Science Foundation’s (NSF) Course, Curriculum and Laboratory Improvement (CCLI) grant to

specifically address the problem of students’ declining interest in electromagnetics (EM), while

applications of EM continue to permeate many areas of electrical engineering both in the

industry and academia. The new approach to teaching introductory course of EM aims to spark

students’ interest to the subject via offering them several real-world problems from the select

areas of signal integrity engineering, radar, antenna analysis and EM field propagation in human

tissue. The problems are intuitively relevant and presentation of them is based on visualizing

software (Matlab and Ansoft Designer/HFSS). The students are able to choose to either run

numerous simulations to understand the problem better (most, probably, will), or consider the

theoretical foundations and understand the dependencies before approaching the problem. The

paper is focused on the description of sample problems and corresponding software test-benches.

Introduction

This paper stems from the project funded under the National Science Foundation’s (NSF)

Course, Curriculum, and Laboratory Improvement (CCLI). The project has main emphasis on

increasing students’ motivation for studying electromagnetics by re-developing the course flow.

The educational concept to be explored is based on breaking down the course into 4-5 lecture/lab

mini-projects, each focused on a particular theme of interest to engineers and researchers

nowadays. As stated in the Project proposal – “Our broad goal of this research <…> is twofold:

a) To increase inclusiveness and appeal of electromagnetics to a diverse student

body;

b) To open new opportunities to the students by bringing their innovation and

engineering leadership skills and mastery of electromagnetics to the level

commensurate with current R&D trends.”

With this in mind, we started developing the conceptual design of an introductory EM course by

creating and improving test-benches representative of realistic problems in EM. One criterion in

choosing these problems was their appeal to students; another was relevance to the traditional

subjects of the discipline of electromagnetics, as well as to the topics currently pursued in the

industrial and academic communities.

Presented in the paper are first results of the development of such problems, categorized by the

software (Ansoft and Matlab). Some components of these educational modules were offered to

the students taking introductory electromagnetics course in spring semester of 2007. The results

of student surveys and informal discussions with the students are presented in the paper as well.

Page 13.398.2

Page 3: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

Ansoft Test-Benches

Ansoft1 is an electromagnetic simulation software package which can be categorized as

computer-aided engineering (CAE) technology. It is widely used, for example, as an industry

tool for design and verification of high-speed electronic interconnect structures. Ansoft has an

active University Program which allows institutions of higher education to acquire their products

as software bundles at a nominal cost.

Below are the descriptions of two “pilot” simulation units offered to the students in spring

semester of 2007, approximately two months after the NSF-sponsored project start – these units

were further improved and modified during Summer 2007.

A. Signal Integrity Simulation of a Wirebond Interconnect

Wirebond is a thin conductor which connects an integrated chip (IC) chip package to the

printed circuit board (PCB). A segment of such an interconnect topology can be assembled as a

simulation model using Ansoft HFSS and simulated to get a feel for a variety of parameters

which govern the transformations of an electric signal propagating via such structure. In

particular, once the architecture shown in Figure 1 is drawn, students can attempt the following

sets of simulations:

� Generate and plot S-parameters at the frequencies of interest – learn to read S-parameter

tables to determine the point of rapid increase of signal attenuation and discern frequency

regions with high reflection loss;

� Run an animation of an electric field propagation along the interconnect structure –

observe how it changes with frequency;

� Run an animation of EM field propagation in the direction perpendicular to signal’s

propagation – i.e. understand the implications of undesirable radiation from such

structures;

� Plot current density to understand the current distribution as a function of frequency;

� Play with structure dimensions and composition (e.g. – change dielectric permittivity of a

substrate to observe any changes in performance).

Based on the initial run of this test-bench with the students, the reception was very good.

Students readily experimented with the topology, simulation setups and, quite predictably,

enjoyed the animation aspect of plotting EM fields in 3-D space. The concept of scattering

parameters (S-parameters) came across fairly vividly and there was little confusion over what

they mean and how to read them later when they were covered in lecture material. Overall, it

took approximately two hours for students to draw the structure and run a few simulations on it;

an additional hour was needed to complete several experiments. This simulation unit is fairly

flexible, however, and can be modified from what can be a single lab class to a mini-project

lasting several weeks. The one-lab instructions for this unit are attached in the Appendix to

illustrate the procedure involved in creating and analyzing the structure.

Page 13.398.3

Page 4: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

Figure 1 Final wirebond topology as drawn in HFSS

Figure 2 Example of animation (magnitude of E-field is plotted) – frequency is varied and we

can see that as frequency grows, the wirebond section effectively works as a choke (field source

is on the left and propagation direction is to the right)

Page 13.398.4

Page 5: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

Figure 3 Example of E-field radiation animation - field's magnitude is plotted in the plane

perpendicular to the direction of propagation to illustrate the concept of EMI

B. EM Wave Propagation in Brain Tissue

This simulation unit was intended, first and foremost, as an “igniter” of students’ interest

to problems that can be solved using electromagnetics. The concept itself is fairly obvious and

intuitive – how much EM power is penetrating a human head when a cell phone antenna is

actively emitting it? Students can easily relate to the scenario; however it is important to let them

know that rigorous solution for this kind of a problem is most certainly outside the scope of the

introductory EM course. Still, with modern simulation software, it is possible to at least attempt a

qualitative analysis of a given problem, without deriving the solution in closed form for it. The

student response to this simulation unit, as a result, was mixed: Most liked the animation aspect,

but a few complained that, even though they can see and appreciate the graphical solution

provided by the software, they do not understand the “inner workings” of the simulator, thus they

“have to trust” what the computer is telling them. We actually thought of this as an opportunity

to engage students further. After the simulations were run, we outlined the areas and methods of

electromagnetics which provide the paths to obtaining an accurate solution, or at least avenues to

better understanding what the simulator must have done to produce the results seen on screen.

This was met with much interest from students and, hopefully, prompted them to think of EM as

a much applied discipline to pursue further on more advanced levels.

The simulation unit consists of drawing the model of a human head in Ansoft HFSS;

drawing a helix antenna with a source next to the human head model and simulating EM field

propagation at a certain frequency of operation2. Representative illustrations are shown in

Figures 4 – 6.

Page 13.398.5

Page 6: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

Figure 4 Model topology drawn in HFSS: Spherical object is a human head model with cortical

and grey matter tissue regions; next to it is a model of a cell phone antenna

Figure 5 Electric field animation: It can be seen, that electric field does not, in fact, penetrate

much into the brain tissue in this example

Page 13.398.6

Page 7: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

Figure 6 Plot of a SAR (specific absorption rate), which is supposed to be under 1.6 W/kg as per

FCC requirements for cell phones (clearly satisfied in this example)

MATLAB Test-Benches

MATLAB is used extensively in teaching EM nowadays – in fact, it is used as a primary

simulation engine by authors of several textbooks on the subject, including the textbook3 used in

teaching our introductory EM course at Miami University. One example below is a simulation of

a well-known problem of static electric field computation due a metallic rod (wire) with a linear

charge distribution. The “twist” on it is using arbitrary charge distribution instead of constant and

using animation capabilities of MATLAB to present a more visually appealing solution. �

A. E-field Animation in Electrostatics

The topic of electrostatics often intimidates students taking EM course for the first time,

as much of it is rooted in geometry and integral computations. To reduce the burden of

calculating integrals, we came up with a numerical example which implements two classic

methods of solving for an electric field due to a wire segment with a linear charge distribution.

The benefits of such an approach are: a). Students learn about MATLAB capabilities to perform

symbolic calculations; b). Students learn to address the problem in a systematic way – draft the

general solution first and let computational tools solve for the numerical answer later; c).

Resultant animation of an E-field allows to plot what is essentially a 4-D vector field (3

coordinates and magnitude) and observe its behavior. The procedure is described below.

Page 13.398.7

Page 8: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

Method I – Classical approach

Figure 7 Problem setup in Cartesian coordinate system

A finite-length wire with arbitrary linear charge distribution ρ(z) is shown in Figure 7. We can

define an observation point P, where the electric field due to this wire needs to be found. As per

the classical approach, which stems from Coulomb’s Law, the electric field due to a point charge

can be readily determined. Such a point charge may be approximated by an infinitesimal

segment of the wire, shown in red in the graph above. The length of the segment is dz and the

charge contained within it is dQ. The electric field at P due to the point charge dQ is then

���� � � ��||� �� ,

where k is Coulomb force constant, ��� is the vector from the dQ to P and �� is the unit vector in

the direction of ���. Once this equation is obtained, the rest of the solution is, essentially, an

exercise in geometry and then in numerical integration. It can be shown that dQ is expressed via

ρ(z) as dQ = ρ(z)dz and, therefore, the 3 components of the electric field at P are:

���� � ��� · � · �� · � ���������� � ��� � �� � �����

��

��

���

���� � ��� · � · �� · � ���������� � ��� � �� � ������/�

�/�

��/�

���! � ��! · � · � ���� · �� � ��������� � ��� � �� � ������/�

�/�

��/�

Page 13.398.8

Page 9: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

Method II – Electric Potential

While the first method required computing of three integrals (one per each E-field component),

the method of electric potential involves only one integral. The electric potential V (a scalar) at

the observation point P is calculated as

"�#� � � · $ %�!��!&�'�(�'�(�!�!'��

�/���/� .

To find the electric field we simply need to calculate a gradient of the scalar field V obtained for

a number of points in 3-D space around the wire.

The two methods will produce similar, but not exactly same results. Number of points in the

XYZ grid of observation points will affect the solution. Also, since closed-form integration and

differentiation is replaced with numerical summation and difference, the accuracy of the results

will be affected by how MATLAB performs these operations as well. Some details on that are

provided as script comments in the Appendix.

Figure 8 Snapshot of animations showing Ex component of an electric field: Left - solution

obtained using classical approach; Right - solution obtained using method of electric potential

The reception of both MATLAB projects was good among students taking the course in

Spring 2007. Several of them ventured farther than assignments required them, exploring other

setups and configurations. Overall, these simulation units are deemed a success and will be

expanded and added to in the upcoming year.

Conclusions and Preliminary Student Feedback

These educational modules were offered in an introductory undergraduate EM course and

it is assumed that the students have had no exposure to the field of electromagnetics prior to

taking it. Thus, the goal of the class is to ignite students’ interest in EM and convince them to

consider exploring further. At the end of the course an anonymous feedback was collected from

the students. It was particularly interesting to read students’ comments about several “pilot Page 13.398.9

Page 10: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

projects,” which were made in

described topics and included

Below are representati

pre-selection of “only positive

• “Need better un

• “The strength o

• “Good applicat

exercises.”

• “The class and

• “The course wa

could also see t

The feedback form a

effectiveness of the efforts to

EM for the future career devel

�� �

������

��

�����

������

�����

����

into labs during the course. These “pilot projec

d MATLAB and Ansoft HFSS test-benches.

ative comments made by students in regards to

ve” or “only negative” comments was done):

understanding of what HFSS is doing and why.

h of the course is that it is an avenue for further

cation of concepts learned in the course dur

d labs were very helpful.”

was the first really complex course that I felt I

e the relevance to real-world applications.”

also contained three custom questions de

to increase students’ motivation to learn the su

elopment. The questions and answer distributio

�� ����

������

�������� ������ ����� �� ����

�����

������� �������� �

��������

�� ����

�������

�������� ������ ����� �� ����

�����

������������ ���� ���������������

���� ���������������������

����� ������������ ���������

���������������������

jects” were based on the

s to the test-benches (no

hy.”

er study in the field.”

during projects and lab

t I learned a lot but that I

designed to gauge the

subject and to consider

tion are shown below.

��

Page 13.398.10

Page 11: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

Bibliography

1. Ansoft Corporation. www.ansof

2. Dielectric properties of body tis

http://niremf.ifac.cnr.it/tissprop/ (IF

3. S. M. Wentworth, Applied Elect

2007.

APPENDIX

A. Instructions for W

1. Open Ansoft HFSS.

2. 3D Modeler � Units a

3. View � Modify attrib

name, e.g. Default> �

angle to the x-y-z Carte

4. Draw � Box (or from

5. Click at the origin, dr

window with exact coo

��

����

��

���

���

soft.com

tissues in the frequency range 10 Hz – 100 GHz. Interne

(IFAC-CNR, Florence, Italy, 1997-2007).

ectromagnetics: Early Transmission Lines Approach, Jo

Wirebond Simulation Unit in Ansoft HFSS

s and select ‘mil’

ributes � Orientation � Get current view attri

� Add/Edit � Make Default � Apply (Th

artesian standard)

m icon menu: second row, left of cylinder)

drag diagonally, then up and click again. A

oordinates pops up. Fill in the values as shown

�� ����

��������

�������� ������ ����� �� ����

�����

������������� ���� ������

���������������� �����������

����� ������� ����� �����

�����

net resource. Available:

John Wiley & Sons, NY,

ttributes � <Type in the

This sets Default aspect

A box is drawn and a

n below:

Page 13.398.11

Page 12: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

6. Click OK, and then go to View � Fit All � All Views.

7. Click on the box again and modify information pertaining to this object in the sub-

window on the left panel. In the Name type ‘gnd’, click on material and enter ‘copper’,

then set color and transparency as you wish. Congratulations – you just created a 500 x

100 mil segment of a motherboard’s ground plane with 2 mil thickness!

8. Next we have to place a dielectric substrate on the ground plane. Signal traces will then

be routed (also in copper) on top of that dielectric. Repeat the procedure from steps 4-5

and specify the following coordinates for the dielectric:

9. Repeat step 7, but call the new object ‘dielectric’; specify the material as FR4 epoxy and

set the color and transparency to different values.

10. Now for slightly harder part: Drawing signal traces. First one is the trace routed inside

the chip. Again, draw a box and choose the following coordinates:

11. Fill in the parameters in the left-panel sub-window: Name ‘chiptrace’, material – copper,

color is the same as ground plane and transparency = 0.

12. Next one up is a bonding pad inside the chip: Place a box, choose coordinates:

Page 13.398.12

Page 13: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

13. See step 11 and repeat; Name: ‘chip_bondpad.’

14. To get from the chip to the board a special type of micro-wire is sometimes used. It is

called bond-wire and it is referred to as part of the chip’s package. Click on ‘Draw

bondwire’ icon (same row as box, cylinder, etc) and the position first point at the center

of the bonding pad. Note the coordinates of the point in the bottom right-hand corner.

When the coordinates are x=50, y=125, z=14 – click once. This defines the starting point

for the bond-wire. Without clicking, drag the point along the y-axis staying parallel to it.

When the coordinates in the lower right-hand corner become x=50, y=250, z=12 – click

again. The window showing a JEDEC-type bondwire pops up and asks for the height and

landing point elevation of the bondwire. Leave h1 at 5mils, and change h2 to 0 – this

means that the landing point is aligned in height with the starting point. The last window

that pops up will look like this:

15. To make sure your bondwire is correctly placed, go to View � Modify attributes �

Orientation and choose Front from the list of available views. The bondwire should have

starting and landing points on the same level. Revert to the default view by selecting it.

Select bondwire and assign its name, material (gold) and color/transparency.

16. Now all is left is placing PCB bonding pad and trace. By now you should be proficient

enough in placing boxes, so I’ll just show the two coordinate windows corresponding to

the PCB bonding pad and trace and mention that both are made of copper as well.

Here’s how the final topology looks like at the end:

Page 13.398.13

Page 14: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

17. The topology is 25% of the setup. The remaining three fourths are: Boundary definitions,

Excitation definitions and Analysis definition.

18. By default all geometries exist in vacuum. To make conditions more realistic it is better

to put them in air (this is particularly true when solving for EMI problems). To do that,

create yet another box with the following coordinates:

19. Define the material as ‘air’ and specify 100% transparency.

20. This might seem a bit unclear: All 3D shapes in HFSS must not intersect each other.

Right now, the air box intersects all traces, bonding pads and bond-wire. To remedy this,

we have to follow the procedure outlined below:

a. In the Objects sub-window (between left panel and drawing) select air, all

traces/bond-pads and bond-wire (hold Ctr key to do multiple selections)

b. In the drawing window right-click anywhere and choose Edit � Boolean �

Subtract. A window pops up and you see that all metal parts (5 total) are in the

‘tools’ and air is in the ‘blank’. Leave it this way, then check ‘Clone tool objects

before subtracting’ box and click OK. Now your air box has the new shape:

Original box minus all metal components. (The metal components are also there

thanks to ‘Clone tool objects…’ option).

21. All material-based boundaries need not to be defined; the only boundary definition

needed is EM-field radiation from the air box. Right-click in the drawing window and

choose ‘Select faces.’ Then, click on each outer side of the air box (5 total) and do Assign

Boundary � Radiation. You might have to choose various views of the geometry to

select each of the 5 sides. You can always go back to the original aspect angle by

choosing Default view. When you are done, check that you got all 5 sides right by

clicking on Boundaries under the Project in the upper left sub-window and clicking

through the 5 sides.

22. Excitation: We need to assign two ports (points of signal application). One port is

Data_In – at the left and another is Data_Out at the right (where the signal will continue

traveling through the motherboard). Ports are defined as simple squares and these need to

be drawn in XZ planes, so change to XZ in the dropdown menu on the second icon row.

23. Choose View � Modify Attributes � Orientation, and then Left. This is where your

Data_In port will be. Draw a rectangle and define its parameters as follows:

Page 13.398.14

Page 15: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

24. Choose color = red and transparency = 60% for the Port object and call it Data_In. Zoom

in on the rectangle by using zoom in icon. Now, assign excitation to it:

a. Right-click on it, then Assign Excitation � Wave Port.

b. In the new window click Next, then where it says Integration Line – click and

choose New Line.

c. Point at the center of the bottom side of the port rectangle (i.e. – ground plane),

click and drag the line upwards up to the bottom of the trace. Click and press Next

in the pop-up window until it disappears. Now, check your Port 1 excitation

pattern by clicking on Excitations � Wave Port 1 in the upper-left sub-window. It

should look like:

25. Repeat for the right-side port at the other end of the geometry (where PCB trace ends).

26. Thus all geometrical portions are complete; we just need to define solution setup

(Analysis).

27. In the upper-left sub-window choose Analysis; right-click and choose Add solution setup.

Define solution frequency = 15 GHz, maximum number of passes = 10.

28. Right-click on Analysis Setup1 and choose Add Sweep. Choose Discrete under Sweep

type; choose Linear Count from drop-down menu and then Start, Stop and Count are: 15 Page 13.398.15

Page 16: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

MHz, 15 GHz, 10. Make sure to check ‘Save Fields (All frequencies)’ box below! Click

Display to the right of Frequency Setup to see all frequencies at which the fields will be

evaluated. Click OK.

29. Almost ready to solve! Last check – click on Validate button (upper icon row) and see if

everything is OK.

30. Right-click Setup1 in the upper-left sub-window, then Analyze. Go have a soda – this

will take a few minutes. If you want to see how the simulation progresses, choose HFSS

� Results � Solution Data � Convergence (tab) and see how close to the convergence

the simulation process gets (should converge on the 9th

pass).

31. After about 5 minutes the simulation completes. Again, go to HFSS � Results �

Solution Data and then to Matrix data. Click on S-Matrix and All. Freqs. The table shows

how much magnitude/phase the wave will have if it is launched in Port 1 (or 2) and is

received at Port 2 (or 1). Choose magnitude from drop-down menu and observe how

magnitude of forward-traveling wave (i.e. – from Port 1 to Port 2) drops with frequency

and magnitude of the reflected wave (i.e. – from Port 1 back to Port 1) grows with

frequency. This hints at the fact that the bond-wire is actually a high-frequency choke.

32. Close results window and go to Results in the upper-left sub-window. Right-click, Create

Report, then plot S(WavePort1,WavePort1) and S(WavePort2,WavePort1) in dB versus

frequency. The first characteristic is called ‘return loss’ and it is desirable to keep it under

–10 dB. The second characteristic is called ‘insertion loss’ and when it is –6 dB the

signal’s amplitude is cut in half, so it is desirable to keep it above that value. Determine

from the plots what is the cut-off operating frequency of the drawn topology.

33. Although somewhat ineffective, field plots and animations add visual appeal to HFSS.

Experiment with field plots by selecting the components for which you’d like to plot

fields (do that in Objects sub-window by holding Ctrl key – choose all traces and bond-

wire set for a test), right-clicking in the drawing window and choosing Fields � E �

ComplexMag_E. Choose Solution � Setup1: Sweep1 so that all frequencies are

accounted for in the plots. When you click Done the field distribution will be overlaid on Page 13.398.16

Page 17: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

the traces. You can also plot H and J. If you want to see how fields change with

frequency you can click on Field Overlays in upper-left sub-window, then click again on

the last-plotted field, then right-click on the name of the plot and choose Animate. Right-

clicking on the scale with values allows you to modify it (e.g. switch to Log scale).

34. You can also plot versus distance at 15 GHz. Delete previous Field Overlays setups; click

on Planes (same Objects tree); choose 5 trace/bond-wire components again, and also

choose XZ plane. Repeat the procedure from step 33 to choose field plot, then in Animate

dialog choose Distance as the variable. Specify 100 steps and simulate. Right-click on the

scale, then Modify and Scale. Change to Use Limits and set Max to 20,000 for clearer

visuals.

35. Feel free to experiment more.

B. MATLAB scripts for plotting E-field computed using classical and electric

potential approaches

clear all;

% (C) ______________, Dept of ECE, _______________ % 2006-2007

% Calculation of electric field using classical approach % Geometry: finite-length wire along the z-axis with % length L (z=[-L/2...L/2]) and electric charge density % rho, which can be a function of z

% Variables: % rho is linear charge density (can be a polynomial of z); % xp, yp, zp are coordinates of the observation point % z0 is z-coordinate of the point source on the wire; % L is length of the wire; % ke is a constant (=9*10^9)

button='Yes'; while button=='Yes'

% Dialog box to choose which E-field component will plot: prompt = {['Which E-field component will be plotted?',... ' (1=Ex, 2=Ey, 3=Ez, any other number=|E|)']}; dlg_title = 'Choose E-component 2 plot'; num_lines = 1; def = {'Type here'}; answer = inputdlg(prompt,dlg_title,num_lines,def); Echosen=str2num(answer{1});

h = waitbar(0,'Please wait...'); % <-- Define "wait bar"; assign values % to it within the script body as % waitbar(value) syms rho F z L x0 y0 z0 Ex ke

%rho = 1e-9*(0.3*z^3-0.1*(z-0.25)^2+z*0.01); % <-- This will cause MATLAB to % compute the integrals for % approx. 3 minutes on P4

Page 13.398.17

Page 18: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

%rho=1e-9*z/z; % <-- Simplest rho: Const rho=5e-9*z; % Integrands: One per each component of E-field Fx = ke*x0*rho/(x0^2+y0^2+(z0-z)^2)^1.5; Fy = ke*y0*rho/(x0^2+y0^2+(z0-z)^2)^1.5; Fz = ke*(z0-z)*rho/(x0^2+y0^2+(z0-z)^2)^1.5;

% ...and integrate to get E-field Ex = int(Fx,z,-L/2,L/2); Ey = int(Fy,z,-L/2,L/2); Ez = int(Fz,z,-L/2,L/2);

waitbar(0.1);

% Setting up E-field components as functions for numerical substitutions Ex_fun_num=vectorize(char(Ex)); Ex_fun_num=@(L,ke,x0,y0,z0)eval(Ex_fun_num);

Ey_fun_num=vectorize(char(Ey)); Ey_fun_num=@(L,ke,x0,y0,z0)eval(Ey_fun_num);

Ez_fun_num=vectorize(char(Ez)); Ez_fun_num=@(L,ke,x0,y0,z0)eval(Ez_fun_num);

waitbar(0.25);

% Define constants and set up Cartesian space in (x,y,z) L=5e-2; % <-- Total length of wire; default 5cm N=70; % <-- Number of points in each direction (x,y,z) % 75 points is about optimal on my PC (execution time-wise) ke=9e9;

% Define X-Y-Z mesh-grid arrays % Default: all go from -5cm to 5cm x=linspace(-0.05,0.05,N);stepx=x(N)-x(N-1); y=linspace(-0.05,0.05,N);stepy=y(N)-y(N-1); z=linspace(-0.05,0.05,N);stepz=z(N)-z(N-1); [XX,YY,ZZ]=meshgrid(x,y,z); [x2plot,y2plot]=meshgrid(x,y); % <-- This is for plotting

waitbar(0.3);

% Substitute numerical values into function handles for E-field Ex_num=Ex_fun_num(L,ke,XX,YY,ZZ); Ey_num=Ey_fun_num(L,ke,XX,YY,ZZ); Ez_num=Ez_fun_num(L,ke,XX,YY,ZZ); Emag=sqrt(Ex_num.^2+Ey_num.^2+Ez_num.^2); % <-- Magnitude

waitbar(0.9);

figure;grid on; hold on; set(gca,'nextplot','replacechildren');

Page 13.398.18

Page 19: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

% Calculating min/max values for plotting: exmax=max(max(max(Ex_num))); exmin=min(min(min(Ex_num))); eymax=max(max(max(Ey_num))); eymin=min(min(min(Ey_num))); ezmax=max(max(max(Ez_num))); ezmin=min(min(min(Ez_num))); emagmax=max(max(max(Emag))); emagmin=0;

set(gca,'nextplot','replacechildren'); waitbar(1); close(h); % <-- Closing waitbar % Plotting in a loop: for k=1:N, switch(Echosen) case 1 surf(x2plot,y2plot,Ex_num(:,:,k)); xlabel('x, m'); ylabel('y, m'); zlabel('Field intensity (magnitude), V/m'); alpha(0.8); % <-- Transparency factor (0 = completely

transparent) shading interp; % <-- Interpolate between meshes camlight left; % <-- Use camera lighting from the left lighting phong; % <-- Use lighting scheme 'phong' grid on; colorbar; title(['E_x at z = ',num2str(z(k))],'FontSize',12,... 'FontWeight','demi');pause(0.1); axis([min(x) max(x) min(y) max(y) exmin exmax]); case 2 surf(x2plot,y2plot,Ey_num(:,:,k)); xlabel('x, m'); ylabel('y, m'); zlabel('Field intensity (magnitude), V/m'); alpha(0.8); % <-- Transparency factor (0 = completely

transparent) shading interp; % <-- Interpolate between meshes camlight left; % <-- Use camera lighting from the left lighting phong; % <-- Use lighting scheme 'phong' grid on; colorbar; title(['E_y at z = ',num2str(z(k))],'FontSize',12,... 'FontWeight','demi');pause(0.1); axis([min(x) max(x) min(y) max(y) eymin eymax]); case 3 surf(x2plot,y2plot,Ez_num(:,:,k)); xlabel('x, m'); ylabel('y, m'); zlabel('Field intensity (magnitude), V/m'); alpha(0.8); % <-- Transparency factor (0 = completely

transparent) shading interp; % <-- Interpolate between meshes camlight left; % <-- Use camera lighting from the left lighting phong; % <-- Use lighting scheme 'phong' grid on; colorbar; title(['E_z at z = ',num2str(z(k))],'FontSize',12,... 'FontWeight','demi');pause(0.1); axis([min(x) max(x) min(y) max(y) ezmin ezmax]);

Page 13.398.19

Page 20: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

otherwise surf(x2plot,y2plot,Emag(:,:,k)); xlabel('x, m'); ylabel('y, m'); zlabel('Field intensity (magnitude), V/m'); alpha(0.8); % <-- Transparency factor (0 = completely

transparent) shading interp; % <-- Interpolate between meshes camlight left; % <-- Use camera lighting from the left lighting phong; % <-- Use lighting scheme 'phong' grid on; colorbar; title(['|E| at z = ',num2str(z(k))],'FontSize',12,... 'FontWeight','demi');pause(0.1); axis([min(x) max(x) min(y) max(y) emagmin emagmax]); end end

% Dialog for while loop button = questdlg('Another run?','Press No to exit'); end

clear all;

% (C) __________, Dept of ECE, ____________ % 2006-2007

% Calculation of electric field using electric potential % Geometry: finite-length wire along the z-axis with % length L (z=[-L/2...L/2]) and electric charge density % rho, which can be a function of z

% This routine computes V (potential) using Symbolic Math % Toolbox, then converts it to numerics and computes % -gradient(V) to get E, which has components (Ex, Ey, Ez)

% Variables: % rho is linear charge density (can be a polynomial of z); % F is integrand (=k*rho*dz/R, where R is distance from the % arbitrary point source on the wire to the arbitrary % observation point where V is calculated; % xp, yp, zp are coordinates of the observation point % zl is z-coordinate of the point source on the wire; % L is length of the wire; V is computed potential; % ke is a constant (=9*10^9)

% While loop to keep he script running button='Yes'; while button=='Yes'

% Dialog box to choose which E-field component will plot: prompt = {['Which E-field component will be plotted?',... ' (1=Ex, 2=Ey, 3=Ez, any other number=|E|)']}; dlg_title = 'Choose E-component 2 plot'; P

age 13.398.20

Page 21: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

num_lines = 1; def = {'Type here'}; answer = inputdlg(prompt,dlg_title,num_lines,def); Echosen=str2num(answer{1});

h = waitbar(0,'Please wait...'); % <-- Define "wait bar"; assign values % to it within the script body as % waitbar(value) syms rho F xp yp zp zl L V ke % Define rho as a function of z, or, if uniform % distribution, define as rho = const*zl/zl %rho = 1e-9*(0.3*zl^3-0.1*(zl-0.25)^2+zl*0.01); %rho = 1e-9*zl/zl; rho=5e-9*zl^1; F = ke*rho/sqrt(xp^2+yp^2+(zp-zl)^2); % Integrate F to obtain V in analytical form: V = int(F,zl,-L/2,L/2); waitbar(0.3); % Start substituting numerical values into V: L=5e-2; % <-- Total length of wire; default 5cm ke=-9e9;% <-- Make k negative to account for "-" in E=-gradient(V) V_fun_num=vectorize(char(V)); V_fun_num=@(L,ke,xp,yp,zp)eval(V_fun_num); % Define number of points in X-Y-Z mesh N=70; % <-- Somewhere between 20 and 120 works reasonably fast

% Define X-Y-Z mesh-grid arrays % Default: all go from -5cm to 5cm x=linspace(-0.05,0.05,N);stepx=x(N)-x(N-1); y=linspace(-0.05,0.05,N);stepy=y(N)-y(N-1); z=linspace(-0.05,0.05,N);stepz=z(N)-z(N-1); [XX,YY,ZZ]=meshgrid(x,y,z); [x2plot,y2plot]=meshgrid(x,y); % <-- This is for plotting % Do the mesh-grid array substitution into analytical % expression for V: %Vnum_final=subs(Vnum,{xp,yp,zp},{XX,YY,ZZ}); % <-- For R2006a Vnum_final=V_fun_num(L,ke,XX,YY,ZZ);

waitbar(0.75); % To calculate E-field we need to compute the gradient, % which Matlab will approximate as delta_F/delta_x % instead of getting an exact analytical expression for % a true derivative. The actual step size delta_x then % becomes important, as by default Matlab will choose it % to be =1 and the result for gradient calculated that % way will be hugely inaccurate. To avoid that, we use % actual delta_x (y, z) derived from original {x},{y},{z} % data arrays, denoted here as stepx, stepy and stepz

[Ex,Ey,Ez]=gradient(Vnum_final,stepx,stepy,stepz); Emag=sqrt(Ex.^2+Ey.^2+Ez.^2); % <-- Magnitude waitbar(0.9); % Calculating min/max values for plotting: exmax=max(max(max(Ex))); exmin=min(min(min(Ex))); eymax=max(max(max(Ey))); eymin=min(min(min(Ey))); ezmax=max(max(max(Ez))); ezmin=min(min(min(Ez))); P

age 13.398.21

Page 22: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

emagmax=max(max(max(Emag))); emagmin=0;

% Preparing to plot: set the mode to animation set(gca,'nextplot','replacechildren'); waitbar(1); close(h); % <-- Closing waitbar % Plotting in a loop: for k=1:N, switch(Echosen) case 1 surf(x2plot,y2plot,Ex(:,:,k)); xlabel('x, m'); ylabel('y, m'); zlabel('Field intensity (magnitude), V/m'); alpha(0.8); % <-- Transparency factor (0 = completely

transparent) shading interp; % <-- Interpolate between meshes camlight left; % <-- Use camera lighting from the left lighting phong; % <-- Use lighting scheme 'phong' grid on; colorbar; title(['E_x at z = ',num2str(z(k))],'FontSize',12,... 'FontWeight','demi');pause(0.1); axis([min(x) max(x) min(y) max(y) exmin exmax]); case 2 surf(x2plot,y2plot,Ey(:,:,k)); xlabel('x, m'); ylabel('y, m'); zlabel('Field intensity (magnitude), V/m'); alpha(0.8); % <-- Transparency factor (0 = completely

transparent) shading interp; % <-- Interpolate between meshes camlight left; % <-- Use camera lighting from the left lighting phong; % <-- Use lighting scheme 'phong' grid on; colorbar; title(['E_y at z = ',num2str(z(k))],'FontSize',12,... 'FontWeight','demi');pause(0.1); axis([min(x) max(x) min(y) max(y) eymin eymax]); case 3 surf(x2plot,y2plot,Ez(:,:,k)); xlabel('x, m'); ylabel('y, m'); zlabel('Field intensity (magnitude), V/m'); alpha(0.8); % <-- Transparency factor (0 = completely

transparent) shading interp; % <-- Interpolate between meshes camlight left; % <-- Use camera lighting from the left lighting phong; % <-- Use lighting scheme 'phong' grid on; colorbar; title(['E_z at z = ',num2str(z(k))],'FontSize',12,... 'FontWeight','demi');pause(0.1); axis([min(x) max(x) min(y) max(y) ezmin ezmax]); otherwise surf(x2plot,y2plot,Emag(:,:,k)); xlabel('x, m');

Page 13.398.22

Page 23: Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis

ylabel('y, m'); zlabel('Field intensity (magnitude), V/m'); alpha(0.8); % <-- Transparency factor (0 = completely

transparent) shading interp; % <-- Interpolate between meshes camlight left; % <-- Use camera lighting from the left lighting phong; % <-- Use lighting scheme 'phong' grid on; colorbar; title(['|E| at z = ',num2str(z(k))],'FontSize',12,... 'FontWeight','demi');pause(0.1); axis([min(x) max(x) min(y) max(y) emagmin emagmax]); end end

% Dialog for while loop button = questdlg('Another run?','Press No to exit'); end

Page 13.398.23