(* THE MICHELL SOLUTION

The terms in each block of Table 8.1 are listed separately in the following cells. *)

ϕ0=C01*r^2+C02*r^2*Log[r]+C03*Log[r]+C04*θ

ϕ1c=C11*r^3*Cos[θ]+C12*r*θ*Sin[θ]+C13*r*Log[r]*Cos[θ]+C14*Cos[θ]/r

ϕ1s=C15*r^3*Sin[θ]+C16*r*θ*Cos[θ]+C17*r*Log[r]*Sin[θ]+C18*Sin[θ]/r

ϕnc=Cn1*r^(n+2)*Cos[n*θ]+Cn2*r^(-n+2)*Cos[n*θ]+Cn3*r^n*Cos[n*θ]+Cn4*r^(-n)*Cos[n*θ]

ϕns=Cn5*r^(n+2)*Sin[n*θ]+Cn6*r^(-n+2)*Sin[n*θ]+Cn7*r^n*Sin[n*θ]+Cn8*r^(-n)*Sin[n*θ]

(* Notice that the last two cells can be used to generate expressions for any value of n, using commands such as *)

ϕ3c=ϕnc/.n->3

(* The required function can now be assembled by combining appropriate terms from the above terms. For example,if we require terms varying with Cos[2*θ] and θ-independent terms, we would write *)

ϕ2c=ϕnc/.n->2
ϕ=ϕ0+ϕ2c

(* The stress components are then given by *)

σrr:=(1/r)*D[ϕ,r]+(1/r^2)*D[ϕ,θ,θ];
σrθ:=(1/r^2)*D[ϕ,θ]-(1/r)*D[ϕ,r,θ];
σθθ:=D[ϕ,r,r];

(* To obtain the corresponding displacements (Table 9.1),we use the file `urt.m'---i.e. *)
SetDirectory[NotebookDirectory[]];
<<urt.m