clear all % choice of angles alpha=pi/2,beta=pi/3,gamma=pi-alpha-beta l=5; % an arbitrary choice for eigenvalue R=0.2; s=log([0.001:0.01:R]); % s in logarithmic coordinates. boundfun=inline('sqrt(2)*alpha/R+1./(2*sqrt(alpha))*l*R+l./(sqrt(2*alpha)).*l.*exp(s)') %generating figure for bounds around the 3 vertices, single eigenvalue %guess. y1=boundfun(R,alpha,l,s);y2=boundfun(R,beta,l,s); y3=boundfun(R,gamma,l,s); figure(1) plot(s,y1,'r',s,y2,'b',s,y3,'g'),xlabel s, ylabel('bound'), legend(['\alpha=', num2str(alpha)], ['\beta=',num2str(beta)],['\gamma=',num2str(gamma)]) %generating figure for bounds around the 3 vertices, for a range of eigenvalue %guesses. figure(2) ll=[0.3:0.5:20]; % a range of eigenvalues to explore [S,L]=meshgrid(s,ll); Y1=boundfun(R,alpha,L,S);Y2=boundfun(R,beta,L,S); Y3=boundfun(R,gamma,L,S); % Produce the two surface plots h(1)=surf(S,L,Y1,'FaceAlpha','flat',... 'AlphaDataMapping','scaled',... 'AlphaData',gradient(Y1),... 'FaceColor','red'); % Change the alphamap to be opaque at the middle and % transparent towards the ends: alphamap('vup') hold on h(2) = surf(S,L,Y2,'FaceAlpha','flat',... 'AlphaDataMapping','scaled',... 'AlphaData',gradient(Y2),... 'FaceColor','blue'); % Change the alphamap to be opaque at the middle and % transparent towards the ends: alphamap('vup') h(3)=surf(S,L,Y3,'FaceAlpha','flat',... 'AlphaDataMapping','scaled',... 'AlphaData',gradient(Y2),... 'FaceColor','green'); % Change the alphamap to be opaque at the middle and % transparent towards the ends: alphamap('vup') xlabel s, ylabel('\lambda') hold off title(['Bounds for a range of s and \lambda. Red sheet=bound around corner', num2str(alpha),' blue sheet around', num2str(beta)]) view(3)