Developing Problem Based Introductory Electromagnetics ......introductory EM course. Still, with modern simulati on software, it is possible to at least attempt a qualitative analysis
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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.
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
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
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
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
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
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
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
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
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
%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);
% 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');
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]);
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
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
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');
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