# FILE variational1612mpl.txt
# apply rayleighQuot with functions even in x and even in y
#
# better notation would be E for Edges, along with F for Face, G for Gradient
# here B for boundary, In LaTeX it is E
# Remark. The final answer in the arXivV2 is correct, but an attempt to
# indicate steps that could have been used in hand calculation is flawed.
# Specifically the line above equation (B.7) giving Vx and Vy has
# factors of r errors in the final terms.
FBG := proc (u, a, b)
global x,y;
local G, B, F;
G:= int(int(diff(u,x)^2 + diff(u,y)^2,x=-a .. a),y=-b .. b);
B:= 2*(int(subs(x=a,u)^2,y=-b ..b)+int(subs(y=b,u)^2,x=-a .. a));
F:= int(int(u^2,x=-a .. a),y=-b .. b);
[F,B,G]
end proc:
rayleighQuot:= proc(u,a,b,beta)
global x,y;
local lis, G, B, F;
lis:= FBG(u,a,b);
F:= lis[1];
B:= lis[2];
G:= lis[3];
simplify((G+B/beta)/F)
end proc;
tmpSqRect:=simplify(rayleighQuot(cos(mu*x/r)*cos(mu*y*r),r*h,h/r,beta));
tmp1:=factor(tmpSqRect-mu^2*(r^2+1/r^2));
# in tmp1, mu is general, now use that it is to be muSq for square,
# mu*tan(mu*h)=1/beta
subsSinmuh:= uLoc -> simplify(subs(sin(mu*h)= tmu*cos(mu*h),uLoc));
tmp2:=simplify(subs(cos(mu*h)^2 = 1/(1+tmu^2), simplify(subsSinmuh(tmp1))));
simplify(subs(tmu=1/(beta*mu),tmp2));
tmp3:=factor(%);
# checks (B.7) and (B.8) of arXivV2
rs:=sqrt(r):
exprFromLaTeX:= 2*mu^2*beta*(rs-1/rs)^2*(r+1+1/r)/(h*(1+(beta*mu)^2)+beta);
checkB7:= simplify(tmp3+exprFromLaTeX);
# result of 0 checks