% Delivered to the Government in Accordance with Contract FA8650-10-C-7080
% 
%  (c) 2011 United Technologies Corp.
% Developed with the sponsorship of the Defense Advanced Research Projects Agency (DARPA).
%  
% Permission is hereby granted, free of charge, to any person obtaining a copy of this data, including any software or models in source or binary form, as well as any drawings, specifications, and documentation (collectively "the Data"), to deal in the Data without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Data, and to permit persons to whom the Data is furnished to do so, subject to the following conditions:
%  
% The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Data.
%  
% THE DATA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, SPONSORS, DEVELOPERS, CONTRIBUTORS, OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DATA OR THE USE OR OTHER DEALINGS IN THE DATA.
% 

% This script edits data so that it can be used in the surface fitting tool
h = 0;

number = size(PR_IPT);
for count1 = 1:number(1)
    for count2 = 1:number(2)
    
    h = h+1;
    
    S_New(h) = Speed_IPT(count1);
    B_New(h) = Beta_IPT(count2);

    PR_New(h) = PR_IPT(count1,count2);
    MassSpeed_New(h) = Mass_IPT(count1,count2)*Speed_IPT(count1);
    Efficiency_New(h) = Efficiency_IPT(count1,count2);
      
    end
end
Tolerance = 0.01;
c_095 = 0;
c_100 = 0;
c_105 = 0;

% Find speed value 0.95
for count = 1:h;
if abs(S_New(count)-0.95)< Tolerance
c_095 = c_095+1;
S_095(c_095) = S_New(count);
M_095(c_095) = MassSpeed_New(count);
PR_095(c_095)= PR_New(count);
end

% Find speed value 1.0
if abs(S_New(count)-1.0)< Tolerance
c_100 = c_100+1;
S_100(c_100) = S_New(count);
M_100(c_100) = MassSpeed_New(count);
PR_100(c_100)= PR_New(count);
end

% Find speed value 1.05
if abs(S_New(count)-1.05)< Tolerance
c_105 = c_105+1;
S_105(c_105) = S_New(count);
M_105(c_105) = MassSpeed_New(count);
PR_105(c_105)= PR_New(count);
end


end

plot(MassSpeed_New, PR_New,'k.');
hold on

plot(M_095, PR_095,'b.');
hold on;
plot(M_100, PR_100,'g.');
plot(M_105, PR_105,'r.');
hold off
