{VERSION 2 3 "IBM INTEL NT" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 0 0 0 1 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R 3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 0 0 255 1 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 11 0 128 128 1 2 1 2 0 0 0 0 0 0 } 0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "Fancy3 from web page 8/3/9 6 run in maple4" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 12 "vector stuff" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 2 "op" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 19 "electric field plot" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 17 "envelope detector" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 17 "driven oscillator" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "E&M Packet Prob lem ABW solution Potential and field plots of three " }}{PARA 0 "" 0 " " {TEXT -1 73 "point charges Learning objectives: Translation of stand ard 1/r potential " }}{PARA 0 "" 0 "" {TEXT -1 81 "to off-origin point s Physical intuition regarding potential Identify equilibrium " }} {PARA 0 "" 0 "" {TEXT -1 71 "points Relate potential plot and electric field vectors MAPLE: plot3d, " }}{PARA 0 "" 0 "" {TEXT -1 25 "grad, f ieldplot commands " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 41 " restart; with(linalg): with(plots): " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 52 "ar bitrary units are used throughout in Coulomb's law" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " Q1:=1.;Q2:=1;Q 3:=-1: # define relative magnitude of three charges" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 "Set plot range; use non-even values to avoid singular points in grids" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 73 " xmax:=0.7 55; ymax:=0.755: #plot domain -xmax " 0 "" {MPLTEXT 1 0 71 " coul1:= Q1/((x-0.5)^2+y ^2)^0.5; # potential due to 1st charge only" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " coul2:=Q2/((x+.5)^2+y^2)^0.5; # potential due to 2nd charge only" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 " \+ coul3:=Q3/((x)^2+(y-.7)^2)^0.5; # potential due to 3rd charge only" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " coul123:=coul1+coul2+ coul3; # potential due to all three charges" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 38 "3d countour plot of pot ential function" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 129 " plot3d(coul123, x=-xmax..xmax, y=-ymax/2..2*ymax, g rid=[49,49],style=patchcontour,contours=10,tickmarks=[1,1,100],view=-2 0..20);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 55 "Get elect ric field from negative gradient of potential " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 60 "(Note: \"-grad(U)\" doesn 't seem to work, so using \"grad(-U)\" " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 " vect:=grad(-coul123, vect or([x,y]));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 46 "Create new vector field of unit vectors E/|E| " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " ve ct2:=evalm(vect/sqrt(vect[1]^2+vect[2]^2));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 109 "fieldplot([vect2[1],vect2[2]],x=-xmax..xmax,y=-ym ax..ymax+1/2,title=`unit vectors showing dir. of E field `);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 "Co mpress dynamic range of E-vector lengths by taking ln(1+|E|)" }}{PARA 0 "" 0 "" {TEXT -1 71 "log is taken twice to put all lengths within ra nge of fieldplot command" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " vect3:=evalm(vect2*ln(ln(sqrt(vect[1]^2+ vect[2]^2)+1)+1));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 99 " \+ fieldplot([vect3[1],vect3[2]],x=-xmax..xmax,y=-ymax..ymax+1/2,title=`e lectric field vectors`);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 63 "This problem il lustrates dealing with complex numbers, and the " }}{PARA 0 "" 0 "" {TEXT -1 54 "use of the 'op' command to parse an output expression." } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 58 "Plot the phase and amplitude response of a driven, damped " }}{PARA 0 "" 0 "" {TEXT -1 72 "oscillator as a function of frequency.It is interesting t hat very heavy " }}{PARA 0 "" 0 "" {TEXT -1 62 "damping (b=10, k=10, m =1) crushes the response away from zero " }}{PARA 0 "" 0 "" {TEXT -1 10 "frequency." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " restart;with(plots):" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 50 " assume(k,real);assume(m,real);assume(A,real); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 " assume(omega>0);as sume(t,real);assume(b,real);assume(phi,real);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 74 " eqn:=A*exp( I*(omega*t+phi))-k*x(t)-b*diff(x(t),t) = m*diff(x(t),t,t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " s:=dsolve(eqn,x(t)); # (takes \+ a little while)" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 15 " x:=rhs(s);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " values:=\{A=1,m=1,k=10,b=1/10\};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 " xs:=subs(values,x);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 82 " steady:=op(1,xs); # keep only the oscillating terms for stead y state response" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " ev :=evalc(subs(t=0,phi=0,steady));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 50 "Phase of the response as a functio n of frequency. " }}{PARA 0 "" 0 "" {TEXT -1 71 "The conventional defi nition is the phase of the driver minus the phase " }}{PARA 0 "" 0 "" {TEXT -1 22 "of the driven system. " }}{PARA 0 "" 0 "" {TEXT -1 62 "Th e relative amplitude response will be taken as exp(-I alph)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " assu me(alph,real);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " cosa l:=op(1,ev); # cos(alph)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " sinal:=-op(2,ev)/I; # sin(alph)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " alph:=arctan(sinal/cosal);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " plot(alph,omega=0..10,title=`response ph ase vs. omega`);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 71 "The driver is in phase with the driven system at v ery low frequencies, " }}{PARA 0 "" 0 "" {TEXT -1 53 "and pulls ahead \+ until it is Pi/2 ahead at resonance, " }}{PARA 0 "" 0 "" {TEXT -1 52 " and goes on to be Pi ahead at very high frequencies." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 45 "Amplitude response as a function of frequency" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 52 " xcc:=subs(I=-I,steady); # get complex con jugate" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 " xmag:=simpli fy(steady*xcc); # get magnitude squared" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " xev:=simplify(evalc(xmag));" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 69 " plot(sqrt(xev),omega=0..10,title=`Respo nse amplitude vs freq.`);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 "In AM (am plitude-modulated) radio, the amplitude of a high-frequency " }}{PARA 0 "" 0 "" {TEXT -1 72 "signal is modulated by the lower-frequency audi o information. AM radios " }}{PARA 0 "" 0 "" {TEXT -1 70 "use 'envelop e detectors' involving RC circuits in order to remove the " }}{PARA 0 "" 0 "" {TEXT -1 64 "high-frequency (the 'carrier wave') and leave the audio signal. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 68 "This problem gives you a simple modulated signal. It also gives you " }}{PARA 0 "" 0 "" {TEXT -1 73 "the 'rectified' signal we \+ would see after passing through a diode (which " }}{PARA 0 "" 0 "" {TEXT -1 42 "lets current flow in one direction only.)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 72 "You are to pass the \+ signal through a series RC circuit, first through a " }}{PARA 0 "" 0 " " {TEXT -1 73 "resistor R and then a capacitor C to ground. The 'envel ope' signal is to " }}{PARA 0 "" 0 "" {TEXT -1 36 "be the voltage acro ss the capacitor." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 79 "Letting v be the incoming signal, the equation to be solv ed is v -IR -q/C = 0 ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 "You must replace the current I by a function of q, t he charge on the " }}{PARA 0 "" 0 "" {TEXT -1 76 "capacitor. This (cal l it eq1) will be the generic equation to be solved for " }}{PARA 0 " " 0 "" {TEXT -1 79 "q the charge on the capacitor as a function of tim e. By substituting values of " }}{PARA 0 "" 0 "" {TEXT -1 77 "R and C \+ into eq1, you get eq2. This new equation is to be solved numerically \+ " }}{PARA 0 "" 0 "" {TEXT -1 58 "for q (the charge on the capacitor) a s a function of time." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 88 "a) Get the rectified signal first, by using the Heavis ide function. The input signal is " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 40 " v := sin(96 Pi t) *sin(12000 Pi t). " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 84 "b) Se t up the differential equation, using q(t) for the charge on the capac itor C . " }}{PARA 0 "" 0 "" {TEXT -1 85 "C is connected to ground and to the resistor R . R has the input voltage on one side " }}{PARA 0 " " 0 "" {TEXT -1 47 "and C on the other. [The current will be dq/dt]" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 84 "c) Subst itute values into the DE to make a new DE which will be solved numeric ally. " }}{PARA 0 "" 0 "" {TEXT -1 77 "Start off by setting RC equal t o 1/10 the period of the 'carrier frequency'. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 76 "d) Solve the new DE numer ically. Plot (use odeplot) and see what this gives " }}{PARA 0 "" 0 " " {TEXT -1 81 "you for an envelope function Compare this to the plot o f the modulated function. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 88 "This code did not work in release 4, when both fx n and derivative were specified at t=0 " }}{PARA 0 "" 0 "" {TEXT -1 46 "for a 1st order de. Perry found this problem." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 26 " restart; with( plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 " th:=6000*2* Pi*t; # carrier frequency is 6000 hz" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 86 " z:=sin(th*8/1000)*sin(th); # amplitude-modulated (AM) signal (modulated at 48 hz)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " v:=z*Heaviside(z); # rectified signal after goin g through a diode" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 73 " plot(v,t=0..0.015,numpoints=400, title= `plot of modulated signal`); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 58 "From here on down, the students shoul d be doing the work. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 " eq1:=v-R*diff(q(t),t)-q(t)/C=0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " eq2:=subs(R=45,C=1/100000,eq1) ; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "RC is 0.45 ms. carrier pd= 0.17 ms. modulation pd .= 20 ms." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 " \+ sol:=dsolve(\{eq2,q(0)=0\}, q(t),numeric); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 93 " odeplot(sol,[t,q(t)*100000/1],0..15/1000,nu mpoints=400,title=`signal across capacitor`);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 95 "Note that we don't get all of the signal back, nor is the shape a perfect fit to the envelop e. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 13 "end of Fancy3" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "42 7 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }