function [m] = merit_psi(v)
alpha=v(1);
B=v(2);

L=1;
% k*L should be around 2 otherwise derivative of inner function has wrong slope
% more precisely something like pi*N + 2, otherwise derivative 
% then derivative pointing to x axis as it should for physical reasons
% k=2; % nice smallest energy plot
k=2+1*pi; % next energy level
% k=2+2*pi; % next energy level

m= ( sin(k*L) - B*exp(-alpha*L) )^2  + ( k*cos(k*L) + alpha*B*exp(-alpha*L) )^2;

end
