COMPLEX ANALYSIS: Mathematica 4.1 Notebooks
(c) John H. Mathews, and
Russell W. Howell, 2002
Complimentary software to accompany our textbook:

COMPLEX ANALYSIS: for Mathematics and Engineering, 
4th Edition,  2001,  ISBN: 0-7637-1425-9
Jones & Bartlett Publishers, Inc.  
40 Tall Pine Drive, Sudbury, MA 01776  
Tele.  (800) 832-0034, FAX:  (508)  443-8000  
E-mail:  mkt@jbpub.com  
Internet:  http://www.jbpub.com/  
This free software is compliments of the authors.
John H. Mathews,   mathews@fullerton.edu 
Russell W. Howell,  howell@westmont.edu

CHAPTER 10  APPLICATIONS of HARMONIC FUNCTIONS

a = A = b = B = c = k = R = T = u = U = v = V = w = W = x = X = y = Y = z = Z = 
                                        0; 
Clear[a, a0, a1, a2, a3, A, b, B, 
        CR, Δx, Δy, eq1, eq2, eqns, f, f1, F, F1, 
        F2, F3, F4, g, G, lines, n, P, Ψ, ϕ, Φ, 
        r, r0, solset, θ, t, T, T1, T2, Q, u, u0, U, U1, v, v0, V, V1, 
        w, w0, W, W1, x, x1, x2, x3, y, z, z1, z2, z3, 
        z4]; 
Needs["Graphics`ComplexMap`"]; 
Needs["Graphics`ParametricPlot3D`"]
Needs["Graphics`Colors`"];

Section 10.1	Preliminaries

Section 10.2	Invariance of Laplace's Equation and the Dirichlet Problem

Section 10.3	Poisson's Integral Formula for the Upper Half Plane

Section 10.4	Two Dimensional Mathematical Models

Section 10.5  Steady State Temperatures

In the theory of heat conduction the assumption is made that heat flows in the direction of decreasing temperature.  We also assume that the time rate at which heat flows across a surface area is proportional to the component of the temperature gradient in the direction perpendicular to the surface area.  If the temperature T(x,y)  does not depend on time, then the heat flow at the point  (x,y)  is given by the vector  

	V(x, y)  = - K  grad T (x, y)   =  - 
              K ( (Subscript[T, x]) (x, 
                    y)  +  i  (Subscript[T, y]) (x, y)),  

where  K  is the thermal conductivity of the medium and it is assumed to be constant.  We assume that no thermal energy is created or destroyed within the region, then the net amount of heat flowing through any small rectangle is identically zero.  A straightforward derivation can be used to show that

	 (Subscript[T, xx]) (x, y)  +   (Subscript[T, yy]) (x, y) = 
        0,  

which implies that  T (x, y)  satisfies Laplace's equation and hence it is a harmonic function.

	If the domain in which  T (x, y)  is defined is simply connected, then a conjugate harmonic function  S (x, y)  exists, and    F (z) = T (x, y)  +  i  S (x, y)  is an analytic function.      The curves  T (x, y) = (Subscript[K, 1])  are called isothermals and are lines connecting points of the same temperature.  The curves  S (x, y) = (Subscript[K, 2])  are called the heat flow lines, and one can visualize the heat flowing along these curves from points of higher temperature to points of lower temperature.

Example 10.14,  Page 412.  Find the temperature  T(x,y)  at each point in the horizontal strip  a < Im[z] < b  if the temperature at points on the boundary satisfies  

\(T \((x, a)\) = T\_1, 
T \((x, b)\) = \(\(T\_2\)\(.\)\)\)

Solution 10.14.

Enter the formula for the temperature function.  This is similar to Example 10.1,  Page 310 and Example 10.18,  Page 343.

Remove[a, b, x, y, 
        T]; 
Clear[cont]; 
T[x_, y_]  =  
        (Subscript[T, 1])  +  (((Subscript[T, 2])  -  (Subscript[T, 1]))/(b  -  a)) (y  -  
                a); 
Print["T[x,y] = ", T[x, y]];

For illustration we choose  a = 1,   b = 3,   (Subscript[T, 1]) = 50  and  (Subscript[T, 2]) = 10.

a  =  1; 
b  =  3; 
(Subscript[T, 1])  =  50; 
(Subscript[T, 2])  =  10; 
Print["T[x,y] = ", T[x, y]]; 
Print["T[x,1] = ", T[x, 1]]; 
Print["T[x,2] = ", T[x, 2]]; 
Print["T[x,3] = ", T[x, 3]];

Use Mathematica to make a contour plot of the temperature.

cont  =  {10, 20, 30, 40, 50}; 
ContourPlot[T[x, y], {x, -3, 3}, {y, 0, 3}, 
        Contours  ->  cont, PlotPoints -> 10, 
        AspectRatio -> (1/2), 
ColorFunction -> 
          Hue]; 
Print["Contour plot for"]; 
Print["T[x,y] = ", T[x, y]]; 
Print[""]; 
Print[T[x, y] == c]; 
Print["where  c = ", cont];

Hence the temperature function  T[x,y] = 50 - 20 (-1+y)  is harmonic in the horizontal strip  1 < Im[z] < 3  and has the desired boundary values.

Example 10.15,  Page 413.  Find the temperature  T(x,y)  at each point in the upper half plane  Im[z] > 0  ,  if the temperature at points on the boundary satisfies  

\(T \((x, 0)\) = T\_1\ \ \ for\ \ \ x > 0, 

      T \((x, 0)\) = T\_2\ \ \ for\ \ \ x < \ 0. \)

Solution 10.15.

Enter the formula for the temperature function.  This is similar to Example 10.2,  Page 310.

Remove[a, b, x, y, T]; 
T[x_, y_]  =  
        (Subscript[T, 1])  +  (((Subscript[T, 2])  - (Subscript[T, 1]))/π) 
            Arg[x  +  I y]; 
Print["T[x,y] = ", T[x, y]];

For illustration we choose  (Subscript[T, 1]) = 50  and  (Subscript[T, 2]) = 10.  
Then we can check out the temperature at points whose argument is  Arg[z] = 0, (π/4), (π/2), ((3 π)/4), π.

(Subscript[T, 1])  =  50; 
(Subscript[T, 2])  =  10; 
Print["T[x,y] = ", T[x, y]]; 
Print[""]; 
For[k = 0, 
        k ≤ 4, k++, 
X = 
          Cos[((π k)/4)];  
        Y = Sin[((π k)/4)];  
Print[" T[", 
          X, ",", Y, "] = ", 
          T[X, Y]];  ];

Use Mathematica to make a contour plot of the temperature.

cont  =  
        Table[10 + 5  k, {k, 0, 8}]; 
ContourPlot[T[x, y], {x, -3, 3}, {y, 0, 3}, 
        Contours  ->  cont, PlotPoints -> 35, 
        AspectRatio -> (1/2), 
ColorFunction -> 
          Hue]; 
Print["Contour plot for"]; 
Print["T[x,y] = ", T[x, y]]; 
Print[""]; 
Print[T[x, y] == c]; 
Print["where  c = ", cont];

Hence the temperature function  T[x, y] = 50 - ((40 Arg[x  +  i y])/π)  is harmonic in the upper half plane  Im[z] > 0  and has the desired boundary values.

Example 10.16,  Page 414.  Find the temperature  T(x,y)  at each point in the upper half-disk  H : y > 0, |z|<1,  if the temperature at points on the boundary satisfies 

\(T \((x, 
            y)\) = \(100\ \ \ when\ \ \ z = e\^\(i\ θ\)\ \ \ and\ \ 0 < θ < π\ \ \ on\ the\ upper\ semi - 
              circle\), 
T \((x, 
            0)\) = \ \ 50\ \ \ for\ \ \  - 1 < x < 
          1\ \ on\ the\ \(\(diameter\)\(.\)\)\)

Solution 10.16.

Construct the solution via a known conformal mapping. This is similar to Example 10.9,  Page 318.

Remove[T, U, V, x, y, w, 
        W]; 
Clear[f, cont]; 
f[
          z_]  = (( I (1  -  z))/(1  +  z)); 
W  =  ComplexExpand[f[x  +  I y]]; 
U  =  
        Together[
          ComplexExpand[Re[W], 
            TargetFunctions -> {Re, Im}]]; 
V  =  
          Together[
            ComplexExpand[Im[W], 
              TargetFunctions -> {Re, Im}]]; ; 
T[x_, y_]  =  100  -  (100/π) ArcTan[(V/U)]; 
Print["w = ", f[z], " = ", 
        U  +  I V];  
Print[" "]; 
Print["u = ", U ];  
Print["v = ",  V];  
Print[" "]; 
\(\(Print[\*""T[x,y] = 100 - (100/π) ArcTan[(v/u)]""];\)\ \)
Print["T[x,y] = ", T[x, y]];

We can check out some of the boundary values by taking limits.

Print["T[x,y] = ", 
        T[x, y]]; 
Print[" "]; 
\(\(Print[\*"" (lim_(y -> 0)) T[((-1)/2),y] = "", Limit[T[\(-1\)\/2, y], \ y -> 0]];\)\ \)
\(\(Print[\*"" \!\(lim\+\(y -> 0\)\) T[0,y] = "", 
        Limit[T[0, y], \ y -> 0]];\)\ \)
\(\(Print[\*"" \!\(lim\+\(y -> 0\)\) T[\!\(1\/2\),y] = "", 
        Limit[T[1\/2, y], \ y -> 0]];\)\ \)
\(\(Print[\*"" T[\!\(\@2\/2\),\!\(\@2\/2\)] = "", 
        T[\@2\/2, \@2\/2]];\)\ \)
Print["       T[0,1] = ", T[0, 1]]; 
\(\(Print[\*""T[\!\(\(-\@2\)\/2\),\!\(\@2\/2\)] = "", 
        T[\(-\@2\)\/2, \@2\/2]];\)\ \)

Use Mathematica to make a contour plot of the temperature.

cont  =  
        Table[50 + 10  k, {k, 0, 5}]; 
ContourPlot[T[x, y], {x, -1, 1}, {y, 0.01, 1}, 
        Contours  ->  cont, 
PlotPoints -> 35, 
        AspectRatio -> (1/2), 
        ColorFunction -> Hue]; 
Print["Contour plot for"]; 
Print["T[x,y] = ", T[x, y]]; 
Print[""]; 
Print[T[x, y] == c]; 
Print["where  c = ", cont];

Hence the temperature function  T[x, y] = 
        100 - ((100 ArcTan[((1 -  (x^2) -  (y^2))/(2 y))])/π)  is harmonic in the upper half-disk  H : y > 0, |z|<1,  and has the desired boundary values.

We now turn our attention to the problem of finding the steady state temperature function T(x,y) inside the simply connected domain D whose boundary consists of three adjacent curves (Subscript[C, 1]), (Subscript[C, 2]), and (Subscript[C, 3]), where T (x, y) = (Subscript[T, 1]) along (Subscript[C, 1]), T (x, y) = (Subscript[T, 2]) along (Subscript[C, 2]), and the region is insulated along (Subscript[C, 3]).

Example 10.17,  Page 416.  Find the temperature  T(x,y)  at each point in the upper half-plane  Im[z] > 0   where the temperature at points on the boundary satisfies  

\(T \((x, 0)\) = \ \ 1\ \ \ for\ \ \ x\  > \ 1, 

      T \((x, 0)\) = \(-1\)\ \ \ for\ \ \ x < \ \(-1\), 
∂T\/∂N = \(∂\_y\ \((T \((x, y)\))\) = 
          0\ \ \ for\ \ \  - 1 < x < 1. \)\)

Solution 10.17.

This is similar to Example 10.13,  Page 325, but the method of solution is different.

Construct the solution via a known conformal mapping.

Remove[T, x, y]; 
Clear[lines, Ty]; 
T[x_, 
          y_]  = (( 2)/π) Re[
            ArcSin[x  +  I y]]; 
Print["T[x,y] = ", T[x, y]]; 
Print["T[x,y] = ", 
        ComplexExpand[T[x, y]]]; 
T[x_, y_]  =  
        (2/π) ArcSin[(((Sqrt[(((x + 1))^2)  +  (y^2)])  - (Sqrt[(((x - 1))^2)  +  (y^2)]))/2)]; 
Print["T[x,y] = ", T[x, y]];

For computational purposes we use the formula  \(Re[ArcSin[x\  + \ i\ y]] = 
        ArcSin[\(\@\(\((x + 1)\)\^2\  + \ y\^2\)\  - \@\(\((x - 1)\)\^2\  + \ y\^2\)\)\/2]\)  
Then we can check out the temperature and the normal derivative at several boundary points.

T[x_, y_]  =  
        (2/π) ArcSin[(((Sqrt[(((x + 1))^2)  +  (y^2)])  - (Sqrt[(((x - 1))^2)  +  (y^2)]))/2)]; 
Ty[x_, y_]  =  (∂_y) T[x, y]; 
Print["  T[x,y] = ", T[x, y]]; 
Print[""]; 
Print["Some boundary values are"]; 
Print[" T[-3,0] = ", 
        T[-3, 0]]; 
Print[" T[-2,0] = ", T[-2, 0]]; 
Print[" T[-1,0] = ", T[-1, 0]]; 
Print["  T[1,0] = ", T[1, 0]]; 
Print["  T[2,0] = ", T[2, 0]]; 
Print["  T[3,0] = ", T[3, 0]]; 
Print[" "]; 
\(\(Print[\*""\!\(T\_y\)[x,y] = "", 
        Ty[x, y]];\)\ \)
Print[""]; 
Print["Some values of the normal derivative are"]; 
\(\(Print[\*""\!\(T\_y\)[\!\(\(-1\)\/2\),0] = "", 
        Ty[\(-1\)\/2, 0]];\)\ \)
\(\(Print[\*""  \!\(T\_y\)[0,0] = "", Ty[0, 0]];\)\ \)
\(\(Print[\*"" \!\(T\_y\)[\!\(1\/2\),0] = "", 
        Ty[1\/2, 0]];\)\ \)

Use Mathematica to make a contour plot of the temperature.

T[x_, 
          y_]  = (( 2)/π) Re[
            ArcSin[x  +  I y]]; 
cont  =  Table[-1  +  0.2  k, {k, 0, 10}]; 
ContourPlot[T[x, y], {x, -4, 4}, {y, 0.000001, 4}, 
        Contours  ->  cont, PlotPoints -> 25, 
        AspectRatio -> (1/2), 
ColorFunction -> 
          Hue]; 
Print["Contour plot for"]; 
Print["T[x,y] = ", T[x, y]]; 
Print[""]; 
Print[T[x, y] == c]; 
Print["where  c = ", cont];

Hence the temperature function  T[x, 
          y] = (( 2)/π) Re[
            ArcSin[x  +  i y]]  is harmonic in the upper half plane   Im[z] > 0 ,  and has the desired boundary values.

Section 10.5  Exercises for Steady State Temperatures
See textbook page 417.

Section 10.6	Two-Dimensional Electrostatics

Section 10.7	Two-Dimensional Fluid Flow

Section 10.8	The Joukowski Airfoil

Section 10.9	The Schwarz-Christoffel Transformation

Section 10.10	Image of a Fluid Flow

Section 10.11	Sources and Sinks

GO TO  THE  Table of Contents