Additional scripts for batch processing
Script file "batchsol.m"
%Script to batch run function "predictcpcurve_sm.m"
%at different solidity
ctfile = 'Ctang.NACA12.table';
cnfile = 'Cnorm.NACA12.table';
solset = [.05 .10 .20 .40];
tsr = [1.5 : 0.25 : 8]';
ure = ones(size(tsr)) * 53e3;
%FILENAME for output
solstr = ['So005'; 'So010'; 'So020'; 'So040';]; %
foilstr = '.Naca12.';
restr = 'Re53e3';
for i = 1 : 1 : length(solset)
%Get the performance curve records: tsr - Cp
cp = predictcpcurve_sm(ctfile, cnfile, solset(i), tsr, ure)
%Save the performance curve output in file
save([solstr(i,:) foilstr restr '.curve'], 'cp', '-ascii');
end
Script file "batchtablesplot.m"
%Script to plot one curves from each given tables data
%on single or different figures
%Similar form of tables
fname = [
'So005.Naca12.Re53e3.curve';
'So010.Naca12.Re53e3.curve';
'So020.Naca12.Re53e3.curve';
'So040.Naca12.Re53e3.curve';
]
%Plot certain column vs. certain column of each tables
xColumn = 1;
yColumn = 2;
markType = 'vo*.'; %'vos*p.';
markColor = 'rgbm';
markLine = '----';
figNum = [1 1 1 1];
yStr = 'C_P';
xStr = 'tsr';
titleStr = [yStr ' vs. ' xStr];
curveTot = size(fname, 1);
for i = 1 : 1 : curveTot
figure(figNum(i));
hold on;
xlabel(xStr); ylabel(yStr); title(titleStr);
table = load(fname(i, :));
plot(table(:,xColumn), table(:,yColumn),...
[markColor(i) markType(i) markLine(i)]);
hold off;
end
% Algorithm for plotting from tables
% (all table curves with same title, x & y label, axis size,
% and same data columns but can differ mark color and type)
% Get tables filename
% Get which same columns to plot from all 'similar' tables
% Get figure num. to plot to for every tables
% Get mark type and color for every tables
% For every table
% Get the required figure (can be the same figure)
% Label title, x & y axis titles
% Plot curve on specified figure
|