Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. config='Cruise';
  2. addpath('Helpers')
  3.  
  4. clear all
  5. clc
  6. close all
  7.  
  8. %Cruise
  9. CLc=[1.8884 0.01017 -1.7652];
  10. CDc=[0.1403 -0.04123 0.1353];
  11.  
  12. %Cruise, trimmed
  13. CLct=[1.73999 0.01009 -1.6175];
  14. CDct=[0.1169 -0.02943 0.1120];
  15.  
  16. %Flaps TO
  17. CLto=[1.835 -0.8361 -8361];
  18. CDto=[0.11714 0.08347 0.08347];
  19.  
  20. %Flaps Landing
  21. CLl=[1.89016 -0.663 -663];
  22. CDl=[0.13151 0.04126 0.04126];
  23.  
  24. %Calculate polars
  25. xc = [CLc(1) CLc(2) CLc(3)]; % Define Points
  26. yc = [CDc(1) CDc(2) CDc(3)];
  27. xmc = @(xc) [xc'.^2 xc' ones(size(xc))']; % Quadratic Regression Matrix
  28. bc = xmc(xc)\yc'; % Estimate Parameters
  29. xo = linspace(min(xc)-1,max(xc)+1); % Create X-Value Vector
  30. yo = xmc(xo)*bc; % Calculate Y-Values
  31.  
  32. xct = [CLct(1) CLct(2) CLct(3)]; % Define Points
  33. yct = [CDct(1) CDct(2) CDct(3)];
  34. xmct = @(xct) [xct'.^2 xct' ones(size(xct))']; % Quadratic Regression Matrix
  35. bct = xmct(xct)\yct'; % Estimate Parameters
  36. xoct = linspace(min(xct)-1,max(xct)+1); % Create X-Value Vector
  37. yoct = xmct(xoct)*bct; % Calculate Y-Values
  38.  
  39. xto = [CLto(1) CLto(2) CLto(3)]; % Define Points
  40. yto = [CDto(1) CDto(2) CDto(3)];
  41. xmto = @(xto) [xto'.^2 xto' ones(size(xto))']; % Quadratic Regression Matrix
  42. bto = xmto(xto)\yto'; % Estimate Parameters
  43. xoto = linspace(min(xto)-1,max(xto)+1); % Create X-Value Vector
  44. yoto = xmto(xoto)*bto; % Calculate Y-Values
  45.  
  46. xl = [CLl(1) CLl(2) CLl(3)]; % Define Points
  47. yl = [CDl(1) CDl(2) CDl(3)];
  48. xml = @(xl) [xl'.^2 xl' ones(size(xl))']; % Quadratic Regression Matrix
  49. bl = xml(xl)\yl'; % Estimate Parameters
  50. xol = linspace(min(xl)-1,max(xl)+1); % Create X-Value Vector
  51. yol = xml(xol)*bl; % Calculate Y-Values
  52.  
  53. %Plots
  54. figure(1)
  55. latexPlot(plot(yo,xo,'-b',yc,xc,'pb'),14)
  56. hold on
  57. latexPlot(plot(yoct,xoct,'-r',yct,xct,'pr'),14)
  58. xlabel('Drag Coefficient (CD)');ylabel('Lift Coefficient (CL)');
  59. legend('Cruise','Max and Min Limits','Trimmed Cruise','Max and Min Limits')
  60.  
  61. figure(2)
  62. latexPlot(plot(yoto,xoto,'-m',yto,xto,'pm'),14)
  63. hold on
  64. latexPlot(plot(yol,xol,'-c',yl,xl,'pc'),14)
  65. xlabel('Drag Coefficient (CD)');ylabel('Lift Coefficient (CL)');
  66. legend('Take Off','Max and Min Limits','Landing','Max and Min Limits')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement