Mathematica Version 6 Compatibility Information
(continued)

This notebook continues Chapter by Chapter observations. Don't forget to look at the introduction in the first notebook!

19 Elementary applications to 
two-dimensional physics

There is nothing that goes wrong in this chapter, but the following optimizations, particularly for on-screen work, might be helpful.

19.5 The method of images

\[MathematicaIcon] Half-plane boundary conditions

ContourPlot now colours in by default, which I do not object to!

ContourPlot[1/2*Log[(x^2+(y-1)^2)/(x^2+(y+1)^2)], 
{x,-2,2},{y,0,4}, PlotPoints -> 30]

19.6 Further applications to fluid dynamics

The plot given here takes a long time to compute with the setting of PlotPoints given. The near disappearance on screen of thin lines also undermines the output. The following are better!

ContourPlot[ArcTan[1+x^2-y^2, 2 x y], {x, -2, 2}, {y, 0, 2}, ContourShading -> False, PlotPoints -> 40, ContourStyle -> AbsoluteThickness[0.3],  Contours ->Table[k/4, {k, -15, 15, 1/2}], AspectRatio -> 1/2]

ContourPlot[y*(1 - 1/(x^2+y^2)), {x, -4, 4}, {y, -2, 2}, AspectRatio -> 1/2, ContourShading -> False, PlotPoints -> 40, Contours -> 41, ContourStyle -> AbsoluteThickness[0.3]]

ContourPlot[y*(1 - 1/(x^2+y^2)) +5/(4 Pi)Log[x^2+y^2], {x, -4, 4}, {y, -2, 2}, AspectRatio -> 1/2, 
	 ContourShading -> False, PlotPoints -> 40,Contours ->Table[k/4, {k, -15, 15, 1}], ContourStyle -> AbsoluteThickness[0.3]]

\[MathematicaIcon] Conformal mappings on the cylinder

The same modifications as before help the speed output quality.

JoukowskiFlow[z_, θ_, a_, w_, U_, V_, k_, λ_] :=
	Module[{ζ},
	ζ = -w + Exp[-I*θ]*z/2*(1 + Sqrt[1-4 λ^2 Exp[2 I θ]/z^2]) ;
		(U-I*V)ζ + (U+I*V)a^2/ζ - (Log[ζ]*I*k)/(2*Pi)]

JoukowskiPsi[x_, y_, θ_, a_, α_, β_, U_, V_, k_, λ_] :=
	Im[JoukowskiFlow[x+I y, θ, a, α+I β, U, V, k, λ]]

myplot = ContourPlot[JoukowskiPsi[x,y,0,3/2,0,0,1,0.5,-4, Sqrt[3]/2], {x, -4, 4}, {y, -2, 2}, ContourShading -> False, AspectRatio -> 1/2, PlotPoints -> 30, Contours ->Table[k/4, {k, -20, 20, 1}]]

EllipseGraphic[A_, B_] := ParametricPlot[{A Cos[s], B Sin[s]}, {s, 0, 2 Pi}, PlotStyle -> Thickness[0.008]]

ell = EllipseGraphic[2,1]

Show[myplot, ell]

Several other graphics in this section benefit from the same treatment. It is not a good idea to lower the value of PlotPoints too much in the Finn-Cox graphics in the last section, as this might produce artefacts. The results from M6 look slightly different.

20 Numerical transform techniques

20.3 \[MathematicaIcon] Applying the discrete Fourier transform in two dimensions

There is not really a problem here, except that the new default of colouring a ListDensityPlot is rather annoying. The following was supposed to produce a black and white plot, but now we get a blue "E" on a yellow background with rather fuzzy edges (which is more annoying if you expand the image):

chare[x_, y_] := Which[-30<x<-20 && -40 <y<40, 0, -20≤ x ≤ 30 &&  -40<y<-30, 0, -20≤ x ≤ 30 &&  -5<y<5, 0,-20≤ x ≤ 30 &&  30<y<40, 0,True, 1]

edata = Table[N[chare[x, y]], {y, -50, 50, 100/127}, {x, -50, 50, 100/127}];
ListDensityPlot[edata, Mesh -> False, PlotRange -> All]

ListDensityPlot[edata, Mesh -> False, PlotRange -> All, ColorFunction -> GrayLevel]

If anyone knows how to get rid of the interpolation at the edges let the author know!

21 Conformal mapping II: the 
Schwarz–Christoffel mapping

Many of the plots in this Chapter will get coloured in by default in Mathematica 6, otherwise just the following needs to be noted.

21.4 Triangular and rectangular boundaries

Mathematica 6 appears to be less tolerant of processing Input expressed in Traditional Form. It is safer to define w as

w = Gamma[(α + β)/Pi]/(Gamma[α/Pi]*Gamma[β/Pi])*Integrate[ζ^(α/Pi - 1)*(1 - ζ)^(β/Pi - 1), {ζ, 0, z}, 
    Assumptions -> {Im[z] != 0 || Re[z] <= 1, α > 0, β > 0}]

If you know about incomplete beta functions, a simpler solution is to just define afresh

g[z_] := Beta[z, 1/3, 1/3] Gamma[2/3]/Gamma[1/3]^2

and note that

D[g[z], z]

which has the right phase factor, and the plot is better with thicker lines, as usual!

Needs["Graphics`ComplexMap`"];

CartesianConformal[func_, xrange_, yrange_, options___] :=
	Show[GraphicsArray[{
			CartesianMap[#&,xrange, yrange, options,  DisplayFunction -> Identity],
			CartesianMap[func, xrange, yrange, options, DisplayFunction -> Identity]
		}], DisplayFunction -> $DisplayFunction];

CartesianConformal[(g[#]&),  {-8, 8},{10^(-12), 8}, Lines -> 30,PlotPoints -> 100, PlotRange -> All, PlotStyle -> AbsoluteThickness[0.4]]

21.5 \[MathematicaIcon] Higher-order hypergeometric mappings

In the test version of M6 used to prepare this file, some of the integrations benefit from the post-application of FullSimplify. For example, normfactor benefits from being cleaned up in this way. 

I have not found any other problems in this Chapter, though many of the graphics get coloured in by default, rather tastefully!