電気力線

2005/6/12 平野拓一(東京工業大学)
May 28, 2005 Takuichi Hirano (Tokyo Institute of Technology)

点電荷

ϵ0 = 8.854*(10^(-12));
q = 1. ;
u[r_, θ_] := 
        (q/(4*π*ϵ0*r));
g1 = 
      ContourPlot[
        u[(Sqrt[(x^2) + (z^2)]), ArcTan[z, x]], {x, -1, 1}, {z, -1, 
          1}, 
PlotPoints -> 
          50, 
Contours -> 
          20, 
ContourShading -> False]

g2 = 
      ContourPlot[
        ArcTan[x, z], {x, -1, 1}, {z, -1, 
          1}, 
PlotPoints -> 
          200, 
Contours -> 
          10, 
ContourShading -> False]

Show[{g1, g2}]

電気双極子

ϵ0 = 8.854*(10^(-12));
p = 1. ;
r[x_, z_] := (Sqrt[(x^2) + (z^2)]);
u[x_, z_] := 
        (p/(4*π*ϵ0*r[x, z]^2))*
          (z/r)[x, z];
g1 = 
      ContourPlot[
        u[x, z], {x, -1, 1}, {z, -1, 
          1}, 
PlotPoints -> 
          50, 
Contours -> 
          10, 
ContourShading -> False]

\(g2 = 
      ContourPlot[
        Log[r[x, z]\^3\/x\^2], {x, \(-1\), 1}, {z, \(-1\), 
          1}, 
PlotPoints -> 
          200, 
Contours -> 
          10, 
ContourShading -> False]\)

<< Graphics`Arrow`;
Show[{g1, g2, 
        Graphics[{RGBColor[1, 0, 1], AbsoluteThickness[2], 
            Arrow[{0, -0.1}, {0, 0.1}]}]}]

微小ダイポール

t = 1.0;
g2 = 
      ContourPlot[(Cos[t - (Sqrt[(x^2) + (z^2)])] + 
              Sin[t - (Sqrt[(x^2) + (z^2)])]/(Sqrt[(x^2) + (z^2)]))*
          Sin[ArcTan[z, x]]^2, {x, -2, 2}, {z, -2, 
          2}, 
PlotPoints -> 
          200, 
Contours -> 
          10, 
ContourShading -> False]

電気力線の微分方程式

FieldLine[{x_, ex_, x0_}, {y_, ey_, y0_}, {t_, t1_}] := 
      Module[{exf, eyf, sol, t2, 
          offM}, {exf, 
            eyf} = {ex, ey} /. {x -> x[t], 
              y -> y[t]}; 
offM = 
          OnMessQ[NDSolve::ndsz]; 
If[offM, 
          Off[NDSolve::ndsz]]; 
sol = 
          NDSolve[{x'[t] == exf, y'[t] == eyf, 
              x[0] == x0, y[0] == y0}, {x[t], y[t]}, {t, 0, 
              t1}]; 
If[offM, 
          On[NDSolve::ndsz]]; 
sol = {x[t], y[t]} /. 
            First[sol]; 
If[
          VectorQ[sol /. t -> 0, NumberQ], 
          t2 = Part[sol, 1, 0, 1, 1, 2]; 
sol = 
            ParametricPlot[Evaluate[sol], {t, 0, t2}, 
              DisplayFunction -> Identity]; 
First[
            Cases[sol, Line[_], Infinity]], Line[{{x0, y0}}]]]

<< Calculus`VectorAnalysis`;
SetCoordinates[Cartesian[x, y, z]]

ϕ[x_, y_] := 
        (q1/(4*π*ϵ0*(Sqrt[(x^2) + (y^2)]))) + 
          (q2/(4*π*ϵ0*(Sqrt[(((x - d))^2) + (y^2)])));

ex = -Grad[ϕ[x, 
                y]][[1]];
ey = -Grad[ϕ[x, y]][[2]];

q1 = 4. ;
q2 = -1. ;
d = 1. ;
ϵ0 = 1. ;

δa = 0.05;
gLoF = 
        Table[FieldLine[{x, ex, δa*Cos[t]}, {y, 
              ey, δa*Sin[t]}, {l, 10}], {t, (2*π)/32. /2, 
            2*π - 0.001, (2*π)/32. }];

g2 = 
      Show[Graphics[{AbsoluteThickness[2], 
            gLoF}], 
PlotRange -> {{-2, 
              2}, {-2, 2}}, 
AspectRatio -> 
          Automatic]

FieldLines