# This file converts a real Airy stress function phi(x,y) into the two complex potentials chi(z1), theta(z1). In this file we write chi(z1)=chi and its conjugate as chib, etc. f:=expand(subs({x=(z1+z2)/2,y=I*(z2-z1)/2},phi)); #From (18.28), we have g_2^{\prime\prime} as g2pp:=diff(f,z1,z1,z2); #and hence, integrating, g2p:=int(g2pp,z1)+A; #the constant in g2p+g2pb must be real, so there is no loss in generality in taking A to be real. Integrate again to get g2:=int(g2p,z1); #There is no need to introduce an additional constant here because any such term could be wrapped into g1. g2b:=subs({z1=z2,I=-I},g2); #In the next step, h=g1+g1b h:=f-z2*g2-z1*g2b; #Use the procedure rtoch for g1. g1p:=diff(h,z1); #A must be chosen to make g1p a function of z1 only s:=coeff(g1p,z2); sol1:=solve({s=0},{A}); g1p:=subs(sol1,g1p); g2:=simplify(subs(sol1,g2)); g2b:=simplify(subs(sol1,g2b)); #Integrate to recover g1. There is no need to include a constant of integration here, since it would correspond to a null stress field. g1:=int(g1p,z1); g1b:=subs({z1=z2,I=-I},g1); #Complex form of f from (18.27). ff:=simplify(g1+g1b+z1*g2b+z2*g2); "Here we write chi(z1)=chi, theta(z1)=theta and the conjugates as chib, thetab"; chi:=2*g2; chib:=2*g2b; theta:=2*diff(g1,z1); thetab:=subs({z1=z2,I=-I},theta); "We can also then calculate the displacements as:"; tmu:=kappa*chi-z1*diff(chib,z2)-thetab;