Conformal Mapping Using Maple

This Maple worksheet will illustrate some methods for plotting the solutions of electrostatics problems in two dimensions. Let's start with the charged conducting strip, which is located on the x-axis between -1 and 1. The solution for the complex potential is

> F:=C*I*arcsin(z);

[Maple Math]

where C is a constant to be determined and the complex variable z is

> z:=x+I*y;

[Maple Math]

Now Laplace's equation in two dimensions is

> laplace:=diff(Phi(x,y),x$2) + diff(Phi(x,y),y$2)=0;

[Maple Math]

Let's substitute F into Laplace's equation and verify that it is indeed a solution:

> simplify(subs(Phi(x,y)=F,laplace));

[Maple Math]

This is certainly reassuring. Both the real and the imaginary parts of F are solutions of Laplace's equation. We can also see that on the conductor (y=0, -1<x<1), Re(F) = 0, so that the Re(F) can be associated with the potential and it satisfies the correct boundary conditions. Now let's plot the potential. We first need to load the plots package.

> with(plots);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

We have many options. The best in this case is the two dimensional contour plot. First plot the real part, which gives the equipotential surfaces. The solution will be symmetric about y=0, so we only need to plot the top half.

> contourplot(subs(C=1,Re(F)),x=-2..2,y=0.01..2,contours=20,coloring=[red,blue],numpoints=1000);

[Maple Plot]

Next, plot the imaginary part, which will give the field lines.

> contourplot(subs(C=1,Im(F)),x=-2..2,y=0.01..2,contours=20,coloring=[red,blue],numpoints=1000);

[Maple Plot]

Now let's plot both on the same plot. We can see how the equipotentials and the field lines are orthogonal.

> contourplot({subs(C=1,Re(F)),subs(C=1,Im(F))},x=-2..2,y=0.01..2,contours=20,coloring=[red,blue],numpoints=1000);

[Maple Plot]

We can now find the surface charge density on the conductor. To do this we need the y-component of the electric field evaluated on the strip. Clearly the value will depend upon how we take the limit-from the top or the bottom. Let's take the limit from the top. First, calculate the y-component of the electric field (we actually want to take the real part):

> E_y := -diff(F,y);

[Maple Math]

The surface charge density, from Gauss's Law, is sigma=E/2*epsilon_0, where the factor of 2 comes from the two sides of the strip. Evaluate E_y on

the strip, y=0.

> sigma:=2*epsilon*simplify(subs(y=0,E_y));

[Maple Math]

Plot the result.

> plot(subs(C=1,epsilon=1,sigma),x=-1..1);

[Maple Plot]

We see that the surface charge density has a square root divergence, which is typical for sharp edges. To calculate the constant C, we need to integrate the surface charge density across the strip and set the integral equal to the charge per unit length lambda.

> eqn:=lambda= int(sigma,x=-1..1);

[Maple Math]

> solve(eqn,C);

[Maple Math]

We've now calculated C; let's assign this value to C, and display the surface charge density once again.

> assign(C=%);

> sigma;

[Maple Math]

> unassign('C');

>