-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.m
1469 lines (1114 loc) · 49.9 KB
/
Main.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%% AS5213 UAV Design
% Author: Team SARAS
% Last Modified: 25/ 5/ 2022
%% INTIAL SETTINGS
clc; clear; close all;
PS = PLOT_STANDARDS();
%% GENERAL CONSTANTS AND MISSION SPECIFICATIONS
% Earth gravitational acceleration
global g
g = 9.81;
% Design quantities
global V_cruise V_takeoff V_descent Max_range Max_altitude Max_cruise_height
V_cruise = 20;
V_takeoff = 5;
V_descent = 2.5;
% Range for IITM is 42 km
Max_range = 110 * 1000 * (1 + 5/100);
Max_altitude = 4200;
Max_cruise_height = 45.81;
% Number of motors
global VTOL_motor_count FixedWing_motor_count
VTOL_motor_count = 4;
FixedWing_motor_count = 1;
%% FIRST WEIGHT ESTIMATE
%==================================================
% PAYLOAD WEIGHT ESTIMATE
global payload_redundancy_ratio W_payload W_payload_dropped
payload_redundancy_ratio = 5 / 100;
W_payload = 1.309 * (1 + payload_redundancy_ratio);
W_payload_dropped = 0;
% W_payload = 1.109 * (1 + payload_redundancy_ratio);
% W_payload_dropped = 0.495;
%==================================================
% IMPORT HISTORICAL DATA FROM GOOGLE SHEETS
ID = '1g2JynuGUuHT1ay0MLLTOBL6tM6G6r_BdMQI8w2SrnpY';
sheet_name = 'HistoricData';
url_name = sprintf('https://docs.google.com/spreadsheets/d/%s/gviz/tq?tqx=out:csv&sheet=%s', ID, sheet_name);
HistoricData = webread(url_name);
%==================================================
% STORE THE DATA IN VARIABLES
range_historic = HistoricData.Range;
endurance_historic = HistoricData.Endurance;
cruise_speed_historic = HistoricData.CruiseSpeed;
MTOW_historic = HistoricData.MTOW;
payload_weight_historic = HistoricData.PayloadWeight;
empty_weight_historic = HistoricData.EmptyWeight;
battery_weight_historic = HistoricData.BatteryWeight;
%==================================================
% GET THE EMPTY WEIGHT FRACTIONS AND FIT FUNCTIONAL RELATION WITH MTOW
empty_weight_fraction_historic = empty_weight_historic ./ MTOW_historic;
global battery_redundancy_ratio
battery_redundancy_ratio = 5 / 100;
% Fit function to the data, fit power law relation
% Fitting We/W0 = A*(W0)^c
% Or log(We/W0) = c*log(W0) + log(A)
x = MTOW_historic;
y = empty_weight_fraction_historic;
f = fit(x, y, 'power1');
A = f.a;
c = f.b;
% Plot the Original Data and the Curve Fit
figure(1);
fig1_comps.fig = gcf;
% Plot the data
hold on
fig1_comps.p1 = plot(linspace(min(x), max(x), 100), f(linspace(min(x), max(x), 100)), 'DisplayName', sprintf("$$%.4fW_{0}^{%.4f}$$", A, c), 'LineWidth', 1.25, 'Color', PS.Green2);
fig1_comps.p2 = plot(x, y, 'DisplayName', 'Historic Data', 'LineStyle', 'none', 'Marker', 'o', 'MarkerSize', 5, 'MarkerFaceColor', PS.Blue2, 'MarkerEdgeColor', PS.DBlue3);
% Set properties
xlabel('$$W_{0}$$');
ylabel('$$\frac{W_{e}}{W_{0}}$$');
legend();
legendX = 0.74; legendY = 0.8; legendWidth = .1; legendHeight = .1;
fig1_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
%==================================================
% ESTIMATE BATTERY WEIGHT FRACTION
battery_weight_fraction_historic = battery_weight_historic ./ MTOW_historic;
average_battery_weight_fraction_historic = mean(battery_weight_fraction_historic);
% Add redundancy in battery weight fraction
battery_redundancy_ratio = 5/100;
battery_weight_fraction = average_battery_weight_fraction_historic;
figure(2);
fig2_comps.fig = gcf;
fig2_comps.p1 = scatter(MTOW_historic, battery_weight_fraction_historic, 'Marker', 'o', 'SizeData', 30, 'MarkerFaceColor', PS.Purple1, 'MarkerEdgeColor', PS.Purple2);
% Set properties
xlabel('$$W_{0}$$');
ylabel('$$\frac{W_{b}}{W_{0}}$$');
legendX = 0.65; legendY = 0.85; legendWidth = .1; legendHeight = .1;
fig2_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
%==================================================
% SOLVE TO GET TOTAL WEIGHT
syms W0
eqn = W0 == (W_payload) / (1 - (battery_weight_fraction) - (A*(W0^(c))) );
W0_FirstEstimate = double(vpasolve(eqn, W0));
W_First_EmptyWeight = W0_FirstEstimate * f(W0_FirstEstimate);
W_First_BatteryWeight = W0_FirstEstimate * battery_weight_fraction;
%Can we use the iteration method, so that I can put it in the report?
%========================================================
% PRINT RESULTS OF THIS SECTION
disp('FIRST WEIGHT ESTIMATE');
disp('--------------------');
fprintf('Payload Weight = %.2f kg\n', W_payload);
fprintf('Empty Weight Estimate = %.2f kg\n', W_First_EmptyWeight);
fprintf('Battery Weight Estimate = %.2f kg\n', W_First_BatteryWeight);
fprintf('First Weight Estimate = %.2f kg\n', W0_FirstEstimate);
fprintf('\n\n');
%========================================================
% SAVE FIGURE AS AN IMAGE
figure_location = 'Figures';
SAVE_MY_FIGURE(fig1_comps, sprintf('%s\\EmptyWeightFraction_vs_MTOW.png', figure_location), 'small');
SAVE_MY_FIGURE(fig2_comps, sprintf('%s\\BatteryWeightFraction_vs_MTOW.png', figure_location), 'small');
%========================================================
% CLOSE ALL FIGURES
close all;
%% SECOND WEIGHT ESTIMATE
W_payload;
W_payload_dropped;
W_EmptyWeight = W_First_EmptyWeight;
W_BatteryWeight = W_First_BatteryWeight;
W0_FirstEstimate;
% Empty weight fraction - A * W0^c
A;
c;
%==================================================
% BATTERY SPECIFICATIONS
% We choose Battery with 22.2V
% Commonly available Li-ion battery energy density 300W-hr/kg (without fireproofing)
global Battery_specific_energy battery_SOH battery_SOC battery_PIF battery_discharge_efficiency battery_Voltage
Battery_specific_energy = 300 * 3600;
battery_SOH = 0.9;
battery_SOC = 0.85;
battery_PIF = 0.65;
battery_discharge_efficiency = 0.9;
battery_Voltage = 22.2;
%==================================================
% DESIGN, GEOMETRIC AND ATMOSPHERIC QUANTITIES OF WING AND PROPELLER
% Geometric quantities - taken from similar aircraft
Wing_span = 2.53;
Root_chord = 0.3044;
Tip_chord = 0.2150;
% Tip_chord = 0.1993;
Mean_chord = 0.2623;
% Mean_chord = 0.259701;
% Mean_chord = 0.255495;
% P330_MTOW = 14;
% P330_WingArea = 0.63716;
% P330_WingLoading = (P330_MTOW) / P330_WingArea;
% Wing_area = W0_FirstEstimate / P330_WingLoading;
Wing_area = 0.63716;
AR = 10.046;
Wing_area = 0.8;
AR = 7.2;
Taper_ratio = 0.7064;
%Taper_ratio = 0.654768
% Propeller - 16 inch diameter - taken from similar aircraft
prop_diameter = (16 * 2.54) / 100;
A_prop = pi * (prop_diameter^2) / 4;
% Atmospheric quantities
std_atm = standardAtmosphere();
Density_sea_level = std_atm.density(0 / 1000);
Density_max_altitude = std_atm.density(Max_altitude / 1000);
%==================================================
% EFFICIENCY FACTORS
global prop_efficiency motor_efficiency ESC_efficiency oswald_efficiency figure_of_merit_hoverpower
prop_efficiency = 0.85;
motor_efficiency = 0.9;
ESC_efficiency = 0.85;
oswald_efficiency = 0.75;
figure_of_merit_hoverpower = 0.8;
%==================================================
% TIME REQUIRED IN DIFFERENT MISSION SEGMENTS
global TakeOff_time Cruise_time Descent_time
TakeOff_time = Max_cruise_height / V_takeoff;
Cruise_time = Max_range / V_cruise;
Descent_time = Max_cruise_height / V_descent;
%==================================================
% ITERATIVELY GET BETTER ESTIMATES OF WEIGHT AT DIFFERENT ALTITUDES
N_h = 100;
h_min = 0;
h_max = Max_altitude;
h_list = linspace(h_min, h_max, N_h);
% Different weights at all altitudes
W_empty_weight_list = cell(N_h, 1);
W_battery_weight_list = cell(N_h, 1);
W_total_weight_list = cell(N_h, 1);
W_Second_EmptyWeight_list = zeros(N_h, 1);
W_Second_BatteryWeight_list = zeros(N_h, 1);
W0_SecondEstimate_list = zeros(N_h, 1);
% Set first element as First Weight Estimates
for i_h = 1:N_h
W_empty_weight_list{i_h} = [W_EmptyWeight];
W_battery_weight_list{i_h} = [W_BatteryWeight];
W_total_weight_list{i_h} = [W0_FirstEstimate];
end
% Find Second Weight Estimate for all the altitudes
for i_h = 1:N_h
iteration_counter = 1;
% tolerance of 1e-3 corresponds to error of 1 gm
tolerance = 1e-3;
error_weight_estimate = 10;
while error_weight_estimate > tolerance
h = h_list(i_h);
rho_h = std_atm.density(h / 1000);
%==================================================
% AERODYNAMIC QUANTITIES
% Design lift coefficient estimation
% In cruise W = L = (1/2) * rho * V^2 * S * Cl
CL_cruise = (g * W_total_weight_list{i_h}(iteration_counter)) / (0.5 * rho_h * V_cruise * V_cruise * Wing_area);
CD0 = CD0_func(Wing_area);
CD_cruise = CD0 + (1 / (pi * AR * oswald_efficiency)) * (CL_cruise^2);
%==================================================
% POWER REQUIRED CALCULATIONS
% Cruise
T_cruise = 0.5 * rho_h * V_cruise * V_cruise * Wing_area * CD_cruise;
P_cruise = V_cruise * T_cruise;
% Vertical take off 1
K_T = 1.2;
T_takeoff_1 = K_T * (g * W_total_weight_list{i_h}(iteration_counter) / VTOL_motor_count);
P_takeoff_1 = VTOL_motor_count * (V_takeoff * T_takeoff_1 / 2) * (1 + sqrt(1 + ((2 * T_takeoff_1) / (rho_h * (V_takeoff^2) * A_prop))));
% Vertical descent 1
T_hover_1 = g * W_total_weight_list{i_h}(iteration_counter) / VTOL_motor_count;
V_propeller_hover = sqrt(T_hover_1 / (2 * rho_h * A_prop));
x = -1 * (V_descent / V_propeller_hover);
K = 1.2;
V_propeller_induced = (K - 1.125*x - 1.372*(x^2) - 1.718*(x^3) - 0.655*(x^4)) * V_propeller_hover;
P_descent_1 = VTOL_motor_count * K * (g * W_total_weight_list{i_h}(iteration_counter) / VTOL_motor_count) * (V_propeller_induced - V_descent);
% Vertical take off 2
K_T = 1.2;
T_takeoff_2 = K_T * (g * (W_total_weight_list{i_h}(iteration_counter) - W_payload_dropped) / VTOL_motor_count);
P_takeoff_2 = VTOL_motor_count * (V_takeoff * T_takeoff_2 / 2) * (1 + sqrt(1 + ((2 * T_takeoff_2) / (rho_h * (V_takeoff^2) * A_prop))));
% Vertical descent 2
T_hover_2 = g * (W_total_weight_list{i_h}(iteration_counter) - W_payload_dropped) / VTOL_motor_count;
V_propeller_hover = sqrt(T_hover_2 / (2 * rho_h * A_prop));
x = -1 * (V_descent / V_propeller_hover);
K = 1.2;
V_propeller_induced = (K - 1.125*x - 1.372*(x^2) - 1.718*(x^3) - 0.655*(x^4)) * V_propeller_hover;
P_descent_2 = VTOL_motor_count * K * (g * (W_total_weight_list{i_h}(iteration_counter) - W_payload_dropped) / VTOL_motor_count) * (V_propeller_induced - V_descent);
%==================================================
% POWER REQUIRED ACCOUNTING FOR INEFFICIENCIES
P_cruise = P_cruise / (prop_efficiency * motor_efficiency * ESC_efficiency);
P_takeoff_1 = P_takeoff_1 / (figure_of_merit_hoverpower * motor_efficiency * ESC_efficiency);
P_descent_1 = P_descent_1 / (figure_of_merit_hoverpower * motor_efficiency * ESC_efficiency);
P_takeoff_2 = P_takeoff_2 / (figure_of_merit_hoverpower * motor_efficiency * ESC_efficiency);
P_descent_2 = P_descent_2 / (figure_of_merit_hoverpower * motor_efficiency * ESC_efficiency);
%==================================================
% ENERGY REQUIRED CALCULATIONS
Energy_cruise = P_cruise * Cruise_time;
Energy_takeoff_1 = P_takeoff_1 * TakeOff_time;
Energy_descent_1 = P_descent_1 * Descent_time;
Energy_takeoff_2 = P_takeoff_2 * TakeOff_time;
Energy_descent_2 = P_descent_2 * Descent_time;
%==================================================
% BATTERY WEIGHT REQUIRED CALCULATIONS
Total_energy_required = Energy_cruise + Energy_takeoff_1 + Energy_descent_1 + Energy_takeoff_2 + Energy_descent_2;
% Accounting for inefficiencies
Total_energy_required = Total_energy_required / (battery_SOH * battery_SOC * battery_discharge_efficiency);
Battery_weight = (Total_energy_required / Battery_specific_energy) / battery_PIF;
Battery_weight = Battery_weight * (1 + battery_redundancy_ratio);
%==================================================
% WEIGHT ESTIMATE
syms W0
eqn = W0 == (W_payload + Battery_weight) / (1 - (A*(W0^(c))) );
% Get new weight estimate
iteration_counter = iteration_counter + 1;
W_total_weight_list{i_h}(iteration_counter) = double(vpasolve(eqn, W0));
% W_total_weight_list{i_h}(iteration_counter) = double(solve(eqn, W0));
error_weight_estimate = abs(W_total_weight_list{i_h}(iteration_counter) - W_total_weight_list{i_h}(iteration_counter - 1));
W_empty_weight_list{i_h}(iteration_counter) = A*(W_total_weight_list{i_h}(iteration_counter)^c) * W_total_weight_list{i_h}(iteration_counter);
W_battery_weight_list{i_h}(iteration_counter) = Battery_weight;
% iteration_counter
end
%==================================================
% ACCOUNT FOR REDUNDANCIES
W_Second_EmptyWeight_list(i_h) = W_empty_weight_list{i_h}(iteration_counter);
W_Second_BatteryWeight_list(i_h) = W_battery_weight_list{i_h}(iteration_counter);
W0_SecondEstimate_list(i_h) = W_payload + W_Second_EmptyWeight_list(i_h) + W_Second_BatteryWeight_list(i_h);
end
%==================================================
% FIND THE MAXIMUM SECOND WEIGHT ESTIMATE AND PARAMETER CALCULATIONS
[W0_SecondEstimate_max, idx_W0_SecondEstimate_max] = max(W0_SecondEstimate_list);
W_Second_EmptyWeight = W_Second_EmptyWeight_list(idx_W0_SecondEstimate_max);
W_Second_BatteryWeight = W_Second_BatteryWeight_list(idx_W0_SecondEstimate_max);
W0_SecondEstimate = W0_SecondEstimate_list(idx_W0_SecondEstimate_max);
h_W0_SecondEstimate_max = h_list(idx_W0_SecondEstimate_max);
rho_h = std_atm.density(h_W0_SecondEstimate_max / 1000);
CL_cruise = (g * W0_SecondEstimate) / (0.5 * rho_h * V_cruise * V_cruise * Wing_area);
CD0 = CD0_func(Wing_area);
CD_cruise = CD0 + (1 / (pi * AR * oswald_efficiency)) * (CL_cruise^2);
[P_cruise, P_takeoff_1, P_descent_1, P_takeoff_2, P_descent_2, Total_energy_required, Battery_weight] = Power_Calculation_func(h_W0_SecondEstimate_max, W0_SecondEstimate, Wing_area, AR, A_prop);
Energy_cruise = P_cruise * Cruise_time;
Energy_takeoff_1 = P_takeoff_1 * TakeOff_time;
Energy_descent_1 = P_descent_1 * Descent_time;
Energy_takeoff_2 = P_takeoff_2 * TakeOff_time;
Energy_descent_2 = P_descent_2 * Descent_time;
%==================================================
% PLOT FIGURES FOR WEIGHT ESTIMATES THROUGH THE ITERATIONS
% Show the convergence of the total weight estimate
figure(1);
fig1_comps.fig = gcf;
% Plot the data
hold on
fig1_comps.p1 = plot(1:length(W_total_weight_list{idx_W0_SecondEstimate_max}), W_total_weight_list{idx_W0_SecondEstimate_max}, 'LineWidth', 1.25, 'Marker', 'o', 'MarkerSize', 5, 'MarkerFaceColor', PS.Blue1, 'MarkerEdgeColor', PS.DBlue2);
% Set properties
xlabel('$$Iteration Count$$');
ylabel('$$W_{0}$$');
% legend();
legendX = 0.78; legendY = 0.77; legendWidth = .1; legendHeight = .1;
fig1_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
%==================================================
% PRINT RESULTS OF THIS SECTION
disp('SECOND WEIGHT ESTIMATE');
disp('--------------------');
fprintf('TakeOff_time = %.2f s or %.2f min\n', TakeOff_time, TakeOff_time / 60);
fprintf('Cruise_time = %.2f s or %.2f min\n', Cruise_time, Cruise_time / 60);
fprintf('Height Second Weight Estimate max = %.2f\n', h_W0_SecondEstimate_max);
fprintf('CL_cruise = %.2f\n', CL_cruise);
fprintf('CD_cruise = %.2f\n', CD_cruise);
fprintf('P_cruise = %.2f Watts\n', P_cruise);
fprintf('P_takeoff_1 = %.2f Watts\n', P_takeoff_1);
fprintf('P_descent_1 = %.2f Watts\n', P_descent_1);
fprintf('P_takeoff_2 = %.2f Watts\n', P_takeoff_2);
fprintf('P_descent_2 = %.2f Watts\n', P_descent_2);
fprintf('Energy_cruise = %.2f (%.4e) J\n', Energy_cruise, Energy_cruise);
fprintf('Energy_takeoff_1 = %.2f (%.4e) J\n', Energy_takeoff_1, Energy_takeoff_1);
fprintf('Energy_descent_1 = %.2f (%.4e) J\n', Energy_descent_1, Energy_descent_1);
fprintf('Energy_takeoff_2 = %.2f (%.4e) J\n', Energy_takeoff_2, Energy_takeoff_2);
fprintf('Energy_descent_2 = %.2f (%.4e) J\n', Energy_descent_2, Energy_descent_2);
fprintf('Total_energy_required = %.2f J\n', Total_energy_required);
fprintf('Battery_weight = %.2f kg\n', Battery_weight);
fprintf('Payload Weight = %.2f kg\n', W_payload);
fprintf('Empty Weight Estimate = %.2f kg\n', W_Second_EmptyWeight);
fprintf('Battery Weight Estimate = %.2f kg\n', W_Second_BatteryWeight);
fprintf('Final Weight Estimate = %.2f kg\n', W0_SecondEstimate);
fprintf('\n\n');
%========================================================
% SAVE FIGURE AS AN IMAGE
figure_location = 'Figures';
SAVE_MY_FIGURE(fig1_comps, sprintf('%s\\SecondWeightEstimate_ConvergencePlot.png', figure_location), 'small');
%========================================================
% CLOSE ALL FIGURES
close all;
%% WING LOADING AND POWER LOADING
%==================================================
% FACTORS GOVERNING WING LOADING
% 1) Prescribed Flight Speed
% 2) Absolute Ceiling
% 3) Range
% POWER LOADING = (P/W)
% GOAL: Minimize Power Loading or Minimize Battery Capacity or Fix Cruise Speed at Absolute Ceiling
% NOTE: Take into account the efficiency factors
%==================================================
% SET REQUIRED DATA VALUES
MTOW = W0_SecondEstimate;
N_h = 100;
h_min = 0;
h_max = Max_altitude;
h_list = linspace(h_min, h_max, N_h);
% Get std_atm object
std_atm = standardAtmosphere();
% Get area list
N_S = 1000;
S_min = 0.25;
S_max = 2;
S_list = linspace(S_min, S_max, N_S);
WL_list = (MTOW * g) ./ S_list;
% Expressions for CD0 and K taken from https://nptel.ac.in/courses/101106035 lecture 8
CD0 = CD0_func(S_list);
K = 1.333 / (pi * AR);
global Variation_percentage
Variation_percentage = 5 / 100;
%==================================================
% PRESCRIBED FLIGHT SPEED
% Idea: Fix V_cruise, Go to each height find the variation of PL vs WL. Find min at each altitude.
% Find max of all the minimas. Take 5% variation of that particular WL. That is our I1.
PL_list = zeros(N_h, N_S);
for i = 1:N_h
h = h_list(i);
rho_h = std_atm.density(h / 1000);
% Get Power Loading
q = (1/2) * rho_h * V_cruise * V_cruise;
CL = WL_list / q;
CD = CD0 + K * (CL.^2);
D = q .* S_list .* CD;
T = D;
PL_list(i, :) = (T * V_cruise) / (MTOW * g);
% PL_list(i, :) = (V_cruise * q .* CD) ./ (WL_list);
end
% Plot variation of Power Loading with Wing Loading at different altitudes
figure(1);
fig1_comps.fig = gcf;
% Plot the data
hold on
i_list = 0: (N_h / 5): N_h;
i_list(1) = 1;
for i = i_list
fig1_comps.p1(i) = plot(WL_list, PL_list(i, :), 'DisplayName', sprintf('h = %.2f', h_list(i)), 'LineWidth', 1.25);
end
% Set properties
xlabel('$$Wing Loading \; \frac{W}{S}$$');
ylabel('$$Power Loading \; \frac{P}{W}$$');
legend();
legendX = 0.75; legendY = 0.77; legendWidth = .1; legendHeight = .1;
fig1_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
STANDARDIZE_FIGURE(fig1_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig1_comps, sprintf('%s\\PowerLoading_vs_WingLoading_PrescribedVelocity_at_different_Altitudes.png', figure_location), 'small');
% Find Maximum of the Minimum Power Loading at each Each Altitude. Take 5% variation around that as the Interval for Wing Loading.
PL_min_list = zeros(N_h, 1);
for i = 1:N_h
PL_min_list(i) = min(PL_list(i, :));
end
[max_PL_min_list, idx_max_PL_min_list] = max(PL_min_list);
% Get Power Loading at that Altitude and the Interval of Wing Loading for 5% Variation of Power Loading
h_prescribedV = h_list(idx_max_PL_min_list);
rho_h_prescribedV = std_atm.density(h_prescribedV / 1000);
% Get Power Loading
q = (1/2) * rho_h_prescribedV * V_cruise * V_cruise;
CL = WL_list / q;
CD = CD0 + K * (CL.^2);
D = q .* S_list .* CD;
T = D;
PL = (T * V_cruise) / (MTOW * g);
PL_min = min(PL);
PL_percent_variation_idx = find(abs(PL - PL_min)/PL_min < Variation_percentage);
WL_interval_prescribedV = WL_list(PL_percent_variation_idx);
PL_interval_prescribedV = PL(PL_percent_variation_idx);
% Plot variation of Power Loading with Wing Loading and 5% Variation
figure(2);
fig2_comps.fig = gcf;
% Plot the data
fig2_comps.p1 = plot(WL_list, PL, 'LineWidth', 1.25);
hold on
fig2_comps.p2 = xline(min(WL_interval_prescribedV), '--', 'LineWidth', 1);
fig2_comps.p3 = xline(max(WL_interval_prescribedV), '--', 'LineWidth', 1);
fig2_comps.p4 = yline(min(PL_interval_prescribedV), '--', 'LineWidth', 1);
fig2_comps.p5 = yline(max(PL_interval_prescribedV), '--', 'LineWidth', 1);
% Set properties
xlabel('$$Wing Loading \; \frac{W}{S}$$');
ylabel('$$Power Loading \; \frac{P}{W}$$');
STANDARDIZE_FIGURE(fig2_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig2_comps, sprintf('%s\\PowerLoading_vs_WingLoading_PrescribedVelocity_5PercentVariation.png', figure_location), 'small');
%==================================================
% ABSOLUTE CEILING
rho_ceil = std_atm.density(h_max / 1000);
% The CL value which minimizes Power Required is used
CL = sqrt((3 * CD0) / K);
CD = CD0 + K * CL.^(2);
PL_1 = sqrt((2 * MTOW * g) ./ (rho_ceil * S_list)) .* (CD ./ (CL.^(1.5)));
% IMPORTANT: What was wrong with the code below?
% q = (1/2) * rho_ceil * V_cruise * V_cruise;
% CL = WL_list / q;
% CD = CD0 + K * (CL.^2);
% D = q .* S_list .* CD;
% PL_2 = (D * V_cruise) / (MTOW * g);
q = (1/2) * rho_ceil * V_cruise * V_cruise;
CL = sqrt((3 * CD0) / K);
CD = CD0 + K * CL.^(2);
D = q .* S_list .* CD;
PL_2 = (D * V_cruise) / (MTOW * g);
% Plot figures for variation with Altitude
figure(3);
fig3_comps.fig = gcf;
% Plot the data
fig3_comps.p1 = plot(WL_list, PL_1, 'DisplayName', 'Minimum Power', 'LineWidth', 1.25);
hold on
fig3_comps.p2 = plot(WL_list, PL_2, 'DisplayName', 'Cruise Velocity 20', 'LineWidth', 1.25);
% Set properties
xlabel('$$Wing Loading \; \frac{W}{S}$$');
legend();
legendX = 0.72; legendY = 0.8; legendWidth = .1; legendHeight = .1;
fig3_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
STANDARDIZE_FIGURE(fig3_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig3_comps, sprintf('%s\\PowerLoading_vs_WingLoading_at_AbsoluteCeiling.png', figure_location), 'small');
% 5percent Variation
% Power Loading at the point of nearest approach
PL_intersection = Point_of_Closest_Approach(WL_list, PL_1, PL_2);
PL_1_percent_variation_idx = find(abs(PL_1 - PL_intersection)/PL_intersection < Variation_percentage);
PL_2_percent_variation_idx = find(abs(PL_2 - PL_intersection)/PL_intersection < Variation_percentage);
WL_1_interval_absceil = WL_list(PL_1_percent_variation_idx);
WL_2_interval_absceil = WL_list(PL_2_percent_variation_idx);
PL_1_interval_absceil = PL_1(PL_1_percent_variation_idx);
PL_2_interval_absceil = PL_2(PL_2_percent_variation_idx);
% Plot variation of Power Loading with Wing Loading and 5% Variation
figure(4);
fig4_comps.fig = gcf;
% Plot the data
fig4_comps.p1 = plot(WL_list, PL_1, 'DisplayName', 'PL_1', 'LineWidth', 1.25);
hold on
fig4_comps.p2 = plot(WL_list, PL_2, 'DisplayName', 'PL_2', 'LineWidth', 1.25);
fig4_comps.p3(1) = xline(min(WL_1_interval_absceil), '--r', 'LineWidth', 1, 'HandleVisibility', 'off');
fig4_comps.p3(2) = xline(max(WL_1_interval_absceil), '--r', 'LineWidth', 1, 'HandleVisibility', 'off');
fig4_comps.p4(1) = xline(min(WL_2_interval_absceil), '--b', 'LineWidth', 1, 'HandleVisibility', 'off');
fig4_comps.p4(2) = xline(max(WL_2_interval_absceil), '--b', 'LineWidth', 1, 'HandleVisibility', 'off');
fig4_comps.p5(1) = yline(min(PL_1_interval_absceil), '--r', 'LineWidth', 1, 'HandleVisibility', 'off');
fig4_comps.p5(2) = yline(max(PL_1_interval_absceil), '--r', 'LineWidth', 1, 'HandleVisibility', 'off');
fig4_comps.p6(1) = yline(min(PL_2_interval_absceil), '--b', 'LineWidth', 1, 'HandleVisibility', 'off');
fig4_comps.p6(2) = yline(max(PL_2_interval_absceil), '--b', 'LineWidth', 1, 'HandleVisibility', 'off');
% Set properties
xlabel('$$Wing Loading \; \frac{W}{S}$$');
ylabel('$$Power Loading \; \frac{P}{W}$$');
legend();
legendX = 0.78; legendY = 0.77; legendWidth = .1; legendHeight = .1;
fig3_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
STANDARDIZE_FIGURE(fig4_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig4_comps, sprintf('%s\\PowerLoading_vs_WingLoading_at_AbsoluteCeiling_5PercentVariation.png', figure_location), 'small');
%==================================================
% BATTERY WEIGHT
C_list = zeros(N_h, N_S);
for i = 1:N_h
h = h_list(i);
rho_h = std_atm.density(h / 1000);
% Get Power Loading
q = (1/2) * rho_h * V_cruise * V_cruise;
[~, ~, ~, ~, ~, Total_energy_required, Battery_weight] = Power_Calculation_func(h, MTOW, S_list, AR, A_prop);
Battery_weight_list(i, :) = Battery_weight;
% C_list(i, :) = Max_range * (q .* S_list .* CD0 + ((MTOW*g)^2 * K)./(q .* S_list)) / (prop_efficiency * battery_Voltage);
end
% Plot figures for variation with Altitude
figure(5);
fig5_comps.fig = gcf;
% Plot the data
hold on
i_list = 0: (N_h / 5): N_h;
i_list(1) = 1;
for i = i_list
fig5_comps.p(i) = plot(WL_list, Battery_weight_list(i, :), 'DisplayName', sprintf('h = %.2f', h_list(i)), 'LineWidth', 1.25);
end
% Set properties
xlabel('$$Wing Loading \; \frac{W}{S}$$');
ylabel('$$Battery Weight$$');
legend();
legendX = 0.74; legendY = 0.77; legendWidth = .1; legendHeight = .1;
fig5_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
STANDARDIZE_FIGURE(fig5_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig5_comps, sprintf('%s\\BatteryWeight_vs_WingLoading_Range_at_different_Altitudes.png', figure_location), 'small');
% Find Maximum of the Minimum Battery Capacity at each Each Altitude. Take 5% variation around that as the Interval for Wing Loading.
Battery_weight_min_list = zeros(N_h, 1);
for i = 1:N_h
Battery_weight_min_list(i) = min(Battery_weight_list(i, :));
end
[max_Battery_weight_min_list, idx_max_Battery_weight_min_list] = max(Battery_weight_min_list);
% Get Power Loading at that Altitude and the Interval of Wing Loading for 5% Variation of Power Loading
h_rangeV = h_list(idx_max_Battery_weight_min_list);
rho_h_rangeV = std_atm.density(h_rangeV / 1000);
% Get Battery weight
[~, ~, ~, ~, ~, Total_energy_required, Battery_weight] = Power_Calculation_func(h_rangeV, MTOW, S_list, AR, A_prop);
Battery_weight_min = min(Battery_weight);
Battery_weight_percent_variation_idx = find(abs(Battery_weight - Battery_weight_min)/Battery_weight_min < Variation_percentage);
WL_interval_rangeV = WL_list(Battery_weight_percent_variation_idx);
Battery_weight_interval_rangeV = Battery_weight(Battery_weight_percent_variation_idx);
% Plot variation of Power Loading with Wing Loading and 5% Variation
figure(6);
fig6_comps.fig = gcf;
% Plot the data
fig6_comps.p1 = plot(WL_list, Battery_weight, 'LineWidth', 1.25);
hold on
fig6_comps.p2 = xline(min(WL_interval_rangeV), '--', 'LineWidth', 1);
fig6_comps.p3 = xline(max(WL_interval_rangeV), '--', 'LineWidth', 1);
fig6_comps.p4 = yline(min(Battery_weight_interval_rangeV), '--', 'LineWidth', 1);
fig6_comps.p5 = yline(max(Battery_weight_interval_rangeV), '--', 'LineWidth', 1);
% Set properties
xlabel('$$Wing Loading \; \frac{W}{S}$$');
ylabel('$$Battery Weight$$');
STANDARDIZE_FIGURE(fig6_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig6_comps, sprintf('%s\\BatteryWeight_vs_WingLoading_Range_5PercentVariation.png', figure_location), 'small');
%==================================================
% COMMON INTERVAL FOR WING LOADING THAT SATISFIES ALL THE CONSTRAINTS
WL_interval_min_list = [min(WL_interval_prescribedV), min(WL_1_interval_absceil), min(WL_2_interval_absceil), min(WL_interval_rangeV)];
WL_interval_max_list = [max(WL_interval_prescribedV), max(WL_1_interval_absceil), max(WL_2_interval_absceil), max(WL_interval_rangeV)];
WL_interval_common_min = max(WL_interval_min_list);
WL_interval_common_max = min(WL_interval_max_list);
WL_interval_common = WL_list((WL_list >= WL_interval_common_min) & (WL_list <= WL_interval_common_max));
S_interval_common_min = (MTOW * g) / WL_interval_common_max;
S_interval_common_max = (MTOW * g) / WL_interval_common_min;
figure(7);
fig7_comps.fig = gcf;
% Plot the data
fig7_comps.p1 = plot(WL_interval_prescribedV, 6 * ones(length(WL_interval_prescribedV), 1), 'DisplayName', 'Prescribed Velocity', 'LineWidth', 1.25);
hold on
fig7_comps.p2 = plot(WL_1_interval_absceil, 5 * ones(length(WL_1_interval_absceil), 1), 'DisplayName', 'Absolute Ceiling I1', 'LineWidth', 1.25);
fig7_comps.p3 = plot(WL_2_interval_absceil, 4 * ones(length(WL_2_interval_absceil), 1), 'DisplayName', 'Absolute Ceiling I2', 'LineWidth', 1.25);
fig7_comps.p4 = plot(WL_interval_rangeV, 3 * ones(length(WL_interval_rangeV), 1), 'DisplayName', 'Battery Weight', 'LineWidth', 1.25);
fig7_comps.p5 = plot(WL_interval_common, 1 * ones(length(WL_interval_common), 1), 'DisplayName', 'Common Interval', 'LineWidth', 1.75);
fig7_comps.p6 = xline(min(WL_interval_common), '--', 'LineWidth', 1, 'HandleVisibility', 'off');
fig7_comps.p7 = xline(max(WL_interval_common), '--', 'LineWidth', 1, 'HandleVisibility', 'off');
x = [WL_interval_common_min, WL_interval_common_max, WL_interval_common_max, WL_interval_common_min];
y = [0, 0, 8, 8];
patch(x, y, PS.Blue1, 'HandleVisibility', 'off', 'FaceAlpha', .3);
ylim([0, 8]);
set(gca, 'YTick', []);
legend('Location', 'northwest');
% Set properties
xlabel('$$Wing Loading \; \frac{W}{S}$$');
STANDARDIZE_FIGURE(fig7_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig7_comps, sprintf('%s\\WingLoading_CommonInterval.png', figure_location), 'small');
%==================================================
% PRINT RESULTS OF THIS SECTION
disp('WING LOADING AND POWER LOADING');
disp('--------------------');
fprintf('Wing Loading Min = %.2f\n', WL_interval_common_min);
fprintf('Wing Loading Max = %.2f\n', WL_interval_common_max);
fprintf('MTOW = %.2f\n', MTOW);
fprintf('Wing Area Min = %.2f\n', S_interval_common_min);
fprintf('Wing Area Max = %.2f\n', S_interval_common_max);
fprintf('\n\n');
%========================================================
% CLOSE ALL FIGURES
close all;
%% DISK LOADING AND POWER LOADING
%==================================================
% FACTORS GOVERNING DISK LOADING
% 1) Take-off
% 2) Descent
% DISK LOADING = (MTOW / VTOL_motor_count) / (A_prop)
% POWER LOADING = (P_prop/W) - defined per propeller
% GOAL: Minimize Power Loading
% NOTE: Take into account the efficiency factors
%==================================================
% SET REQUIRED DATA VALUES
MTOW = W0_SecondEstimate;
N_h = 100;
h_min = 0;
h_max = Max_altitude;
h_list = linspace(h_min, h_max, N_h);
% Get std_atm object
std_atm = standardAtmosphere();
% Get area list
N_Aprop = 1000;
% A_prop from past data is 0.1297
Aprop_min = 0.05;
Aprop_max = .3;
Aprop_list = linspace(S_min, S_max, N_S);
DL_list = (MTOW * g / VTOL_motor_count) ./ Aprop_list;
Weight_per_prop = (MTOW * g) / VTOL_motor_count;
% Find out the power required at different disk loading at varying altitudes
PL_takeoff_list = zeros(N_h, N_Aprop);
PL_descent_list = zeros(N_h, N_Aprop);
for i = 1:N_h
h = h_list(i);
rho_h = std_atm.density(h / 1000);
% Get Power required
% Dummy Wing area - this will not affect power in hover
Wing_area = 0.6;
% Only power required in takeoff and descent are of interest
[~, P_takeoff_1, P_descent_1, ~, ~, ~, ~] = Power_Calculation_func(h, MTOW, Wing_area, AR, Aprop_list);
PL_takeoff_list(i, :) = (P_takeoff_1 / VTOL_motor_count) / (Weight_per_prop);
PL_descent_list(i, :) = (P_descent_1 / VTOL_motor_count) / (Weight_per_prop);
end
% Plot variation of Power required takeoff with Disk Loading at different altitudes
figure(1);
fig1_comps.fig = gcf;
% Plot the data
hold on
i_list = 0: (N_h / 5): N_h;
i_list(1) = 1;
for i = i_list
fig1_comps.p1(i) = plot(DL_list, PL_takeoff_list(i, :), 'DisplayName', sprintf('h = %.2f', h_list(i)), 'LineWidth', 1.25);
end
% Set properties
xlabel('$$Disk Loading \; \frac{W}{S}$$');
ylabel('$$Power Loading (Takeoff)\; \frac{P}{W}$$');
legend();
legendX = 0.75; legendY = 0.77; legendWidth = .1; legendHeight = .1;
fig1_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
STANDARDIZE_FIGURE(fig1_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig1_comps, sprintf('%s\\PowerLoadingTakeoff_vs_DiskLoading_at_different_Altitudes.png', figure_location), 'small');
% Plot variation of Power required Descent with Disk Loading at different altitudes
figure(2);
fig2_comps.fig = gcf;
% Plot the data
hold on
i_list = 0: (N_h / 5): N_h;
i_list(1) = 1;
for i = i_list
fig2_comps.p1(i) = plot(DL_list, PL_descent_list(i, :), 'DisplayName', sprintf('h = %.2f', h_list(i)), 'LineWidth', 1.25);
end
% Set properties
xlabel('$$Disk Loading \; \frac{W}{S}$$');
ylabel('$$Power Loading (Takeoff)\; \frac{P}{W}$$');
legend();
legendX = 0.75; legendY = 0.77; legendWidth = .1; legendHeight = .1;
fig2_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
STANDARDIZE_FIGURE(fig2_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig2_comps, sprintf('%s\\PowerLoadingDescent_vs_DiskLoading_at_different_Altitudes.png', figure_location), 'small');
% Find Maximum of the Minimum Power Loading at each Each Altitude.
PL_takeoff_min_list = zeros(N_h, 1);
PL_descent_min_list = zeros(N_h, 1);
for i = 1:N_h
PL_takeoff_min_list(i) = min(PL_takeoff_list(i, :));
PL_descent_min_list(i) = min(PL_descent_list(i, :));
end
[max_PL_takeoff_min_list, idx_max_PL_takeoff_min_list] = max(PL_takeoff_min_list);
[max_PL_descent_min_list, idx_max_PL_descent_min_list] = max(PL_descent_min_list);
% Plot the variation of power loading with disk loading for take off and descent at this altitude
figure(3);
fig3_comps.fig = gcf;
% Plot the data
fig3_comps.p1 = plot(DL_list, PL_takeoff_list(idx_max_PL_takeoff_min_list, :), 'DisplayName', 'Takeoff', 'LineWidth', 1.25);
hold on
fig3_comps.p2 = plot(DL_list, PL_descent_list(idx_max_PL_descent_min_list, :), 'DisplayName', 'Descent', 'LineWidth', 1.25);
% Set properties
xlabel('$$Disk Loading \; \frac{W}{S}$$');
ylabel('$$Power Loading \; \frac{P}{W}$$');
legend();
legendX = 0.75; legendY = 0.77; legendWidth = .1; legendHeight = .1;
fig2_comps.legendPosition = [legendX, legendY, legendWidth, legendHeight];
STANDARDIZE_FIGURE(fig3_comps);
figure_location = 'Figures';
SAVE_MY_FIGURE(fig3_comps, sprintf('%s\\PowerLoading_vs_DiskLoading_MaxValues.png', figure_location), 'small');
%==================================================
% PRINT RESULTS OF THIS SECTION
disp('DISK LOADING AND POWER LOADING');
disp('--------------------');
fprintf('PL max in takeoff at h = %.2f\n', h_list(idx_max_PL_takeoff_min_list));
fprintf('PL max in descent at h = %.2f\n', h_list(idx_max_PL_descent_min_list));
fprintf('\n\n');
%========================================================
% CLOSE ALL FIGURES
close all;
%% MACH NUMBER AND REYNOLDS NUMBER VARIATION WITH ALTITUDE
%==================================================
% VARIATION OF M AND Re WITH ALTITUDE
std_atm = standardAtmosphere();
N_h = 100;
h_min = 0;
h_max = Max_altitude;
h_list = linspace(h_min, h_max, N_h);
% M = V_cruise / c_h
% Re = ((rho_h * V_cruise * L) / mu_h) - where L is a characteristic length. We choose it to be chord length
rho_h = std_atm.density(h_list / 1000);
T_h = std_atm.temperature(h_list / 1000);
gamma = 1.4;
R = 287.058;
c_h = sqrt(gamma * R * T_h);
mu_h = std_atm.viscosity(h_list / 1000);
% Characteristic Length
L_characteristic = .25;
% Mach Number
M_h = V_cruise ./ c_h;
% Reynolds Number
Re_h = (rho_h * V_cruise * L_characteristic) ./ mu_h;
% Minimum and Maximum Mach No. and Reynolds No.
[M_min, idx_M_min] = min(M_h);
h_M_min = h_list(idx_M_min);
[M_max, idx_M_max] = max(M_h);
h_M_max = h_list(idx_M_max);
[Re_min, idx_Re_min] = min(Re_h);
h_Re_min = h_list(idx_Re_min);
[Re_max, idx_Re_max] = max(Re_h);
h_Re_max = h_list(idx_Re_max);
%==================================================
% PLOT THE VARIATION OF MACH NUMBER AND REYNOLDS NUMBER WITH HEIGHT
% Mach Number
figure(1);
fig1_comps.fig = gcf;
% Plot the data
fig1_comps.p1 = plot(h_list, M_h, 'LineWidth', 1.25);