Solutions For Chapter 4 Problems 1. Current Continuity and Relaxation Time
Solutions For Chapter 4 Problems 1. Current Continuity and Relaxation Time
Solutions For Chapter 4 Problems 1. Current Continuity and Relaxation Time
m
The relaxation time is: 142 x10 sec
21
The plot is obtained with the following MATLAB routine.
% MLP0402
%
% Plot rhov vs time
% for a charge placed in silver
tau=er*eo/sig;
t=tau/10:tau/10:10*tau;
rho=rhovo*exp(-t./tau);
subplot(2,1,1)
plot(t,rho)
xlabel('t (s)')
ylabel('rhov (C/m^3)')
grid on
4-2
subplot(2,1,2)
loglog(t,rho)
xlabel('t (s)')
ylabel('rhov (C/m^3)')
grid on
Fig. P4.02
P4.3: A current density is given by J = e-.01ta A/m2. Find the charge density after 10
seconds if it has an initial value of zero.
v 1 2 0.01t
J
t
t
e 2e0.01t
d v 2e 0.01t
dt; v 200e 0.01t C
At t = 0, v = 0 = 200 + C, C = -200.
C
So we have v 200 e 1 19
0.01(10)
m3
4 Q C
(a) Volume v 0.01m 4.19 x10 m ; vo 14.3 3
3 6 3
3 v m
t /
(b) v 0.10 vo vo e
11.8 8.854 x10
12
t
ln 0.10 2.303; t 2.303 547ns
Q 60C
(c) s ; area=4 r 2 1.257 x103 m2 ; s 47.8 mC 2
area 1.257 x103 m 2 m
2. Wave Fundamentals
P4.5: A propagating electric field is given by
V
E z , t 100.e .01z cos 107 t z .
4m
(a) Determine the attenuation constant, the wave frequency, the wavelength, the
propagation velocity and the phase shift. (b) How far must the wave travel before its
amplitude is reduced to 1.0 V/m?
m
(a) 0.01 Np m ; f 5MHz; 2m; u p 1x10 ; 45
7
s 4
0.01 z 1
(b) E ( z ) 100e 1; 0.01z ln ; z 460m
100
P4.6: A 10.0 MHz magnetic field travels in a fluid for which the propagation velocity is
1.0x108 m/sec. Initially, we have H(0,0)=2.0 ax A/m. The amplitude drops to 1.0 A/m
after the wave travels 5.0 meters in the y direction. Find the general expression for this
wave.
A
The general expression for the wave is: H( y, t ) H o e cos t y a x
y
m
rad
2 f 2 10 x106 20 x106
s
u 2 rad
u p 1x108 m s ; p 10m; 0.2
f m
A
H(0,0) 2.0a x ; H o 2.0, 0
m
H ( y 5) 1 H o e y 2.0e (5) ; solving we get 0.14
Finally,
A
H ( y, t ) 2.0e 0.14 y cos 20 x106 t 0.2 y a x
m
P4.7: MATLAB: Modify the simple wave program in MATLAB 4.1 to include
attenuation. Generate a plot for the case where the amplitude is 4 V/m, the attenuation
4-4
constant is 0.001 Np/m, and the frequency is 1 MHz. Take your snapshot in time at 0
seconds, and let your phase shift be 0.
% M-File: MLP0407
%
% This is a modification of ML0401 that
% includes attenuation. It plots a wave (in vac)
% versus position (in z direction) for a fixed time.
%
% Wentworth, 1/19/03
%
% Variables:
% atten attenuation constant
% Eo wave amplitude (V/m)
% f frequency (Hz)
% omega angular frequency (rad/sec)
% t time snapshot (sec)
% phi phase constant (degrees)
% phir phase constant (radians)
% c speed of light in vacuum (m/s)
% lambda wavelength (m)
% B phase constant (1/m)
% E electric field intensity
% z position
% Initialize Variables
atten=0.001;
Eo=4;
f=1e6;
t=0;
phi=0;
phir=phi*pi/180;
c=2.998e8;
lambda=c/f;
B=2*pi/lambda;
omega=2*pi*f;
% Perform Calculation
z=0:4*lambda/100:4*lambda;
E=Eo*exp(-atten.*z).*cos(omega*t-B*z+phir);
4-5
Fig. P4.7
P4.8: MATLAB: Modify the traveling wave program in MATLAB 4.2 to include
attenuation. Use the parameters from problem P4.7, except for the fixed time of course.
% M-File: MLP0408
%
% This program illustrates a traveling wave including
% attenuation. It modifies ML0402.
%
% Wentworth, 1/19/03
%
% Variables:
% atten attenuation (Np/m)
% Eo wave amplitude (V/m)
% f frequency (Hz)
% omega angular frequency (rad/sec)
% t time snapshot (sec)
% phi phase constant (degrees)
% phir phase constant (radians)
% c speed of light in vacuum (m/s)
4-6
% Initialize Variables
atten=0.001
Eo=4;
f=1e6;
t=1;
phi=0;
phir=phi*pi/180;
c=2.998e8;
lambda=c/f;
B=2*pi/lambda;
omega=2*pi*f;
% Perform Calculation
z=0:4*lambda/100:4*lambda;
E=Eo.*exp(-atten.*z).*cos(omega*t-B*z+phir);
t=0:1/(40*f):1/f;
for n=1:40;
E=Eo.*exp(-atten.*z).*cos(omega*t(n)-B*z+phir);
plot(z,E)
axis([0 4*lambda -2*Eo 2*Eo])
grid
title('General Wave Equation');
xlabel('z(m)');
ylabel('E(V/m)');
4-7
M(:,1)=getframe;
end
dB Wb
10 2 a z
dt ms
dB Wb
Vemf dS 10 2 a z dxdya z
dt ms
Wb Vs
Vemf 0.1 0.1V
s Wb
0.1V
I= I 10mA
10
I=10mA clockwise (when viewed
From +z) Fig. P4.9
P4.10: A bar magnet is dropped through a conductive ring. Indicate in a sketch the
direction of the induced current when the falling magnet is just above the plane of the
ring and when it is just below the plane of the ring, as shown in Figure 4.22.
When the north pole first goes through the loop, flux is increasing and the current
induced to oppose this change in flux is as shown.
When the south pole is exiting the loop, flux is decreasing and the current induced acts to
oppose this change in flux.
Fig. P4.10
P4.11: Considering Figure 4.7, suppose the area of a single loop of the pair is 100 cm 2,
and the magnetic flux density is constant over the area of the loops but changes with time
t
as B Bo e a z , where Bo = 4.0 mWb/m2 and = 0.30 Np/sec. Determine VR at 1, 10,
and 100 seconds.
B dB
Vemf N dS; Bo e t a z ; Vemf 2 Bo e t S
t dt
2
1m 0.30t
VR 2 Bo Se 2 0.30 4 x10 100cm
t 3 2
e 24 x10 6 e 0.30t
100 cm
at t = 1 sec, VR = 17.8 V
at t = 10 sec, VR = 1.20 V
at t = 100 sec, VR = 2.25x10-18 V
N1 N
We have i2 i1 and v2 2 v1
N2 N1
4-9
N2
v1 2
v1 v2 N1 N 2
Z1 , Z 2 Z1
i1 i2 N1 N1
N i1
2
2
N
Z1 1 Z 2
N2
P4.13: A 1.0 mm diameter copper wire is shaped into a square loop of side 4.0 cm. It is
placed in a plane normal to a magnetic field increasing with time as B = 1.0 t Wb/m2 az,
where t is in seconds. (a) Find the magnitude of the induced current and indicate its
direction in a sketch. (b) Calculate the magnetic flux density at the center of the loop
resulting from the induced current, and compare this with the original magnetic flux
density that generated the induced current at t = 1.0 sec.
We find the distributed resistance of the loop and work the problem assuming this
resistance is lumped in one spot as shown in the figure.
(a) The induced current is Vemf divided by the distributed resistance of the wire loop.
1 l 1m 4 0.04m)
R 3.5m
A 5.8 x10 0.0005m 2
7
0.04 0.04
dB Wb dB Wb
1 2 a z ; Vemf dS 1 2 dx dy 1.6mV
dt ms dt ms 0 0
1.6mV
I ind 0.46 A (note that this answer has no time dependence)
3.5m
Fig. P4.13
(b) The field at the center of the loop from a single arm of the loop is found from Eqn.
(3.7):
a
I z I 1 0.46 1 A
H 2 2 a z -a z a z 2.59a z ;
4 z 2 a 2 2a 2 2 0.02 m
4-10
Wb
So B 4o H 13 az .
m2
P4.14: The mean length around a nickel core of a transformer like the one shown in
Figure 4.11 is 16 cm, and its cross sectional area is 1 cm 2. There are 30 turns on the
primary side and 45 on the secondary side. If the current on the primary side is 1.0
sin20x106t mA, (a) calculate the amplitude of the magnetic flux in the core in the
absence of the output windings. (b) With the output windings in place, calculate i2.
Vm l
(a) ; Vm N1i1 ; R
R r o A
N i A 30 1mA 600 4 x10 1cm
7 2
m2
11 r o 14 x109 Wb
l 0.16m 100cm
2
(b) i2
N1
N2
i1
30
45
2
1sin 20 x106 t mA sin 20 x106 t mA
3
P4.15: A triangular wire loop has its vertices at the points (2, 0, 0), (0, 3, 0) and (0, 0, 4),
with dimensions in meters. A time-varying magnetic field is given by B = 4t ay Wb/m2 (t
in seconds). If the wire has a total distributed resistance of 2 , calculate the induced
current and indicate its direction in a carefully drawn sketch.
B
Vemf dS,
t
B Wb
4a y 2
t ms
1 MN
S MN
2 MN
M 2a x 3a y , N 2a x 4a z
S 6a x 4a y 3a z m 2
Vemf = -(4)(4)=-16V
Vemf 16V Fig. P4.15
I 8A
R 2
In Figure P4.16, an imaginary circuit has been chosen. For the chosen circulation
direction, we have the sign for Vemf as shown. Then,
o I m o I
h
Vemf u B dL -1a a dza z 1 dz ,
2 s 2 0
Vemf 160nV . Therefore, the bottom of the bar is positive.
Fig. P4.16
P4.17: Suppose we have a conductive bar moving along a pair of conductive rails as in
Figure 4.12, only now the magnetic flux density is B = 4.0ax + 3.0az Wb/m2. If R = 10.
, w = 20. cm, and uy = 3.0 m/s, calculate the current induced and indicate its direction.
Wb m
Vemf Bu y dxa z 3 2 3 0.2m 1.8V
m s
1.8V
I 0.18 A (clockwise when viewed from the +z axis)
10
P4.18: The radius r of a perfectly conducting metal loop in free space, situated in the x-y
plane, increases at the rate of (r)-1 m/sec. A break in the loop has a small 2.0 ohm
resistor across it. Meanwhile, there exists a magnetic field B = 1.0 az T. Determine the
current induced in the loop, and show in a sketch the direction of flow.
Here we’ve assumed dS = -dSaz to get iind and Vemf as shown. Our approach will be to
find , then Vemf = -d/dt.
4-12
BdS 1a z d d a z
r
2 d r 2
0
d dr 1
2 r 2 r 2V
dt dt r
Vemf 2V
2V
I 1A, clockwise as shown
2
Fig. P4.18
P4.19: Rederive Vemf for the rectangular loop of Figure 4.16 if the magnetic field is now B
= Boaz.
We see in Figure P4.19a that u B dL 0 for the 1 2 and 3 4 line sections.
For the 2 3 section we have:
3
dl d a
2 u B dL; B Boa z , dL d a , u dt dt a
Bo a 2
0
u B dL Bo d
a
2
Bo a 2
a
u B dL Bo d
0
2
, so for the 2 3 section, the contributions to Vemf
cancel. This will also be the case for the 4 1 section, and therefore Vemf = 0; no current
is induced.
P4.20: In Figure 4.16, replace the rectangular loop with a circular one of radius a and
rederive Vemf.
P4.21: A conductive rod, of length 6.0 cm, has one end fixed on a grounded origin and is
free to rotate in the x-y plane. It rotates at 60 revolutions per second in a magnetic field
B = 100. mT az. Find the voltage at the end of the bar.
We can confirm the sign by observing that a positive charge placed in the middle of the
bar would move to the ungrounded end by the Lorentz force equation.
P4.22: Consider the rotating conductor shown in Figure 4.24. The center of the 2a
diameter bar is fixed at the origin, and can rotate in x-y plane with B = Boaz. The outer
ends of the bar make conductive contact with a ring to make one end of the electrical
contact to R; the other contact is made to the center of the bar. Given Bo = 100. mWb/m2,
a = 6.0 cm, and R = 50. , determine I if the bar rotates at 1.0 revolution per second.
d
Vemf u B dL; u a a , dL d a
dt
Figure P4.22 indicates one of the paths for the circulation integral.
4-14
a a
Bo a 2
Vemf a Bo a z d a Bo d
0 0
2
Vemf Bo a 2
1 rev rad 3 Wb 2 1 Vs A
2
I 1 2 100 x10 0.06m
R 2R 2 s rev m 50 Wb V
I 22.6 A
Fig. P4.22
P4.23: A Faraday Disk Generator is similar to the rotating conductor of P4.22, only now
the rotating element is a disk instead of a bar. Derive an expression of the V emf produced
by a Faraday Disk Generator, and using the parameters given in problem 4.22, find I.
P4.24: Consider a sliding rail problem where the conductive rails expand as they progress
in the y direction as shown in Figure 4.25. If w = 10. cm and the distance between the
rails increases at the rate of 1.0 cm in the x direction per 1.0 cm in the y direction, and uy
= 2.0 m/sec, find the Vemf across a 100. resistor at the instant when y = 10. cm if the
field is Bo = 100. mT.
First we modify the figure so that the top rail is horizontal and all the spreading occurs
via the bottom rail. As before, our approach will be to find and then d /dt. We have:
BdS Boa z dxdya z
Now, notice that x and y are not independent and are in fact related: x=y+w
So we have
y y w y
1
Bo dxdy Bo y w dy Bo y 2 wy
y 0 x 0 0 2
4-15
d dy Wb m
Vemf Bo y w Bo y w u y 0.100 2 0.1m 0.1m 2
dt dt m s
Vemf 40mV
Alternate Method:
Vemf u B dL u y a y Boa z dxa x
1
y
2
Vemf u y Bo dx u y Bo w y
1
w y
2
Fig. P4.24
5. Displacement Current
P4.25: Suppose a vector field is given as
A 3x 2 yz 3a x .
Verify that the divergence of the curl of this vector field is equal to zero.
3 x yz 3
2
0 0
9 x 2 yz 2a y 3 x 2 z 3a z
A
y
9 x 2 yz 2 3x 2 z 3 9 x 2 z 2 9 x 2 z 2 0
z
4-16
1
A
2 cos a 2 cos a sin a 2 cos a
1 1
A
sin
2 cos
1
2 sin 2sin 0
P4.27: A pair of 60 cm 2 area plates are separated by a 2.0 mm thick layer of ideal
dielectric characterized by r = 9.0. If a voltage v(t) = 1.0 sin (2x103t) V is placed across
the plates, determine the displacement current.
P4.28: Plot the loss tangent of seawater ( = 4 S/m and r = 81) versus log of frequency
from 1 Hz to 1 GHz. At what frequency is the magnitude of the displacement current
density equal to the magnitude of the conduction current density?
tan
4 S m
889 x106
2 f ( Hz ) 81 8.854 x1012 F m f
(Plot this in Figure P4.28)
Solving for f when tan = 1: f = 890MHz
% MLP0428
clear
clc
for i=1:9
for j=1:10
m=(i-1)*10+j;
f(m)=j*10^(i-1);
tand(m)=889e6/f(m);
end
4-17
end
loglog(f,tand)
xlabel('frequency (Hz)')
ylabel('loss tangent')
grid on
Fig. P4.28
P4.29: A 1.0 m long coaxial cable of inner conductor diameter 2.0 mm and outer
conductor diameter 6.0 mm is filled with an ideal dielectric with r = 10.2. A voltage v(t)
= 10.cos(6x106 t) mV is placed on the inner conductor and the outer conductor is
grounded. Neglecting fringing fields at the ends of the coax, find the displacement
current between the inner and outer conductors.
Q
C , so Q Cv(t )
V
2 l 2 l Vo cos t
for coax (from chapter 2): C= so Q
ln b a ln b a
Since the wave has an attenuation term (e-2zt) it is clearly not lossless.
ax ay az
H 5e 2 zt a 10te 2 zt a
E o
t x y z z y y
5e 2 zt 0 0
10t 2 zt 10
dH e dta y , H = te 2 zt dta y
o o
This integral is solved by parts udv uv vdu where we let u t and dv e 2 zt dt.
We arrive at:
10t 2 zt 10 2 zt A
H e e ay
2o z 4o z 2
m
V
E( y , t ) 100.cos 4 106 t 0.1257 y a z
m
.
Find the wave amplitude, frequency, propagation velocity, wavelength, and the relative
permittivity of the media. (b) Find H(y,t).
V 2 m 1
Eo 100 , f 2MHz, , 50m, u p 100 x106 ; r 9
m s
H
E Eo sin t y a x o
t
Eo Eo
H sin t y dt cos t y a x
o o
Eo
H ( y, t ) cos t y a x
o
A
Inserting the given values we find: H ( y, t ) 0.796 cos 4 x10 t 0.126 y a x
6
m
4-19
1
2 f x108 , f x108 50MHz
2
c 3x108 2 rad
6m,
f 0.5 x10 8
3 m
D
H (no J c )
t
ax ay az
H H sin t z a
x y z z o y
H o sin t z 0 0
E
H o cos t z a y o
t
Ho H
dE E = cos t z dta y o sin t z a y
o o
Ho V
so E( z , t ) sin t z a y
o m
kV
inserting the given values we find: E( z, t ) 7.5sin x10 t
8
z ay
3 m
P4.33: Find the instantaneous expression for E for the magnetic field of problem P4.6.
A
From P4.6 we have H 2.0e 0.14 y cos 20 x106 t 0.2 y a x . We can write this wave
m
A
as H H o e cos t y
y
a x , and can reinsert the values at the end.
m
E c
First we have H . Assuming a nonmagnetic medium, we have u p ,
t r
or r = 9. Now we evaluate the curl of H:
ax a y az
H H o e y cos t y a z .
x y z y
H o e cos t y 0
y
0
4-20
H o e y cos t y a z H o e y cos t y e y sin t y a z .
y
E
So H H o e cos t y a z H o e sin t y a z
y y
.
t
Solving for E:
H H
E o e y cos t y dta z o e y sin t y dta z
H H
E o e y sin t y a z o e y cos t y a z .
Now we can evaluate the variables:
H o
2 0.14 56,
20 x10 9 8.854 x1012
6
Ho
2 0.2 251.
20 x10 9 8.854 x1012
6
So
V
E 56e 0.14 y sin 20 x106 t 0.2 y a z 251e 0.14 y cos 20 x106 t 0.2 y a z .
m
where b=cosy, c=siny, and tany=c/b. Now, since b/c = 251/56, then y=12.6° and A=257.
Thus
V
E( y, t ) 257e 0.14 y cos 20 x10 6 t 0.2 y 12.6 a z .
m
This result is easier to obtain using the phasor approach of the next section.
P4.34: Given, at some point distant from a point source at the origin in free space,
V
E(r , t ) 8.0 cos 9 106 t r a ,
m
find frequency, phase constant and H(r,t).
c 2 rad
2 f , f 4.5MHz, 66.7 m, 0.094
f m
B H
E o
t t
4-21
1
E rE a , E Eo cos t r ,
r r
r
Eo r cos t r Eo cos t r Eo r sin t r
E
E o cos t r r sin t r a
r
E cos t r
o a Eo sin t r a
r
Assume we can ignore the first term in the far-field for large r, then we have
H
E Eo sin t r a o
t
Eo E
dH H o sin t r dta oo cos t r a
Inserting the given values we find
mA
H (r , t ) 21cos t r a
m
P4.35: In a lossless, non-magnetic media, the magnetic field at some point distant from a
source at the origin is given by
A
H ( , t ) 6.0sin 3 108 t 10 a ,
m
find the relative permittivity of the media, the frequency and phase constant of the wave,
and E(,t).
2 f 3x108 ; f 48MHz
m c
u p 0.3 x108 ; r 100
s r
r rad
10
c m
D E
H
t t
1 1
H
H o sin t 10 a z H o sin t H o cos t a z
In the far-field, we will ignore the first term (has 1/) leaving us with
H H o cos t a z
Ho
Now, dE E cos t dta z
Ho
E sin t a z .
4-22
V
Plugging in the given values we arrive at: E( , t ) 226sin(3x10 t 10 )a z
8
.
m
V
E y , t 4.0sin x107 t y a x 9.0 cos x107 t y a z .
m
Determine and H(y,t).
c m u 2 rad
f 5MHz , u p 1.73x108 , p 34.6m, 0.181
r s f m
H
E 9 sin t y a x 4 cos t y a z o
t
9 4
H cos t y a x sin t y a z
o o
Inserting the given values we arrive at:
mA
H ( y, t ) 41cos t y a x 18sin t y a z
m
t
t
Re B s e jt Re B s e jt Re jB s e jt
P4.38: Derive the differential phasor form of (a) Gauss’s Law, and (b) Ampere’s Circuit
Law.
D v , D x, y, z , t v x, y, z , t
Re Ds e jt Re vs e jt ; Re Ds e jt Re vs e jt ;
Ds vs
D E
H
t t
Re H s e jt Re Es e jt ; Re H s e jt Re j E s e jt
t
H s j E s
E s Eo e j y a z , Es j H s
E s j Eo e j y a x j H s
Eo j y Eo
Hs e a x and H ( y, t ) cos t y a x .
o o
Plugging in the values from P4.31, we find
A
H ( y, t ) 0.796 cos 4 x106 t 0.126 y a x .
m
H s H o e j z a x , H s j o Es
ax ay az
Hs jH e j z a
x y z z o y
jH o e j z 0 0
Hs jH o e j z a y j 2 H o e j z a y H o e j z a y j o Es
z
H o e j z a y H o j z Ho V
Es j e a y , E( z , t ) sin t z a y
j o o o m
Plugging in the values from P4.32, we find
4-24
kV
E( z , t ) 7.5sin 108 t z a y .
3 m
j z j z
The phasor version of E is: E s 10e a x 20e a y
ax ay az
Es 20e j z a 10e j z a
x y z z
x
z
y
10e j z 20e j z 0
E s j 20e j z a x j 10e j z a y jo H s
j 20 j z j 10 j z 20 j z 10 j z
Hs e ax e ay e ax e ay
jo jo o o
x106 rad
up ; 10.47 x103
u p 3 x10 8
m
Inserting the appropriate values we then find:
mA
H s 53e j z a x 27e j z a y ,
m
mA
and H ( z , t ) 53cos t z a x 27 cos t z a y
m
j y j y
In phasor form the field of P4.36 is: E s j 4e a x 9e a z
Now apply E s jo H s
ax ay az
Es j9 e j y a x j 2 4 e j y a z
x y z
j 4e j y 0 9e j y
j 9 e j y a x 4 e j y a z jo H s
j9 j y 4 j y 9 j y 4 j y
Hs e ax e az e ax j e az
jo jo o o
Inserting the appropriate values we then find:
4-25
c m rad
up 1.73 x108 , 0.181
r s up m
mA
H ( y, t ) 41cos t y a x 18sin t y a z
m
P4.43: MATLAB: In MATLAB 4.4, a polar plot of the phasor corresponded to a location
on a sine wave for a particular time, at a fixed position in space. You can also make a
polar phasor plot for a snapshot in time, where you change position. Modify MATLAB
4.4 to provide an animation of the phasor versus sine wave as you change the position.
% M-File: MLP0443
%
% This program modifies ML0404, generating a
% position plot animation synchronized with
% a polar plot.
%
% Wentworth, 1/19/03
%
% Variables:
% Eo field amplitude (V/m)
% E electric field intensity (V/m)
% E E-field for movie
% f frequency (Hz)
% theta angle
% theta1 angle for movie
% T period (1/f)
% t time (s)
% t1 time for movie
% Perform Calculation
z=0:lambda/100:2*lambda;
theta=-beta*z;
E=Eo*cos(theta);
P4.44: MATLAB: Repeat problem P4.43, now accounting for attenuation. Run the
program assuming an attenuation of 2 x 10-6 Np/m.
% M-File: MLP0444
%
% Same as MLP0443 but add attenuation.
%
% This program modifies ML0404, generating a
4-27
% Perform Calculation
z=0:lambda/100:2*lambda;
theta=-beta*z;
E=Eo.*exp(-atten.*z).*cos(theta);
z1=0:lambda/50:2*lambda;
for n=1:100
theta1(n)=-beta*z1(n);
E2(n)=Eo.*exp(-atten.*z1(n));
E1(n)=E2(n).*cos(theta1(n));
E2(n)=Eo.*exp(-atten.*z1(n));
subplot(211),plot(z,E,z1(n),E1(n),'ro');
subplot(212),polar(theta1(n),E2(n),'ro');
M(:,1)=getframe;
end