-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXCGLocation.m~
112 lines (84 loc) · 4.15 KB
/
XCGLocation.m~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
%% XCG Location
clear CG_types
clear mXcgi
% All references and moment arms in ft
% Lifting Components - referenced to desired CG
% Wing
mXcgi.Wing = [Wt.Struc.Wing, cglocAC];
% Tail
mXcgi.Tail = [Wt.Struc.HT+Wt.Struc.VT, TAIL.Lopt];
XLE_w = 80; % length from nose to leading edge of wing
% Fuselage
% Ranges from 0.40 - 0.50 length of fuselage;
mXcgi.Fuselage = [Wt.Struc.Fuselage, -XLE_w - 0.25*cRootSub + cglocAC + 0.40*L_F];
% Engine
length_engine = 142/12; % ft length of PW TF33-P7
x_engine2 = 116; % location of inlet double engines from nose
x_engine = 1.5*length_engine+x_engine2; % location of inlet of single engine from nose
% Engine_cg can vary from .3 -.4 of length of engine from inlet
mXcgi.Engine2 = [Wt.Pwr.Engine*(2/3),-XLE_w - 0.25*cRootSub + cglocAC + x_engine2 + length_engine*.3];
% Single engine (most aft)
mXcgi.Engine1 = [Wt.Pwr.Engine*(1/3),-XLE_w - 0.25*cRootSub + cglocAC + x_engine + 0.3*length_engine + length_engine*.3];
% Nacelle
% http://adg.stanford.edu/aa241/AircraftDesign.html Sect 9.2.2)
nacLength = (2.4077*(constraints.req_Thr^0.3876))/12; % nacelle length ft
nacDMax = 1.0827*(constraints.req_Thr^0.4134)/12; % nacelle diameter ft
mXcgi.Nacelle2 = [Wt.Struc.Nacelle*(2/3),-XLE_w - 0.25*cRootSub + cglocAC + x_engine2 + nacLength*.38];
mXcgi.Nacelle1 = [Wt.Struc.Nacelle*(1/3),-XLE_w - 0.25*cRootSub + cglocAC + x_engine + 0.2*length_engine + nacLength*.38];
% Nose and Main Gear
x_NoseGear = 31; % ft nosegear distance from nose
x_MainGear = 95.92; % ft main gear distance from nose
mXcgi.NoseGear = [Wt.Struc.NoseGear,-XLE_w - 0.25*cRootSub + cglocAC + x_NoseGear];
mXcgi.MainGear = [Wt.Struc.MainGear,-XLE_w - 0.25*cRootSub + cglocAC + x_MainGear];
% Fuel System
% Fuel tank should have minimal effect on CG loaded and empty
LengthFuelTank = 12; % ft
% Put fuel tank CG on CG
mXcgi.FuelSystem = [Wt.Pwr.FuelSystem,0];
% Fixed Equipment Weight
% Flight Control System
x_cockpit = L_N + L_CP/3; % length of quiet spike needle + center of cockpit from nose
mXcgi.FCsys = [Wt.Feq.FCsysGD,-XLE_w - 0.25*cRootSub + cglocAC + x_cockpit]; % In Cockpit
% Hydraulic System for Landing Gear
Nose_rat = Wt.Struc.NoseGear/(Wt.Struc.NoseGear+Wt.Struc.MainGear); % weight ratio of nose landing gear
Main_rat = Wt.Struc.MainGear/(Wt.Struc.NoseGear+Wt.Struc.MainGear); % weight ratio of main landing gear
mXcgi.HydraulicNose = [Wt.Feq.Hydraulic*Nose_rat,-XLE_w - 0.25*cRootSub + cglocAC + x_NoseGear];
mXcgi.HydraulicMain = [Wt.Feq.Hydraulic*Main_rat,-XLE_w - 0.25*cRootSub + cglocAC + x_MainGear];
% Instrumentation, Avionics
mXcgi.Instrumentation = [Wt.Feq.Iae,-XLE_w - 0.25*cRootSub + cglocAC + x_cockpit]; % Under Cockpit
% Electrical System
mXcgi.ElecSys = [Wt.Feq.ElecSys,-XLE_w - 0.25*cRootSub + cglocAC + x_cockpit]; % Also under cockpit
% Air Conditioning, Pressurazation, and de-icing systems
mXcgi.Api = [Wt.Feq.ApiGD,-XLE_w - 0.25*cRootSub + cglocAC + x_engine + length_engine*.4]; % located at engine
% Oxygen System
% CG placed in center of habitable cabin
mXcgi.Oxygen = [Wt.Feq.OxygenGD,-XLE_w - 0.25*cRootSub + cglocAC + (L_C/2) + L_N + L_CP];
% Auxiliary Power Unit
% Placed at Engines
mXcgi.Apu1 = [Wt.Feq.Apu,-XLE_w - 0.25*cRootSub + cglocAC + x_engine + length_engine*.4];
% Aircraft Furnishings (Seats, Lavatory, etc.)
% CG placed in center of habitable cabin
mXcgi.Furn =[Wt.Feq.Furn,-XLE_w - 0.25*cRootSub + cglocAC + (L_C/2) + L_N + L_CP];
% Operational Weight( Food, Drinks, ETC)
mXcgi.Oper = [Wt.Feq.Oper,-XLE_w - 0.25*cRootSub + cglocAC + L_N + L_CP]; % CG placed in front of cabin
% Paint Weight
mXcgi.Paint = [Wt.Feq.Paint,-XLE_w - 0.25*cRootSub + cglocAC + 0.40*L_F]; % Fuselage CG paint
%% CG Excursion Diagram
filename = 'CG_Calc_Copy.xlsx';
% Read in data from 'CG_Calc_Copy.xlsx' spreadsheet
Wt.Excel = xlsread(filename,'G34:G39');
cgExcel = xlsread(filename,'I34:I39');
close all;
figure()
title('CG Excursion Diagram')
xlabel('CG Location (% MAC)')
ylabel('Weight (lbs)')
hold on;
xMACExcel = xlsread(filename, 'J34:J39');
% Print range of most fwd and aft cg locations
% Plot CG Diagram
plot(xMACExcel, Wt.Excel,'b')
plot(xMACExcel, Wt.Excel,'s', 'MarkerSize',5,...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[0.5,0.5,0.5])
xlim('