function [CL CD CM] = LiftDragCoeff(Re,aoa)
%
% PURPOSE: Find the coefficients of lift and drag where the angle of attack
%          (AOA) may be greater than stall for Reynolds numbers in the range
%          20k-60k.  This is table look-up with a cubic spline interpolation.  
%
%          aoa is in radians.
%
% REFERENCE: "Aerodynamic Characteristics of Seven Symmetrical Airfoil
%            Sections Through 180-Degree Angle of Attack For Use In
%            Aerodynamic Analysis of Vertical Axis Wind Turbines"
%            R.E. Sheldahl, P.C. Klimas SAND80-2114  
%
% FIRST AUTHOR: 
%
% CHANGE LOG:
%
%
% In keeping with the chart, aoa is in degrees.
%
  persistent Daoa DCL DCD DRe min_DRe max_DRe;
  if( isempty(Daoa) )
   [num,txt,raw] = xlsread('LiftDragCurves.xls');
      
   for i = 2:2:length(txt)
    DRe(i/2) = str2double(txt{1,i}(regexp(txt{1,i},'[0-9]')));
   end  
   min_DRe = min(DRe);
   max_DRe = max(DRe);
   Daoa = num(:,1);
   DCL = num(:,2:2:end);
   DCD = num(:,3:2:end);
   %F_CL = TriScatteredInterp(DRe',Daoa,DCL);
   %F_CD = TriScatteredInterp(DRe',Daoa,DCD);
   
   DM_aoa = 0:5:180
   DM = [0   0   .025  -.05 -.07 -.075 -.1 -.15 -.16 -.19 -.21 -.23 -.25 -.27 -.3 -.31 -.325 -.34 -.35 ...
        -.36 -.37 -.38. 4 .41. 42 .43 .44 .43 .41. 39 .35. .33 .3 .29 .35 .3 0
   
  end

  %Arrange Re and aoa vectors appropriately.
  aoa = aoa(:);  %Insist it's a column vector
  Re = Re(:)';  %Insist it's a row vector
  
  %Truncate Reynolds number request at max and min
  idx = find(Re < min_DRe);
    Re(idx) = min_DRe;
  idx = find(Re > min_DRe);
    Re(idx) = max_DRe; 
    
    
  %Convert aoa to +/- 180 degrees.
  aoa = mod(aoa+180,360)-180;
  
  %CL = F_CL(Re,aoa);
  %CD = F_CD(Re,aoa);Tes
   CL = griddata(DRe,Daoa,DCL,Re,abs(aoa));
   CD = griddata(DRe,Daoa,DCD,Re,abs(aoa));
   CL = sign(aoa)*CL;  %This works for scaler inputs but needs to be improved to handle vector inputs.  
   
   
   