5. Electrostatics

Legal Notice, Disclaimer, and Book Ordering Information:

Null

Setup

\(Clear["Global`*"]; 
Off[General::spell]; 
Off[General::spell1]; 
    \)

Needs["Calculus`VectorAnalysis`"]

Needs["Graphics`PlotField`"]

Needs["Graphics`PlotField3D`"]

<< "D:\Mma\Inits\ch5init.m"

Clear["Global`*"];

5.2 Problems

5.2.2  Cartesian and Cylindrical Coordinates

Problem 5:  Conducting Cylinder with a Potential on the Surface

Consider a long cylinder of radius r0 that is separated by a long lengthwise gap on each side.  Use cylindrical coordinates {r,ϕ,z} amd let the length of the cylinder be along the z-axis.  One half of the cylinder (0 < ϕ < π) is kept at potential V0 and the other half at potential -V0.

Part (a)   Express the potential inside and outside the cylinder as a power series in r and 1/r, respectively.

termIn[m_] = A[m] ((((r/r0)))^m) Sin[m ϕ]

potIn[n_] := (∑_(m = 1)^n) termIn[m]

eq1 = V[ϕ] == termIn[m] /. {r -> r0}

rhs = 
      (∫_0
            ^(2 π))eq1[[2]] 
            Sin[m ϕ] \[DifferentialD]ϕ //. {
          Sin[4 m π] -> 0}

lhs = 
      Simplify[(∫_0^(1 π))+V0 Sin[m ϕ] 
                \[DifferentialD]ϕ + 
            (∫_π^(2 π))-V0 Sin[m ϕ] 
                \[DifferentialD]ϕ //. {
            Cos[m π] -> (((-1))^m), 
            Cos[2 m π] -> 1}]

aSol = 
      Simplify[Solve[rhs == lhs, A[m]][[1
          ]]]; A[m_] = A[m] /. aSol

potIn[n]

termOut[m_] = A[m] ((((r0/r)))^m) Sin[m ϕ]

potOut[n_] := (∑_(m = 1)^n) termOut[m]potOut[n]

Part (b)   Plot the value of the potential as a function of ϕ for fixed r.  Compare the series expansion at r=r0.

values = {r0 -> 1, V0 -> 1};

Clear[pot]; pot[n_, x_ /; x < 1] := potIn[n]; pot[n_, x_ /; x ≥ 1] := potOut[n];

pot[1,1]//.values

Plot[
      Table[pot[20, r/r0] //. values, {r, 0, 1, 0.2}] // Evaluate, {ϕ, 
        0, 2 π}];

Plot[
      Table[pot[20, r/r0] //. values, {r, 1, 2, 0.2}] // Evaluate, {ϕ, 
        0, 2 π}];

Part (c)   Make a three dimensional plot of the potential as a function of r and ϕ.

CylindricalPlot3D[
      pot[20, (r/r0)] //. values, {r, 0, 3}, {ϕ, 0, 2 π}, 
      BoxRatios -> {1, 1, 1}, ViewPoint -> {4, -2, 0}];