--- /dev/null
+import Circ;
+
+real u = 2cm, v=0;
+
+write("resistor");
+TwoTerminal Rn = resistor((0,v), normal, 0, "$R_{normal}$", "30\ohm");
+dot("beg", Rn.beg, NW);
+dot("end", Rn.end, NE);
+dot("mid", Rn.mid, S);
+TwoTerminal Rvb = resistor((u,v), variable, 0, "$R_{variable}$", "30\kohm");
+v -= u;
+
+write("capacitor");
+TwoTerminal Cn = capacitor((0,v), normal, 0, "$C_{normal}$", "30 $\mu$F");
+TwoTerminal Ce = capacitor((u,v), electrolytic, 0, "$C_{electrolytic}$", "30 $\mu$F");
+TwoTerminal Cvb = capacitor((2u,v), variable, 0, "$C_{variable}$", "30 $\mu$F");
+TwoTerminal Cvt = capacitor((3u,v), variant, 0, "$C_{variant}$", "30 $\mu$F");
+v -= u;
+
+write("inductor");
+TwoTerminal Lup = inductor((0,v), Up, 0, "$L_{Up}$", "30 H");
+TwoTerminal Ldown = inductor((u,v), Down, 0, "$L_{Down}$", "30 H");
+v -= u;
+
+write("diode");
+TwoTerminal Dn = diode((0,v), normal, 0, "$D_{normal}$", "1.3 V");
+TwoTerminal Dz = diode((u,v), zener, 0, "$D_{zener}$", "1.3 V");
+TwoTerminal Dled = diode((2u,v), LED, 0, "$D_{LED}$", "1.7 V");
+v -= u;
+
+write("battery");
+TwoTerminal B = battery((0,v), 0, "Battery", "1.5 V");
+v -= u;
+
+write("switch");
+TwoTerminal B = switchSPST((0,v), NO, 0, "$S_{NO}$", "Open");
+TwoTerminal B = switchSPST((u,v), NC, 0, "$S_{NC}$", "Closed");
+v -= u;
+
+write("current");
+TwoTerminal Icurr = current((0,v), 0, "I", "10 A");
+v -= u;
+
+write("source");
+TwoTerminal Sdc = source((0,v), DC, 0, "DC", "5 V");
+TwoTerminal Sac = source((u,v), AC, 0, "AC", "5 V$_{pp}$");
+TwoTerminal Si = source((2u,v), I, 0, "I", "5 A");
+TwoTerminal Sv = source((3u,v), V, 0, "V", "5 V");
+v -= u;
--- /dev/null
+import ElectroMag;
+
+real u = 1cm;
+
+Charge a = pCharge(center=(0.5u,2u));
+Charge b = pCharge(center=(0,0));
+Charge c = nCharge(center=(-3u,0), q=-3);
+Charge cs[] = {a,b,c};
+Distance dab = Distance(b.center, a.center, scale=u, L="$r_1$");
+Distance dbc = Distance(c.center, b.center, scale=u, L="$r_2$");
+Distance ds[] = {dab};
+Angle abc = Angle(a.center, b.center, c.center, radius=.5u, L="$\theta_T$");
+Angle bac = Angle(b.center, a.center, c.center, radius=-0.4u, L="$\phi_x$");
+Angle as[] = {abc, bac};
+
+//write(a.center.x);
+//write(a.center.y);
+for (int i=0; i<cs.length; i+=1)
+ cs[i].draw();
+for (int i=0; i<ds.length; i+=1)
+ ds[i].draw();
+for (int i=0; i<as.length; i+=1)
+ as[i].draw();
+
+//Vector Fba = CoulombForce(b,a, scale=2u, unit=u);
+//Fba.draw();
+CoulombForces(c=cs, scale=2u, unit=u);
+
+Charge a = pCharge(center=(-2u, 2u));
+a.draw();
+Vector v = EField(a.center, mag=u/2, dir=0,L="E"); v.draw();
+Vector v = BField(a.center, mag=u/2, dir=90,L="B"); v.draw();
+Vector v = Velocity(a.center, mag=u/2, dir=180,L="$v$"); v.draw();
// auto-signed charge
Charge aCharge(pair center=(0,0), real q=1, real radius=2mm, pen outline=currentpen, Label L="")
{
+ Charge c;
if (q > 0) {
- Charge c = pCharge(center, q, radius, outline, L);
+ c = pCharge(center, q, radius, outline, L);
} else {
- Charge c = nCharge(center, q, radius, outline, L);
+ c = nCharge(center, q, radius, outline, L);
}
return c;
}
--- /dev/null
+MODULES = Circ ElectroMag Mechanics
+
+all : $(MODULES:%=%-test.pdf)
+
+view : $(MODULES:%=%-view)
+
+clean :
+ rm -f $(MODULES:%=%-test.pdf)
+
+%-view : %-test.pdf
+ xpdf $< &
+
+%-test.pdf : %-test.asy $(MODULES:%=%.asy)
+ asy -f pdf $<
--- /dev/null
+import Mechanics;
+
+real u = 1cm;
+
+Mass a = Mass(center=(0,0));
+Mass b = Mass(center=(2u,1u));
+Mass c = Mass(center=(1u,-2u));
+Mass ms[] = {a,b, c};
+Distance dab = Distance(a.center, b.center, scale=u, L="$r_{ab}$");
+Distance dac = Distance(a.center, c.center, scale=u, L="$r_{ac}$");
+Distance ds[] = {dab, dac};
+Angle bac = Angle(b.center, a.center, c.center, radius=-.5u, L="$\theta_T$");
+Angle as[] = {bac};
+
+Vector vs[];
+
+vs.push(ihat(center=(0,u)));
+vs.push(jhat(center=(0,u)));
+
+for (int i=0; i<ms.length; i+=1)
+ ms[i].draw();
+for (int i=0; i<ds.length; i+=1)
+ ds[i].draw();
+for (int i=0; i<as.length; i+=1)
+ as[i].draw();
+for (int i=0; i<vs.length; i+=1)
+ vs[i].draw();
+
+Pendulum p = makePendulum(pivot=(3.5u,-3u), mass=b, length=4u, angleDeg=-20,
+ angleL="$\rho$", stringL="r");
+
+real len = abs(p.pivot.x-b.center.x);
+Spring s = Spring(pFrom=b.center-(2u,0), pTo=b.center, L="$k_1$"); s.draw();
+s = Spring(pFrom=b.center, pTo=(p.pivot.x, b.center.y), L="$k_2$"); s.draw();
+
+p.draw(drawVertical=true);
+
+Surface s = Surface(pFrom=(0,-7u), pTo=(3.5u, -7u), L="Table");
+s.draw();
Find the electric force between the two after they have come to equilibrium.
\end{problem*} % problem 19.7
-% A := origin;
-% B := (3cm, 0);
-
\begin{solution}
\Part{a}
\begin{center}
import Mechanics;
import ElectroMag;
-real u = 1cm; // Length of 1 m on the page
-real Fscale = .3cm; // Length of 1 N on the page
-qa = 12e-9;
-qb = -18e-9
+real u = 200cm; // Length of 1 m on the page
+real Fscale = 5e9cm; // Length of 1 N on the page
+real qa = 12e-9;
+real qb = -18e-9;
Charge a = aCharge((0,0)*u, q=qa, L="$q_1$");
-Charge b = aCharge((0,0.03)*u, q=qb, L="$q_2$");
+Charge b = aCharge((0.03,0)*u, q=qb, L="$q_2$");
Distance r = Distance(a.center, b.center, L="$r$");
Vector Fab = CoulombForce(a, b, scale=Fscale, L="$F$");
Vector Fba = CoulombForce(b, a, scale=Fscale, L="$F$");
+Fab.mag /= 10.0; // Not part of Fscale b/c of rounding
+Fba.mag /= 10.0;
r.draw();
Fab.draw();
import Mechanics;
import ElectroMag;
-real u = 1cm; // Length of 1 m on the page
-real Fscale = .3cm; // Length of 1 N on the page
-qa = 12e-9;
-qb = -18e-9
+real u = 200cm; // Length of 1 m on the page
+real Fscale = 5e9cm; // Length of 1 N on the page
+real qa = 12e-9;
+real qb = -18e-9;
Charge a = aCharge((0,0)*u, q=(qa+qb)/2, L="$Q/2$");
-Charge b = aCharge((0,0.03)*u, q=(qa+qb)/2, L="$Q/2$");
+Charge b = aCharge((0.03,0)*u, q=(qa+qb)/2, L="$Q/2$");
Distance r = Distance(a.center, b.center, L="$r$");
Vector Fab = CoulombForce(a, b, scale=Fscale, L="$F$");
Vector Fba = CoulombForce(b, a, scale=Fscale, L="$F$");
the distance between the spheres, so they may be treated as point
charges. Show that if the angle $\theta$ is small, the equilibrium
separation $d$ between the spheres is
-$d=(q^2L/2\pi\vareplison_0mg)^{1/3}$. (Hint: If $\theta$ is small,
+$d=(q^2L/2\pi\varepsilon_0mg)^{1/3}$. (Hint: If $\theta$ is small,
then $\tan\theta\approx\sin\theta$.)
\end{problem*}