function alpha = vdp_first_airy_root();
%  
% 2003-11-14 cbm
% no rights reserved: public domain code
  
z = 0:.05:5;

figure(8);  clf;
%subplot(2,1,1);  hold on;
hold on;
plot([z(1) z(end)], [0 0], 'k:');
plot(z,real(airy(-z)), 'bx-');
title('real(airy(-z))');

%subplot(2,1,2);
%plot(z,imag(airy(-z)), 'rx-');
%title('imag(airy(z)) (should be zero)');

disp('from plot, estimated root is near 2.4');

x0 = 2.4

f = inline('real(airy(-x))', 'x');

opt = optimset('TolFun', 1e-15);

[x,fval,exitflag,output] = fsolve(f, x0, opt);

%x
%fval
%exitflag
%output

%disp('airy(-x) is');
%airy(-x)

%disp('discard imaginary part');

alpha = real(x)
