function main
  clc
  format long G

  % set constant c, boundary conditions, and eta interval:
  c = 1/2;
  Y_1_0 = 0.33205;  %Y_1 is f'' Guess until Y_2 = 1 at "infinity" 
  Y_2_0 = 0;        %Y_2 is f'
  Y_3_0 = 0;        %Y_3 is f
  eta_span = [0 10];

  % Solve using Runge-Kutta
  [eta,Y] = ode45( @derivatives, eta_span ,[Y_1_0 Y_2_0 Y_3_0]);

  % plot the results
  hold on;
  plot(Y(:,1), eta, '-',  'LineWidth',2, 'Color', 'red' )
  plot(Y(:,2), eta, '--', 'LineWidth',2, 'Color', 'blue' )
  plot(Y(:,3), eta, '-.', 'LineWidth',2, 'Color', 'green' )
  axis( [0 2 0 6] )
  ylabel('\bf\it\eta \rm\bf(-)')
  xlabel('\bfY variables \rm\bf(-)')
  legend( '\itY_1', '\itY_2', '\itY_3' )
    
  %print results so that we can pick the correct BC at eta = 0:
  Number_pts = length(eta);        %number of points in the array
  Output = zeros(Number_pts,4);    %set up an output array of correct length
  for i=1:Number_pts               %fill in the output array
      Output(i,1)=eta(i);
      Output(i,2)=Y(i,1);
      Output(i,3)=Y(i,2);
      Output(i,4)=Y(i,3);
  end
  fprintf('\n In the table below, Output = eta, Y(1), Y(2), Y(3) \n');
  Output                          %prints Output in column format
 
  %---------------------------------------------------------------------
  % Function for the derivatives
     function dYdt = derivatives(eta,Y)
     %Create an empty column vector, and then fill with the derivatives
     dYdt = zeros(3,1); 
     dYdt(1) = -c*Y(3)*Y(1);   
     dYdt(2) = Y(1);
     dYdt(3) = Y(2);
   end
end
