% IMPORTANT k and L should be the same as in merit_psi function
L=1;
k=2+pi;

v0=fminsearch(@merit_psi, [.11,1]);
x=linspace(0,2,1000);
plot( ...
	x(x<L), sin(k*x(x<L)), ...
	x(x>L), v0(2)*exp(-v0(1).*x(x>L)) ...
	)
set(gca,'fontsize',20); 
legend('inner psi', 'outer psi');	
xlabel('x');	
ylabel('Psi');	


