Question: piecewise contour

I want to plot contour for piecewise  function , here is my code

with(plots):
d1:=0.1:eta:=0.01:k:=2:L:=1:
mu:=0.01:delta1:=0.1:delta2:=0.2:
d1:=0.2:d2:=0.2:L1:=0.2: L2:=0.2:
h:=z->piecewise( z<=d1,    1,
                 z<=d1+L1,   1-(delta1/(2))*(1 + cos(2*(Pi/L1)*(z - d1 - L1/2))), 
                        z<=d1+L1+d2,  1 ,          
                    z<=d1+L1+d2+L2,  1-(delta2/(2))*(1 + cos(2*(Pi/L2)*(z - d1 - d2-L1-L2/2))),
                 z<=L,    1):
A1:=((k+2)*(k+3)*(1-mu)^(k+1)-2*(1-mu)^(k+2)*(k+2+mu))^(1/k):
A2:=(A1*r/h(z)^(1+3/k)):
contourplot(A2,z=0..1,r=-h(z)..h(z),colour=black,axes=boxed);

Please Wait...