Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- config='Cruise';
- addpath('Helpers')
- clear all
- clc
- close all
- %Cruise
- CLc=[1.8884 0.01017 -1.7652];
- CDc=[0.1403 -0.04123 0.1353];
- %Cruise, trimmed
- CLct=[1.73999 0.01009 -1.6175];
- CDct=[0.1169 -0.02943 0.1120];
- %Flaps TO
- CLto=[1.835 -0.8361 -8361];
- CDto=[0.11714 0.08347 0.08347];
- %Flaps Landing
- CLl=[1.89016 -0.663 -663];
- CDl=[0.13151 0.04126 0.04126];
- %Calculate polars
- xc = [CLc(1) CLc(2) CLc(3)]; % Define Points
- yc = [CDc(1) CDc(2) CDc(3)];
- xmc = @(xc) [xc'.^2 xc' ones(size(xc))']; % Quadratic Regression Matrix
- bc = xmc(xc)\yc'; % Estimate Parameters
- xo = linspace(min(xc)-1,max(xc)+1); % Create X-Value Vector
- yo = xmc(xo)*bc; % Calculate Y-Values
- xct = [CLct(1) CLct(2) CLct(3)]; % Define Points
- yct = [CDct(1) CDct(2) CDct(3)];
- xmct = @(xct) [xct'.^2 xct' ones(size(xct))']; % Quadratic Regression Matrix
- bct = xmct(xct)\yct'; % Estimate Parameters
- xoct = linspace(min(xct)-1,max(xct)+1); % Create X-Value Vector
- yoct = xmct(xoct)*bct; % Calculate Y-Values
- xto = [CLto(1) CLto(2) CLto(3)]; % Define Points
- yto = [CDto(1) CDto(2) CDto(3)];
- xmto = @(xto) [xto'.^2 xto' ones(size(xto))']; % Quadratic Regression Matrix
- bto = xmto(xto)\yto'; % Estimate Parameters
- xoto = linspace(min(xto)-1,max(xto)+1); % Create X-Value Vector
- yoto = xmto(xoto)*bto; % Calculate Y-Values
- xl = [CLl(1) CLl(2) CLl(3)]; % Define Points
- yl = [CDl(1) CDl(2) CDl(3)];
- xml = @(xl) [xl'.^2 xl' ones(size(xl))']; % Quadratic Regression Matrix
- bl = xml(xl)\yl'; % Estimate Parameters
- xol = linspace(min(xl)-1,max(xl)+1); % Create X-Value Vector
- yol = xml(xol)*bl; % Calculate Y-Values
- %Plots
- figure(1)
- latexPlot(plot(yo,xo,'-b',yc,xc,'pb'),14)
- hold on
- latexPlot(plot(yoct,xoct,'-r',yct,xct,'pr'),14)
- xlabel('Drag Coefficient (CD)');ylabel('Lift Coefficient (CL)');
- legend('Cruise','Max and Min Limits','Trimmed Cruise','Max and Min Limits')
- figure(2)
- latexPlot(plot(yoto,xoto,'-m',yto,xto,'pm'),14)
- hold on
- latexPlot(plot(yol,xol,'-c',yl,xl,'pc'),14)
- xlabel('Drag Coefficient (CD)');ylabel('Lift Coefficient (CL)');
- legend('Take Off','Max and Min Limits','Landing','Max and Min Limits')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement