Update MetaPost to Asymptote in Serway and Jewett v4's problem 19.13.
authorW. Trevor King <wking@drexel.edu>
Wed, 11 Apr 2012 21:54:02 +0000 (17:54 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 11 Apr 2012 21:54:02 +0000 (17:54 -0400)
latex/problems/Serway_and_Jewett_4/problem19.13.tex

index b722de8787cc8058bfd0b22348443e8437bb2d66..598b3146899b2130ab838b3431bef1becaae500f 100644 (file)
@@ -1,63 +1,59 @@
 \begin{problem*}{19.13}
 Three point charges are arranged as shown in Figure P19.13.\\
-%\begin{center}
-% \begin{tabular}{|l|r|r|r|}
-%   Name & Charge (nC) & x (m) & y (m) \\
-%   \hline
-%   $q_1$ & $5.00$ & $0$ & $0$ \\
-%   $q_2$ & $6.00$ & $0.300$ & $0$ \\
-%   $q_3$ & $-3.00$ & $0$ & $-0.100$ \\
-%   \hline
-% \end{tabular}
-%\end{center}
 \Part{a} Find the vector electric field \vect{E} that $q_2$ and $q_3$
 together create at the origin.
 \Part{b} Find the vector force \vect{F} on $q_1$.
 \end{problem*} % problem 19.13
 
-\empaddtoprelude{
-  numeric a;
-  pair A, B, C;
-  a := 3cm;
-  A := origin;   % q1
-  B := (a,0);    % q2
-  C := (0,-a/3); % q3
-  def drawB = 
-    label.top(btex 0.300\mbox{ m} etex, draw_length(B, A, 8pt));
-    label.lft(btex 0.100\mbox{ m} etex, draw_length(A, C, 8pt));
-    labeloffset := 6pt;
-    draw_pcharge(A, 4pt);
-    label.rt(btex $q_1 = 5\mbox{ nC}$ etex, A);
-    draw_pcharge(B, 4.2pt);
-    label.rt(btex $q_2 = 6\mbox{ nC}$ etex, B);
-    draw_ncharge(C, 3pt);
-    label.rt(btex $q_3 = -3\mbox{ nC}$ etex, C);
-  enddef;
-}
-
 \begin{nosolution}
 \begin{center}
-\begin{empfile}[2p]
-\begin{emp}(0cm,0cm)
-  drawB;
-\end{emp}
-\end{empfile}
+\begin{asy}
+import ElectroMag;
+
+real u = 20cm;
+draw_ijhat();
+Charge a = aCharge((0, 0), q=5, Label("$q_1=5.00\U{nC}$", align=W));
+a.draw();
+Charge b = aCharge((0.3u, 0), q=6, Label("$q_2=6.00\U{nC}$", align=S));
+b.draw();
+Charge c = aCharge((0, -0.1u), q=-3, Label("$q_3=-3.00\U{nC}$", align=S));
+c.draw();
+Distance dab = Distance(a.center(), b.center(), offset=-24pt, L="$0.300\U{m}$");
+dab.draw();
+Distance dac = Distance(a.center(), c.center(), L="$0.100\U{m}$");
+dac.draw();
+\end{asy}
 \end{center}
 \end{nosolution}
 
 \begin{solution}
 \begin{center}
-\begin{empfile}[2]
-\begin{emp}(0cm,0cm)
-  label.lft(btex $E_{21}$ etex, draw_Efield(B, A, a/8));
-  label.rt(btex $E_{31}$ etex, draw_Efield(C, A, -a/5));
-  draw_ijhats(-(a, a/3), 0, a/6);  
-  drawB;
-\end{emp}
-\end{empfile}
+\begin{asy}
+import ElectroMag;
+
+real u = 20cm;
+draw_ijhat();
+Charge a = aCharge((0, 0), q=5, Label("$q_1=5.00\U{nC}$", align=dir(160)));
+a.draw();
+Charge b = aCharge((0.3u, 0), q=6, Label("$q_2=6.00\U{nC}$", align=S));
+b.draw();
+Charge c = aCharge((0, -0.1u), q=-3, Label("$q_3=-3.00\U{nC}$", align=S));
+c.draw();
+Distance dab = Distance(a.center(), b.center(), offset=-24pt, L="$0.300\U{m}$");
+dab.draw();
+Distance dac = Distance(a.center(), c.center(), offset=-24pt,
+    L=Label("$0.100\U{m}$", align=LeftSide));
+dac.draw();
+Charge cs[] = {b, c};
+string subscripts[] = {"2", "3"};
+CoulombEFields(a.center(), cs, subscripts, scale=0.1u, unit=0.03u);
+Vector F = CoulombForce(b, a, scale=0.1u, unit=0.006u)
+         + CoulombForce(c, a, scale=0.1u, unit=0.006u);
+F.label = Label("$F$", position=EndPoint, align=RightSide);
+F.draw();
+\end{asy}
 \end{center}
 \Part{a}
-\begin{equation}
 \begin{equation}
  \vect{E} = k_e \sum_i \frac{q_i}{r_i^2}\rhat_i
           = k_e \left[\frac{q_2}{x_2^2}(-\ihat) + \frac{q_3}{y_3^2}\jhat\right]