%
%  code35.m -- turning point demo II
%
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

figure(2);  clf
subplot(2,1,1)
plot(t3,y3(:,1),'r');  hold on
title(['\bf turning point example (alpha=' num2str(alpha) ')'])
xlabel('\bf x-axis')
ylabel(['\bf y(x;\epsilon=' num2str(epsil) ')'])

axis([0 1 1 4.5])

%  outer solution

xx = 0.3:0.02:1; alph = [0.5 2 4];
  
subplot(2,1,2)
for j = 1:size(alph,2)
  y0 = exp(- (xx.^(1-alph(j)) - 1)/(1-alph(j)));
  plot(xx,y0,'r');  hold on
end
plot(xx,1./xx,'b')

title(['\bf turning point example:  outer solution'])
xlabel('\bf x-axis')
ylabel('\bf y_0(x)')
text(0.35,1.9,'\bf \alpha = 0.5')
text(0.40,2.6,'\bf \alpha = 1.0')
text(0.50,2.9,'\bf \alpha = 2.0')
text(0.60,3.8,'\bf \alpha = 4.0')
axis([0 1 1 4.5])

figure(1);  

subplot(2,1,1);  hold on
xC = fzero('code35a',0.3,[],alpha,epsil);

plot([xC xC],[min(y3(:,1)) max(y3(:,1))],'b--')

y0 = exp(- (t3.^(alpha-1) - 1)/(alpha-1)/2/epsil);

subplot(2,1,2)
%plot(t3,y0,'r')
%title(['\bf turning point example (alpha=' num2str(alpha) ')'])
%xlabel('\bf x-axis')
%ylabel(['\bf y(x;\epsilon=' num2str(epsil) ')'])



