{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "# Program to Illustr ate two charged rings being moved away from the origin symmetrically; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "# At the moment .. bo th rings are charged the same" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "restart;with(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "v:=1000*q/sqrt( (x-a)^2 + R^2);# Electric potential function" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "Ex:=simplify(-diff(v,x)); # \+ Electric field in the x direction" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "a1:=4; b:=-a1; # A1 is the magnitude of the distance \+ away from the origin for each ring" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 90 "e2rings:=subs(q=+1,a=a1,R=3*sqrt(2),Ex)+subs(q=+1,a=b ,R=3*sqrt(2),Ex); #add the two rings" }}}{PARA 11 "" 1 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "e2ringsa:=subs(q=+1,a=a 1,R=3*sqrt(2),Ex); # field from \"right\" ring " }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 65 "e2ringsb:=subs(q=+1,a=b,R=3*sqrt(2),Ex); # fie ld from \"left\" ring" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 194 "p lot([e2ringsa,e2ringsb,e2rings],x=-15..15,view=-50..50,labels=[\"x\", \"E\"],color=[yellow,blue,green],thickness=[2,2,4]); # plot with blue =left, yellow=right, green=combined field - expanded view" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 149 "plot([e2ringsa,e2ringsb,e2rings],x =-5..5,view=-50..50,labels=[\"x\",\"E\"],color=[yellow,blue,green],thi ckness=[2,2,4]); # view zoomed around the origin" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 72 "fsolve(\{e2rings=0\},\{x\},\{x=-8..-0.0001\} ); #solve for the zero on the left" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 91 "fsolve( \{e2rings=0\},\{x\},\{x=-0.0001..0.0001\}); # verify the zero in the m iddle (if equal q's)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "fso lve(\{e2rings=0\},\{x\},\{x=0.0001..8\}); #solve for zero on the right " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "17" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }