function pde_6a
% ode_6a.m  solve 
xmin=0;
xmax=2;
while((xmax-xmin)>10e-6)
  x=(xmin+xmax)/2;
  init = [0 0 x];
  eta = [0 5];
  [t,y] = ode45(@eqn, eta, init);
  % max(y(:,2))
  if max(y(:,2))>1
    xmax=x;
  else
    xmin=x;
  end
end % while

plot(t,y(:,3),'r+-',t,y(:,2),'b*-',t,y(:,1),'g+-')
axis equal
axis([0 3 0 2])
legend('d2F','dF','F')
grid on

  function f = eqn(t,y)
    f = zeros(size(y));
    f(1) = y(2);
    f(2) = y(3);
    f(3) = -1 -2*y(1)*y(3) + y(2)*y(2);
  end % eqn
end % ode_6a
