<Text-field layout="Heading 1" style="Heading 1"> Chapter 4: Complex numbers and functions</Text-field>
<Text-field bookmark="Complex arithmetic (top)" layout="Heading 2" style="Heading 2"> Complex arithmetic</Text-field>Basics:z1:= 5 +3*I; z2:= 1 -6*I;Real and imaginary parts:Re(z1); Im(z1);Addition:z3:= z2 +z1;Plotting arrows ( the arrow function in package plots is quite different ):with(plottools): l1 := arrow( [0,0], [Re(z1),Im(z1)], .01,.3,.1, color=green ): l2 := arrow( [0,0], [Re(z2),Im(z2)], .01,.3,.1, color=blue ): l3 := arrow( [0,0], [Re(z3),Im(z3)], .2,.5,.1, color=red ):plots[display](l1,l2,l3, axes=normal, view=[-10..10,-10..10] );Multiplication:z1*z2;Complex conjugation:conjugate(6+4*I);conjugate(6+4*I)*(6+4*I);assume(x,real); assume(y,real);conjugate(x+y*I)*(x+y*I);expand(%);Polar coordinates:polar(z1); evalf(%); evalc(%);Magnitude & phase:abs(z1), argument(z1);Plots:with(plottools): l1 := arrow( [0,0], [5,4], .05,.2,.05, color=green ): l2 := arc( [0,0], 4, 0..arctan(.8), color=red ):plots[display]( l1,l2, axes=normal, view=[-5..5,-5..5], scaling=constrained );Multiplication:z1:= 1+2*I; z2:= 1+8*I; z3:=z1*z2;with(plottools): l1 := arrow( [0,0], [Re(z1),Im(z1)], .02,.2,.1, color=blue ): l1a := arc( [0,0], abs(z1)/2, 0..argument(z1), color=blue ):l2 := arrow( [0,0], [Re(z2),Im(z2)], .02,.2,.1, color=blue ): l2a := arc( [0,0], abs(z2)/2, 0..argument(z2), color=blue ):l3 := arrow([0,0], [Re(z3),Im(z3)], .04,.4,.1, color=red ): l3a := arc( [0,0], abs(z3)/2, 0..argument(z3),color=red ):Plot:plots[display]( l1,l2,l3,l1a,l2a,l3a, axes=normal, scaling=constrained );
<Text-field layout="Heading 2" style="Heading 2"> Elementary complex functions</Text-field>restart;Exponential function: NiMvKSUiZUclInpHKUYlLCYlInhHIiIiKiYlImlHRiolInlHRipGKg== :plot3d( Re( exp(x+I*y) ), x=-6..6, y=-6..6, shading=z, axes=framed, labels=["x","y","Re(f)"], orientation=[-60,60], title="Real Part" );plot3d( Im( exp(x+I*y) ), x=-6..6, y=-6..6, shading=z, axes=framed, labels=["x","y","Im(f)"], orientation=[-60,60], title="Imaginary Part" );Fractional powers:plot3d( abs(( x+I*y)^(1/2) ), x=-1..1, y=-1..1, shading=z, axes=framed, labels=["x","y","|f|"], orientation=[-60,45], title="Magnitude", grid=[40,40] );plot3d( Re( (x+I*y)^(1/2) ), x=-1..1, y=-1..1, shading=z, axes=framed, labels=["x","y","Re(f)"], orientation=[-60,35], title="Real Part", grid=[40,40] );plot3d( Im( (x+I*y)^(1/2) ), x=-1..1, y=-1..1, shading=z, axes=framed, labels=["x","y","Im(f)"], orientation=[-60,35], title="Imaginary Part", grid=[40,40] ); Maple defines its polar angle NiMlJnRoZXRhRw== to be in the range NiM7LCQlI1BpRyEiIkYl . Thus, we have a branch cut on the negative real axis.
<Text-field layout="Heading 2" style="Heading 2"> Special complex functions</Text-field>
<Text-field layout="Heading 2" style="Heading 2"> Wave interference</Text-field>Suppose we have 12 different oscillations going like NiMtJSRjb3NHNiMsJiomJSZvbWVnYUciIiIlInRHRilGKSYlJHBoaUc2IyUibkdGKQ== , all interfering with each other by adding together and suppose also that the nth wave has a phase shift given by NiMvJiUkcGhpRzYjJSJuRyoqIiIjIiIiRidGKiUjUGlHRioiIzghIiI= . The total oscillation is:restart;s1:= Sum( cos(omega*t+2*Pi*'n'/13), 'n'=1..12 ); # inerts1:= value(s1);Can't be simplified:simplify(s1);Alternative approach:s1:= Sum( exp( I*2*Pi*'n'/13 ), 'n'=1..12 );s1:= value(s1);s1:= simplify(s1);Total oscillation:evalc( Re( exp(I*omega*t) *s1 ) );
<Text-field layout="Heading 2" style="Heading 2"> Electrostatics with line charges</Text-field>
<Text-field layout="Heading 3" style="Heading 3"> Line charges</Text-field>The complex plane is a wonderful place to visualize electric fields and equipotential surfaces of infinitely long line charges extending perpendicular to the plane. Consider a line charge with charge/length NiMlJ2xhbWJkYUc= located in the xy-plane at complex position NiMmJSJ6RzYjIiIh . Its electric field lines and equipotential "surfaces" are given by the contours of NiMtJSNJbUc2IyUiRkc= and NiMtJSNSZUc2IyUiRkc= , respectively, where NiMvLSUiRkc2IyUiekcsJCooJSdsYW1iZGFHIiIiLSUjbG5HNiMsJkYnRismRic2IyIiISEiIkYrKigiIiNGKyUjUGlHRismJShlcHNpbG9uR0YxRitGM0Yz For NiMvJiUiekc2IyIiIUYn and NiMvKiYlJ2xhbWJkYUciIiIqKCIiI0YmJSNQaUdGJiYlKGVwc2lsb25HNiMiIiFGJiEiIkYm , we have:restart: with(plots):p1:= contourplot( Re(-ln(x+I*y)), x=-5..5, y=-5..5, grid=[30,30], contours=30, coloring=[cyan,blue] ):p2:= contourplot( Im(-ln(x+I*y)), x=-5..5, y=-5..5, grid=[30,30], contours=30, coloring=[red,red] ):plots[display]( [p1,p2], scaling=constrained );This looks quite nice except for the mess in the electric field along the negative x-axis. This is the infamous branch cut of the log function which plots as a cliff. (Another way to visualize the electric field without this annoying cliff is to use Maple's fieldplot command, discussed in Chapter 2.)
<Text-field layout="Heading 3" style="Heading 3"> Conducting corners</Text-field>Consider the following contour plot of the function NiMqJiUiaUciIiIqJCUiekciIiNGJQ== .restart:with(plots):p1:=contourplot(Re(I*(x+I*y)^2),x=0..5,y=0..5,grid=[30,30],contours=40,coloring=[cyan,blue]):p2:=contourplot(Im(I*(x+I*y)^2),x=0..5,y=0..5,grid=[30,30],contours=40,coloring=[red,red]):plots[display]([p1,p2],scaling=constrained);Recalling that the potential is given by the real part and the field lines by the imaginary part we have NiMvKiYlImlHIiIiKiQlInpHIiIjRiYsJiomJSJ4R0YmJSJ5R0YmISIiKiZGJUYmLCYqJEYsRilGJiokRi1GKUYuRiZGJg==and in the plot the blue contours are equipotentials and the red lines are field lines. With NiMvJSJWRywkKiYlInhHIiIiJSJ5R0YoISIi both the x-axis and the y-axis are grounded, so you are looking at the way electric fields behave in a grounded right-angle corner. You can see the red field lines far apart from each other in the corner, indicating that the electric field is zero there. And how does the electric field behave as we approach the corner? Remember from electricity and magnetism that NiMvJiUiRUc2IyUieEcsJC0lJWRpZmZHNiQlIlZHRichIiI= and NiMvJiUiRUc2IyUieUcsJC0lJWRpZmZHNiQlIlZHRichIiI= , so NiMmJSJFRzYjJSJ4Rw== is proportional to y and NiMmJSJFRzYjJSJ5Rw== is proportional to x, so as we approach the corner where x=0 and y=0, both fields go linearly to zero.
<Text-field layout="Heading 3" style="Heading 3"> Convex conducting corners</Text-field>We can also find a function that represents the way fields behave in the neighborhood of a convex corner instead of a concave one by using the function NiMqJiklImVHLCQqKCUiaUciIiIlI1BpR0YpIiInISIiRixGKSklInpHKiYiIiNGKSIiJEYsRik= .restart:with(plots):p1:= contourplot( Re(exp(-I*Pi/6)*(x+I*y)^(2/3)), x=-5..5, y=-5..5, grid=[30,30], contours=40, coloring=[blue,blue] ):p2:= contourplot( Im(exp(-I*Pi/6)*(x+I*y)^(2/3)), x=-5..5, y=-5..5, grid=[30,30], contours=40, coloring=[red,red]):plots[display]( [p1,p2], scaling=constrained );To see how this is the field of a corner, ignore the third quadrant and just focus on quadrants 1, 2, and 4. [The boundaries of the third quadrant form the corner]. The blue lines are equipotentials and they get pulled tightly around the corner, and the red field lines radiate out from the corner. In cylindrical coordinates this potential is proportional to NiMpJSJyRyomIiIjIiIiIiIkISIi so the electric field, which goes like the derivative of the potential, is proportional to NiMqJiIiIkYkKSUickcqJkYkRiQiIiQhIiJGKQ== , which goes to infinity at the corner.You may be asking yourself where these weird formulas are coming from. They are called conformal mappings and you will study them in a course on complex analysis. It's something fun to look forward to.