├── .gitattributes ├── .gitignore ├── _org └── SimTool_org.zip ├── libraries └── stdatmo.zip ├── Aerodynamics ├── libf2c.lib ├── Aerodynamics.m ├── calculate_polar.m ├── calculate_polar_angle.m ├── Polars │ └── old │ │ ├── MH139F-120000.png │ │ ├── MH139F-240000.png │ │ ├── MH139F-30000.png │ │ ├── MH139F-480000.png │ │ ├── MH139F-60000.png │ │ ├── MH139F-960000.png │ │ ├── MH139F-1920000.png │ │ ├── MH139F-2840000.png │ │ ├── MH139F-30000.dat │ │ ├── MH139F-1920000.dat │ │ ├── MH139F-120000.dat │ │ ├── MH139F-960000.dat │ │ ├── MH139F-240000.dat │ │ ├── MH139F-2840000.dat │ │ ├── MH139F-480000.dat │ │ └── MH139F-60000.dat └── Airfoils │ ├── we_0.txt │ ├── we_-15.txt │ ├── we_15.txt │ ├── naca0005_-15.txt │ ├── naca0005_0.dat │ ├── MH139F.dat │ ├── FX7112030.dat │ ├── MH139Fm20.dat │ ├── MH139Fp20.dat │ ├── FX7112030m30.dat │ └── FX7112030p30.dat ├── matlab_functions ├── VAR.m ├── hOptimizer.m ├── aerodynamics │ ├── findAir.m │ ├── stdatmo.m │ ├── PreparePars_OptCruise.m │ ├── CalcPFromPolars.m │ ├── CalcOptimalFlyingSpeedsFromPolars.m │ └── CalcFlightPars_OptCruise.m ├── _old │ ├── DetailedAnalysisForm.fig │ ├── performanceEvaluator_extended.m │ ├── performanceEvaluator_FWpropagation.m │ └── DetailedAnalysisForm.m ├── structure │ ├── StructureDesigner.m │ └── mat_data.m ├── plotScripts │ ├── Plot_BasicSimulationTimePlot_ASJFR81hFlightPaper.m │ ├── Plot_BasicSimulationTimePlot.m │ ├── Plot_AirplaneAnalysis_DifferentPlaces.m │ ├── Plot_AirplaneAnalysis_Standard.m │ ├── Plot_AirplaneDesignEnvironment_ASFinalPaper.m │ ├── Plot_AirplaneAnalysis_FSRPaper.m │ ├── Plot_AirplaneDesign_Standard.m │ ├── Plot_AirplaneDesign_ASFinalPaper_PlotOrderChanged.m │ └── Plot_AirplaneAnalysis_ASFinalPaper_PlotOrderChanged.m ├── solar │ ├── CalculateIncomingSolarPower.m │ └── solar_radiation_on_surface2.m ├── ChargeLimiter.m ├── subplot_tight.m ├── evaluateSolution.m └── initParameters.m ├── readme.md ├── AirplaneAnalysis.m ├── AirplaneDesign.m └── _old └── designSpace_Environment_HTAIL_SolarCell_TradeOff.m /.gitattributes: -------------------------------------------------------------------------------- 1 | *.m diff -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | results/* 2 | *.asv 3 | *.jpg 4 | *.eps 5 | *.png 6 | *.jpg -------------------------------------------------------------------------------- /_org/SimTool_org.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/_org/SimTool_org.zip -------------------------------------------------------------------------------- /libraries/stdatmo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/libraries/stdatmo.zip -------------------------------------------------------------------------------- /Aerodynamics/libf2c.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/libf2c.lib -------------------------------------------------------------------------------- /matlab_functions/VAR.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/matlab_functions/VAR.m -------------------------------------------------------------------------------- /Aerodynamics/Aerodynamics.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/Aerodynamics.m -------------------------------------------------------------------------------- /matlab_functions/hOptimizer.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/matlab_functions/hOptimizer.m -------------------------------------------------------------------------------- /Aerodynamics/calculate_polar.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/calculate_polar.m -------------------------------------------------------------------------------- /Aerodynamics/calculate_polar_angle.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/calculate_polar_angle.m -------------------------------------------------------------------------------- /matlab_functions/aerodynamics/findAir.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/matlab_functions/aerodynamics/findAir.m -------------------------------------------------------------------------------- /matlab_functions/aerodynamics/stdatmo.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/matlab_functions/aerodynamics/stdatmo.m -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-120000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/Polars/old/MH139F-120000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-240000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/Polars/old/MH139F-240000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-30000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/Polars/old/MH139F-30000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-480000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/Polars/old/MH139F-480000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-60000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/Polars/old/MH139F-60000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-960000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/Polars/old/MH139F-960000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-1920000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/Polars/old/MH139F-1920000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-2840000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/Aerodynamics/Polars/old/MH139F-2840000.png -------------------------------------------------------------------------------- /matlab_functions/_old/DetailedAnalysisForm.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/matlab_functions/_old/DetailedAnalysisForm.fig -------------------------------------------------------------------------------- /matlab_functions/structure/StructureDesigner.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/matlab_functions/structure/StructureDesigner.m -------------------------------------------------------------------------------- /matlab_functions/_old/performanceEvaluator_extended.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/matlab_functions/_old/performanceEvaluator_extended.m -------------------------------------------------------------------------------- /matlab_functions/_old/performanceEvaluator_FWpropagation.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/HEAD/matlab_functions/_old/performanceEvaluator_FWpropagation.m -------------------------------------------------------------------------------- /matlab_functions/aerodynamics/PreparePars_OptCruise.m: -------------------------------------------------------------------------------- 1 | function [OptCruisePars]=PreparePars_OptCruise(m,rho,mu,A,c_wing,g,polar) 2 | %Performs a precalculation of important cruise parameters. These are 3 | %constant over rho, thus only have to be recalculated if height chance 4 | %occurs -> computational advantages. 5 | 6 | % For every Re, get the CL required to lift the A/C 7 | v_array=polar.ReList.*mu./rho./c_wing; 8 | CL_array=2*m*g/rho/A./v_array.^2; 9 | 10 | %get respective CD at that CL from polar and calculate power necessary 11 | for i=1:length(polar.ReList) 12 | %CLtest=2*m*g/rho/A/v(i)^2; 13 | if(CL_array(i)>polar.c_L_max(i) || CL_array(i) 0.01 12 | Re = min([rho*A_wing/plane.struct.b*v/mu,plane.polar.ReList(length(plane.polar.ReList))]); 13 | if Re0.01 17 | Re=min([rho*b/AR*v_tmax/mu,polar.ReList(length(polar.ReList))]); 18 | v_tmax_old = v_tmax; 19 | CL = interp1(log(polar.ReList),polar.c_L_cn,log(Re)); 20 | v_tmax = sqrt((m_distr+m_central+m_struct+masses.m_prop)*g/(0.5*rho*b^2/AR*CL)); % logarithmic interp. 21 | delta_v_tmax=(v_tmax-v_tmax_old)/v_tmax; 22 | end 23 | CL = interp1(log(polar.ReList),polar.c_L_gr,log(Re)); 24 | v_rmax=sqrt(2*(m_distr+m_central+m_struct+masses.m_prop)*g/(rho*b^2/AR*CL)); 25 | %refine iteratively 26 | delta_v_rmax=1; 27 | while abs(delta_v_rmax)>0.01 28 | Re=min([rho*b/AR*v_rmax/mu,polar.ReList(length(polar.ReList))]); 29 | v_rmax_old = v_rmax; 30 | CL = interp1(log(polar.ReList),polar.c_L_gr,log(Re)); 31 | v_rmax = sqrt((m_distr+m_central+m_struct+masses.m_prop)*g/(0.5*rho*b^2/AR*CL)); % logarithmic interp. 32 | delta_v_rmax=(v_rmax-v_rmax_old)/v_rmax; 33 | end 34 | end -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Conceptual Design and Analysis Tool for solar-powered UAVs # 2 | 3 | ## Based on ## 4 | - Philipp Oettershagen, Amir Melzer, Thomas Mantel, Konrad Rudin, Thomas Stastny, Bartosz Wawrzacz, Timo Hinzmann, Stefan Leutenegger, Kostas Alexis, Roland Siegwart, _Design of small hand‐launched solar‐powered UAVs: From concept study to a multi‐day world endurance record flight_, Journal of Field Robotics 34 (7), 1352-1377 . http://www.atlantiksolar.ethz.ch/wp-content/downloads/publications/JFR_81hFlight_paper_final.pdf 5 | - Philipp Oettershagen, Amir Melzer, Thomas Mantel, Konrad Rudin, Rainer Lotz, Dieter Siebenmann, Stefan Leutenegger, Kostas Alexis and Roland Siegwart, _A Solar-Powered Hand-Launchable UAV for Low-Altitude Multi-Day Continuous Flight_, International Conference on Robotics and Automation (ICRA) 2015. http://www.atlantiksolar.ethz.ch/wp-content/downloads/publications/AtlantikSolar_ICRA_2015_vFinal.pdf 6 | - Stefan Leutenegger, Mathieu Jabas, Roland Y. Siegwart, _Solar Airplane Conceptual Design and Performance Estimation_, Journal of Intelligent & Robotic Systems (2011), Volume 61, Issue 1, pp 545-561. 7 | - A. Noth, _Design of solar powered airplanes for continuous flight_, PhD thesis, ETH Zurich, 2008. http://www.asl.ethz.ch/research/asl/skysailor/Design_of_Solar_Powered_Airplanes_for_Continuous_Flight 8 | 9 | ## Usage ## 10 | Run 11 | - `AirplaneDesign.m` to design your airplane (design variables are wing span b, aspect ratio AR, and battery mass m_bat) and analyse its performance (in the form of excess time t_exc, charge margin t_cm, endurance t_endurance, and minimum state-of-charge SoC). 12 | - `AirplaneAnalysis.m` to analyse your designed airplane with respect to a) other days of the year or other latitudes or b) meteorological disturbances (clouds or winds) in the form of the clearness and turbulence values. 13 | 14 | -------------------------------------------------------------------------------- /matlab_functions/solar/CalculateIncomingSolarPower.m: -------------------------------------------------------------------------------- 1 | function [ PSolar, irr_vec, etas] = CalculateIncomingSolarPower(t,h,environment,plane,settings,params) 2 | %CALCULATEINCOMINGSOLARPOWER Summary of this function goes here 3 | % Small wrapper function for calculating the absolute incoming solar power from the incoming irradiance and the plane and 4 | % environmental properties 5 | 6 | % Precalcs 7 | c_temp = 1.0 - params.solar.k_temp*(environment.T_ground - (273.15 + 25)); 8 | eta_solar = params.solar.eta_sc * c_temp * params.solar.eta_mppt; 9 | 10 | % Irradiation 11 | irr_vec = solar_radiation_on_surface2(0,0,mod(t+environment.add_solar_timeshift,86400),(environment.dayofyear+floor((t+environment.add_solar_timeshift)/86400)),... 12 | environment.lat,environment.lon, h,environment.albedo); 13 | 14 | % AOI-handling 15 | epsilonAOI = 1.0; 16 | epsilonDiff = 1.0; 17 | if (settings.useAOI) 18 | AOI = irr_vec(7); 19 | epsilonAOI = interp1(params.solar.angle_AOI,params.solar.epsilon_AOI, AOI, 'linear', 0.0); 20 | epsilonDiff = params.solar.epsilon_diff; 21 | end 22 | 23 | % Irradiation levels 24 | % Could also integrate irradiation levels Isolar here 25 | 26 | %P-Solar calculation 27 | PSolar_global = environment.clearness * irr_vec(1) * plane.ExpPerf.solar.surface * eta_solar * params.solar.eta_cbr * epsilonAOI; 28 | if(settings.useDirDiffRad) 29 | PDiffuse = environment.clearness * irr_vec(3) * plane.ExpPerf.solar.surface * eta_solar * epsilonDiff; 30 | PDirect = environment.clearness * irr_vec(2) * plane.ExpPerf.solar.surface * eta_solar * params.solar.eta_cbr * epsilonAOI; 31 | PSolar = PDiffuse + PDirect; 32 | else 33 | PSolar = PSolar_global; 34 | end 35 | 36 | %Re-calculate eta's 37 | etas(1) = PSolar / (environment.clearness * irr_vec(1) * plane.ExpPerf.solar.surface); 38 | etas(2) = epsilonAOI; 39 | 40 | end -------------------------------------------------------------------------------- /matlab_functions/ChargeLimiter.m: -------------------------------------------------------------------------------- 1 | function [ P_bat_limited ] = ChargeLimiter(SoC_current, P_bat, params, plane) 2 | %CHARGELIMITER This function represents a battery-charge-limiter function, 3 | %which can be based either on theoretical (model-based) or experimental 4 | %data. 5 | 6 | if(params.bat.chrg_lim_type == 1) 7 | % Model-based (theoretical) charge limiting curve 8 | 9 | % Max admissible charging power in [W] at any SoC 10 | P_bat_max_overall = params.bat.chrg_lim_Prel1 * params.bat.e_density * plane.bat.m /3600; 11 | 12 | if(SoC_current < params.bat.chrg_lim_SoC1) 13 | P_bat_limited = P_bat; 14 | if(P_bat_limited > P_bat_max_overall) P_bat_limited = P_bat_max_overall; end 15 | elseif(SoC_current >= 1.0) 16 | P_bat_limited = 0; 17 | else 18 | % Use exp.-decreasing (exp(-c*x)) fct., where P_bat_limited=Prel2*P_max at SoC2(=1.0). Find the constant first 19 | c =-log(params.bat.chrg_lim_Prel2); 20 | 21 | P_bat_limited = exp (-c*(SoC_current-params.bat.chrg_lim_SoC1)/(1.0-params.bat.chrg_lim_SoC1))*P_bat_max_overall; 22 | if(P_bat < P_bat_limited) 23 | P_bat_limited = P_bat; 24 | end 25 | end 26 | elseif(params.bat.chrg_lim_type == 2) 27 | % Experimentally-recorded charge limiting curve, measured on AS-P Test Flight Day #23 28 | SoC = [0.99 0.98 0.97 0.96 0.95 0.94 0.93 0.92 0.9 0.89 0.86 0.82 0.78]; 29 | MaxChargingCurrent = [0.6 0.8 1.0 1.5 2.0 3.0 3.5 4.0 5.0 6.0 7.0 8.0 10.0]; 30 | Voltage = [25.36 25.33 25.28 25.24 25.2 25.17 25.15 25.13 25.1 25.08 25.03 25.0 24.9]; 31 | 32 | MaxChargingPower = MaxChargingCurrent .* Voltage; 33 | 34 | if(SoC_current < min(SoC)) 35 | P_bat_limited = P_bat; 36 | elseif(SoC_current >= 1.0) 37 | P_bat_limited = 0; 38 | elseif(SoC_current > max(SoC)) 39 | P_bat_limited = MaxChargingPower(1); 40 | else 41 | P_bat_limited = interp1(SoC, MaxChargingPower, SoC_current); 42 | if(P_bat < P_bat_limited) 43 | P_bat_limited = P_bat; 44 | end 45 | end 46 | else 47 | % Don't use charge limiting at all 48 | P_bat_limited = P_bat; 49 | end 50 | end 51 | 52 | -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/we_0.txt: -------------------------------------------------------------------------------- 1 | WE3.55/9.3 , 116 2 | 1 0 3 | 0.99849 0.00118 4 | 0.99404 0.00292 5 | 0.98485 0.00553 6 | 0.97357 0.00845 7 | 0.9631 0.01107 8 | 0.9527 0.01362 9 | 0.94107 0.01642 10 | 0.92812 0.01942 11 | 0.91404 0.02248 12 | 0.89889 0.02561 13 | 0.88268 0.02882 14 | 0.86547 0.03211 15 | 0.84732 0.03544 16 | 0.8283 0.03879 17 | 0.80845 0.04213 18 | 0.78784 0.04545 19 | 0.76653 0.04873 20 | 0.74458 0.05196 21 | 0.72205 0.05511 22 | 0.69901 0.05814 23 | 0.67551 0.06102 24 | 0.65162 0.06375 25 | 0.6274 0.06634 26 | 0.60292 0.06876 27 | 0.57824 0.07097 28 | 0.55342 0.07295 29 | 0.52852 0.0747 30 | 0.50361 0.0762 31 | 0.47875 0.07744 32 | 0.45399 0.07841 33 | 0.4294 0.0791 34 | 0.40503 0.07951 35 | 0.38094 0.07965 36 | 0.35719 0.0795 37 | 0.33383 0.07905 38 | 0.31091 0.07829 39 | 0.28849 0.07723 40 | 0.26662 0.07588 41 | 0.24534 0.07425 42 | 0.22471 0.07235 43 | 0.20477 0.07017 44 | 0.18555 0.06773 45 | 0.1671 0.06505 46 | 0.14947 0.06213 47 | 0.13268 0.05899 48 | 0.11678 0.05565 49 | 0.10179 0.05211 50 | 0.08774 0.04841 51 | 0.07466 0.04456 52 | 0.06258 0.04059 53 | 0.05152 0.03652 54 | 0.04149 0.03236 55 | 0.03252 0.02815 56 | 0.02461 0.02391 57 | 0.01777 0.01968 58 | 0.01203 0.01556 59 | 0.0074 0.01159 60 | 0.00382 0.00758 61 | 0.00128 0.00349 62 | 0 0 63 | 0.00023 -0.0023 64 | 0.00199 -0.00403 65 | 0.00526 -0.00589 66 | 0.0099 -0.00784 67 | 0.01579 -0.00969 68 | 0.02291 -0.01139 69 | 0.03126 -0.01294 70 | 0.04083 -0.01433 71 | 0.05158 -0.01555 72 | 0.06351 -0.01659 73 | 0.0766 -0.01743 74 | 0.09078 -0.01808 75 | 0.10601 -0.01855 76 | 0.12243 -0.01882 77 | 0.14004 -0.01887 78 | 0.15821 -0.01882 79 | 0.17646 -0.01876 80 | 0.19566 -0.01856 81 | 0.21688 -0.01807 82 | 0.24069 -0.01734 83 | 0.26703 -0.01645 84 | 0.29392 -0.01543 85 | 0.31951 -0.0143 86 | 0.34442 -0.0131 87 | 0.3696 -0.01186 88 | 0.39491 -0.01065 89 | 0.42006 -0.00951 90 | 0.44541 -0.00831 91 | 0.47145 -0.00692 92 | 0.49864 -0.00547 93 | 0.52714 -0.0041 94 | 0.55596 -0.00274 95 | 0.58396 -0.00132 96 | 0.61055 0.0001 97 | 0.63554 0.00141 98 | 0.65968 0.00253 99 | 0.68373 0.00343 100 | 0.70744 0.00418 101 | 0.73038 0.00486 102 | 0.75248 0.00547 103 | 0.77381 0.006 104 | 0.79479 0.00636 105 | 0.81568 0.00649 106 | 0.83573 0.00645 107 | 0.85435 0.0063 108 | 0.87258 0.00611 109 | 0.89135 0.00591 110 | 0.90943 0.00562 111 | 0.92542 0.00515 112 | 0.93945 0.00456 113 | 0.95208 0.00392 114 | 0.96402 0.00323 115 | 0.97565 0.00249 116 | 0.98586 0.0017 117 | 0.99366 0.00086 118 | 1 0 119 | -------------------------------------------------------------------------------- /matlab_functions/subplot_tight.m: -------------------------------------------------------------------------------- 1 | function h=subplot_tight(m,n,p,margins,varargin) 2 | %function subplot_tight(m,n,p,margins,varargin) 3 | % 4 | % Functional purpose: A wrapper function for Matlab function subplot. Adds the ability to define the margins between 5 | % neighbouring subplots. Unfotrtunately Matlab subplot function lacks this functionality, and the margins between 6 | % subplots can reach 40% of figure area, which is pretty lavish. 7 | % 8 | % Input arguments (defaults exist): 9 | % margins- two elements vector [vertical,horizontal] defining the margins between neighbouring axes. Default value 10 | % is 0.01. Note this vale will cause titles legends and labels to collide with the subplots, while presenting 11 | % relatively large axis. 12 | % 13 | % Output arguments: same as subplot- none, or axes handle according to function call. 14 | % 15 | % Issues & Comments: Note that if additional elements are used in order to be passed to subplot, margins parameter must 16 | % be defined. For default margins value use empty element- []. 17 | % 18 | % Author and Date: Nikolay S. 29/03/2011. 19 | % Last update: Nikolay S. 21/04/2011 (accourding to Alan B comment). 20 | % 21 | % Usage example: h=subplot_tight((2,3,1:2,[0.5,0.2]) 22 | 23 | if (nargin<4) || isempty(margins) 24 | %Warning: Default margins edited by PhilippOe to give sufficient space 25 | margins=[0.01,0.04]; % default margins value- 1% of figure 26 | end 27 | 28 | if length(margins)==1 29 | margins(2)=margins; 30 | end 31 | 32 | %note n and m are switched as Matlab indexing is column-wise, while subplot indexing is row-wise :( 33 | [subplot_col,subplot_row]=ind2sub([n,m],p); 34 | 35 | 36 | height=(1-(m+1)*margins(1))/m; % single subplot height 37 | width=(1-(n+1)*margins(2))/n; % single subplot width 38 | 39 | % note subplot suppors vector p inputs- so a merged subplot of higher dimentions will be created 40 | subplot_cols=1+max(subplot_col)-min(subplot_col); % number of column elements in merged subplot 41 | subplot_rows=1+max(subplot_row)-min(subplot_row); % number of row elements in merged subplot 42 | 43 | merged_height=subplot_rows*( height+margins(1) )- margins(1); % merged subplot height 44 | merged_width= subplot_cols*( width +margins(2) )- margins(2); % merged subplot width 45 | 46 | merged_bottom=(m-max(subplot_row))*(height+margins(1)) +margins(1); % merged subplot bottom position 47 | merged_left=min(subplot_col)*(width+margins(2))-width; % merged subplot left position 48 | pos_vec=[merged_left merged_bottom merged_width merged_height]; 49 | 50 | % h_subplot=subplot(m,n,p,varargin{:},'Position',pos_vec); 51 | % Above line doesn't work as subplot tends to ignore 'position' when same mnp is utilized 52 | h_subplot=subplot('Position',pos_vec,varargin{:}); 53 | 54 | if nargout~=0 55 | h=h_subplot; 56 | end -------------------------------------------------------------------------------- /matlab_functions/plotScripts/Plot_BasicSimulationTimePlot.m: -------------------------------------------------------------------------------- 1 | function [] = Plot_BasicSimulationTimePlot(flightdata,environment,params, plane) 2 | % Basic plot of flight data vs. time 3 | % Plot_BasicSimulationTimePlot(...) plots the flightdata (altitude, batters 4 | % state, all power input and output components) over time. 5 | 6 | time = flightdata.t_array ./3600; 7 | 8 | str=strcat('24h flight overview',' b=',num2str(flightdata.b),' AR=',num2str(flightdata.AR),' mbat=',num2str(flightdata.m_bat));%: DayOfYear=',num2str(environment.dayofyear),' CLR=',num2str(environment.clearness),' Turb=',num2str(environment.turbulence),' b=',num2str(plane.struct.b),' AR=',num2str(plane.struct.AR),' mbat=',num2str(plane.bat.m)); 9 | figurehandle = figure('Name',str); 10 | 11 | plotmargins.horiz = 0.05; 12 | plotmargins.vert = 0.018; 13 | plotmargins.vert_last = 0.05; 14 | 15 | % Altitude 16 | ax(1)=subplot_tight(5,1,1,[plotmargins.vert plotmargins.horiz]); 17 | dh_array=zeros(size(flightdata.h_array)); 18 | dh_array(1)=0; 19 | for i=2:size(flightdata.h_array,2) 20 | dh_array(i)=flightdata.h_array(i)-flightdata.h_array(i-1); 21 | end 22 | plot(time, flightdata.h_array); 23 | legend('h'); 24 | ylabel('Altitude above MSL [m]'); 25 | 26 | %Angles & Sun 27 | ax(end+1)=subplot_tight(5,1,2,[plotmargins.vert plotmargins.horiz]); 28 | plot(time, flightdata.irr_array(3,:) * 180 / pi()); 29 | ylabel('Angles'); 30 | legend('Sun incidence angle [°]'); 31 | 32 | % Battery state 33 | subplot_tight(5,1,3,[plotmargins.vert plotmargins.horiz]); 34 | E_bat_max = flightdata.m_bat * params.bat.e_density; 35 | [ax(end+1:end+2),~,~] = plotyy(time, flightdata.bat_array/E_bat_max, time, flightdata.bat_array/3600); 36 | ylabel('Battery Charge State'); 37 | legend('Battery SoC[%]','Battery Energy [Wh]'); 38 | 39 | %Power in- and output 40 | ax(end+1)=subplot_tight(5,1,4,[plotmargins.vert plotmargins.horiz]); 41 | plot(time, flightdata.P_solar_array,... 42 | time, flightdata.P_elec_tot_array,... 43 | time, flightdata.P_prop_array,... 44 | time, ones(1,numel(flightdata.t_array))*plane.avionics.power,... 45 | time, flightdata.P_charge_array,... 46 | time, ones(1,numel(flightdata.t_array))*plane.payload.power); 47 | ylabel('Power [W] or [W/m^2]'); 48 | legend('P_{Solar}[W]','P_{electot}[W]','P_{prop}[W]','P_{avionics}[W]','P_{battery}[W]','P_{payload}[W]'); 49 | 50 | %Angles & Sun 51 | ax(end+1)=subplot_tight(5,1,5,[plotmargins.vert_last plotmargins.horiz]); 52 | plot(time, [flightdata.eta_array(1,:) ; flightdata.eta_array(2,:)]); 53 | ylabel('Efficiency'); 54 | legend('\eta_{sm}','\epsilon_{AOI}'); 55 | 56 | xlabel('Time of Day [h]'); 57 | 58 | for i=numel(ax)-1:-1:1 59 | set(ax(i),'XTickLabel',''); 60 | end 61 | %dcm_obj = datacursormode(figurehandle); 62 | %set(dcm_obj,'UpdateFcn',{@PlotPrecisionCallback}); 63 | linkaxes(ax,'x'); 64 | end 65 | 66 | -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/we_-15.txt: -------------------------------------------------------------------------------- 1 | WE3.55/9.3 , 116 2 | 0.99891174 0.06410315 3 | 0.99714778 0.06485212 4 | 0.99239907 0.06538109 5 | 0.98284669 0.06552361 6 | 0.97119530 0.06542463 7 | 0.96040395 0.06524552 8 | 0.94969833 0.06501692 9 | 0.93773992 0.06471144 10 | 0.92445472 0.06425751 11 | 0.91006250 0.06356907 12 | 0.89461862 0.06267131 13 | 0.87813016 0.06157648 14 | 0.86065506 0.06030010 15 | 0.84226164 0.05881907 16 | 0.82302268 0.05713218 17 | 0.80298460 0.05522081 18 | 0.78221759 0.05309343 19 | 0.76078478 0.05074623 20 | 0.74458000 0.05196000 21 | 0.72205000 0.05511000 22 | 0.69901000 0.05814000 23 | 0.67551000 0.06102000 24 | 0.65162000 0.06375000 25 | 0.62740000 0.06634000 26 | 0.60292000 0.06876000 27 | 0.57824000 0.07097000 28 | 0.55342000 0.07295000 29 | 0.52852000 0.07470000 30 | 0.50361000 0.07620000 31 | 0.47875000 0.07744000 32 | 0.45399000 0.07841000 33 | 0.42940000 0.07910000 34 | 0.40503000 0.07951000 35 | 0.38094000 0.07965000 36 | 0.35719000 0.07950000 37 | 0.33383000 0.07905000 38 | 0.31091000 0.07829000 39 | 0.28849000 0.07723000 40 | 0.26662000 0.07588000 41 | 0.24534000 0.07425000 42 | 0.22471000 0.07235000 43 | 0.20477000 0.07017000 44 | 0.18555000 0.06773000 45 | 0.16710000 0.06505000 46 | 0.14947000 0.06213000 47 | 0.13268000 0.05899000 48 | 0.11678000 0.05565000 49 | 0.10179000 0.05211000 50 | 0.08774000 0.04841000 51 | 0.07466000 0.04456000 52 | 0.06258000 0.04059000 53 | 0.05152000 0.03652000 54 | 0.04149000 0.03236000 55 | 0.03252000 0.02815000 56 | 0.02461000 0.02391000 57 | 0.01777000 0.01968000 58 | 0.01203000 0.01556000 59 | 0.00740000 0.01159000 60 | 0.00382000 0.00758000 61 | 0.00128000 0.00349000 62 | 0.00000000 0.00000000 63 | 0.00023000 -0.00230000 64 | 0.00199000 -0.00403000 65 | 0.00526000 -0.00589000 66 | 0.00990000 -0.00784000 67 | 0.01579000 -0.00969000 68 | 0.02291000 -0.01139000 69 | 0.03126000 -0.01294000 70 | 0.04083000 -0.01433000 71 | 0.05158000 -0.01555000 72 | 0.06351000 -0.01659000 73 | 0.07660000 -0.01743000 74 | 0.09078000 -0.01808000 75 | 0.10601000 -0.01855000 76 | 0.12243000 -0.01882000 77 | 0.14004000 -0.01887000 78 | 0.15821000 -0.01882000 79 | 0.17646000 -0.01876000 80 | 0.19566000 -0.01856000 81 | 0.21688000 -0.01807000 82 | 0.24069000 -0.01734000 83 | 0.26703000 -0.01645000 84 | 0.29392000 -0.01543000 85 | 0.31951000 -0.01430000 86 | 0.34442000 -0.01310000 87 | 0.36960000 -0.01186000 88 | 0.39491000 -0.01065000 89 | 0.42006000 -0.00951000 90 | 0.44541000 -0.00831000 91 | 0.47145000 -0.00692000 92 | 0.49864000 -0.00547000 93 | 0.52714000 -0.00410000 94 | 0.55596000 -0.00274000 95 | 0.58396000 -0.00132000 96 | 0.61055000 0.00010000 97 | 0.63554000 0.00141000 98 | 0.65968000 0.00253000 99 | 0.68373000 0.00343000 100 | 0.70744000 0.00418000 101 | 0.73038000 0.00486000 102 | 0.75248000 0.00547000 103 | 0.77887606 0.01135642 104 | 0.79904801 0.01713418 105 | 0.81919255 0.02266648 106 | 0.83856972 0.02781716 107 | 0.85659408 0.03249149 108 | 0.87425209 0.03702623 109 | 0.89243428 0.04169108 110 | 0.90997327 0.04609041 111 | 0.92554007 0.04977494 112 | 0.93924472 0.05283628 113 | 0.95161000 0.05548697 114 | 0.96332174 0.05791078 115 | 0.97474699 0.06020606 116 | 0.98481356 0.06208552 117 | 0.99256518 0.06329293 118 | 0.99891174 0.06410315 119 | 120 | -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/we_15.txt: -------------------------------------------------------------------------------- 1 | WE3.55/9.3 , 116 2 | 0.98446006 -0.06220055 3 | 0.98330692 -0.06066994 4 | 0.97945890 -0.05783748 5 | 0.97125756 -0.05293787 6 | 0.96111767 -0.04719789 7 | 0.95168253 -0.04195733 8 | 0.94229689 -0.03680250 9 | 0.93178786 -0.03108784 10 | 0.92005558 -0.02483836 11 | 0.90724733 -0.01823845 12 | 0.89342366 -0.01129399 13 | 0.87859681 -0.00399791 14 | 0.86282474 0.00363426 15 | 0.84615506 0.01154836 16 | 0.82865019 0.01970695 17 | 0.81034102 0.02807070 18 | 0.79129257 0.03661183 19 | 0.77155761 0.04529550 20 | 0.74458000 0.05196000 21 | 0.72205000 0.05511000 22 | 0.69901000 0.05814000 23 | 0.67551000 0.06102000 24 | 0.65162000 0.06375000 25 | 0.62740000 0.06634000 26 | 0.60292000 0.06876000 27 | 0.57824000 0.07097000 28 | 0.55342000 0.07295000 29 | 0.52852000 0.07470000 30 | 0.50361000 0.07620000 31 | 0.47875000 0.07744000 32 | 0.45399000 0.07841000 33 | 0.42940000 0.07910000 34 | 0.40503000 0.07951000 35 | 0.38094000 0.07965000 36 | 0.35719000 0.07950000 37 | 0.33383000 0.07905000 38 | 0.31091000 0.07829000 39 | 0.28849000 0.07723000 40 | 0.26662000 0.07588000 41 | 0.24534000 0.07425000 42 | 0.22471000 0.07235000 43 | 0.20477000 0.07017000 44 | 0.18555000 0.06773000 45 | 0.16710000 0.06505000 46 | 0.14947000 0.06213000 47 | 0.13268000 0.05899000 48 | 0.11678000 0.05565000 49 | 0.10179000 0.05211000 50 | 0.08774000 0.04841000 51 | 0.07466000 0.04456000 52 | 0.06258000 0.04059000 53 | 0.05152000 0.03652000 54 | 0.04149000 0.03236000 55 | 0.03252000 0.02815000 56 | 0.02461000 0.02391000 57 | 0.01777000 0.01968000 58 | 0.01203000 0.01556000 59 | 0.00740000 0.01159000 60 | 0.00382000 0.00758000 61 | 0.00128000 0.00349000 62 | 0.00000000 0.00000000 63 | 0.00023000 -0.00230000 64 | 0.00199000 -0.00403000 65 | 0.00526000 -0.00589000 66 | 0.00990000 -0.00784000 67 | 0.01579000 -0.00969000 68 | 0.02291000 -0.01139000 69 | 0.03126000 -0.01294000 70 | 0.04083000 -0.01433000 71 | 0.05158000 -0.01555000 72 | 0.06351000 -0.01659000 73 | 0.07660000 -0.01743000 74 | 0.09078000 -0.01808000 75 | 0.10601000 -0.01855000 76 | 0.12243000 -0.01882000 77 | 0.14004000 -0.01887000 78 | 0.15821000 -0.01882000 79 | 0.17646000 -0.01876000 80 | 0.19566000 -0.01856000 81 | 0.21688000 -0.01807000 82 | 0.24069000 -0.01734000 83 | 0.26703000 -0.01645000 84 | 0.29392000 -0.01543000 85 | 0.31951000 -0.01430000 86 | 0.34442000 -0.01310000 87 | 0.36960000 -0.01186000 88 | 0.39491000 -0.01065000 89 | 0.42006000 -0.00951000 90 | 0.44541000 -0.00831000 91 | 0.47145000 -0.00692000 92 | 0.49864000 -0.00547000 93 | 0.52714000 -0.00410000 94 | 0.55596000 -0.00274000 95 | 0.58396000 -0.00132000 96 | 0.61055000 0.00010000 97 | 0.63554000 0.00141000 98 | 0.65968000 0.00253000 99 | 0.68373000 0.00343000 100 | 0.70744000 0.00418000 101 | 0.73038000 0.00486000 102 | 0.75248000 0.00547000 103 | 0.76753022 0.00213729 104 | 0.78788851 -0.00294500 105 | 0.80810035 -0.00822616 106 | 0.82745681 -0.01345412 107 | 0.84540353 -0.01841822 108 | 0.86296318 -0.02332002 109 | 0.88104184 -0.02837124 110 | 0.89843073 -0.03333080 111 | 0.91375423 -0.03792331 112 | 0.92715347 -0.04212443 113 | 0.93918747 -0.04601151 114 | 0.95054204 -0.04976830 115 | 0.96158423 -0.05349315 116 | 0.97124187 -0.05689877 117 | 0.97855868 -0.05972894 118 | 0.98446006 -0.06220055 119 | 120 | -------------------------------------------------------------------------------- /matlab_functions/evaluateSolution.m: -------------------------------------------------------------------------------- 1 | % ************************************************************************* 2 | % evaluateSolution.m 3 | % ************************************************************************* 4 | % Descr.: Performs the actual (structural) design of an airplane as a fct. 5 | % of its wing span, aspect ratio and battery mass. Then evaluates this 6 | % configuration and returns the evaluated performance results 7 | % Authors: S. Leutenegger (2009), P. Oettershagen (2015) 8 | % ************************************************************************* 9 | 10 | function [PerfResults,DesignResults,flightdata] ... 11 | = evaluateSolution(plane,environment,params,settings) 12 | 13 | % Input processing 14 | % ================ 15 | 16 | % set the masses of the various components 17 | % ======================================== 18 | 19 | % Solar module 20 | DesignResults.m_solar = plane.struct.b^2/plane.struct.AR*params.solar.rWngCvrg*... 21 | (params.solar.k_sc+params.solar.k_enc); 22 | 23 | % MPPT 24 | I_max = 1000; %[W/m^2] 25 | DesignResults.m_mppt = params.solar.k_mppt*I_max*plane.struct.b^2/plane.struct.AR ... 26 | *params.solar.eta_sc*params.solar.eta_cbr; 27 | 28 | % total point mass 29 | DesignResults.m_central = DesignResults.m_mppt + plane.payload.mass+plane.avionics.mass... 30 | +(1-params.bat.distr)*plane.bat.m; 31 | 32 | % total distributed mass 33 | DesignResults.m_distr = DesignResults.m_solar + plane.bat.m * params.bat.distr; 34 | 35 | % Automatic Preliminary Design (S. Leutenegger / M. Jabas) 36 | % ======================================================== 37 | if(params.structure.shell==1) 38 | [DesignResults.m_struct,masses,thicknesses,velocities,plane.polar]=StructureDesigner(plane.struct.b,... 39 | plane.struct.AR, DesignResults.m_central,DesignResults.m_distr,params.propulsion.number,environment.usemars,params.structure.corr_fact); 40 | else 41 | [DesignResults.m_struct,masses,thicknesses,velocities,plane.polar]=StructureDesignerRibWing(plane.struct.b,... 42 | plane.struct.AR, DesignResults.m_central,DesignResults.m_distr,params.prop.number,environment.usemars,params.structure.corr_fact); 43 | end 44 | %Save structural masses to DesignResults (array) for later use 45 | DesignResults.m_prop = masses.m_prop; 46 | DesignResults.m_bat = plane.bat.m; 47 | DesignResults.m_no_bat = DesignResults.m_distr + DesignResults.m_central + DesignResults.m_struct + DesignResults.m_prop - plane.bat.m; 48 | plane.m_no_bat = DesignResults.m_no_bat; 49 | 50 | 51 | % Now simulate the course of a day 52 | % ================================ 53 | 54 | % Calculate the "Performance" in terms of endurance/range(speed) or 55 | % excess time, if continuous flight is possible 56 | 57 | if (settings.evaluation.findalt~=1) 58 | [PerfResults,flightdata] = performanceEvaluator(params, plane, environment, settings); 59 | elseif (settings.evaluation.findalt == 1) 60 | PerfResults.t_excess=0; 61 | hL = 0; %min 62 | hU = 30000; % max 63 | environment.h_max = hU; 64 | h = hL:(hU-hL)/60.0:hU; 65 | 66 | for i = 1:numel(h) 67 | environment.h_0 = h(i); 68 | [PerfResults, flightdata] = performanceEvaluator(params, plane, environment, settings); 69 | if (isnan(PerfResults.t_excess) || PerfResults.t_excess<=0) 70 | break; 71 | else 72 | PerfResults.h_max = environment.h_0; 73 | end 74 | end 75 | end -------------------------------------------------------------------------------- /matlab_functions/plotScripts/Plot_AirplaneAnalysis_DifferentPlaces.m: -------------------------------------------------------------------------------- 1 | function Plot_AnalysisSpace_DifferentPlaces() 2 | %************************************************************************** 3 | %*** PLOTTING 4 | %************************************************************************** 5 | 6 | today=now; 7 | doy = today - datenum(2015,1,1) + 1 8 | 9 | % PLOT1: T_EXCESS 10 | figure('Name','tExc') 11 | for k=1:numel(powers) 12 | subplot(numel(powers),1,k); 13 | for i=1:numel(lat) 14 | plot(days, squeeze(res.t_excess(i,k,:)),'LineWidth',2); 15 | hold all 16 | str{i}=strcat(place{i}, '@(h_0=', num2str(h_0(i)), 'm/m_{bat}=',num2str(plane.bat.m),'kg), P_{prop, level}=',num2str(powers(k)),'W'); 17 | end 18 | legend(str{1:end}); 19 | 20 | ylim([0 max(max(res.t_excess(:,k,:)))+0.5]); 21 | t_exc_lim=0.15*plane.bat.m*plane.bat.e_density/(plane.P_prop_level+plane.P_avi); 22 | line([min(days) max(days)],[t_exc_lim t_exc_lim],'Color','red'); 23 | text((min(days)+max(days))/2,t_exc_lim-0.03,'Critical excess time','FontSize',12,'Color','red') 24 | xlabel('day of year [-]'); 25 | ylabel('Modified excess time [h]'); 26 | 27 | line([173 173],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 28 | text(173,0.5,' June 21st','FontSize',12) 29 | line([204 204],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 30 | text(204,0.5,' July 21st','FontSize',12) 31 | line([234 234],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 32 | text(234,0.5,' August 21st','FontSize',12) 33 | line([265 265],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 34 | text(265,0.5,' Sept. 21st','FontSize',12) 35 | %line([doy doy],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color',[1 0.5 0.5]); 36 | %text(doy,0.5,' TODAY','FontSize',12) 37 | end 38 | 39 | % PLOT2: MINIMUM STATE OF CHARGE 40 | figure('Name','SoC') 41 | for k=1:numel(powers) 42 | subplot(numel(powers),1,k); 43 | for i=1:numel(lat) 44 | plot(days, squeeze(minSoC(i,k,:)),'LineWidth',2); 45 | hold all 46 | str{i}=strcat(place{i}, '@(h_0=', num2str(h_0(i)), 'm/m_{bat}=',num2str(plane.bat.m),'kg), P_{prop, level}=',num2str(powers(k)),'W'); 47 | end 48 | legend(str{1:end}); 49 | 50 | ylim([0 max(max(minSoC(:,k,:)))+0.1]); 51 | line([min(days) max(days)],[0.10 0.10],'Color','red'); 52 | text((min(days)+max(days))/2,0.10-0.02,'Critical SoC','FontSize',12,'Color','red') 53 | xlabel('day of year [-]'); 54 | ylabel('Minimum State of Charge [%]'); 55 | 56 | line([173 173],[0 max(max(minSoC(:,k,:)))+0.5],'LineStyle','--','Color','black'); 57 | text(173,0.3,' June 21st','FontSize',12) 58 | line([204 204],[0 max(max(minSoC(:,k,:)))+0.5],'LineStyle','--','Color','black'); 59 | text(204,0.3,' July 21st','FontSize',12) 60 | line([234 234],[0 max(max(minSoC(:,k,:)))+0.5],'LineStyle','--','Color','black'); 61 | text(234,0.3,' August 21st','FontSize',12) 62 | line([265 265],[0 max(max(minSoC(:,k,:)))+0.5],'LineStyle','--','Color','black'); 63 | text(265,0.3,' Sept. 21st','FontSize',12) 64 | %line([doy doy],[0 max(max(minSoC(:,k,:)))+0.5],'LineStyle','--','Color',[1 0.5 0.5]); 65 | %text(doy,0.3,' TODAY','FontSize',12) 66 | end 67 | end -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/naca0005_-15.txt: -------------------------------------------------------------------------------- 1 | NACA 0005-60 2 | 0.98783552 0.09239840 3 | 0.98734152 0.09229677 4 | 0.98586056 0.09199198 5 | 0.98339569 0.09148433 6 | 0.97995203 0.09077431 7 | 0.97553671 0.08986266 8 | 0.97015883 0.08875029 9 | 0.96382954 0.08743840 10 | 0.95656189 0.08592841 11 | 0.94837089 0.08422202 12 | 0.93927340 0.08232123 13 | 0.92928819 0.08022832 14 | 0.91843576 0.07794592 15 | 0.90673842 0.07547697 16 | 0.89422018 0.07282478 17 | 0.88090670 0.06999299 18 | 0.86682524 0.06698559 19 | 0.85200463 0.06380699 20 | 0.83647514 0.06046187 21 | 0.82026852 0.05695532 22 | 0.80341783 0.05329273 23 | 0.78595748 0.04947979 24 | 0.76792304 0.04552253 25 | 0.74935132 0.04142723 26 | 0.73028017 0.03720037 27 | 0.71074847 0.03284872 28 | 0.69079607 0.02837915 29 | 0.67046364 0.02379876 30 | 0.64979271 0.01911470 31 | 0.63301842 0.01751449 32 | 0.61126047 0.01830330 33 | 0.58927845 0.01906765 34 | 0.56711663 0.01980336 35 | 0.54481965 0.02050620 36 | 0.52243242 0.02117184 37 | 0.50000000 0.02179594 38 | 0.47756758 0.02237412 39 | 0.45518035 0.02290203 40 | 0.43288337 0.02337538 41 | 0.41072155 0.02378996 42 | 0.38873953 0.02414171 43 | 0.36698158 0.02442674 44 | 0.34549150 0.02464142 45 | 0.32431259 0.02478238 46 | 0.30348748 0.02484661 47 | 0.28305813 0.02483145 48 | 0.26306567 0.02473468 49 | 0.24355036 0.02455451 50 | 0.22455151 0.02428967 51 | 0.20610737 0.02393935 52 | 0.18825510 0.02350330 53 | 0.17103064 0.02298179 54 | 0.15446868 0.02237559 55 | 0.13860257 0.02168601 56 | 0.12346427 0.02091482 57 | 0.10908426 0.02006425 58 | 0.09549150 0.01913692 59 | 0.08271337 0.01813583 60 | 0.07077560 0.01706425 61 | 0.05970223 0.01592570 62 | 0.04951557 0.01472384 63 | 0.04023611 0.01346245 64 | 0.03188256 0.01214527 65 | 0.02447174 0.01077603 66 | 0.01801857 0.00935829 67 | 0.01253604 0.00789542 68 | 0.00803521 0.00639051 69 | 0.00452512 0.00484633 70 | 0.00201285 0.00326527 71 | 0.00050347 0.00164932 72 | 0.00000000 0.00000000 73 | 0.00050347 -0.00164932 74 | 0.00201285 -0.00326527 75 | 0.00452512 -0.00484633 76 | 0.00803521 -0.00639051 77 | 0.01253604 -0.00789542 78 | 0.01801857 -0.00935829 79 | 0.02447174 -0.01077603 80 | 0.03188256 -0.01214527 81 | 0.04023611 -0.01346245 82 | 0.04951557 -0.01472384 83 | 0.05970223 -0.01592570 84 | 0.07077560 -0.01706425 85 | 0.08271337 -0.01813583 86 | 0.09549150 -0.01913692 87 | 0.10908426 -0.02006425 88 | 0.12346427 -0.02091482 89 | 0.13860257 -0.02168601 90 | 0.15446868 -0.02237559 91 | 0.17103064 -0.02298179 92 | 0.18825510 -0.02350330 93 | 0.20610737 -0.02393935 94 | 0.22455151 -0.02428966 95 | 0.24355036 -0.02455451 96 | 0.26306567 -0.02473468 97 | 0.28305813 -0.02483145 98 | 0.30348748 -0.02484661 99 | 0.32431259 -0.02478238 100 | 0.34549150 -0.02464142 101 | 0.36698158 -0.02442674 102 | 0.38873953 -0.02414171 103 | 0.41072155 -0.02378996 104 | 0.43288337 -0.02337538 105 | 0.45518035 -0.02290203 106 | 0.47756758 -0.02237412 107 | 0.50000000 -0.02179594 108 | 0.52243242 -0.02117184 109 | 0.54481965 -0.02050620 110 | 0.56711663 -0.01980336 111 | 0.58927845 -0.01906765 112 | 0.61126047 -0.01830330 113 | 0.63301842 -0.01751449 114 | 0.65844001 -0.01315746 115 | 0.67868359 -0.00687851 116 | 0.69858218 -0.00067903 117 | 0.71809625 0.00542641 118 | 0.73718703 0.01142362 119 | 0.75581656 0.01729863 120 | 0.77394779 0.02303785 121 | 0.79154470 0.02862798 122 | 0.80857228 0.03405606 123 | 0.82499670 0.03930950 124 | 0.84078532 0.04437606 125 | 0.85590681 0.04924384 126 | 0.87033114 0.05390139 127 | 0.88402974 0.05833764 128 | 0.89697545 0.06254198 129 | 0.90914266 0.06650424 130 | 0.92050732 0.07021473 131 | 0.93104700 0.07366433 132 | 0.94074090 0.07684443 133 | 0.94956996 0.07974704 134 | 0.95751677 0.08236476 135 | 0.96456573 0.08469090 136 | 0.97070300 0.08671941 137 | 0.97591656 0.08844501 138 | 0.98019618 0.08986315 139 | 0.98353348 0.09097009 140 | 0.98592195 0.09176289 141 | 0.98735689 0.09223941 142 | 0.98783552 0.09239840 143 | 144 | -------------------------------------------------------------------------------- /matlab_functions/plotScripts/Plot_AirplaneAnalysis_Standard.m: -------------------------------------------------------------------------------- 1 | function Plot_AirplaneAnalysis_Standard(results, vars) 2 | %************************************************************************** 3 | %*** PLOTTING 4 | %************************************************************************** 5 | % Note: This plot code will automatically plot a) multiple contour plots if 6 | % 3 variables are specified by the user, b) one contour plot for two 7 | % variables, and c) simple 1D-plots for only one specified variable. 8 | today = now; 9 | doy = today - datenum(2015,1,1) + 1; 10 | 11 | for i = 1:numel(vars(3).values) 12 | 13 | %Convert first 14 | for k = 1:numel(vars(2).values) 15 | for j = 1:numel(vars(1).values) 16 | temp_t_exc(k,j) = results(i,k,j).t_excess; 17 | temp_min_SoC(k,j) = results(i,k,j).min_SoC; 18 | temp_chargemargin(k,j) = results(i,k,j).t_chargemargin; 19 | temp_endurance(k,j) = results(i,k,j).t_endurance; 20 | end 21 | end 22 | 23 | str = strcat(vars(3).shortname, '=', num2str(vars(3).values(i))); 24 | figure('Name',str); 25 | 26 | % PLOT1: T_EXCESS 27 | subplot(2,2,1); 28 | if(numel(vars(2).values)>1) 29 | contourf(vars(1).values,vars(2).values,temp_t_exc,[0.01:0.05:min(max(max(max(temp_t_exc))),24.0)],'Linestyle','none'); 30 | hold on 31 | contour(vars(1).values,vars(2).values,temp_t_exc,'LevelStep',1.0,'LineColor',[0 0 0],'ShowText','on'); 32 | ylabel(vars(2).name); 33 | colormap('jet'); 34 | %colormap(flipud(colormap(hot))); %Set an inverted version of the "hot" colormap 35 | caxis([0.5,min(max(max(max(temp_t_exc))),24.0)]) 36 | colorbar 37 | else 38 | plot(vars(1).values,temp_t_exc); 39 | end 40 | title('t_{excess}'); 41 | xlabel(vars(1).name); 42 | 43 | % PLOT1: MIN_SOC 44 | subplot(2,2,2); 45 | if(numel(vars(2).values)>1) 46 | contourf(vars(1).values,vars(2).values,temp_min_SoC,[0.01:0.01:max(max(max(temp_min_SoC)))],'Linestyle','none'); 47 | hold on 48 | contour(vars(1).values,vars(2).values,temp_min_SoC,'LevelStep',0.1,'LineColor',[0 0 0],'ShowText','on'); 49 | ylabel(vars(2).name); 50 | colormap('jet'); 51 | colorbar 52 | else 53 | plot(vars(1).values,temp_min_SoC); 54 | end 55 | title('SoC_{min}'); 56 | xlabel(vars(1).name); 57 | 58 | % PLOT1: CHARGE MARGIN 59 | subplot(2,2,3); 60 | if(numel(vars(2).values)>1) 61 | contourf(vars(1).values,vars(2).values,temp_chargemargin,[0.01:0.05:min(max(max(max(temp_chargemargin))),24.0)],'Linestyle','none'); 62 | hold on 63 | contour(vars(1).values,vars(2).values,temp_chargemargin,'LevelStep',1.0,'LineColor',[0 0 0],'ShowText','on'); 64 | ylabel(vars(2).name); 65 | colormap('jet'); 66 | colorbar 67 | else 68 | plot(vars(1).values,temp_chargemargin); 69 | end 70 | title('t_{chargemargin}'); 71 | xlabel(vars(1).name); 72 | 73 | % PLOT1: ENDURANCE 74 | subplot(2,2,4); 75 | if(numel(vars(2).values)>1) 76 | contourf(vars(1).values,vars(2).values,temp_endurance,[0.01:0.5:max(0.51,max(max(max(temp_endurance))))],'Linestyle','none'); 77 | hold on 78 | contour(vars(1).values,vars(2).values,temp_endurance,'LevelStep',1.0,'LineColor',[0 0 0],'ShowText','on'); 79 | ylabel(vars(2).name); 80 | colormap('jet'); 81 | colorbar 82 | else 83 | plot(vars(1).values,temp_endurance); 84 | end 85 | title('t_{endurance}'); 86 | xlabel(vars(1).name); 87 | end 88 | end 89 | 90 | -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/naca0005_0.dat: -------------------------------------------------------------------------------- 1 | NACA 0005-60 2 | 1.00000000 0.00000000 3 | 0.99949653 0.00002969 4 | 0.99798715 0.00011859 5 | 0.99547488 0.00026619 6 | 0.99196479 0.00047165 7 | 0.98746396 0.00073383 8 | 0.98198143 0.00105126 9 | 0.97552826 0.00142221 10 | 0.96811744 0.00184468 11 | 0.95976389 0.00231642 12 | 0.95048443 0.00283500 13 | 0.94029777 0.00339777 14 | 0.92922440 0.00400196 15 | 0.91728663 0.00464463 16 | 0.90450850 0.00532277 17 | 0.89091574 0.00603325 18 | 0.87653573 0.00677288 19 | 0.86139743 0.00753844 20 | 0.84553132 0.00832663 21 | 0.82896936 0.00913415 22 | 0.81174490 0.00995763 23 | 0.79389263 0.01079369 24 | 0.77544849 0.01163893 25 | 0.75644964 0.01248988 26 | 0.73693433 0.01334303 27 | 0.71694187 0.01419483 28 | 0.69651252 0.01504162 29 | 0.67568741 0.01587972 30 | 0.65450850 0.01670530 31 | 0.63301842 0.01751449 32 | 0.61126047 0.01830330 33 | 0.58927845 0.01906765 34 | 0.56711663 0.01980336 35 | 0.54481965 0.02050620 36 | 0.52243242 0.02117184 37 | 0.50000000 0.02179594 38 | 0.47756758 0.02237412 39 | 0.45518035 0.02290203 40 | 0.43288337 0.02337538 41 | 0.41072155 0.02378996 42 | 0.38873953 0.02414171 43 | 0.36698158 0.02442674 44 | 0.34549150 0.02464142 45 | 0.32431259 0.02478238 46 | 0.30348748 0.02484661 47 | 0.28305813 0.02483145 48 | 0.26306567 0.02473468 49 | 0.24355036 0.02455451 50 | 0.22455151 0.02428967 51 | 0.20610737 0.02393935 52 | 0.18825510 0.02350330 53 | 0.17103064 0.02298179 54 | 0.15446868 0.02237559 55 | 0.13860257 0.02168601 56 | 0.12346427 0.02091482 57 | 0.10908426 0.02006425 58 | 0.09549150 0.01913692 59 | 0.08271337 0.01813583 60 | 0.07077560 0.01706425 61 | 0.05970223 0.01592570 62 | 0.04951557 0.01472384 63 | 0.04023611 0.01346245 64 | 0.03188256 0.01214527 65 | 0.02447174 0.01077603 66 | 0.01801857 0.00935829 67 | 0.01253604 0.00789542 68 | 0.00803521 0.00639051 69 | 0.00452512 0.00484633 70 | 0.00201285 0.00326527 71 | 0.00050347 0.00164932 72 | 0.00000000 0.00000000 73 | 0.00050347 -0.00164932 74 | 0.00201285 -0.00326527 75 | 0.00452512 -0.00484633 76 | 0.00803521 -0.00639051 77 | 0.01253604 -0.00789542 78 | 0.01801857 -0.00935829 79 | 0.02447174 -0.01077603 80 | 0.03188256 -0.01214527 81 | 0.04023611 -0.01346245 82 | 0.04951557 -0.01472384 83 | 0.05970223 -0.01592570 84 | 0.07077560 -0.01706425 85 | 0.08271337 -0.01813583 86 | 0.09549150 -0.01913692 87 | 0.10908426 -0.02006425 88 | 0.12346427 -0.02091482 89 | 0.13860257 -0.02168601 90 | 0.15446868 -0.02237559 91 | 0.17103064 -0.02298179 92 | 0.18825510 -0.02350330 93 | 0.20610737 -0.02393935 94 | 0.22455151 -0.02428966 95 | 0.24355036 -0.02455451 96 | 0.26306567 -0.02473468 97 | 0.28305813 -0.02483145 98 | 0.30348748 -0.02484661 99 | 0.32431259 -0.02478238 100 | 0.34549150 -0.02464142 101 | 0.36698158 -0.02442674 102 | 0.38873953 -0.02414171 103 | 0.41072155 -0.02378996 104 | 0.43288337 -0.02337538 105 | 0.45518035 -0.02290203 106 | 0.47756758 -0.02237412 107 | 0.50000000 -0.02179594 108 | 0.52243242 -0.02117184 109 | 0.54481965 -0.02050620 110 | 0.56711663 -0.01980336 111 | 0.58927845 -0.01906765 112 | 0.61126047 -0.01830330 113 | 0.63301842 -0.01751449 114 | 0.65450850 -0.01670530 115 | 0.67568741 -0.01587972 116 | 0.69651252 -0.01504162 117 | 0.71694187 -0.01419483 118 | 0.73693433 -0.01334303 119 | 0.75644964 -0.01248988 120 | 0.77544849 -0.01163893 121 | 0.79389263 -0.01079369 122 | 0.81174490 -0.00995763 123 | 0.82896936 -0.00913415 124 | 0.84553132 -0.00832663 125 | 0.86139743 -0.00753844 126 | 0.87653573 -0.00677288 127 | 0.89091574 -0.00603325 128 | 0.90450850 -0.00532277 129 | 0.91728663 -0.00464463 130 | 0.92922440 -0.00400196 131 | 0.94029777 -0.00339777 132 | 0.95048443 -0.00283500 133 | 0.95976389 -0.00231642 134 | 0.96811744 -0.00184468 135 | 0.97552826 -0.00142221 136 | 0.98198143 -0.00105126 137 | 0.98746396 -0.00073383 138 | 0.99196479 -0.00047165 139 | 0.99547488 -0.00026619 140 | 0.99798715 -0.00011859 141 | 0.99949653 -0.00002969 142 | 1.00000000 0.00000000 143 | 144 | -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/MH139F.dat: -------------------------------------------------------------------------------- 1 | MH 139F-0 2 | 0.99991827 0.00088256 3 | 0.99239612 0.00372417 4 | 0.98156535 0.00691616 5 | 0.97059460 0.00959046 6 | 0.95957466 0.01205572 7 | 0.94853628 0.01443719 8 | 0.93748854 0.01677492 9 | 0.92643480 0.01908410 10 | 0.91537940 0.02138534 11 | 0.90432443 0.02368861 12 | 0.89326857 0.02598764 13 | 0.88220902 0.02826881 14 | 0.87114419 0.03052428 15 | 0.86007493 0.03275788 16 | 0.84899982 0.03496231 17 | 0.83791622 0.03712359 18 | 0.82682490 0.03924495 19 | 0.81572749 0.04133424 20 | 0.80462328 0.04338702 21 | 0.79351176 0.04539990 22 | 0.78239401 0.04737813 23 | 0.77127065 0.04932421 24 | 0.76014125 0.05123683 25 | 0.74900790 0.05312119 26 | 0.73786937 0.05499303 27 | 0.72674267 0.05687245 28 | 0.72000000 0.05803274 29 | 0.71558714 0.05879211 30 | 0.70456078 0.06073576 31 | 0.69020760 0.06329651 32 | 0.66935928 0.06690547 33 | 0.64355338 0.07108051 34 | 0.61581231 0.07512173 35 | 0.58740137 0.07880793 36 | 0.55883764 0.08206024 37 | 0.53006340 0.08488644 38 | 0.50123643 0.08733758 39 | 0.47245118 0.08934950 40 | 0.44373367 0.09092234 41 | 0.41502894 0.09203455 42 | 0.38639368 0.09266886 43 | 0.35782287 0.09282508 44 | 0.32933849 0.09247330 45 | 0.30100774 0.09159539 46 | 0.27286158 0.09017246 47 | 0.24498189 0.08816427 48 | 0.21751153 0.08553008 49 | 0.19058666 0.08221354 50 | 0.16432978 0.07813746 51 | 0.13888591 0.07322849 52 | 0.11445833 0.06743957 53 | 0.09138306 0.06078041 54 | 0.07025512 0.05340018 55 | 0.05195427 0.04570434 56 | 0.03725333 0.03828816 57 | 0.02615023 0.03156807 58 | 0.01798908 0.02563645 59 | 0.01200709 0.02038662 60 | 0.00761477 0.01567061 61 | 0.00441337 0.01137293 62 | 0.00216352 0.00739939 63 | 0.00072642 0.00369208 64 | 0.00003409 0.00023073 65 | 0.00008807 -0.00302417 66 | 0.00115976 -0.00624116 67 | 0.00350412 -0.00909020 68 | 0.00694098 -0.01147141 69 | 0.01137268 -0.01357069 70 | 0.01700203 -0.01550975 71 | 0.02430623 -0.01735812 72 | 0.03413767 -0.01918157 73 | 0.04783529 -0.02102630 74 | 0.06673654 -0.02281758 75 | 0.09059551 -0.02430222 76 | 0.11758053 -0.02529532 77 | 0.14610326 -0.02584887 78 | 0.17532475 -0.02606096 79 | 0.20488466 -0.02600007 80 | 0.23461316 -0.02570678 81 | 0.26440235 -0.02520738 82 | 0.29421282 -0.02451659 83 | 0.32400889 -0.02362421 84 | 0.35372912 -0.02252543 85 | 0.38349605 -0.02119682 86 | 0.41349344 -0.01965946 87 | 0.44369834 -0.01801663 88 | 0.47405359 -0.01630271 89 | 0.50438236 -0.01455974 90 | 0.53464892 -0.01282857 91 | 0.56472804 -0.01108889 92 | 0.59461297 -0.00950939 93 | 0.62429556 -0.00807239 94 | 0.65295448 -0.00687224 95 | 0.67823259 -0.00592599 96 | 0.69714806 -0.00528184 97 | 0.70967055 -0.00483484 98 | 0.72078924 -0.00438006 99 | 0.73211349 -0.00384362 100 | 0.74337826 -0.00324842 101 | 0.75465675 -0.00262843 102 | 0.76593234 -0.00202853 103 | 0.77721124 -0.00147271 104 | 0.78849189 -0.00095981 105 | 0.79977435 -0.00048663 106 | 0.81105891 -0.00006692 107 | 0.82234582 0.00028408 108 | 0.83363455 0.00057068 109 | 0.84492451 0.00080378 110 | 0.85621549 0.00097996 111 | 0.86750726 0.00109615 112 | 0.87879940 0.00116768 113 | 0.89009170 0.00120539 114 | 0.90138406 0.00119857 115 | 0.91267626 0.00113855 116 | 0.92396805 0.00102504 117 | 0.93525910 0.00085362 118 | 0.94654906 0.00062090 119 | 0.95783739 0.00031949 120 | 0.96912357 -0.00005384 121 | 0.98040833 -0.00046804 122 | 0.99169424 -0.00087171 123 | 0.99974397 -0.00111748 124 | -------------------------------------------------------------------------------- /matlab_functions/plotScripts/Plot_AirplaneDesignEnvironment_ASFinalPaper.m: -------------------------------------------------------------------------------- 1 | function Plot_DesignSpaceEnvironment_ASFinalPaper 2 | %Plotting 3 | 4 | n=0; 5 | 6 | figure 7 | texc_reduced(:,:)=t_excess(:,1,:); 8 | [c2,hc2]=contourf(clearness_array,turbulence_array+1,texc_reduced(:,:),... 9 | 200,'Linestyle','none','ShowText','off'); 10 | colormap(hot); %Set an inverted version of the "hot" colormap 11 | cmap = colormap; 12 | cmap = flipud(cmap); 13 | colormap(cmap); 14 | xlabel('P_{in}/P_{in,nom} [-]'); 15 | ylabel('P_{out}/P_{out,nom} [-]'); 16 | caxis([0,9]); 17 | set(gca,'DataAspectRatio',[0.8 1 1]); 18 | set(gcf, 'Color', 'w'); 19 | set(gcf, 'Position', [0 0 300 300]); 20 | cbar_handle=colorbar; 21 | xbounds = xlim; 22 | set(gca,'XTick',fliplr(xbounds(2):-0.1:xbounds(1))); 23 | ybounds = ylim; 24 | set(gca,'YTick',ybounds(1):0.1:ybounds(2)); 25 | set(get(cbar_handle,'ylabel'),'string','t_{exc} [h]') 26 | if(environment.month==6) 27 | export_fig 5a_texc.eps 28 | else 29 | export_fig 5c_texc.eps 30 | end 31 | 32 | figure 33 | texc_reduced(:,:)=t_excess(:,2,:); 34 | [c2,hc2]=contourf(clearness_array,turbulence_array+1,texc_reduced(:,:),... 35 | 200,'Linestyle','none','ShowText','off'); 36 | colormap(hot); %Set an inverted version of the "hot" colormap 37 | cmap = colormap; 38 | cmap = flipud(cmap); 39 | colormap(cmap); 40 | xlabel('P_{in}/P_{in,nom} [-]'); 41 | ylabel('P_{out}/P_{out,nom} [-]'); 42 | caxis([0,9]); 43 | set(gca,'DataAspectRatio',[0.8 1 1]); 44 | set(gcf, 'Color', 'w'); 45 | set(gcf, 'Position', [100 100 300 300]); 46 | cbar_handle=colorbar; 47 | set(get(cbar_handle,'ylabel'),'string','t_{exc} [h]') 48 | xbounds = xlim; 49 | ybounds = ylim; 50 | set(gca,'YTick',ybounds(1):0.1:ybounds(2)); 51 | set(gca,'XTick',fliplr(xbounds(2):-0.1:xbounds(1))); 52 | if(environment.month==6) 53 | export_fig 5b_texc.eps 54 | else 55 | export_fig 5d_texc.eps 56 | end 57 | 58 | % for m_bat=m_bat_min:m_bat_step:m_bat_max 59 | % if(length(clearness_array)<2 ||length(turbulence_array)<2) continue; end 60 | % 61 | % n=n+1; 62 | % 63 | % subplot_tight(2,1,n,[0.08 0.1]) 64 | % texc_reduced(:,:)=t_excess(:,n,:); 65 | % [c2,hc2]=contourf(clearness_array,turbulence_array+1,texc_reduced(:,:),... 66 | % 200,'Linestyle','none','ShowText','off'); 67 | % colormap(hot); %Set an inverted version of the "hot" colormap 68 | % cmap = colormap; 69 | % cmap = flipud(cmap); 70 | % colormap(cmap); 71 | % ylabel('P_{out}/P_{out,nom} [-]') 72 | % xlabel('P_{in}/P_{in,nom} [-]'); 73 | % %title(['Excess Time [h] (m_{bat}=' num2str(m_bat) 'kg)']); 74 | % %caxis([-15,15]) 75 | % caxis([0,max(max(max( t_excess(:,:,:))))]) 76 | % cbar_handle=colorbar 77 | % set(get(cbar_handle,'ylabel'),'string','t_{exc} [h]') 78 | % 79 | % % nc = get(hc2,'Children'); 80 | % % temp = 100; 81 | % % select_i=zeros(length(nc),1); 82 | % % for i = 1:length(nc) 83 | % % ud1 = get(nc(i),'UserData'); 84 | % % if (abs(ud1) < temp) 85 | % % temp = abs(ud1); 86 | % % end 87 | % % end 88 | % % filler=1; 89 | % % for i = 1:length(nc) 90 | % % ud1 = get(nc(i),'UserData'); 91 | % % if (abs(ud1) == temp) 92 | % % select_i(filler)=i; 93 | % % filler=filler+1; 94 | % % end 95 | % % end 96 | % % j=1; 97 | % % if i>0 98 | % % while(select_i(j)~=0) 99 | % % set(nc(select_i(j)),'Linestyle','-'); 100 | % % set(nc(select_i(j)),'LineWidth',2); 101 | % % j=j+1; 102 | % % end 103 | % % end 104 | % 105 | % 106 | % end 107 | end -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/FX7112030.dat: -------------------------------------------------------------------------------- 1 | FX 71-L-120/30 2 | 1.000000 0.000000 3 | 0.993212 0.000476 4 | 0.980807 0.001348 5 | 0.965749 0.002337 6 | 0.948812 0.003479 7 | 0.930913 0.004785 8 | 0.912504 0.006222 9 | 0.893820 0.007746 10 | 0.875003 0.009326 11 | 0.856178 0.010927 12 | 0.837509 0.012496 13 | 0.819120 0.014128 14 | 0.800992 0.015826 15 | 0.783625 0.017594 16 | 0.766711 0.019735 17 | 0.749257 0.022299 18 | 0.731221 0.024933 19 | 0.712835 0.027591 20 | 0.694255 0.030335 21 | 0.675672 0.033052 22 | 0.657193 0.035681 23 | 0.638771 0.038195 24 | 0.620392 0.040628 25 | 0.602311 0.042909 26 | 0.584260 0.044957 27 | 0.565823 0.046905 28 | 0.547272 0.048861 29 | 0.528965 0.050725 30 | 0.510843 0.052400 31 | 0.492706 0.053913 32 | 0.474615 0.055284 33 | 0.456618 0.056473 34 | 0.438609 0.057476 35 | 0.420554 0.058307 36 | 0.402436 0.058980 37 | 0.384358 0.059512 38 | 0.366410 0.059855 39 | 0.348413 0.059991 40 | 0.330339 0.059971 41 | 0.312327 0.059791 42 | 0.294354 0.059416 43 | 0.276311 0.058860 44 | 0.258325 0.058164 45 | 0.240500 0.057269 46 | 0.222614 0.056161 47 | 0.204830 0.054912 48 | 0.187271 0.053446 49 | 0.169754 0.051745 50 | 0.152439 0.049871 51 | 0.135466 0.047743 52 | 0.118700 0.045376 53 | 0.102621 0.042846 54 | 0.087235 0.040012 55 | 0.072890 0.037108 56 | 0.060163 0.034152 57 | 0.049137 0.031235 58 | 0.039944 0.028518 59 | 0.032385 0.025938 60 | 0.026136 0.023572 61 | 0.020972 0.021409 62 | 0.016688 0.019303 63 | 0.013074 0.017239 64 | 0.009974 0.015271 65 | 0.007314 0.013377 66 | 0.005083 0.011465 67 | 0.003287 0.009468 68 | 0.001918 0.007384 69 | 0.000944 0.005252 70 | 0.000328 0.003119 71 | 0.000035 0.001021 72 | 0.000035 -0.001021 73 | 0.000328 -0.003118 74 | 0.000944 -0.005252 75 | 0.001918 -0.007384 76 | 0.003287 -0.009468 77 | 0.005083 -0.011465 78 | 0.007314 -0.013377 79 | 0.009974 -0.015271 80 | 0.013074 -0.017238 81 | 0.016688 -0.019303 82 | 0.020973 -0.021408 83 | 0.026136 -0.023572 84 | 0.032386 -0.025938 85 | 0.039945 -0.028518 86 | 0.049138 -0.031234 87 | 0.060164 -0.034151 88 | 0.072892 -0.037108 89 | 0.087237 -0.040012 90 | 0.102623 -0.042845 91 | 0.118702 -0.045376 92 | 0.135468 -0.047742 93 | 0.152441 -0.049870 94 | 0.169756 -0.051744 95 | 0.187274 -0.053445 96 | 0.204832 -0.054912 97 | 0.222617 -0.056161 98 | 0.240502 -0.057269 99 | 0.258328 -0.058164 100 | 0.276313 -0.058860 101 | 0.294356 -0.059416 102 | 0.312330 -0.059791 103 | 0.330341 -0.059971 104 | 0.348415 -0.059991 105 | 0.366412 -0.059855 106 | 0.384360 -0.059512 107 | 0.402438 -0.058980 108 | 0.420555 -0.058307 109 | 0.438611 -0.057476 110 | 0.456619 -0.056473 111 | 0.474616 -0.055284 112 | 0.492707 -0.053913 113 | 0.510845 -0.052401 114 | 0.528966 -0.050725 115 | 0.547273 -0.048861 116 | 0.565824 -0.046905 117 | 0.584261 -0.044957 118 | 0.602312 -0.042909 119 | 0.620393 -0.040628 120 | 0.638772 -0.038194 121 | 0.657195 -0.035681 122 | 0.675674 -0.033051 123 | 0.694256 -0.030335 124 | 0.712837 -0.027590 125 | 0.731224 -0.024933 126 | 0.749260 -0.022298 127 | 0.766713 -0.019735 128 | 0.783626 -0.017594 129 | 0.800992 -0.015825 130 | 0.819121 -0.014128 131 | 0.837510 -0.012495 132 | 0.856179 -0.010927 133 | 0.875004 -0.009326 134 | 0.893821 -0.007745 135 | 0.912505 -0.006222 136 | 0.930914 -0.004785 137 | 0.948813 -0.003479 138 | 0.965749 -0.002337 139 | 0.980807 -0.001348 140 | 0.993212 -0.000477 141 | 1.000000 0.000000 142 | -------------------------------------------------------------------------------- /matlab_functions/structure/mat_data.m: -------------------------------------------------------------------------------- 1 | %written by M. Jabas 08/2009 (approx.) 2 | %this database contains the material properties of the 3 | %selected materials and calculates the Q-matrix of the desired 4 | %material 5 | %input: laminatdescription: alph, mat_name, fibrevolume pfi_f 6 | 7 | function[Q_lam_t,Q_lam_c,T,rho,zul_t,zul_c,th_skin] = mat_data(angle) 8 | phi_f=0.35; 9 | %density 10 | rho_f_cfk = 1750; %carbon fibre density 11 | rho_f_gfk = 2550; %glas fiber density 12 | rho_m = 1140; %matrix density 13 | rho_mylar = 1390; %mylar density 14 | th_skin = 12e-6; 15 | rho(1:2) = rho_f_cfk * phi_f + (1-phi_f)* rho_m; 16 | rho(3:4) = rho_f_gfk * phi_f + (1-phi_f)* rho_m; 17 | rho(5) =30; 18 | rho(6) = rho_mylar; 19 | %material properties for tension 20 | %stiffnes for phi_f = 0.35 21 | phi_f_old = 0.35; 22 | %[MPA] cfk-gew cfk-ud gfk-gew gfk-ud core1(conticellCC31) MylarADS 23 | % from paper 48(gauge) 12mu_m 24 | E1t_o = 1e6.* [35853; 73257; 16850; 31435; 15.5; 4894;]; 25 | E2t_o = 1e6.* [35853; 9744; 16850; 8949; 15.5; 4894;]; 26 | v12_o = [0.08; 0.25; 0.12; 0.26; 0.22; 0;]; 27 | G12_o = 1e6.* [1294; 1570; 1678; 1299; 3.7; 4894/2;]; 28 | 29 | %strength patameters 30 | sigma_1_t_zul_o = 1e6.* [376; 914; 291; 554; 0.24; 103;]; 31 | sigma_2_t_zul_o = 1e6.* [376; 115; 291; 30; 0.24; 103;]; 32 | tau_12_zul_o = 1e6.* [63; 67; 48; 46; 1.17; NaN;]; 33 | 34 | 35 | %change in fibrevolume: 36 | E1t = phi_f/phi_f_old.* E1t_o(1:4); 37 | E2t = phi_f/phi_f_old.* E2t_o(1:4); 38 | G12 = phi_f/phi_f_old.* G12_o(1:4); 39 | v12 = v12_o; 40 | sigma_1_t_zul = phi_f/phi_f_old.* sigma_1_t_zul_o(1:4); 41 | sigma_2_t_zul = phi_f/phi_f_old.* sigma_2_t_zul_o(1:4); 42 | tau_12_zul = phi_f/phi_f_old.* tau_12_zul_o(1:4); 43 | 44 | 45 | zul_t = [sigma_1_t_zul sigma_2_t_zul tau_12_zul;... 46 | sigma_1_t_zul_o(5) sigma_2_t_zul_o(5) tau_12_zul_o(5);... 47 | sigma_1_t_zul_o(6) sigma_2_t_zul_o(6) tau_12_zul_o(6)]; 48 | 49 | 50 | for j=1:1:length(E1t) 51 | 52 | %calculation of Q-matrix in cordinate system of the material 53 | 54 | Q_lam_t(:,:,j) = [E1t(j)/(1-v12(j)^2) v12(j)*E2t(j)/(1-v12(j)^2) 0;... 55 | v12(j)*E2t(j)/(1-v12(j)^2) E2t(j)/(1-v12(j)^2) 0; 0 0 G12(j);]; 56 | 57 | %Q-matrix in global cordinatesystem 58 | %Q_glob_t1 = T.*Q_lam_t1.*T'; 59 | 60 | end 61 | 62 | Q_lam_t(:,:,5) = [E1t_o(5) 0 0;... 63 | 0 E2t_o(5) 0; 0 0 G12_o(5);]; 64 | Q_lam_t(:,:,6) = [E1t_o(6) 0 0;... 65 | 0 E2t_o(6) 0; 0 0 G12_o(6);]; 66 | 67 | %=============================================== 68 | %=============================================== 69 | %material properties for compression 70 | %stiffnes for phi_f = 0.35 71 | phi_f_old = 0.35; 72 | % cfk-gew cdk-ud gfk-gew gfk-ud core1 MylarADS 73 | E1c_o = 1e6.* [34683; 79265; 16976; 24235; 15.5; 4894;]; 74 | E2c_o = 1e6.* [34683; 5271; 16976; 8526; 15.5; 4894;]; 75 | v12 = [0.08; 0.25; 0.12; 0.26; 0.22; NaN;]; 76 | G12_o = 1e6.* [1294; 1570; 1678; 1299; 3.7; NaN;]; 77 | 78 | %strenth patameters 79 | sigma_1_c_zul_o = 1e6.* [263; 368; 224; 337; 0.24; 103;]; 80 | sigma_2_c_zul_o = 1e6.* [263; 128; 224; 120; 0.24; 103;]; 81 | tau_12_zul_o = 1e6.* [63; 67; 48; 46; 1.17; NaN;]; 82 | 83 | 84 | 85 | 86 | 87 | %change in fibrevolume: 88 | E1c = phi_f/phi_f_old.* E1c_o(1:4); 89 | E2c = phi_f/phi_f_old.* E2c_o(1:4); 90 | G12 = phi_f/phi_f_old.* G12_o(1:4); 91 | v12 = v12; 92 | sigma_1_c_zul = phi_f/phi_f_old.* sigma_1_c_zul_o(1:4); 93 | sigma_2_c_zul = phi_f/phi_f_old.* sigma_2_c_zul_o(1:4); 94 | tau_12_zul = phi_f/phi_f_old.* tau_12_zul_o(1:4); 95 | 96 | zul_c = [sigma_1_c_zul sigma_2_c_zul tau_12_zul;... 97 | sigma_1_c_zul_o(5) sigma_2_c_zul_o(5) tau_12_zul_o(5);... 98 | sigma_1_c_zul_o(6) sigma_2_c_zul_o(6) tau_12_zul_o(6)]; 99 | 100 | 101 | 102 | for j=1:1:length(E1c) 103 | 104 | %calculation of Q-matrix in cordinatesystem of the material 105 | Q_lam_c(:,:,j) = [E1c(j)/(1-v12(j)^2) v12(j)*E2c(j)/(1-v12(j)^2) 0;... 106 | v12(j)*E2c(j)/(1-v12(j)^2) E2c(j)/(1-v12(j)^2) 0; 0 0 G12(j);]; 107 | 108 | 109 | 110 | %Q-matrix in global cordinatesystem 111 | %Q_glob_c1 = T.*Q_lam_c1.*T'; 112 | 113 | end 114 | 115 | Q_lam_c(:,:,5) = [E1c_o(5) 0 0;... 116 | 0 E2t_o(5) 0; 0 0 G12_o(5);]; 117 | Q_lam_c(:,:,6) = [E1c_o(6) 0 0;... 118 | 0 E2c_o(6) 0; 0 0 G12_o(6);]; 119 | 120 | T = [cos(angle)^2 sin(angle)^2 -2*sin(angle)*cos(angle);... 121 | sin(angle)^2 cos(angle)^2 2*sin(angle)*cos(angle);... 122 | sin(angle)*cos(angle) -sin(angle)*cos(angle) cos(angle)^2-sin(angle)^2;]; 123 | -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/MH139Fm20.dat: -------------------------------------------------------------------------------- 1 | MH 139F-0 m20 2 | 0.981529131860182 0.103407424810787 3 | 0.973488735153262 0.103504937937822 4 | 0.962219415629538 0.102800085878717 5 | 0.950995618340756 0.101560888367094 6 | 0.939797093462717 0.100108433539173 7 | 0.928609898520560 0.098570935015113 8 | 0.917428868016542 0.096989133027278 9 | 0.906251964031892 0.095378450694260 10 | 0.895076215797428 0.093759739448394 11 | 0.883900177329901 0.092143082847211 12 | 0.872724752701349 0.090522137551388 13 | 0.861551969086786 0.088883147291029 14 | 0.850383013812869 0.087218201063958 15 | 0.839217375681176 0.085531188610037 16 | 0.828056217075232 0.083814764504528 17 | 0.816901838648123 0.082054888911416 18 | 0.805753859238102 0.080254860393376 19 | 0.794611125686017 0.078422613030314 20 | 0.783474489379544 0.076553731752692 21 | 0.772344630523732 0.074644856572254 22 | 0.761220768380858 0.072701290257012 23 | 0.750102630509990 0.070725594091008 24 | 0.738990260889688 0.068716390008247 25 | 0.727883844972784 0.066679279232456 26 | 0.716776843540298 0.064628631840711 27 | 0.705678366158831 0.062589153417327 28 | 0.690207600000000 0.063296510000000 29 | 0.669359280000000 0.066905470000000 30 | 0.643553380000000 0.071080510000000 31 | 0.615812310000000 0.075121730000000 32 | 0.587401370000000 0.078807930000000 33 | 0.558837640000000 0.082060240000000 34 | 0.530063400000000 0.084886440000000 35 | 0.501236430000000 0.087337580000000 36 | 0.472451180000000 0.089349500000000 37 | 0.443733670000000 0.090922340000000 38 | 0.415028940000000 0.092034550000000 39 | 0.386393680000000 0.092668860000000 40 | 0.357822870000000 0.092825080000000 41 | 0.329338490000000 0.092473300000000 42 | 0.301007740000000 0.091595390000000 43 | 0.272861580000000 0.090172460000000 44 | 0.244981890000000 0.088164270000000 45 | 0.217511530000000 0.085530080000000 46 | 0.190586660000000 0.082213540000000 47 | 0.164329780000000 0.078137460000000 48 | 0.138885910000000 0.073228490000000 49 | 0.114458330000000 0.067439570000000 50 | 0.091383060000000 0.060780410000000 51 | 0.070255120000000 0.053400180000000 52 | 0.051954270000000 0.045704340000000 53 | 0.037253330000000 0.038288160000000 54 | 0.026150230000000 0.031568070000000 55 | 0.017989080000000 0.025636450000000 56 | 0.012007090000000 0.020386620000000 57 | 0.007614770000000 0.015670610000000 58 | 0.004413370000000 0.011372930000000 59 | 0.002163520000000 0.007399390000000 60 | 0.000726420000000 0.003692080000000 61 | 0.000034090000000 0.000230730000000 62 | 0.000088070000000 -0.003024170000000 63 | 0.001159760000000 -0.006241160000000 64 | 0.003504120000000 -0.009090200000000 65 | 0.006940980000000 -0.011471410000000 66 | 0.011372680000000 -0.013570690000000 67 | 0.017002030000000 -0.015509750000000 68 | 0.024306230000000 -0.017358120000000 69 | 0.034137670000000 -0.019181570000000 70 | 0.047835290000000 -0.021026300000000 71 | 0.066736540000000 -0.022817580000000 72 | 0.090595510000000 -0.024302220000000 73 | 0.117580530000000 -0.025295320000000 74 | 0.146103260000000 -0.025848870000000 75 | 0.175324750000000 -0.026060960000000 76 | 0.204884660000000 -0.026000070000000 77 | 0.234613160000000 -0.025706780000000 78 | 0.264402350000000 -0.025207380000000 79 | 0.294212820000000 -0.024516590000000 80 | 0.324008890000000 -0.023624210000000 81 | 0.353729120000000 -0.022525430000000 82 | 0.383496050000000 -0.021196820000000 83 | 0.413493440000000 -0.019659460000000 84 | 0.443698340000000 -0.018016630000000 85 | 0.474053590000000 -0.016302710000000 86 | 0.504382360000000 -0.014559740000000 87 | 0.534648920000000 -0.012828570000000 88 | 0.564728040000000 -0.011088890000000 89 | 0.594612970000000 -0.009509390000000 90 | 0.624295560000000 -0.008072390000000 91 | 0.652954480000000 -0.006872240000000 92 | 0.678232590000000 -0.005925990000000 93 | 0.697148060000000 -0.005281840000000 94 | 0.710740957143698 -0.001235740573642 95 | 0.721033564168722 0.002994428783832 96 | 0.731491405043971 0.007371639101382 97 | 0.741873255898514 0.011783722399205 98 | 0.752259520656462 0.016223793193463 99 | 0.762649931490488 0.020643993704554 100 | 0.773058528955007 0.025023904651595 101 | 0.783483450386164 0.029364082526603 102 | 0.793923657701057 0.033667554867172 103 | 0.804384126187518 0.037921500085610 104 | 0.814870303155685 0.042111682771409 105 | 0.825380216461652 0.046241971729091 106 | 0.835909583667211 0.050322407816338 107 | 0.846459377145801 0.054349705460155 108 | 0.857030430769960 0.058320901139565 109 | 0.867617106699989 0.062250256693983 110 | 0.878215500102085 0.066147886567189 111 | 0.888829180042721 0.070003692449200 112 | 0.899460905104162 0.073809451960563 113 | 0.910110539549095 0.077564807085381 114 | 0.920779285007988 0.081265491515623 115 | 0.931467972036711 0.084908199986255 116 | 0.942178620730107 0.088485803477931 117 | 0.952911847173077 0.091995088933013 118 | 0.963657717615782 0.095465483482079 119 | 0.974401067232892 0.098946166317607 120 | 0.982049397403836 0.101468387870529 -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/MH139Fp20.dat: -------------------------------------------------------------------------------- 1 | MH 139F-0 p20 2 | 0.982132838455569 -0.101748754571986 3 | 0.976036217467600 -0.096505787802717 4 | 0.966950347698465 -0.089801956846367 5 | 0.957555879348274 -0.083536719383210 6 | 0.948043691627305 -0.077451091294651 7 | 0.938485518106600 -0.071437893199344 8 | 0.928903589101896 -0.065462595950730 9 | 0.919306257266374 -0.059512074805579 10 | 0.909704649901165 -0.053568447066399 11 | 0.900104140904673 -0.047623058819860 12 | 0.890501345416341 -0.041681350472106 13 | 0.880888973982478 -0.035755162980231 14 | 0.871262851053894 -0.029851319722353 15 | 0.861625085306466 -0.023966512392856 16 | 0.851971845629625 -0.018107115079269 17 | 0.842295869793249 -0.012285361751253 18 | 0.832598986085719 -0.006498480557152 19 | 0.822885411064133 -0.000739652402726 20 | 0.813152958977292 0.004987193311089 21 | 0.803399991133674 0.010679045456583 22 | 0.793629318007062 0.016340468038259 23 | 0.783842377257240 0.021973598235181 24 | 0.774038316769993 0.027577352118677 25 | 0.764220879007644 0.033155901268276 26 | 0.754394291545324 0.038724457130605 27 | 0.744581413159395 0.044296089764704 28 | 0.738642218468099 0.047692534675474 29 | 0.734755206325775 0.049915396070596 30 | 0.725058584651221 0.055513066860547 31 | 0.690207600000000 0.063296510000000 32 | 0.669359280000000 0.066905470000000 33 | 0.643553380000000 0.071080510000000 34 | 0.615812310000000 0.075121730000000 35 | 0.587401370000000 0.078807930000000 36 | 0.558837640000000 0.082060240000000 37 | 0.530063400000000 0.084886440000000 38 | 0.501236430000000 0.087337580000000 39 | 0.472451180000000 0.089349500000000 40 | 0.443733670000000 0.090922340000000 41 | 0.415028940000000 0.092034550000000 42 | 0.386393680000000 0.092668860000000 43 | 0.357822870000000 0.092825080000000 44 | 0.329338490000000 0.092473300000000 45 | 0.301007740000000 0.091595390000000 46 | 0.272861580000000 0.090172460000000 47 | 0.244981890000000 0.088164270000000 48 | 0.217511530000000 0.085530080000000 49 | 0.190586660000000 0.082213540000000 50 | 0.164329780000000 0.078137460000000 51 | 0.138885910000000 0.073228490000000 52 | 0.114458330000000 0.067439570000000 53 | 0.091383060000000 0.060780410000000 54 | 0.070255120000000 0.053400180000000 55 | 0.051954270000000 0.045704340000000 56 | 0.037253330000000 0.038288160000000 57 | 0.026150230000000 0.031568070000000 58 | 0.017989080000000 0.025636450000000 59 | 0.012007090000000 0.020386620000000 60 | 0.007614770000000 0.015670610000000 61 | 0.004413370000000 0.011372930000000 62 | 0.002163520000000 0.007399390000000 63 | 0.000726420000000 0.003692080000000 64 | 0.000034090000000 0.000230730000000 65 | 0.000088070000000 -0.003024170000000 66 | 0.001159760000000 -0.006241160000000 67 | 0.003504120000000 -0.009090200000000 68 | 0.006940980000000 -0.011471410000000 69 | 0.011372680000000 -0.013570690000000 70 | 0.017002030000000 -0.015509750000000 71 | 0.024306230000000 -0.017358120000000 72 | 0.034137670000000 -0.019181570000000 73 | 0.047835290000000 -0.021026300000000 74 | 0.066736540000000 -0.022817580000000 75 | 0.090595510000000 -0.024302220000000 76 | 0.117580530000000 -0.025295320000000 77 | 0.146103260000000 -0.025848870000000 78 | 0.175324750000000 -0.026060960000000 79 | 0.204884660000000 -0.026000070000000 80 | 0.234613160000000 -0.025706780000000 81 | 0.264402350000000 -0.025207380000000 82 | 0.294212820000000 -0.024516590000000 83 | 0.324008890000000 -0.023624210000000 84 | 0.353729120000000 -0.022525430000000 85 | 0.383496050000000 -0.021196820000000 86 | 0.413493440000000 -0.019659460000000 87 | 0.443698340000000 -0.018016630000000 88 | 0.474053590000000 -0.016302710000000 89 | 0.504382360000000 -0.014559740000000 90 | 0.534648920000000 -0.012828570000000 91 | 0.564728040000000 -0.011088890000000 92 | 0.594612970000000 -0.009509390000000 93 | 0.624295560000000 -0.008072390000000 94 | 0.652954480000000 -0.006872240000000 95 | 0.678232590000000 -0.005925990000000 96 | 0.697148060000000 -0.005281840000000 97 | 0.707433731804184 -0.007850786367719 98 | 0.718037426670772 -0.011226248905031 99 | 0.728862214117393 -0.014595281803593 100 | 0.739651205750551 -0.017888755005631 101 | 0.750461568645819 -0.021163625743968 102 | 0.761262335247807 -0.024456383048640 103 | 0.772051135984453 -0.027791694090710 104 | 0.782826901678633 -0.031167935275316 105 | 0.793590783176364 -0.034582120107278 106 | 0.804338350211535 -0.038047268545976 107 | 0.815064625320317 -0.041577787011984 108 | 0.825770584572439 -0.045169444159431 109 | 0.836459401568816 -0.048811795546867 110 | 0.847129709265108 -0.052507983098824 111 | 0.857780241530173 -0.056260813007016 112 | 0.868415846861907 -0.060055736135104 113 | 0.879040035423212 -0.063882494390851 114 | 0.889649050209093 -0.067751117680210 115 | 0.900239719172529 -0.071669677893771 116 | 0.910811708204524 -0.075638362037360 117 | 0.921363195477480 -0.079661210685713 118 | 0.931892692650693 -0.083741289689763 119 | 0.942397164761289 -0.087885358687101 120 | 0.952875018444043 -0.092096275034419 121 | 0.963337559400018 -0.096345110950544 122 | 0.973804782474615 -0.100584445226537 123 | 0.981284996064309 -0.103568563290281 124 | -------------------------------------------------------------------------------- /matlab_functions/initParameters.m: -------------------------------------------------------------------------------- 1 | %========================================================================== 2 | %=== Global Design of solar-powered airplanes 3 | %=== Initialization of technological parameters 4 | %=== Stefan Leutenegger and Philipp Oettershagen 5 | %=== 2009-2015 6 | %========================================================================== 7 | 8 | clear params; 9 | 10 | %========================================================================== 11 | %=== TECHNOLOGICAL PARAMETERS GROUP ======================================= 12 | %========================================================================== 13 | %--- ADAPT THESE params ----------------------------------------------- 14 | 15 | %=== Propulsion Group ===================================================== 16 | params.prop.k_prop = 0.0011; % Mass/Power [kg/W] 17 | params.prop.eta_ctrl = 0.97; % Eff. of motor controller [-] 18 | params.prop.eta_mot = 0.82; % Efficiency of motor [-] 19 | params.prop.eta_grb = 0.96; % Efficiency of gearbox [-] 20 | params.prop.eta_plr = 0.82; % Efficiency of propeller [-] 21 | params.prop.eta_climb = 0.5; % Additional loss factor when climbing [-] 22 | params.prop.number = 1; % Number of propulsion units [-] 23 | 24 | %=== Battery and Step-down Converter ====================================== 25 | params.bat.eta_chrg = 0.95; % Eff. of charge process [-]. Lower eta, because charge (during morning at strong sun) mostly happens quickly on solar UAVs. 26 | params.bat.eta_dchrg = 0.97; % Eff. of discharge process [-]. Higher eta, because discharge (during night) happens slower on solar UAVs. 27 | params.bat.eta_bec = 0.65; % Eff. of bec (5V stepdown) [-] 28 | params.bat.e_density = 251*3600; % 251.36*3600; % Energy density of battery including battery-cables sensors etc. 29 | params.bat.distr = 1; % Distributed battery mass? 1/0 30 | params.bat.chrg_lim_type = 1; % 0 = Don't use, 1=use theor. params below, 2 = use experimental charge limit curve 31 | params.bat.chrg_lim_SoC1 = 0.9; % SoC [-] above which charge limiting applies 32 | params.bat.chrg_lim_Prel1 = 0.5; % Maximum charge relative to battery capacity (i.e. in C's) when NOT limiting (i.e. below SoC1) 33 | params.bat.chrg_lim_Prel2 = 0.046; % Specific charge termination power, i.e. P_chrg(SoC=100%) = chrg_lim_Prel2 * e_bat. 34 | 35 | %=== Solar cells ========================================================== 36 | params.solar.k_sc = 0.39; % Mass density of sc [Kg/m2]. 37 | params.solar.k_enc = 0.2; % Mass dens. of encaps. and cables! [Kg/m2] 38 | params.solar.k_mppt = 1/2368; % Mass/Power of mppt [kg/W] 39 | params.solar.rWngCvrg = 0.85; % relative solar cell wing coverage area/without winglet area 40 | params.solar.eta_sc = 0.237; % Efficiency of solar cells (more precisely: modules) [-] 41 | params.solar.eta_cbr = 0.97; % Eff. of cambered conf. [-] 42 | params.solar.eta_mppt = 0.95; % Efficiency of mppt [-] 43 | params.solar.k_temp = 0.003; % Solar power (and thus eta) reduction in [1/K] 44 | params.solar.epsilon_diff = 0.82707; % Component efficiency for incoming diffuse solar radiation. 45 | params.solar.angle_AOI = [0 15 30 45 60 70 75 80 84 87 90] / 180.0 * pi(); % Angle (AOI) of incoming diffuse solar radiation 46 | params.solar.epsilon_AOI = [1 0.997 0.988 0.97 0.915 0.76 0.65 0.56 0.46 0.34 0]; % Component efficiency for respective AOI 47 | 48 | %==== Structure =========================================================== 49 | params.structure.shell = 0; % 1 for shell wing, 0 for rib wing 50 | params.structure.corr_fact = 1.0; % Correction factor that can be used to correct the structural mass estimation 51 | % results if an experimental data point (i.e. a finished structure) is available. 52 | 53 | %-------------------------------------------------------------------------- 54 | 55 | %=== Physics ============================================================== 56 | params.physics.g = 9.81; % Earth Acceleration [m/s^2] 57 | 58 | % TODO check still needed? Or put (default) settings here? 59 | %=== Performance evaluation 60 | params.evaluation.clmb = 1; % 1 to allow altitude changes 61 | params.evaluation.findalt = 0; % if 1, it finds the maximum 62 | % altitude for eternal flight 63 | 64 | %========================================================================== 65 | %=== AIRPLANE CHARACTERISTICS (Defaults only) ============================= 66 | %========================================================================== 67 | %--- ADAPT THESE params ----------------------------------------------- 68 | 69 | %==== Avionics ============================================================ 70 | plane.avionics.mass = 0.4; % Mass of contr./electr/harness. [kg] 71 | plane.avionics.power = 5.5; % Power required for control [W] 72 | 73 | %==== Payload ============================================================= 74 | plane.payload.mass = 0.0; % Mass of payload [kg] 75 | plane.payload.power = 3.0; % Power required for payload [W] 76 | 77 | %==== Propulsion ============================================================= 78 | plane.prop.P_prop_max = 180.0; % Max. prop/climbing power 79 | 80 | 81 | %========================================================================== 82 | %=== ENVIRONMENTAL CHARACTERISTICS (Defaults only) ======================== 83 | %========================================================================== 84 | environment.usemars = 0; 85 | -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/FX7112030m30.dat: -------------------------------------------------------------------------------- 1 | FX 71-L-120/30 m30 2 | 0.959807621135332 0.150000000000000 3 | 0.953691040694443 0.147018228092201 4 | 0.942511995560497 0.141570902244301 5 | 0.928976885030311 0.134898401368644 6 | 0.913738012766414 0.127418902379766 7 | 0.897584024064076 0.119600431557109 8 | 0.880922862405808 0.111640410062347 9 | 0.863980043761500 0.103618232777714 10 | 0.846894043738488 0.095578052915694 11 | 0.829790615512246 0.087552059587153 12 | 0.812838287248994 0.079576353445690 13 | 0.796096946098802 0.071795206904667 14 | 0.779548637578998 0.064201718040293 15 | 0.763624374391474 0.057049350954183 16 | 0.747905920711864 0.050446511343686 17 | 0.731508313314210 0.043940000478989 18 | 0.714571679131554 0.037203111392557 19 | 0.694255000000000 0.030335000000000 20 | 0.675672000000000 0.033052000000000 21 | 0.657193000000000 0.035681000000000 22 | 0.638771000000000 0.038195000000000 23 | 0.620392000000000 0.040628000000000 24 | 0.602311000000000 0.042909000000000 25 | 0.584260000000000 0.044957000000000 26 | 0.565823000000000 0.046905000000000 27 | 0.547272000000000 0.048861000000000 28 | 0.528965000000000 0.050725000000000 29 | 0.510843000000000 0.052400000000000 30 | 0.492706000000000 0.053913000000000 31 | 0.474615000000000 0.055284000000000 32 | 0.456618000000000 0.056473000000000 33 | 0.438609000000000 0.057476000000000 34 | 0.420554000000000 0.058307000000000 35 | 0.402436000000000 0.058980000000000 36 | 0.384358000000000 0.059512000000000 37 | 0.366410000000000 0.059855000000000 38 | 0.348413000000000 0.059991000000000 39 | 0.330339000000000 0.059971000000000 40 | 0.312327000000000 0.059791000000000 41 | 0.294354000000000 0.059416000000000 42 | 0.276311000000000 0.058860000000000 43 | 0.258325000000000 0.058164000000000 44 | 0.240500000000000 0.057269000000000 45 | 0.222614000000000 0.056161000000000 46 | 0.204830000000000 0.054912000000000 47 | 0.187271000000000 0.053446000000000 48 | 0.169754000000000 0.051745000000000 49 | 0.152439000000000 0.049871000000000 50 | 0.135466000000000 0.047743000000000 51 | 0.118700000000000 0.045376000000000 52 | 0.102621000000000 0.042846000000000 53 | 0.087235000000000 0.040012000000000 54 | 0.072890000000000 0.037108000000000 55 | 0.060163000000000 0.034152000000000 56 | 0.049137000000000 0.031235000000000 57 | 0.039944000000000 0.028518000000000 58 | 0.032385000000000 0.025938000000000 59 | 0.026136000000000 0.023572000000000 60 | 0.020972000000000 0.021409000000000 61 | 0.016688000000000 0.019303000000000 62 | 0.013074000000000 0.017239000000000 63 | 0.009974000000000 0.015271000000000 64 | 0.007314000000000 0.013377000000000 65 | 0.005083000000000 0.011465000000000 66 | 0.003287000000000 0.009468000000000 67 | 0.001918000000000 0.007384000000000 68 | 0.000944000000000 0.005252000000000 69 | 0.000328000000000 0.003119000000000 70 | 0.000035000000000 0.001021000000000 71 | 0.000035000000000 -0.001021000000000 72 | 0.000328000000000 -0.003118000000000 73 | 0.000944000000000 -0.005252000000000 74 | 0.001918000000000 -0.007384000000000 75 | 0.003287000000000 -0.009468000000000 76 | 0.005083000000000 -0.011465000000000 77 | 0.007314000000000 -0.013377000000000 78 | 0.009974000000000 -0.015271000000000 79 | 0.013074000000000 -0.017238000000000 80 | 0.016688000000000 -0.019303000000000 81 | 0.020973000000000 -0.021408000000000 82 | 0.026136000000000 -0.023572000000000 83 | 0.032386000000000 -0.025938000000000 84 | 0.039945000000000 -0.028518000000000 85 | 0.049138000000000 -0.031234000000000 86 | 0.060164000000000 -0.034151000000000 87 | 0.072892000000000 -0.037108000000000 88 | 0.087237000000000 -0.040012000000000 89 | 0.102623000000000 -0.042845000000000 90 | 0.118702000000000 -0.045376000000000 91 | 0.135468000000000 -0.047742000000000 92 | 0.152441000000000 -0.049870000000000 93 | 0.169756000000000 -0.051744000000000 94 | 0.187274000000000 -0.053445000000000 95 | 0.204832000000000 -0.054912000000000 96 | 0.222617000000000 -0.056161000000000 97 | 0.240502000000000 -0.057269000000000 98 | 0.258328000000000 -0.058164000000000 99 | 0.276313000000000 -0.058860000000000 100 | 0.294356000000000 -0.059416000000000 101 | 0.312330000000000 -0.059791000000000 102 | 0.330341000000000 -0.059971000000000 103 | 0.348415000000000 -0.059991000000000 104 | 0.366412000000000 -0.059855000000000 105 | 0.384360000000000 -0.059512000000000 106 | 0.402438000000000 -0.058980000000000 107 | 0.420555000000000 -0.058307000000000 108 | 0.438611000000000 -0.057476000000000 109 | 0.456619000000000 -0.056473000000000 110 | 0.474616000000000 -0.055284000000000 111 | 0.492707000000000 -0.053913000000000 112 | 0.510845000000000 -0.052401000000000 113 | 0.528966000000000 -0.050725000000000 114 | 0.547273000000000 -0.048861000000000 115 | 0.565824000000000 -0.046905000000000 116 | 0.584261000000000 -0.044957000000000 117 | 0.602312000000000 -0.042909000000000 118 | 0.620393000000000 -0.040628000000000 119 | 0.638772000000000 -0.038194000000000 120 | 0.657195000000000 -0.035681000000000 121 | 0.675674000000000 -0.033051000000000 122 | 0.694256000000000 -0.030335000000000 123 | 0.724912168108381 -0.017475140890413 124 | 0.739507277207765 -0.005980611392557 125 | 0.753809411390421 0.005319365546415 126 | 0.767642652762671 0.016265488656314 127 | 0.781219240416878 0.026576149045817 128 | 0.795374137578998 0.036791147985111 129 | 0.810225812124206 0.047325293095333 130 | 0.825334653274398 0.057934012579713 131 | 0.840718481537650 0.068626440412847 132 | 0.856220909763892 0.079425447084306 133 | 0.871726409786904 0.090203133247690 134 | 0.887145728431212 0.100864089937653 135 | 0.902369890089480 0.111313068442891 136 | 0.917217878791818 0.121393597620234 137 | 0.931313885030311 0.130850598631356 138 | 0.943859995560497 0.139236097755699 139 | 0.954167540694443 0.146192905882395 140 | 0.959807621135332 0.150000000000000 141 | -------------------------------------------------------------------------------- /Aerodynamics/Airfoils/FX7112030p30.dat: -------------------------------------------------------------------------------- 1 | FX 71-L-120/30 p30 2 | 0.959807621135332 -0.150000000000000 3 | 0.954167040694443 -0.146193771907799 4 | 0.943859995560497 -0.139236097755699 5 | 0.931313885030311 -0.130850598631356 6 | 0.917217012766414 -0.121393097620234 7 | 0.902369024064076 -0.111312568442891 8 | 0.887144862405808 -0.100863589937653 9 | 0.871726043761500 -0.090201767222286 10 | 0.856220043738488 -0.079424947084306 11 | 0.840717615512246 -0.068625940412847 12 | 0.825334287248994 -0.057932646554310 13 | 0.810224946098802 -0.047324793095333 14 | 0.795374637578998 -0.036790281959708 15 | 0.781218374391474 -0.026575649045817 16 | 0.767640920711864 -0.016264488656314 17 | 0.753807313314210 -0.005316999521011 18 | 0.739504679131554 0.005982111392557 19 | 0.724910936057573 0.017477006915816 20 | 0.694255000000000 0.030335000000000 21 | 0.675672000000000 0.033052000000000 22 | 0.657193000000000 0.035681000000000 23 | 0.638771000000000 0.038195000000000 24 | 0.620392000000000 0.040628000000000 25 | 0.602311000000000 0.042909000000000 26 | 0.584260000000000 0.044957000000000 27 | 0.565823000000000 0.046905000000000 28 | 0.547272000000000 0.048861000000000 29 | 0.528965000000000 0.050725000000000 30 | 0.510843000000000 0.052400000000000 31 | 0.492706000000000 0.053913000000000 32 | 0.474615000000000 0.055284000000000 33 | 0.456618000000000 0.056473000000000 34 | 0.438609000000000 0.057476000000000 35 | 0.420554000000000 0.058307000000000 36 | 0.402436000000000 0.058980000000000 37 | 0.384358000000000 0.059512000000000 38 | 0.366410000000000 0.059855000000000 39 | 0.348413000000000 0.059991000000000 40 | 0.330339000000000 0.059971000000000 41 | 0.312327000000000 0.059791000000000 42 | 0.294354000000000 0.059416000000000 43 | 0.276311000000000 0.058860000000000 44 | 0.258325000000000 0.058164000000000 45 | 0.240500000000000 0.057269000000000 46 | 0.222614000000000 0.056161000000000 47 | 0.204830000000000 0.054912000000000 48 | 0.187271000000000 0.053446000000000 49 | 0.169754000000000 0.051745000000000 50 | 0.152439000000000 0.049871000000000 51 | 0.135466000000000 0.047743000000000 52 | 0.118700000000000 0.045376000000000 53 | 0.102621000000000 0.042846000000000 54 | 0.087235000000000 0.040012000000000 55 | 0.072890000000000 0.037108000000000 56 | 0.060163000000000 0.034152000000000 57 | 0.049137000000000 0.031235000000000 58 | 0.039944000000000 0.028518000000000 59 | 0.032385000000000 0.025938000000000 60 | 0.026136000000000 0.023572000000000 61 | 0.020972000000000 0.021409000000000 62 | 0.016688000000000 0.019303000000000 63 | 0.013074000000000 0.017239000000000 64 | 0.009974000000000 0.015271000000000 65 | 0.007314000000000 0.013377000000000 66 | 0.005083000000000 0.011465000000000 67 | 0.003287000000000 0.009468000000000 68 | 0.001918000000000 0.007384000000000 69 | 0.000944000000000 0.005252000000000 70 | 0.000328000000000 0.003119000000000 71 | 0.000035000000000 0.001021000000000 72 | 0.000035000000000 -0.001021000000000 73 | 0.000328000000000 -0.003118000000000 74 | 0.000944000000000 -0.005252000000000 75 | 0.001918000000000 -0.007384000000000 76 | 0.003287000000000 -0.009468000000000 77 | 0.005083000000000 -0.011465000000000 78 | 0.007314000000000 -0.013377000000000 79 | 0.009974000000000 -0.015271000000000 80 | 0.013074000000000 -0.017238000000000 81 | 0.016688000000000 -0.019303000000000 82 | 0.020973000000000 -0.021408000000000 83 | 0.026136000000000 -0.023572000000000 84 | 0.032386000000000 -0.025938000000000 85 | 0.039945000000000 -0.028518000000000 86 | 0.049138000000000 -0.031234000000000 87 | 0.060164000000000 -0.034151000000000 88 | 0.072892000000000 -0.037108000000000 89 | 0.087237000000000 -0.040012000000000 90 | 0.102623000000000 -0.042845000000000 91 | 0.118702000000000 -0.045376000000000 92 | 0.135468000000000 -0.047742000000000 93 | 0.152441000000000 -0.049870000000000 94 | 0.169756000000000 -0.051744000000000 95 | 0.187274000000000 -0.053445000000000 96 | 0.204832000000000 -0.054912000000000 97 | 0.222617000000000 -0.056161000000000 98 | 0.240502000000000 -0.057269000000000 99 | 0.258328000000000 -0.058164000000000 100 | 0.276313000000000 -0.058860000000000 101 | 0.294356000000000 -0.059416000000000 102 | 0.312330000000000 -0.059791000000000 103 | 0.330341000000000 -0.059971000000000 104 | 0.348415000000000 -0.059991000000000 105 | 0.366412000000000 -0.059855000000000 106 | 0.384360000000000 -0.059512000000000 107 | 0.402438000000000 -0.058980000000000 108 | 0.420555000000000 -0.058307000000000 109 | 0.438611000000000 -0.057476000000000 110 | 0.456619000000000 -0.056473000000000 111 | 0.474616000000000 -0.055284000000000 112 | 0.492707000000000 -0.053913000000000 113 | 0.510845000000000 -0.052401000000000 114 | 0.528966000000000 -0.050725000000000 115 | 0.547273000000000 -0.048861000000000 116 | 0.565824000000000 -0.046905000000000 117 | 0.584261000000000 -0.044957000000000 118 | 0.602312000000000 -0.042909000000000 119 | 0.620393000000000 -0.040628000000000 120 | 0.638772000000000 -0.038194000000000 121 | 0.657195000000000 -0.035681000000000 122 | 0.675674000000000 -0.033051000000000 123 | 0.694256000000000 -0.030335000000000 124 | 0.714574277207765 -0.037204611392557 125 | 0.731511411390422 -0.043940634453585 126 | 0.747907652762671 -0.050447511343686 127 | 0.763625240416878 -0.057049850954183 128 | 0.779549137578998 -0.064200852014889 129 | 0.796097812124206 -0.071795706904667 130 | 0.812839653274398 -0.079575987420287 131 | 0.829791481537650 -0.087552559587153 132 | 0.846894909763892 -0.095578552915694 133 | 0.863981409786904 -0.103617866752310 134 | 0.880923728431212 -0.111640910062347 135 | 0.897584890089480 -0.119600931557109 136 | 0.913738878791818 -0.127419402379766 137 | 0.928976885030311 -0.134898401368644 138 | 0.942511995560497 -0.141570902244301 139 | 0.953690540694443 -0.147019094117605 140 | 0.959807621135332 -0.150000000000000 141 | -------------------------------------------------------------------------------- /matlab_functions/plotScripts/Plot_AirplaneAnalysis_FSRPaper.m: -------------------------------------------------------------------------------- 1 | function Plot_AnalysisSpace_FSRPaper() 2 | %************************************************************************** 3 | %*** PLOTTING 4 | %************************************************************************** 5 | 6 | min_end = 8.0*ones(numel(days),1); 7 | month = days/30.5; 8 | cd = round(numel(days)/2); %center day, just middle of the plot 9 | 10 | %PLOT1: T_ENDURANCE 11 | figure 12 | 13 | for k = 1:numel(powers) 14 | daylength = (res.t_sunset(i,k,:)-res.t_sunrise(i,k,:))/3600; 15 | 16 | subplot(numel(powers),1,k); 17 | 18 | %plot(month, squeeze(daylength),'LineWidth',2,'Color','red'); 19 | % Green background 20 | clf 21 | area(month, squeeze(res.t_endurance(numel(clearness),k,:)) ,'LineWidth',1,'FaceColor',[0.4 1.0 0.4],'EdgeColor',[0.4 1.0 0.4]); 22 | hold all 23 | % DayLength 24 | area(month, squeeze(daylength) ,'LineWidth',2,'FaceColor',[1 0.7 0.7],'EdgeColor',[1 0.7 0.7]); 25 | plot(month, squeeze(daylength) ,'LineWidth',2,'Color','r'); 26 | 27 | %h = text(month(cd)-0.5,squeeze(daylength(cd))+0.2,' Length of Daytime'); 28 | %set(h,'BackgroundColor','w'); 29 | dayshift = 95; 30 | %Plot MinEndurance 31 | plot(month, min_end,'LineWidth',2,'Color','k'); 32 | h = text(month(cd+dayshift),min_end(1),[' CLR=' num2str(0.0) ' (min. endurance)']); 33 | set(h,'BackgroundColor',[1 0.7 0.7]); 34 | 35 | %Plot first clearness values 36 | plot(month, squeeze(res.t_endurance(1,k,:)),'--','Color',[0.4 0.4 0.4]); 37 | h = text(month(cd+dayshift),res.t_endurance(1,k,cd+dayshift)-0.8,[' CLR=' num2str(clearness(1))]); 38 | set(h,'BackgroundColor',[1 0.7 0.7]); 39 | 40 | %legend('Flight Endurance Min/Max [h]','Flight Endurance [h]','Length of Daytime [h]'); 41 | 42 | for i = 2:numel(clearness)-1 43 | plot(month, squeeze(res.t_endurance(i,k,:)),'--','Color',[0.4 0.4 0.4]); 44 | h = text(month(cd+dayshift),res.t_endurance(i,k,cd+dayshift)-1.0,[' CLR = ' num2str(clearness(i))]); 45 | set(h,'BackgroundColor',[0.4 1.0 0.4]); 46 | end 47 | plot(month, squeeze(res.t_endurance(numel(clearness),k,:)),'LineWidth',2,'Color','k'); 48 | h = text(month(cd+dayshift),res.t_endurance(numel(clearness),k,cd+dayshift)+0.3,[' CLR=' num2str(clearness(end)) ' (max. endurance)']); 49 | set(h,'BackgroundColor','w'); 50 | 51 | ylim([7.6, 24]); 52 | xlim([0,12]); 53 | xlabel('Month of year [-]'); 54 | ylabel('Flight Endurance [h] vs. atmosphere clearness (CLR)'); 55 | months = ['J';'F';'M';'A';'M';'J';'J';'A';'S';'O';'N';'D']; 56 | set(gca,'XTick',1:12); 57 | set(gca,'XTickLabel',months(1:12)); 58 | 59 | line([173/30.5 173/30.5],[0 max(max(res.t_endurance(:,k,:)))+0.5],'LineStyle','--','Color','black'); 60 | text(173/30.5-0.4,23.0,' June 21st') 61 | line([356/30.5 356/30.5],[0 16],'LineStyle','--','Color','black'); 62 | text(356/30.5-0.8,17.0,' Dec. 21st') 63 | 64 | set(gcf,'Color','w'); 65 | set(findall(gcf,'-property','FontSize'),'FontSize',12) 66 | 67 | %Fake the legend (some bug here) 68 | figure 69 | plot(1,1,'LineWidth',2,'Color','k'); 70 | hold all 71 | plot(1,2,'--','Color',[0.4 0.4 0.4]); 72 | plot(1,2,'LineWidth',2,'Color','r'); 73 | legend('Flight endurance [h] (max/min)','Flight endurance [h]','Length of daylight [h]'); 74 | set(findall(gcf,'-property','FontSize'),'FontSize',12) 75 | 76 | end 77 | 78 | %PLOT1: T_ENDURANCE 79 | figure(1) 80 | for k = 1:numel(powers) 81 | subplot(numel(powers),1,k); 82 | plot(days, squeeze(res.t_excess(1,k,:)),'LineWidth',2); 83 | %hold all 84 | %plot(days, squeeze(res.t_excess(2,k,:)),'LineWidth',2); 85 | ylim([0 max(max(res.t_excess(:,k,:)))+0.5]); 86 | t_exc_lim = 0.15*plane.bat.m*plane.bat.e_density/(plane.P_prop_level+plane.P_avi); 87 | line([min(days) max(days)],[t_exc_lim t_exc_lim],'Color','red'); 88 | text((min(days)+max(days))/2,t_exc_lim-0.03,'Critical excess time','FontSize',12,'Color','red') 89 | xlabel('day of year [-]'); 90 | ylabel('Modified excess time [h]'); 91 | 92 | %str1 = strcat('Barcelona, h_0 = ', num2str(h_0(2)), 'm , P_{prop, level}=',num2str(powers(k)),'W'); 93 | str2 = strcat('Tuggen/CH, h_0=', num2str(h_0(1)), 'm , P_{prop, level}=',num2str(powers(k)),'W'); 94 | legend(str2); 95 | 96 | line([173 173],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 97 | text(173,0.5,' June 21st','FontSize',12) 98 | line([204 204],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 99 | text(204,0.5,' July 21st','FontSize',12) 100 | line([215 215],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 101 | text(215,0.5,' August 2nd','FontSize',12) 102 | end 103 | 104 | %PLOT1: T_DAYLIGHT 105 | figure(1) 106 | for k = 1:numel(powers) 107 | subplot(numel(powers),1,k); 108 | plot(days, squeeze(res.t_excess(1,k,:)),'LineWidth',2); 109 | %hold all 110 | %plot(days, squeeze(res.t_excess(2,k,:)),'LineWidth',2); 111 | ylim([0 max(max(res.t_excess(:,k,:)))+0.5]); 112 | t_exc_lim = 0.15*plane.bat.m*plane.bat.e_density/(plane.P_prop_level+plane.P_avi); 113 | line([min(days) max(days)],[t_exc_lim t_exc_lim],'Color','red'); 114 | text((min(days)+max(days))/2,t_exc_lim-0.03,'Critical excess time','FontSize',12,'Color','red') 115 | xlabel('day of year [-]'); 116 | ylabel('Modified excess time [h]'); 117 | 118 | %str1 = strcat('Barcelona, h_0=', num2str(h_0(2)), 'm , P_{prop, level}=',num2str(powers(k)),'W'); 119 | str2 = strcat('Tuggen/CH, h_0=', num2str(h_0(1)), 'm , P_{prop, level}=',num2str(powers(k)),'W'); 120 | legend(str2); 121 | 122 | line([173 173],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 123 | text(173,0.5,' June 21st','FontSize',12) 124 | line([204 204],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 125 | text(204,0.5,' July 21st','FontSize',12) 126 | line([215 215],[0 max(max(res.t_excess(:,k,:)))+0.5],'LineStyle','--','Color','black'); 127 | text(215,0.5,' August 2nd','FontSize',12) 128 | end 129 | end -------------------------------------------------------------------------------- /matlab_functions/aerodynamics/CalcFlightPars_OptCruise.m: -------------------------------------------------------------------------------- 1 | function [v,Re,CL,CD]=CalcFlightPars_OptCruise(P,Plevel,m,rho,mu,A,c_wing,g,polar,OptCruisePars) 2 | 3 | P=(1-0.6*(P-Plevel)/P)*P; 4 | 5 | Re=interp1(OptCruisePars.P_array(OptCruisePars.min_idx:OptCruisePars.max_idx),polar.ReList(OptCruisePars.min_idx:OptCruisePars.max_idx),P,'linear'); %first guess 6 | 7 | v=Re*mu/rho/c_wing; 8 | CL=interp1(polar.ReList,OptCruisePars.CL_array,Re); 9 | CD=interp1(polar.ReList(OptCruisePars.min_idx:OptCruisePars.max_idx),OptCruisePars.CD_array(OptCruisePars.min_idx:OptCruisePars.max_idx),Re); 10 | 11 | %To take into account decreased efficiency at higher speeds 12 | %Update this to represent real propulsion efficiency over P_prop 13 | 14 | % %Calc CD/CL^1.5 (=C1) for optimal cruise 15 | % C1=sqrt(rho*A/2/(m*g)^3)*P; 16 | % 17 | % %At all reynolds numbers, if CD/CL^1.5==C1, then the A/C can be at level flight 18 | % %consuming the power specified by P. 19 | % 20 | % for i=1:length(polar.ReList) 21 | % temp=polar.c_D_array{1,i}; 22 | % C1vsRe(i,:)=real(temp./(polar.c_L_array.^1.5)); 23 | % end 24 | % 25 | % %we need a positive CL 26 | % min_idx=find(polar.c_L_array(1,:)>0,1,'first'); 27 | % for i=1:length(polar.ReList) 28 | % temp= numel(polar.c_L_array); 29 | % for j=temp:-1:min_idx 30 | % if(isnan(C1vsRe(i,j))==0) max_idx(i)=j; break; end 31 | % end 32 | % idx_Hit(i)=interp1(C1vsRe(i,min_idx:max_idx(i)),min_idx:max_idx(i),C1); 33 | % CLvsRe_Hit(i)=interp1(C1vsRe(i,min_idx:max_idx(i)),polar.c_L_array(min_idx:max_idx(i)),C1); 34 | % end 35 | % 36 | % %Now we need to find v (->Re) such that both FL=Fg and PProp=P! 37 | % for i=1:length(polar.ReList) 38 | % CL(i)=interp1(min_idx:max_idx(i),polar.c_L_array(min_idx:max_idx(i)),idx_Hit(i),'linear'); 39 | % CD(i)=interp1(min_idx:max_idx(i),polar.c_D_array{1,i}(min_idx:max_idx(i)),idx_Hit(i),'linear'); 40 | % C1check(i)=CD(i)/CL(i)^1.5; 41 | % v=polar.ReList(i)/rho/c_wing*mu; 42 | % FL_array(i)= 0.5*rho*CL(i)*A*v^2; 43 | % P_array(i) = 0.5*rho*CD(i)*A*v^3; 44 | % end 45 | % if(find(isnan(FL_array)==1)) 46 | % display('hups'); 47 | % end 48 | % min_idx=find(FL_array>0,1,'first'); 49 | % max_idx=find(isnan(FL_array)==0,1,'last'); 50 | % 51 | % FL=m*g; 52 | % if(m*gpolar.c_L_max(i) || CL_array(i)=0) ReMin=ReSolutions(i); end 137 | % % end 138 | % % %Check: 139 | % % CLAvailAt_ReMin=interp1(polar.ReList,polar.c_L_max,ReMin); 140 | % % v=ReMin*mu/rho/c_wing; 141 | % % CLRequAt_ReMin=2*m*g/rho/A/v^2; 142 | % end 143 | 144 | %Check 145 | % F_Check=0.5*rho*CL*A*v^2; 146 | % PCheck=0.5*rho*CD*A*v^3; 147 | % dF=F_Check-m*g; 148 | % dP=PCheck-P; 149 | end 150 | -------------------------------------------------------------------------------- /matlab_functions/plotScripts/Plot_AirplaneDesign_Standard.m: -------------------------------------------------------------------------------- 1 | function Plot_AirplaneDesign_Standard(PerfResults, DesignResults, environment, plane, params, flightdata, vars) 2 | %-------------------------------------------------------------------------- 3 | %--- OVERVIEW PLOTS 4 | %-------------------------------------------------------------------------- 5 | if(numel(vars(2).values)<2 ||numel(vars(1).values)<2) 6 | display('ERROR: Not enough design variables specified, cannot plot results! Please specific at least the first two design variables.'); 7 | else 8 | for i = 1:numel(vars(3).values) 9 | %Configure figure 10 | str = strcat(vars(3).shortname, '=', num2str(vars(3).values(i))); 11 | figure('Name',str); 12 | colormap(flipud(colormap(hot))); %colormap(jet); 13 | set(gcf, 'Color', 'w'); 14 | 15 | FontSize = 14; 16 | vmargin = 0.10; 17 | hmargin = 0.05; 18 | 19 | %Convert data first 20 | for k = 1:numel(vars(2).values) 21 | for j = 1:numel(vars(1).values) 22 | %display([i,' ',k,' ',j]); 23 | temp_t_exc(k,j) = PerfResults(i,k,j).t_excess; 24 | temp_min_SoC(k,j) = PerfResults(i,k,j).min_SoC; 25 | temp_chargemargin(k,j) = PerfResults(i,k,j).t_chargemargin; 26 | temp_endurance(k,j) = PerfResults(i,k,j).t_endurance; 27 | temp_m_total(k,j) = DesignResults(i,k,j).m_no_bat + DesignResults(i,k,j).m_bat; 28 | if(isnan(temp_chargemargin(k,j))) temp_chargemargin(k,j) = 0.0; end %Remove NaNs to have smooth contour plotting below 29 | end 30 | end 31 | 32 | %NaN-check to avoid plotting errors below 33 | if(sum(~isnan(temp_endurance))==0) temp_endurance(:,:) = 0.0; end 34 | %if(sum(~isnan(temp_chargemargin))==0) temp_chargemargin(:,:) = 0.0; end 35 | 36 | %PLOT1 : Excess time. Draws contour surface, and contour lines 37 | ax(1) = subplot_tight(2,2,1,[vmargin hmargin]); 38 | hold on 39 | [c2,hc2] = contourf(vars(1).values,vars(2).values,temp_t_exc,[0.01:0.05:min(max(max(max(temp_t_exc))),24.0)],'Linestyle','none'); 40 | [c2,hc2] = contour(vars(1).values,vars(2).values,temp_t_exc,'LevelStep',1.0,'LineColor',[0 0 0],'ShowText','on'); 41 | clabel(c2,hc2,'LabelSpacing',144,'FontSize',FontSize); 42 | title('Excess Time [h]'); 43 | ylabel(vars(2).name); 44 | xlabel(vars(1).name); 45 | cbar_handle(1) = colorbar; 46 | caxis([0,min(max(max(max(temp_t_exc(:,:)))),24.0)]); 47 | 48 | % PLOT2 : Endurance 49 | ax(end+1) = subplot_tight(2,2,3,[vmargin hmargin]); 50 | hold on 51 | [c2,hc2] = contourf(vars(1).values,vars(2).values,temp_endurance, [0.1:0.1:max(max(max(temp_endurance)))],'Linestyle','none'); 52 | [c2,hc2] = contour(vars(1).values,vars(2).values,temp_endurance,'LevelStep',2.0,'LineColor',[0 0 0],'ShowText','on'); 53 | clabel(c2,hc2,'LabelSpacing',144,'FontSize',FontSize); 54 | title('Endurance [h]'); 55 | ylabel(vars(2).name); 56 | xlabel(vars(1).name); 57 | cbar_handle(end+1) = colorbar; 58 | caxis([0,max(max(max(temp_endurance(:,:))))]); 59 | 60 | % PLOT3 : Charge margin 61 | ax(end+1) = subplot_tight(2,2,2,[vmargin hmargin]); 62 | hold on 63 | [c2,hc2] = contourf(vars(1).values,vars(2).values,temp_chargemargin, [0.01:0.05:min(max(max(max(temp_chargemargin))),24.0)],'Linestyle','none'); 64 | [c2,hc2] = contour(vars(1).values,vars(2).values,temp_chargemargin,'LevelStep',1.0,'LineColor',[0 0 0],'ShowText','on'); 65 | title('Charge margin [h]'); 66 | ylabel(vars(2).name); 67 | xlabel(vars(1).name); 68 | cbar_handle(end+1) = colorbar; 69 | caxis([0,min(max(max(max(temp_chargemargin(:,:)))),24.0)]); 70 | 71 | %PLOT4: Optional plots can be chosen here 72 | 73 | % PLOT4.1: Structural Mass 74 | % subplot(2,2,4) 75 | % contourf(designVars.b_array,... 76 | % designVars.m_bat_array, m_struct(:,:,l)',200,... 77 | % 'Linestyle','none'); 78 | % xlabel('Wingspan (b) [m]') 79 | % ylabel('Battery mass (m\_bat) [kg]'); 80 | % title(['Structural Mass [kg] (AR=' num2str(AR) ')']); 81 | % caxis([min(min( m_struct(:,:,l))),max(max(m_struct(:,:,l)))]) 82 | % colorbar 83 | 84 | % % PLOT4.1: Combined Performace (T_exc+T_ChargeMargin) 85 | % subplot(2,2,4) 86 | % a=0.6; 87 | % b=1.0-a; 88 | % comb_perf=a*results.t_chargemargin+b*results.t_excess; 89 | % for i=1:size(results.flightdata_array,1) 90 | % for j=1:size(results.flightdata_array,2) 91 | % for k=1:size(results.flightdata_array,3) 92 | % if results.flightdata_array(i,j,k).minSoC<0.1 93 | % comb_perf(i,j,k)=NaN; 94 | % end 95 | % end 96 | % end 97 | % end 98 | % 99 | % contourf(designVars.b_array,... 100 | % designVars.m_bat_array, comb_perf(:,:,l)',200,... 101 | % 'Linestyle','none'); 102 | % xlabel('Wingspan (b) [m]') 103 | % ylabel('Battery mass (m\_bat) [kg]'); 104 | % title(['a*{t_cm}+b*t_{exc} [kg] (AR=' num2str(AR) ')']); 105 | % caxis([min(min( comb_perf(:,:,l))),max(max(comb_perf(:,:,l)))]) 106 | % colorbar 107 | 108 | % PLOT4.3: Total airplane mass 109 | ax(end+1) = subplot_tight(2,2,4,[vmargin hmargin]); 110 | hold on 111 | [c2,hc2] = contourf(vars(1).values,vars(2).values,temp_m_total, [0.01:0.01:max(max(max(temp_m_total)))],'Linestyle','none'); 112 | [c2,hc2] = contour(vars(1).values,vars(2).values,temp_m_total,'LevelStep',1.0,'LineColor',[0 0 0],'ShowText','on'); 113 | title('Total mass [kg]'); 114 | ylabel(vars(2).name); 115 | xlabel(vars(1).name); 116 | cbar_handle(end+1) = colorbar; 117 | caxis([0,max(max(max(temp_m_total(:,:))))]); 118 | 119 | %Set properties for all plots 120 | set(ax,'FontSize',FontSize); 121 | set(cbar_handle,'FontSize',FontSize); 122 | end 123 | end 124 | 125 | %-------------------------------------------------------------------------- 126 | %--- DETAILED TIME PLOTS 127 | %-------------------------------------------------------------------------- 128 | %DetailedAnalysisForm({designVars.AR_array,designVars.b_array,designVars.m_bat_array,results.flightdata_array,results.t_excess,results.t_endurance,results.t_chargemargin}); 129 | 130 | %-------------------------------------------------------------------------- 131 | %--- SIMPLE TIME PLOTS 132 | %-------------------------------------------------------------------------- 133 | % Allows to choose one configuration and plot detailed data. 134 | for i = 1:numel(vars(3).values) 135 | for k = 1:numel(vars(2).values) 136 | for j = 1:numel(vars(1).values) 137 | if(flightdata(i,k,j).b == 4.5 && flightdata(i,k,j).m_bat == 7.0) 138 | Plot_BasicSimulationTimePlot(flightdata(i,k,j), environment, params, plane); 139 | end 140 | end 141 | end 142 | end 143 | 144 | end -------------------------------------------------------------------------------- /matlab_functions/plotScripts/Plot_AirplaneDesign_ASFinalPaper_PlotOrderChanged.m: -------------------------------------------------------------------------------- 1 | function Plot_AirplaneDesign_ASFinalPaper_PlotOrderChanged(PerfResults, DesignResults, environment, plane, params, flightdata, vars) 2 | 3 | plotnr = 3; 4 | %set(0,'defaulttextinterpreter','latex'); 5 | 6 | FontSize = 14; 7 | if(plotnr==3) Fontsize = 18; 8 | vmargin = 0.10; 9 | hmargin = 0.05; 10 | 11 | %-------------------------------------------------------------------------- 12 | %--- OVERVIEW PLOTS 13 | %-------------------------------------------------------------------------- 14 | if(numel(vars(2).values)<2 ||numel(vars(1).values)<2) 15 | display('ERROR: Not enough design variables specified, cannot plot results! Please specific at least the first two design variables.'); 16 | else 17 | for i = 1:numel(vars(3).values) 18 | %Configure figure 19 | str = strcat(vars(3).shortname, '=', num2str(vars(3).values(i))); 20 | figure('Name',str); 21 | colormap(flipud(colormap(hot))); %colormap(jet); 22 | set(gcf, 'Color', 'w'); 23 | 24 | %Convert data first 25 | for k = 1:numel(vars(2).values) 26 | for j = 1:numel(vars(1).values) 27 | %display([i,' ',k,' ',j]); 28 | temp_t_exc(k,j) = PerfResults(i,k,j).t_excess; 29 | temp_min_SoC(k,j) = PerfResults(i,k,j).min_SoC; 30 | temp_chargemargin(k,j) = PerfResults(i,k,j).t_chargemargin; 31 | temp_endurance(k,j) = PerfResults(i,k,j).t_endurance; 32 | temp_m_total(k,j) = 0.0; 33 | if(~isempty(DesignResults)) DesignResults(i,k,j).m_no_bat + DesignResults(i,k,j).m_bat; end; 34 | if(isnan(temp_chargemargin(k,j))) temp_chargemargin(k,j) = 0.0; end %Remove NaNs to have smooth contour plotting below 35 | end 36 | end 37 | 38 | %NaN-check to avoid plotting errors below 39 | if(sum(~isnan(temp_endurance))==0) temp_endurance(:,:) = 0.0; end 40 | %if(sum(~isnan(temp_chargemargin))==0) temp_chargemargin(:,:) = 0.0; end 41 | 42 | %PLOT1 : Excess time. Draws contour surface, and contour lines 43 | ax(1) = subplot_tight(2,2,1,[vmargin hmargin]); 44 | hold on 45 | ylabel_delta=0.0; 46 | if(plotnr==3) ylabel_delta=1.0; end; 47 | [c2,hc2] = contourf(vars(1).values,vars(2).values+ylabel_delta,temp_t_exc,[0.01:0.05:min(max(max(max(temp_t_exc))),24.0)],'Linestyle','none'); 48 | [c2,hc2] = contour(vars(1).values,vars(2).values+ylabel_delta,temp_t_exc,'LevelStep',1.0,'LineColor',[0 0 0]); 49 | clabel(c2,hc2,'LabelSpacing',305,'FontSize',FontSize); 50 | title('Excess Time [h]'); 51 | h = ylabel(vars(2).name); 52 | h = xlabel(vars(1).name); 53 | cbar_handle(1) = colorbar; 54 | caxis([0,min(max(max(max(temp_t_exc))),24.0)]); 55 | if(plotnr==3) 56 | xlabel('P_{in}/P_{in}^{nom} [-]'); 57 | ylabel('P_{out}/P_{out}^{nom} [-]'); 58 | caxis([0,10.10]); 59 | set(gca,'DataAspectRatio',[0.8 1 1]); 60 | set(get(cbar_handle(1),'ylabel'),'string','T_{exc} [h]') 61 | end 62 | 63 | % PLOT2 : Endurance 64 | ax(end+1) = subplot_tight(2,2,3,[vmargin hmargin]); 65 | hold on 66 | [c2,hc2] = contourf(vars(1).values,vars(2).values,temp_endurance, [0.1:0.1:max(max(max(temp_endurance)))],'Linestyle','none'); 67 | [c2,hc2] = contour(vars(1).values,vars(2).values,temp_endurance,'LevelStep',2.0,'LineColor',[0 0 0],'ShowText','on'); 68 | clabel(c2,hc2,'LabelSpacing',305,'FontSize',FontSize); 69 | title('Endurance [h]'); 70 | ylabel(vars(2).name); 71 | xlabel(vars(1).name); 72 | cbar_handle(end+1) = colorbar; 73 | caxis([0,max(max(max(temp_endurance(:,:))))]); 74 | 75 | % PLOT3 : Charge margin 76 | ax(end+1) = subplot_tight(2,2,2,[vmargin hmargin]); 77 | hold on 78 | [c2,hc2] = contourf(vars(1).values,vars(2).values,temp_chargemargin, [0.01:0.05:min(max(max(max(temp_chargemargin))),24.0)],'Linestyle','none'); 79 | [c2,hc2] = contour(vars(1).values,vars(2).values,temp_chargemargin,'LevelStep',1.0,'LineColor',[0 0 0],'ShowText','on'); 80 | title('Charge margin [h]'); 81 | ylabel(vars(2).name); 82 | xlabel(vars(1).name); 83 | cbar_handle(end+1) = colorbar; 84 | caxis([0,min(max(max(max(temp_chargemargin))),24.0)]); 85 | 86 | %PLOT4: Optional plots can be chosen here 87 | 88 | % PLOT4.1: Structural Mass 89 | % subplot(2,2,4) 90 | % contourf(designVars.b_array,... 91 | % designVars.m_bat_array, m_struct(:,:,l)',200,... 92 | % 'Linestyle','none'); 93 | % xlabel('Wingspan (b) [m]') 94 | % ylabel('Battery mass (m\_bat) [kg]'); 95 | % title(['Structural Mass [kg] (AR=' num2str(AR) ')']); 96 | % caxis([min(min( m_struct(:,:,l))),max(max(m_struct(:,:,l)))]) 97 | % colorbar 98 | 99 | % % PLOT4.1: Combined Performace (T_exc+T_ChargeMargin) 100 | % subplot(2,2,4) 101 | % a=0.6; 102 | % b=1.0-a; 103 | % comb_perf=a*results.t_chargemargin+b*results.t_excess; 104 | % for i=1:size(results.flightdata_array,1) 105 | % for j=1:size(results.flightdata_array,2) 106 | % for k=1:size(results.flightdata_array,3) 107 | % if results.flightdata_array(i,j,k).minSoC<0.1 108 | % comb_perf(i,j,k)=NaN; 109 | % end 110 | % end 111 | % end 112 | % end 113 | % 114 | % contourf(designVars.b_array,... 115 | % designVars.m_bat_array, comb_perf(:,:,l)',200,... 116 | % 'Linestyle','none'); 117 | % xlabel('Wingspan (b) [m]') 118 | % ylabel('Battery mass (m\_bat) [kg]'); 119 | % title(['a*{t_cm}+b*t_{exc} [kg] (AR=' num2str(AR) ')']); 120 | % caxis([min(min( comb_perf(:,:,l))),max(max(comb_perf(:,:,l)))]) 121 | % colorbar 122 | 123 | % PLOT4.3: Total airplane mass 124 | ax(end+1) = subplot_tight(2,2,4,[vmargin hmargin]); 125 | hold on 126 | [c2,hc2] = contourf(vars(1).values,vars(2).values,temp_m_total, [0.01:0.01:max(max(max(temp_m_total)))],'Linestyle','none'); 127 | [c2,hc2] = contour(vars(1).values,vars(2).values,temp_m_total,'LevelStep',1.0,'LineColor',[0 0 0],'ShowText','on'); 128 | title('Total mass [kg]'); 129 | ylabel(vars(2).name); 130 | xlabel(vars(1).name); 131 | cbar_handle(end+1) = colorbar; 132 | caxis([0,max(max(max(temp_m_total(:,:))))]); 133 | 134 | %Set properties for all plots 135 | set(ax,'FontSize',FontSize); 136 | set(cbar_handle,'FontSize',FontSize); 137 | end 138 | end 139 | 140 | %-------------------------------------------------------------------------- 141 | %--- DETAILED TIME PLOTS 142 | %-------------------------------------------------------------------------- 143 | %DetailedAnalysisForm({designVars.AR_array,designVars.b_array,designVars.m_bat_array,results.flightdata_array,results.t_excess,results.t_endurance,results.t_chargemargin}); 144 | 145 | %-------------------------------------------------------------------------- 146 | %--- SIMPLE TIME PLOTS 147 | %-------------------------------------------------------------------------- 148 | % Allows to choose one configuration and plot detailed data. 149 | for i = 1:numel(vars(3).values) 150 | for k = 1:numel(vars(2).values) 151 | for j = 1:numel(vars(1).values) 152 | if(flightdata(i,k,j).b == 4.5 && flightdata(i,k,j).m_bat == 7.0) 153 | Plot_BasicSimulationTimePlot(flightdata(i,k,j), environment, params, plane); 154 | end 155 | end 156 | end 157 | end 158 | 159 | end -------------------------------------------------------------------------------- /AirplaneAnalysis.m: -------------------------------------------------------------------------------- 1 | % ************************************************************************* 2 | % AirplaneAnalysis.m: Solar-powered UAV Conceptual Analysis 3 | % ************************************************************************* 4 | % Descr.: Use this file to perform detailed analysis of your solar- 5 | % powered UAV, i.e. analyse a selected configuration w.r.t operation 6 | % at different days of the year, different latitudes, or different 7 | % atmospheric clearness (e.g. clouds) and turbulence (e.g. wind) 8 | % values. 9 | % Authors: P. Oettershagen, S. Leutenegger (2009-2015), based on A. Noth 10 | % ************************************************************************* 11 | 12 | clear variables 13 | close all 14 | addpath(genpath('matlab_functions')) 15 | 16 | % ------------------------------------------------------------------------- 17 | % STEP 1: ANALYSIS SETUP 18 | % ------------------------------------------------------------------------- 19 | 20 | % Analysis-variables have to be specified here! The choices are VAR.DAY_OF_YEAR, 21 | % VAR.CLEARNESS, VAR.TURBULENCE, VAR.LATITUDE, VAR.POWER (all which are dfined 22 | % in the file Var.m). If you only want to specify one or two variables, simply 23 | % provide a constant value for the remaining (i.e. the second/third) one 24 | %P-Std 25 | % vars(1) = VAR.DAY_OF_YEAR; 26 | % vars(1).values = [5*365/12+21 5*365/12+30 6*365/12+15];%[5*30.4166+21 : 30.55/4 : 7*30.5+21;] 27 | % vars(2) = VAR.LATITUDE; 28 | % vars(2).values = 47.6; 29 | % vars(3) = VAR.TURBULENCE; 30 | % vars(3).values = 0; 31 | 32 | %P2 33 | vars(1) = VAR.DAY_OF_YEAR; 34 | vars(1).values = [5*365/12+21:10:11*365/12+21];%[5*30.4166+21 : 30.55/4 : 7*30.5+21;] 35 | vars(2) = VAR.LATITUDE; 36 | vars(2).values = 0:30:90; 37 | vars(3) = VAR.TURBULENCE; 38 | vars(3).values = 0; 39 | 40 | % Airplane general technological parameters first 41 | initParameters; 42 | params.bat.chrg_lim_type = 2; % Enable charge limiting using experimental data 43 | 44 | %This is the plane-specific data 45 | plane.payload.mass = 0.0; 46 | plane.bat.m = 2.918+0*0.293+0*0.04863; 47 | plane.m_no_bat = 6.92-2.918 + plane.payload.mass; 48 | plane.struct.b = 5.65; 49 | plane.struct.AR = 18.5; 50 | plane.m = plane.m_no_bat+plane.bat.m; 51 | plane.ExpPerf.m = 6.92; % 52 | plane.ExpPerf.solar.surface = 88 * (0.125^2 - 4*70.36E-6); 53 | plane.ExpPerf.P_prop_level = 35.8; % 54 | plane.ExpPerf.rho_P_prop_level = 1.10; % Density at which power curve of aircraft was recorded 55 | plane.avionics.power = 6.0; 56 | plane.payload.power = 0; 57 | plane.prop.P_prop_max = 180.0; 58 | 59 | %These are the (default) environment parameters 60 | environment.dayofyear = 5*30.5+30; % Only used if you do not specify this as a VARIABLE above 61 | environment.lat = 47.6; % Rafz 62 | environment.lon = 8.53; 63 | environment.h_0 = 416+120; % with 120m AGL flight altitude for enough safety 64 | environment.h_max = 700; 65 | environment.T_ground = 31.3+273.15; 66 | environment.turbulence = 0; % Only used if you do not specify this as a VARIABLE above 67 | environment.turbulence_day = 0.0;%0.307; % Relative increase of power consumption during the day, e.g. due to thermals 68 | environment.clearness = 1.0; % Only used if you do not specify this as a VARIABLE above 69 | environment.albedo = 0.12; 70 | environment.add_solar_timeshift = -3600; % [s], due to Daylight Saving Time (DST), actually used for solar income calculations 71 | environment.plot_solar_timeshift = -1.533; % [h], just used for plotting results (to plot them in solar time), does not affect anything else 72 | 73 | %Evaluation settings 74 | settings.DEBUG = 0; % Force DEBUG mode 75 | settings.dt = 100; % Discretization time interval [s] 76 | settings.climbAllowed = 0; 77 | settings.SimType = 0; % 0 = Start on t_eq, 1 = start on specified Initial Conditions 78 | settings.SimTimeDays = 2; % Simulation Time in days (e.g. 1 = std. 24h simulation) 79 | settings.InitCond.SoC = 0.577;%0.46; % State-of-charge [-] 80 | settings.InitCond.t = (11+14.0/60.0)*3600.0;%9.0*3600 + 32*60; % [s]launch time 81 | settings.useAOI = 1; % 1 to enable the use of angle-of-incidence dependent solar module efficiency 82 | settings.useDirDiffRad = 1; % 1 to enable the use of separate diffuse and direct radiation solar module efficiencies 83 | 84 | % ------------------------------------------------------------------------- 85 | % STEP 2: Calculate analysis results 86 | % ------------------------------------------------------------------------- 87 | 88 | % Number of configurations calculated 89 | N = numel(vars(1).values) * numel(vars(2).values) * numel(vars(3).values); 90 | disp(['Number of configurations to be calculated: ' num2str(N)]); 91 | h=waitbar(0,'Progress'); 92 | 93 | str=''; 94 | ctr = 0; 95 | for i = 1:numel(vars(3).values) 96 | for k = 1:numel(vars(2).values) 97 | for j = 1:numel(vars(1).values) 98 | 99 | ctr = ctr+1; 100 | varval(3)=vars(3).values(i); 101 | varval(2)=vars(2).values(k); 102 | varval(1)=vars(1).values(j); 103 | 104 | %Assign variables dynamically 105 | idx = find(vars == VAR.CLEARNESS,1,'first'); 106 | if ~isempty(idx) ; environment.clearness = varval(idx); end 107 | idx = find(vars == VAR.TURBULENCE,1,'first'); 108 | if ~isempty(idx) ; environment.turbulence = varval(idx); end 109 | idx = find(vars == VAR.DAY_OF_YEAR,1,'first'); 110 | if ~isempty(idx) ; environment.dayofyear = varval(idx); end 111 | idx = find(vars == VAR.LATITUDE,1,'first'); 112 | if ~isempty(idx) ; environment.lat = varval(idx); end 113 | idx = find(vars == VAR.POWER,1,'first'); 114 | if ~isempty(idx) ; plane.ExpPerf.P_prop_level = varval(idx); end 115 | 116 | %Execute simulation 117 | [results(i,k,j), flightdata(i,k,j)] = performanceEvaluator(params ,plane, environment, settings); 118 | 119 | if(abs(environment.plot_solar_timeshift) > 0.01) 120 | results(i,k,j).t_eq2 = results(i,k,j).t_eq2 + environment.plot_solar_timeshift * 3600; 121 | results(i,k,j).t_fullcharge = results(i,k,j).t_fullcharge + environment.plot_solar_timeshift * 3600; 122 | results(i,k,j).t_sunrise = results(i,k,j).t_sunrise + environment.plot_solar_timeshift * 3600; 123 | results(i,k,j).t_max = results(i,k,j).t_max + environment.plot_solar_timeshift * 3600; 124 | results(i,k,j).t_sunset = results(i,k,j).t_sunset + environment.plot_solar_timeshift * 3600; 125 | results(i,k,j).t_eq = results(i,k,j).t_eq + environment.plot_solar_timeshift * 3600; 126 | end 127 | 128 | completedRatio = ((i-1)*numel(vars(2).values)*numel(vars(1).values) + (k-1)*numel(vars(1).values) + j)/N; 129 | waitbar(completedRatio,h,[num2str(completedRatio*100.0,'Progress: %.0f\n') '%']); 130 | 131 | str = [str sprintf('#%d| Set: DoY=%g,Lat=%g,P=%g,CLR=%g,Turb=%g Res:Soc_min=%g%%,T_exc=%gh,T_cm=%gh,T_end=%gh CharTimes:t_sr=%gh t_eq1=%gh t_fc=%gh t_fc90=NA t_eq2=%gh t_ss=%gh\n',ctr,... 132 | environment.dayofyear,environment.lat,plane.ExpPerf.P_prop_level,environment.clearness,environment.turbulence,... 133 | results(i,k,j).min_SoC*100,results(i,k,j).t_excess,results(i,k,j).t_chargemargin,results(i,k,j).t_endurance,... 134 | results(i,k,j).t_sunrise/3600,results(i,k,j).t_eq/3600,results(i,k,j).t_fullcharge/3600, results(i,k,j).t_eq2/3600, results(i,k,j).t_sunset/3600)]; 135 | end 136 | end 137 | end 138 | close(h) 139 | 140 | display('*** Performance solutions ***'); 141 | display(str); 142 | 143 | % ------------------------------------------------------------------------- 144 | % STEP 3: PLOTTING 145 | % ------------------------------------------------------------------------- 146 | % Note: Plotting scripts are located in the matlab_functions/PlotScripts 147 | % folder. Please modify and call these scripts if you want to modify the 148 | % plots 149 | 150 | Plot_AirplaneAnalysis_Standard(results, vars); 151 | %Plot_AirplaneAnalysis_ASFinalPaper_PlotOrderChanged(results, [], environment, plane, params, flightdata, vars,1); 152 | 153 | if(numel(vars(1).values)*numel(vars(2).values)*numel(vars(3).values)==1) 154 | Plot_BasicSimulationTimePlot(flightdata,environment,params, plane) 155 | end 156 | -------------------------------------------------------------------------------- /AirplaneDesign.m: -------------------------------------------------------------------------------- 1 | % ************************************************************************* 2 | % AirplaneDesign.m: Solar-powered UAV Conceptual Design 3 | % ************************************************************************* 4 | % Descr.: Use this file to perform the conceptual design of your solar- 5 | % powered UAV, i.e. analyse its performance (in the form of excess time, 6 | % charge margin, endurance and minimum battery state-of-charge) as a 7 | % function of its design variables (wing span b, aspect ratio AR, battery 8 | % mass m_bat). One can also design configurations considering different 9 | % atmospheric clearness (e.g. clouds) and turbulence (e.g. wind) values. 10 | % Authors: P. Oettershagen, S. Leutenegger (2009-2015), based on A. Noth 11 | % ************************************************************************* 12 | 13 | % Initialize 14 | clear variables; 15 | close all; 16 | clc; 17 | addpath(genpath('matlab_functions')) 18 | 19 | % ------------------------------------------------------------------------- 20 | % STEP 1: DESIGN SETUP 21 | % ------------------------------------------------------------------------- 22 | % Set the three variables to choose as design variables here. Choices are the 23 | % labels defined in the file VAR.m (i.e. VAR.WING_SPAN, VAR.BATTERY_MASS, 24 | % VAR.ASPECT_RATIO, VAR.CLEARNESS and VAR.TURBULENCE, VAR.DAY_OF_YEAR, VAR.LATITUDE). 25 | % 26 | % There is basically two design ways: 27 | % 1. Specify wing span, battery mass and aspect ratio ranges to design your 28 | % airplane first 29 | % 2. Then (optionally) choose the optimal wing span and aspect ratio from the 30 | % first step, and set 'VAR.BATTERY_MASS','VAR.CLEARNESS' and 'VAR.TURBULENCE' 31 | % to optimize the partially-fixed configuration in more detail over the 32 | % remaining variables. 33 | % 34 | % Example: 35 | % vars(1)= VAR.WING_SPAN; 36 | % vars(1).values = 3:1:5; %Analyse over wing spans from 3 to 5m in 1m steps 37 | 38 | %Plot1 39 | vars(1) = VAR.WING_SPAN; 40 | vars(1).values = 3.5:1.0:6.5; 41 | vars(2) = VAR.BATTERY_MASS; 42 | vars(2).values = 2.5:1.0:6.5; 43 | vars(3) = VAR.ASPECT_RATIO; 44 | vars(3).values = 18.5; 45 | 46 | % Plot3 47 | % vars(1) = VAR.CLEARNESS; %VAR.BATTERY_MASS; 48 | % vars(1).values = 0.4:0.2:1; 49 | % vars(2) = VAR.TURBULENCE; %VAR.WING_SPAN; 50 | % vars(2).values = 0.0:0.2:0.6; %5.4:0.1:5.8; 51 | % vars(3) = VAR.DAY_OF_YEAR; 52 | % vars(3).values = [floor(3*30.5+21), floor(5*30.5+21)]; 53 | 54 | % Plot2 55 | % vars(1) = VAR.DAY_OF_YEAR; %VAR.BATTERY_MASS; 56 | % vars(1).values = [5*365/12+21 5*365/12+30 6*365/12+15];%floor(0*30.5):5:floor(11*30.5+29); 57 | % vars(2) = VAR.LATITUDE; 58 | % vars(2).values = 47.6;%0:2.5:70; 59 | % vars(3) = VAR.ASPECT_RATIO; 60 | % vars(3).values = 18.5; 61 | 62 | % Airplane general technological parameters first 63 | initParameters; 64 | params.structure.corr_fact = 1.21; % Structural mass correction factor. Set to 65 | % * 1.0 to use the original model without correction. 66 | % * 1.21 to correspond to AtlantikSolar initial structural mass calculation by D. Siebenmann 67 | 68 | % This is the default configuration for our design variables! 69 | % (which is only used if we don't design over b, m_bat or AR) 70 | plane.struct.b = 5.6; 71 | plane.struct.AR = 18.5; 72 | plane.bat.m = 2.9; 73 | 74 | %This is the other plane-specific data. 75 | plane.avionics.power = 6.0; 76 | plane.avionics.mass = 1.20; 77 | plane.payload.power = 0; 78 | plane.payload.mass = 0.0; 79 | plane.prop.P_prop_max = 180.0; 80 | 81 | % Set environment 82 | environment.dayofyear = 5*30.5+21; 83 | environment.lat = 47.6; % 1: Barcelona 2:Tuggen/CH 84 | environment.lon = 8.53; 85 | environment.h_0 = 416+120; % with 120m AGL flight altitude for enough safety 86 | environment.h_max = 700; % Barcelona: 4000ft 87 | environment.T_ground = 25+273.15; 88 | environment.turbulence = 0; 89 | environment.turbulence_day = 0.0; % Relative increase of power consumption during the day, e.g. due to thermals 90 | environment.clearness = 1.0; 91 | environment.albedo = 0.12; 92 | environment.add_solar_timeshift = -3600; % [s], due to Daylight Saving Time (DST), actually used for solar income calculations 93 | environment.plot_solar_timeshift = -1.533; % [h], just used for plotting results (to plot them in solar time), does not affect anything else 94 | 95 | %Evaluation settings 96 | settings.DEBUG = 0; % Force DEBUG mode 97 | settings.dt = 100; % Discretization time interval [s] 98 | settings.climbAllowed = 0; 99 | settings.SimType = 0; % 0 = Start on t_eq, 1 = start on specified Initial Conditions 100 | settings.SimTimeDays = 2; % Simulation Time in days (e.g. 1 = std. 24h simulation) 101 | settings.InitCond.SoC = 0.46; % State-of-charge [-] 102 | settings.InitCond.t = 4.0*3600 + 32*60; % [s]launch time 103 | settings.evaluation.findalt = 0; % if 1, it finds the maximum altitude for eternal flight 104 | %settings.optGRcruise = 0; % 1 to allow cruise at optimal glide ratio & speed when max altitude reached 105 | settings.useAOI = 0; % 1 to enable the use of angle-of-incidence dependent solar module efficiency 106 | settings.useDirDiffRad = 0; % 1 to enable the use of separate diffuse and direct radiation solar module efficiencies 107 | 108 | % ------------------------------------------------------------------------- 109 | % STEP 2: Calculate performance results 110 | % ------------------------------------------------------------------------- 111 | 112 | % Number of configurations calculated 113 | N = numel(vars(1).values) * numel(vars(2).values) * numel(vars(3).values); 114 | disp(['Number of configurations to be calculated: ' num2str(N)]); 115 | h=waitbar(0,'Progress'); 116 | 117 | % Calculate performance results 118 | str=''; 119 | ctr = 0; 120 | for i = 1:numel(vars(3).values) 121 | for k = 1:numel(vars(2).values) 122 | for j = 1:numel(vars(1).values) 123 | 124 | ctr = ctr+1; 125 | varval(3)=vars(3).values(i); 126 | varval(2)=vars(2).values(k); 127 | varval(1)=vars(1).values(j); 128 | 129 | %Assign variables dynamically 130 | idx = find(vars == VAR.WING_SPAN,1,'first'); 131 | if ~isempty(idx) ; plane.struct.b = varval(idx); end 132 | idx = find(vars == VAR.BATTERY_MASS,1,'first'); 133 | if ~isempty(idx) ; plane.bat.m = varval(idx); end 134 | idx = find(vars == VAR.ASPECT_RATIO,1,'first'); 135 | if ~isempty(idx) ; plane.struct.AR = varval(idx); end 136 | idx = find(vars == VAR.CLEARNESS,1,'first'); 137 | if ~isempty(idx) ; environment.clearness = varval(idx); end 138 | idx = find(vars == VAR.TURBULENCE,1,'first'); 139 | if ~isempty(idx) ; environment.turbulence = varval(idx); end 140 | idx = find(vars == VAR.DAY_OF_YEAR,1,'first'); 141 | if ~isempty(idx) ; environment.dayofyear = varval(idx); end 142 | idx = find(vars == VAR.LATITUDE,1,'first'); 143 | if ~isempty(idx) ; environment.lat = varval(idx); end 144 | 145 | [PerfResults(i,k,j),DesignResults(i,k,j),flightdata(i,k,j)] = ... 146 | evaluateSolution(plane,environment,params,settings); 147 | 148 | if(abs(environment.plot_solar_timeshift) > 0.01) 149 | PerfResults(i,k,j).t_eq2 = PerfResults(i,k,j).t_eq2 + environment.plot_solar_timeshift * 3600; 150 | PerfResults(i,k,j).t_fullcharge = PerfResults(i,k,j).t_fullcharge + environment.plot_solar_timeshift * 3600; 151 | PerfResults(i,k,j).t_sunrise = PerfResults(i,k,j).t_sunrise + environment.plot_solar_timeshift * 3600; 152 | PerfResults(i,k,j).t_max = PerfResults(i,k,j).t_max + environment.plot_solar_timeshift * 3600; 153 | PerfResults(i,k,j).t_sunset = PerfResults(i,k,j).t_sunset + environment.plot_solar_timeshift * 3600; 154 | PerfResults(i,k,j).t_eq = PerfResults(i,k,j).t_eq + environment.plot_solar_timeshift * 3600; 155 | end 156 | 157 | str = [str sprintf('#%d| Set: b:%g m_bat:%g AR:%g DoY=%g,Lat=%g,CLR=%g,Turb=%g Res:Soc_min=%.2f%%,T_exc=%.2fh,T_cm=%.2fh,T_end=%.2fh CharTimes:t_sr=%.2fh t_eq1=%.2fh t_fc=%.2fh t_fc90=NA t_eq2=%.2fh t_ss=%.2fh m=%.2f P=%.2f\n',ctr,... 158 | flightdata(i,k,j).b,flightdata(i,k,j).m_bat,flightdata(i,k,j).AR,... 159 | environment.dayofyear,environment.lat,environment.clearness,environment.turbulence,... 160 | PerfResults(i,k,j).min_SoC*100,PerfResults(i,k,j).t_excess,PerfResults(i,k,j).t_chargemargin,PerfResults(i,k,j).t_endurance,... 161 | PerfResults(i,k,j).t_sunrise/3600,PerfResults(i,k,j).t_eq/3600,PerfResults(i,k,j).t_fullcharge/3600, PerfResults(i,k,j).t_eq2/3600, PerfResults(i,k,j).t_sunset/3600,... 162 | DesignResults(i,k,j).m_no_bat+DesignResults(i,k,j).m_bat,PerfResults(i,k,j).P_elec_level_tot_nom)]; 163 | 164 | completedRatio = ((i-1)*numel(vars(2).values)*numel(vars(1).values) + (k-1)*numel(vars(1).values) + j)/N; 165 | waitbar(completedRatio,h,[num2str(completedRatio*100.0,'Progress: %.0f\n') '%']); 166 | end 167 | end 168 | end 169 | close(h) 170 | 171 | display('*** Performance solutions ***'); 172 | display(str); 173 | 174 | % ------------------------------------------------------------------------- 175 | % STEP 3: Plotting 176 | % ------------------------------------------------------------------------- 177 | % Note: Plotting scripts are located in the matlab_functions/PlotScripts 178 | % folder. Please modify and call these scripts if you want to modify the 179 | % plots 180 | 181 | Plot_AirplaneDesign_Standard(PerfResults, DesignResults, environment, plane, params, flightdata, vars); 182 | %Plot_AirplaneDesign_ASFinalPaper_PlotOrderChanged(PerfResults, DesignResults, environment, plane, params, flightdata, vars); 183 | 184 | if(numel(vars(1).values)*numel(vars(2).values)*numel(vars(3).values)==1) 185 | Plot_BasicSimulationTimePlot(flightdata,environment,params, plane) 186 | end -------------------------------------------------------------------------------- /_old/designSpace_Environment_HTAIL_SolarCell_TradeOff.m: -------------------------------------------------------------------------------- 1 | %========================================================================== 2 | % Analyze the Design Space of the senseSoar Airplane, but with respect 3 | % to the environmental conditions actually prevalent! This function thus 4 | % has to be called after the optimization of the Airplane (which has been 5 | % done through the designSpaceNew-function) 6 | % 7 | % Philipp Oettershagen 8 | % 05/2012 9 | %========================================================================== 10 | 11 | % TODO!!!: 12 | % - Set VMax at level flight if max. altitude reached (->use all power!) 13 | % - Multiday flight simulation verification 14 | 15 | 16 | % Initialize 17 | clear variables; 18 | close all; 19 | clc; 20 | % use double core- processing 21 | %matlabpool open 2 22 | %options = optimset('UseParallel','always'); 23 | initParameters; 24 | 25 | % Editable Section: 26 | % ================= 27 | 28 | % Set fixed aircraft parameters 29 | %************************************************************************** 30 | % MOD for different AC configs 31 | %************************************************************************** 32 | %config1: BASECONFIG. b=5.4m, 100 cells (16@tail) 33 | b=5.6; 34 | AR=18.0; 35 | delta_mass=0.0; 36 | nrcells=100; 37 | 38 | %config2: b=5.4m, 84cells (0@tail) 39 | % b=5.4; 40 | % AR=17.7; 41 | % delta_mass=-0.06; %cable & HTP weight, solar cells deducted automatically, wing weight constant 42 | % nrcells=84; 43 | 44 | %config3: b=5.656m, 88cells (0@tail) 45 | % b=5.656; 46 | % AR=18.54; 47 | % delta_mass=-0.06; %cable & HTP weight, 48 | % nrcells=88; 49 | 50 | %config4: b=5.656m, 104cells (16@tail) 51 | % b=5.656; 52 | % AR=18.54; 53 | % delta_mass=0; 54 | % nrcells=104; 55 | 56 | %calculate new AC-config parameters 57 | parameters.avionics.mass = 0.15+delta_mass; %Set delta mass here 58 | parameters.solar.rWngCvrg = nrcells*0.125^2/b/(b/AR); 59 | % ATTENTION: ADD CL^1.5/CD changes manually!!! 60 | 61 | % Set environment and aircraft parameters to be variated 62 | clearness_min=0.30; 63 | clearness_max=1.0; 64 | clearness_step=0.05; 65 | turbulence_min=0.0; 66 | turbulence_max=0.7; 67 | turbulence_step=0.05; 68 | m_bat_min = 2.0; 69 | m_bat_max = 2.0; 70 | m_bat_step = 0.2; 71 | 72 | % Set environment, payload and airfoil 73 | environment.month = 6; 74 | environment.day = 21; 75 | environment.dayofyear = 5*30.5+21; 76 | environment.h = 100; 77 | environment.hmax = 5500*0.3048; %Maximum altitude not be exceeded [m] 78 | environment.T_ground = 300.0; %288.15; 79 | environment.lat = 38.0; 80 | environment.albedo = 0.1; %0.1 for atlantic, more if above ground 81 | environment.clearness = NaN; %Clearness or Cloud-Coverage-factor(CCF) 82 | environment.turbulence = NaN; %Turbulence, defined here as Plevel_turb/Plevel_noturb=(1+turbulence) 83 | environment.usemars = 0; 84 | payload.mass = 0.18; 85 | payload.power = 3; 86 | 87 | % Change some parameters 88 | parameters.multidaysim = 1; % if 0, simulates a single day (-> pure excess time). 89 | % if 1, simulates multiday flight 90 | parameters.propulsion.number = 1; % Number of propulsion units [-] 91 | parameters.structure.shell = 0; % 1 for shell wing, 0 for rib wing 92 | parameters.evaluation.clmb = 1; % 1 to allow altitude changes 93 | parameters.optGRcruise = 0; % 1 to allow cruise at optimal glide ratio & speed when max altitude reached 94 | parameters.evaluation.findalt = 0; % if 1, it finds the maximum 95 | % altitude for eternal flight 96 | parameters.dt = 100; % Discretization time interval [s] 97 | 98 | %-------------------------------------------------------------- 99 | 100 | % Evaluation 101 | % ========== 102 | 103 | % Number of configurations calculated: 104 | N = ((clearness_max-clearness_min)/clearness_step+1)... 105 | *((turbulence_max-turbulence_min)/turbulence_step+1)... 106 | *((m_bat_max-m_bat_min)/m_bat_step+1); 107 | %disp(['Number of configurations to be calculated: ' num2str(N)]) 108 | %disp(['Expected processing time: ' num2str(N*10/3600) ' h']) 109 | 110 | % Start the evaluation 111 | h=waitbar(0,'Progress'); 112 | i=0; 113 | tic 114 | l=0; 115 | 116 | %data storage matrices (3D) 117 | clearness_array=clearness_min:clearness_step:clearness_max; 118 | turbulence_array=turbulence_min:turbulence_step:turbulence_max; 119 | m_bat_array=m_bat_min:m_bat_step:m_bat_max; 120 | t_excess=zeros(length(turbulence_array),length(clearness_array),length(m_bat_array)); 121 | t_endurance=zeros(length(turbulence_array),length(clearness_array),length(m_bat_array)); 122 | t_chargemargin=zeros(length(turbulence_array),length(clearness_array),length(m_bat_array)); 123 | %continuousflight=zeros(length(turbulence_array),length(clearness_array),length(m_bat_array)); 124 | v_tmax=zeros(length(turbulence_array),length(clearness_array),length(m_bat_array)); 125 | m_struct=zeros(length(turbulence_array),length(clearness_array),length(m_bat_array)); 126 | 127 | for m_bat=m_bat_array 128 | l=l+1; 129 | m=0; 130 | for turbulence=turbulence_array 131 | environment.turbulence=turbulence; %Just a hack cause matlab doesnt allow to put environment.turbulence @for loop 132 | m=m+1; 133 | n=0; 134 | for clearness=clearness_array 135 | environment.clearness=clearness; 136 | n=n+1; 137 | 138 | [performance,tmpflightdata,polar,masses] = ... 139 | evaluateSolution(b,AR,m_bat,payload,environment,parameters); 140 | % store 141 | t_excess(m,n,l)=performance.t_excess; 142 | t_endurance(m,n,l)=performance.t_endurance; 143 | t_chargemargin(m,n,l)=performance.t_chargemargin; 144 | %continuousflight(m,n,l)=performance.continuousflight; 145 | v_tmax(m,n,l)=performance.v_tmax; 146 | m_struct(m,n,l)=masses.m_struct; 147 | if(isempty(tmpflightdata)==0) 148 | flightdata_array(m,n,l)=tmpflightdata; 149 | end 150 | flightdata_array(m,n,l).AR=AR; 151 | flightdata_array(m,n,l).b=b; 152 | flightdata_array(m,n,l).m_bat=m_bat; 153 | 154 | % waiting times 155 | i=i+1; 156 | elapsed = toc; 157 | remaining = N*elapsed/i-elapsed; 158 | rhours=floor(remaining/3600); 159 | rminutes=floor((remaining-rhours*3600)/60); 160 | rseconds=floor((remaining-rhours*3600-rminutes*60)); 161 | %disp(['Time remaining: ' num2str(rhours,'%02.0f') ':' ... 162 | % num2str(rminutes,'%02.0f') ':' num2str(rseconds,'%02.0f')]); 163 | waitbar(i/N,h,['Time remaining: ' num2str(rhours,'%02.0f') ':' ... 164 | num2str(rminutes,'%02.0f') ':' num2str(rseconds,'%02.0f')]); 165 | end 166 | end 167 | end 168 | close(h) 169 | 170 | %Plotting 171 | l=1; 172 | i=0; 173 | for m_bat=m_bat_min:m_bat_step:m_bat_max 174 | if(length(clearness_array)<2 ||length(turbulence_array)<2) continue; end 175 | 176 | i=i+1; 177 | %h12(l)=figure(l+1); %TOCHANGE 178 | 179 | %subplot(2,2,1) 180 | [c2,hc2]=contourf(clearness_min:clearness_step:clearness_max,... 181 | turbulence_min:turbulence_step:turbulence_max, t_excess(:,:,l),... 182 | 200,'Linestyle','none','ShowText','off'); 183 | xlabel('CCF [-]') 184 | ylabel('Turbulence [-]'); 185 | title(['Excess Time [h] (m_bat=' num2str(m_bat) 'kg)']); 186 | %caxis([-15,15]) 187 | caxis([0,max(max(max( t_excess(:,:,:))))]) 188 | colorbar 189 | 190 | nc = get(hc2,'Children'); 191 | temp = 100; 192 | select_i=zeros(length(nc),1); 193 | for i = 1:length(nc) 194 | ud1 = get(nc(i),'UserData'); 195 | if (abs(ud1) < temp) 196 | temp = abs(ud1); 197 | end 198 | end 199 | filler=1; 200 | for i = 1:length(nc) 201 | ud1 = get(nc(i),'UserData'); 202 | if (abs(ud1) == temp) 203 | select_i(filler)=i; 204 | filler=filler+1; 205 | end 206 | end 207 | j=1; 208 | if i>0 209 | while(select_i(j)~=0) 210 | set(nc(select_i(j)),'Linestyle','-'); 211 | set(nc(select_i(j)),'LineWidth',2); 212 | j=j+1; 213 | end 214 | end 215 | 216 | 217 | % subplot(2,2,2) 218 | figure 219 | contourf(clearness_min:clearness_step:clearness_max,... 220 | turbulence_min:turbulence_step:turbulence_max, t_endurance(:,:,l),... 221 | 200,'linestyle','none'); 222 | xlabel('ccf [-]') 223 | ylabel('turbulence [-]'); 224 | title(['endurance [h] (m_bat=' num2str(m_bat) 'kg)']); 225 | caxis([0,48]) 226 | colorbar 227 | 228 | % subplot(2,2,3) 229 | % contourf(b_min:b_step:b_max,... 230 | % m_bat_min:m_bat_step:m_bat_max, v_tmax(:,:,l)',... 231 | % 200,'Linestyle','none'); 232 | % xlabel('Wingspan (b) [m]') 233 | % ylabel('Battery mass (m\_bat) [kg]'); 234 | % title(['Nominal Speed [m/s] (AR=' num2str(AR) ')']); 235 | % caxis([min(min( v_tmax(:,:,l))),max(max( v_tmax(:,:,l)))]) 236 | % colorbar 237 | 238 | % subplot(2,2,3) 239 | figure 240 | contourf(clearness_min:clearness_step:clearness_max,... 241 | turbulence_min:turbulence_step:turbulence_max, t_chargemargin(:,:,l),... 242 | 200,'Linestyle','none'); 243 | xlabel('CCF [-]') 244 | ylabel('Turbulence [-]'); 245 | title(['Charge margin [h] (m_bat=' num2str(m_bat) 'kg)']); 246 | caxis([0,max(max(max( t_chargemargin(:,:,:))))]) 247 | colorbar 248 | 249 | % subplot(2,2,4) 250 | % contourf(clearness_min:clearness_step:clearness_max,... 251 | % turbulence_min:turbulence_step:turbulence_max, t_endurance(:,:,l),... 252 | % 200,'Linestyle','none'); 253 | % xlabel('CCF [-]') 254 | % ylabel('Turbulence [-]'); 255 | % title(['Structural Mass [kg] (m_bat=' num2str(m_bat) 'kg)']); 256 | % caxis([min(min( m_struct(:,:,l))),max(max(m_struct(:,:,l)))]) 257 | % colorbar 258 | 259 | l=l+1; 260 | end 261 | 262 | %DetailedAnalysisForm({AR_array,b_array,m_bat_array,flightdata_array,t_excess,t_endurance,t_chargemargin}); 263 | %end use double core- processing 264 | %matlabpool close 265 | %print(h12(1),'test2.emf','-dmeta','-painters') -------------------------------------------------------------------------------- /matlab_functions/solar/solar_radiation_on_surface2.m: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % Moix Pierre-Olivier, January 2004 (Main Code) 3 | % Philipp Oettershagen, Autonomous Systems Lab, ETH Zurich, March 2016 (only small extensions) 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | % 6 | % MODIFIED FOR THE INDEPENDENT SOLAR RADIATION CALCULATOR 7 | % 8 | % solar_radiation_on_surface.m 9 | % modeling of the sun irradiance on a given surface at a given time 10 | % The model is based on Duffie & Beckman: "Solar Engineering of Thermal Processes" 11 | % the equations numbers is refered to this book 12 | % 13 | % Derived from a base script of N. Morel at start but fully revised with 14 | % the equations of the book 15 | % 16 | % 17 | % The function calculates an estimate of the instantaneous 18 | % solar radiation during at a time ts0 on a surface 19 | % of arbitrary slope and orientation. 20 | % 21 | % Parameters: 22 | % slope in degrees: horizontal=0, vertical=90 23 | % orien in degrees South=0, East=90, West=-90, North=180 24 | % ts0 is time in seconds 25 | % day is the day of year (1 = January 1st) 26 | % latitude in degrees, north = positive 27 | % longitude in degrees, 0° = Prime Meridian (Greenwich), postive = east 28 | % altitude in meters 29 | % albedo, from 0 to 1 30 | % typically albedo is 31 | % fresh snow 0.8 to 0.9 32 | % green land with grass 0.12 to 0.25 33 | % sand 0.25 to 0.45 34 | % forest 0.05 to 0.2 35 | % sea and ocean 0.02 to 0.05 if sun height >30 degrees 36 | % 0.02 to 0.2 if sun height <10 degrees 37 | % 38 | % Note that if Daylight Saving Time (DST) is applied at your location, then 39 | % you need to apply that yourself/manually! 40 | % 41 | % The output of the function is an array with the 42 | % following components (the components not calculated 43 | % because of 'flagSolOutput' value are set to zero): 44 | % r(1)=global radiation on the surface 45 | % r(2)=direct radiation on the surface 46 | % r(3)=diffuse radiation on the surface 47 | % r(4)=global horizontal radiation 48 | % r(5)=direct horizontal radiation 49 | % r(6)=diffuse horizontal radiation 50 | % 51 | % r(7)=incidence_angle=incidence angle theta on surface (radians) 52 | % r(8)=azimut_angle=direction of the sun compared to the direction of the south 53 | % r(9)=zenith_angle; 54 | % 55 | 56 | 57 | %aa_interp=interp1(1:12,aa,day/365*12); 58 | % bb_interp=interp1(1:12,aa,day/365*12); 59 | % cc_interp=interp1(1:12,aa,day/365*12); 60 | 61 | function r=solar_radiation_on_surface2(slope,orien,t,day,latitude,longitude, altitude,albedo) 62 | day=day-1; % different convention: day one in input means 0 days over 63 | ts0=(day)*86400+t; 64 | 65 | 66 | %%%%%%%%%%%%%%%%%%%%% 67 | % not modified 68 | timezone=round(longitude*24/360); % [hours], West>0 % PhilippOe: Really? Western timezones are negative! Seems like formula is correct, but comment is wrong! 69 | %We place ourself at Greenwich time in any case 70 | %as basis, this will be much easier: 71 | ts0=ts0-timezone*60*60; 72 | 73 | %%%%%%%%%%%%%%%% 74 | % Limits 75 | max_incidence_angle=89.8*pi/180; %To choose with cell properties 76 | cosmin=cos(max_incidence_angle); % For the limit of direct irradiance over this there 77 | % is total reflectance or the sun is behind the cell 78 | %fminDiff=0.2; % minimum diffuse fraction 79 | 80 | % Changes for simplifications of the inputs 81 | phi=latitude*pi/180; 82 | cosphi=cos(phi); 83 | sinphi=sin(phi); 84 | 85 | 86 | %%%%%%%%%%%%%%%%%%% 87 | % declination 88 | del=23.45*(pi/180)*sin(2*pi*(284+day)/365); % [rad] 89 | cosdel=cos(del); 90 | sindel=sin(del); 91 | da=2*pi*day/365; 92 | 93 | 94 | %%%%%%%%%%%%%%%%%%%%%%% 95 | % sunrise and sunset solar times [s] 96 | omega_s=acos(-sindel/cosdel*sinphi/cosphi); %hour angle at sunrise 1.6.10 97 | tsunrise=43200*(1-omega_s/pi); 98 | tsunset=43200*(1+omega_s/pi); 99 | if(abs(imag(omega_s))>1e-10) %This happens when the sun never sets 100 | %display('Warning: Sunrise and sunset solar angles are imaginary! Does the sun not set?'); %Extension: PhilippOe 101 | tsunrise = 0 - longitude/15*3600 -1; %-1 is added just because of numerical accuracy issues in the following comparison with tsSol0 102 | tsunset = 86400 - longitude/15*3600 +1; 103 | end 104 | 105 | %%%%%%%%%%%%%%%%%%%%% 106 | % et = equation of time, in seconds, 107 | % correction due to the speed variation of the earth around the sun 108 | et=(0.0072*cos(da)-0.0528*cos(2*da)-0.0012*cos(3*da)... 109 | -0.1229*sin(da)-0.1565*sin(2*da)-0.0041*sin(3*da))*3600; 110 | 111 | 112 | %%%%%%%%%%%%%%%%%%%%%%%% 113 | % time difference and other constants 114 | %tdiff=3600*(timezone-longitude/15)-day*86400;%+et; do not consider et, user enters sideral time 115 | %tsSol0=ts0+tdiff; % solar times, one day range 116 | tsSol0 = t+(longitude/15-timezone)*3600; % Calculate User's local Time [Junwoo] 117 | 118 | 119 | %%%%%%%%%%%%%%%%%%%%%% 120 | % solar angles (Duffie & Beckman, pp 15 ff) 121 | ha=pi*(1-tsSol0/43200); % this is the omega in the book, ha is for hour angle 122 | 123 | sinha=sin(ha); 124 | cosha=cos(ha); 125 | beta=pi/180*slope; 126 | sin_beta=sin(beta); 127 | cos_beta=cos(beta); 128 | gam=pi/180*orien; 129 | singam=sin(gam); 130 | cosgam=cos(gam); 131 | cost=sindel*sinphi*cos_beta-sindel*cosphi*sin_beta*cosgam... 132 | +cosdel*cosphi*cos_beta*cosha+cosdel*sinphi*sin_beta*cosgam*cosha... 133 | +cosdel*sin_beta*singam*sinha; %equation 1.6.2 134 | 135 | if (abs(cost)>1+eps) 136 | error(['*** solar: cos(t)=',num2str(cost)]); 137 | end 138 | 139 | incidence_angle=acos(cost); % [rad] 140 | 141 | %the zenith angle: (is incidence angle for an horizontal surface) 142 | cosz=cosphi*cosdel*cosha+sinphi*sindel; 143 | if (abs(cosz)>1+eps) 144 | error(['*** solar: zenith angle=',num2str(cosz)]); 145 | end 146 | zenith_angle=acos(cosz); 147 | 148 | %h=pi/2-acos(cosz); %sun height h (called alpha s in the book), complement of the zenith angle 149 | 150 | 151 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 152 | % Solar angle for which the sun azimut is > pi/2 or < -pi/2, this happens for days longer than 12 hours 153 | % In that case we must determine in which quadrant we are 154 | % equation 1.6.6g 155 | 156 | omega_ew=acos(sindel/cosdel*cosphi/sinphi); 157 | 158 | 159 | % %%%%%%%%%%%%%%%%%%%%%%%%% 160 | % %With the notations of the book: 161 | sinz=sqrt(1-cosz*cosz); 162 | sina=cosdel*sinha/sinz; % this is eq 1.6.6b a is for gamma prime s 163 | if (abs(ha)<=omega_ew), C1=1; 164 | else C1=-1; end 165 | if ((phi-del)>=0), C2=1; 166 | else C2=-1; end 167 | if ((ha)>=0), C3=1; 168 | else C3=-1; end 169 | gamma_s=C1*C2*asin(sina)+C3*(1-C1*C2)*pi/2; 170 | 171 | %correction to put back between -pi and pi: 172 | if (gamma_s<-pi), gamma_s=gamma_s+2*pi; end 173 | if (gamma_s>pi), gamma_s=gamma_s-2*pi; end 174 | % %it's OK, checked it gives the same value 175 | % %%%%%%%%%%%%%%%%%%% 176 | 177 | azimut_angle=gamma_s; 178 | 179 | 180 | 181 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 182 | % Radiation for a completely clear sky 183 | % reference: T.Markus, E.Morris, "Building, Climate and Energy", 184 | % Pitman, London (1980) 185 | 186 | %corrections to apply for each month for radiation: 187 | aa=[1233,1230,1214,1185,1135,1103,1088,1085,1107,1151,1192,1220,1233,1230]; 188 | bb=[142,142,144,156,180,196,205,207,201,177,160,149,142,142]*0.001; 189 | cc=[57,58,60,71,97,121,134,136,122,92,73,57,57,57]*0.001; 190 | 191 | 192 | if (tsSol0tsunset), % then we are during night 193 | r(1:6)=[0,0,0,0,0,0]; 194 | else % day 195 | % linear interpolation 196 | i=floor((day+15)/365*12+1); 197 | r=((day+15-(i-1)*365/12)/30); 198 | aa_interp=aa(i)+(aa(i+1)-aa(i))*r;%interp1(0:12,aa,(day+15)/365*12); 199 | bb_interp=bb(i)+(bb(i+1)-bb(i))*r;%interp1(0:12,bb,(day+15)/365*12); 200 | cc_interp=cc(i)+(cc(i+1)-cc(i))*r;%interp1(0:12,cc,(day+15)/365*12); 201 | m=35/sqrt(1224*cosz*cosz+1); 202 | tau=(1-altitude/44308).^5.257; 203 | qndirCS=aa_interp*exp(-bb_interp*m*tau); 204 | if (cosz>=0), 205 | qhdirCS=qndirCS*cosz; 206 | qhdiffCS=qndirCS*cc_interp; 207 | else 208 | qhdirCS=0; qhdiffCS=0; 209 | end 210 | qhtotCS=qhdirCS+qhdiffCS; 211 | if (cosz65 236 | % climate='Subarctic summer'; 237 | % r0=0.99; 238 | % r1=0.99; 239 | % rk=1.01; 240 | % elseif abs(latitude)<20 241 | % climate='Tropical' 242 | % r0=0.95; 243 | % r1=0.98; 244 | % rk=1.02; 245 | % else 246 | % if month>3&month<9 247 | % climate='Midlattitude summer'; 248 | % r0=0.97; 249 | % r1=0.99; 250 | % rk=1.02; 251 | % else 252 | % climate='Midlattitude winter'; 253 | % r0=1.03; 254 | % r1=1.01; 255 | % rk=1.00; 256 | % end 257 | % end 258 | % 259 | % a0=a0_star*r0; 260 | % a1=a1_star*r1; 261 | % k=k_star*rk; 262 | % 263 | % % we have to put a limitation on the coz to avoid division by 0: 264 | % if cosz0,1,'first'); 163 | if idx_sunrise>numel(flightdata2_array(bidx,mbatidx,ARidx).t_array) 164 | idx_sunrise=idx_sunset; 165 | end 166 | t_sunset=flightdata2_array(bidx,mbatidx,ARidx).t_array(idx_sunset); 167 | t_sunrise=flightdata2_array(bidx,mbatidx,ARidx).t_array(idx_sunrise); 168 | tmp10=['t_sunrise: ' num2str(mod(t_sunrise,86400)/3600) 'hrs']; 169 | tmp11=['t_sunset: ' num2str(mod(t_sunset,86400)/3600) 'hrs']; 170 | tmp12=['T_night: ' num2str((t_sunrise-t_sunset)/3600) 'hrs']; 171 | 172 | set(handles.E_Performance,'String',{tmp1 tmp2 tmp3 ' ' tmp4 tmp5 ' ' tmp6 tmp7 tmp8 ' ' tmp9 ' ' tmp10 tmp11 tmp12}); 173 | 174 | %------------------------------------------------- 175 | % DRAW FLIGHTDATA vs TIME 176 | %------------------------------------------------- 177 | 178 | %figure 1 179 | % [handles.axyy NULL NULL]= plotyy(flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).h_array,... 180 | % flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).v_array); 181 | % legend('h[m]','v[m/ss]'); 182 | plot(handles.axes1, flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).h_array); 183 | legend(handles.axes1, 'h[m]'); 184 | 185 | %figure2 186 | dh_array=zeros(size(flightdata2_array(bidx,mbatidx,ARidx).h_array)); 187 | dh_array(1)=0; 188 | for i=2:size(flightdata2_array(bidx,mbatidx,ARidx).h_array,2) 189 | dh_array(i)=flightdata2_array(bidx,mbatidx,ARidx).h_array(i)-flightdata2_array(bidx,mbatidx,ARidx).h_array(i-1); 190 | end 191 | 192 | plot(handles.axes2, ... 193 | flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).Re_array/100,... 194 | flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).CL_array*1000,... 195 | flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).CD_array*10000,... 196 | flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,dh_array*10); 197 | legend(handles.axes2,'Re/100','Cl*1000','Cd*10000','dh*10'); 198 | 199 | %figure 3 200 | plot(handles.axes3,... 201 | flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).bat_array/3600); 202 | legend(handles.axes3,'E_{Bat}[Wh]'); 203 | ylim(handles.axes3,[0 max(flightdata2_array(bidx,mbatidx,ARidx).bat_array/3600)*1.1]); 204 | 205 | %figure 4 206 | plot(handles.axes4,... 207 | flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).P_solar_array,... 208 | flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).P_elec_tot_array,... 209 | flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,flightdata2_array(bidx,mbatidx,ARidx).P_prop_array); 210 | %flightdata2_array(bidx,mbatidx,ARidx).t_array/3600,P_0); 211 | %ylabel(handles.axes4,'Irradiance [W/m^2]'); 212 | xlabel(handles.axes4,'Time of Day [h]'); 213 | legend(handles.axes4,'P_{Solar}[W]','P_{electot}[W]','P_{prop}[W]');%,'P_0[W]'); 214 | 215 | linkaxes([handles.axes1 handles.axes2 handles.axes3 handles.axes4],'x'); 216 | % -------------------------------------------------------------------- 217 | function FileMenu_Callback(hObject, eventdata, handles) 218 | % hObject handle to FileMenu (see GCBO) 219 | % eventdata reserved - to be defined in a future version of MATLAB 220 | % handles structure with handles and user data (see GUIDATA) 221 | 222 | 223 | % -------------------------------------------------------------------- 224 | function OpenMenuItem_Callback(hObject, eventdata, handles) 225 | % hObject handle to OpenMenuItem (see GCBO) 226 | % eventdata reserved - to be defined in a future version of MATLAB 227 | % handles structure with handles and user data (see GUIDATA) 228 | file = uigetfile('*.fig'); 229 | if ~isequal(file, 0) 230 | open(file); 231 | end 232 | 233 | % -------------------------------------------------------------------- 234 | function PrintMenuItem_Callback(hObject, eventdata, handles) 235 | % hObject handle to PrintMenuItem (see GCBO) 236 | % eventdata reserved - to be defined in a future version of MATLAB 237 | % handles structure with handles and user data (see GUIDATA) 238 | printdlg(handles.figure1) 239 | 240 | % -------------------------------------------------------------------- 241 | function CloseMenuItem_Callback(hObject, eventdata, handles) 242 | % hObject handle to CloseMenuItem (see GCBO) 243 | % eventdata reserved - to be defined in a future version of MATLAB 244 | % handles structure with handles and user data (see GUIDATA) 245 | selection = questdlg(['Close ' get(handles.figure1,'Name') '?'],... 246 | ['Close ' get(handles.figure1,'Name') '...'],... 247 | 'Yes','No','Yes'); 248 | if strcmp(selection,'No') 249 | return; 250 | end 251 | 252 | delete(handles.figure1) 253 | 254 | 255 | % --- Executes on selection change in PM_AR. 256 | function PM_AR_Callback(hObject, eventdata, handles) 257 | % hObject handle to PM_AR (see GCBO) 258 | % eventdata reserved - to be defined in a future version of MATLAB 259 | % handles structure with handles and user data (see GUIDATA) 260 | 261 | % Hints: contents = get(hObject,'String') returns PM_AR contents as cell array 262 | % contents{get(hObject,'Value')} returns selected item from PM_AR 263 | 264 | 265 | % --- Executes during object creation, after setting all properties. 266 | function PM_AR_CreateFcn(hObject, eventdata, handles) 267 | % hObject handle to PM_AR (see GCBO) 268 | % eventdata reserved - to be defined in a future version of MATLAB 269 | % handles empty - handles not created until after all CreateFcns called 270 | 271 | % Hint: popupmenu controls usually have a white background on Windows. 272 | % See ISPC and COMPUTER. 273 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 274 | set(hObject,'BackgroundColor','white'); 275 | end 276 | 277 | 278 | 279 | % --- Executes on selection change in PM_mbat. 280 | function PM_mbat_Callback(hObject, eventdata, handles) 281 | % hObject handle to PM_mbat (see GCBO) 282 | % eventdata reserved - to be defined in a future version of MATLAB 283 | % handles structure with handles and user data (see GUIDATA) 284 | 285 | % Hints: contents = cellstr(get(hObject,'String')) returns PM_mbat contents as cell array 286 | % contents{get(hObject,'Value')} returns selected item from PM_mbat 287 | 288 | 289 | % --- Executes during object creation, after setting all properties. 290 | function PM_mbat_CreateFcn(hObject, eventdata, handles) 291 | % hObject handle to PM_mbat (see GCBO) 292 | % eventdata reserved - to be defined in a future version of MATLAB 293 | % handles empty - handles not created until after all CreateFcns called 294 | 295 | % Hint: popupmenu controls usually have a white background on Windows. 296 | % See ISPC and COMPUTER. 297 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 298 | set(hObject,'BackgroundColor','white'); 299 | end 300 | 301 | 302 | % --- Executes on selection change in PM_b. 303 | function PM_b_Callback(hObject, eventdata, handles) 304 | % hObject handle to PM_b (see GCBO) 305 | % eventdata reserved - to be defined in a future version of MATLAB 306 | % handles structure with handles and user data (see GUIDATA) 307 | 308 | % Hints: contents = cellstr(get(hObject,'String')) returns PM_b contents as cell array 309 | % contents{get(hObject,'Value')} returns selected item from PM_b 310 | 311 | 312 | % --- Executes during object creation, after setting all properties. 313 | function PM_b_CreateFcn(hObject, eventdata, handles) 314 | % hObject handle to PM_b (see GCBO) 315 | % eventdata reserved - to be defined in a future version of MATLAB 316 | % handles empty - handles not created until after all CreateFcns called 317 | 318 | % Hint: popupmenu controls usually have a white background on Windows. 319 | % See ISPC and COMPUTER. 320 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 321 | set(hObject,'BackgroundColor','white'); 322 | end 323 | 324 | 325 | % --- Executes when uipanel1 is resized. 326 | function uipanel1_ResizeFcn(hObject, eventdata, handles) 327 | % hObject handle to uipanel1 (see GCBO) 328 | % eventdata reserved - to be defined in a future version of MATLAB 329 | % handles structure with handles and user data (see GUIDATA) 330 | 331 | 332 | 333 | function E_Performance_Callback(hObject, eventdata, handles) 334 | % hObject handle to E_Performance (see GCBO) 335 | % eventdata reserved - to be defined in a future version of MATLAB 336 | % handles structure with handles and user data (see GUIDATA) 337 | 338 | % Hints: get(hObject,'String') returns contents of E_Performance as text 339 | % str2double(get(hObject,'String')) returns contents of E_Performance as a double 340 | 341 | 342 | % --- Executes during object creation, after setting all properties. 343 | function E_Performance_CreateFcn(hObject, eventdata, handles) 344 | % hObject handle to E_Performance (see GCBO) 345 | % eventdata reserved - to be defined in a future version of MATLAB 346 | % handles empty - handles not created until after all CreateFcns called 347 | 348 | % Hint: edit controls usually have a white background on Windows. 349 | % See ISPC and COMPUTER. 350 | if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 351 | set(hObject,'BackgroundColor','white'); 352 | end 353 | 354 | 355 | % --- Executes on button press in PB_ExportPerfData. 356 | function PB_ExportPerfData_Callback(hObject, eventdata, handles) 357 | % hObject handle to PB_ExportPerfData (see GCBO) 358 | % eventdata reserved - to be defined in a future version of MATLAB 359 | % handles structure with handles and user data (see GUIDATA) 360 | global flightdata2_array; %Indices b,mbat,AR 361 | global performance2; %same 362 | 363 | exportdata=zeros(numel(performance2.t_excess),6); 364 | dim1=size(performance2.t_excess,1); 365 | dim2=size(performance2.t_excess,2); 366 | dim3=size(performance2.t_excess,3); 367 | 368 | for i=1:dim1 369 | for j=1:dim2 370 | for k=1:dim3 371 | exportdata((i-1)*dim2*dim3+(j-1)*dim3+k,1)=flightdata2_array(i,j,k).b; 372 | exportdata((i-1)*dim2*dim3+(j-1)*dim3+k,2)=flightdata2_array(i,j,k).m_bat; 373 | exportdata((i-1)*dim2*dim3+(j-1)*dim3+k,3)=flightdata2_array(i,j,k).AR; 374 | exportdata((i-1)*dim2*dim3+(j-1)*dim3+k,4)=performance2.t_excess(i,j,k); 375 | exportdata((i-1)*dim2*dim3+(j-1)*dim3+k,5)=performance2.t_endurance(i,j,k); 376 | exportdata((i-1)*dim2*dim3+(j-1)*dim3+k,6)=performance2.t_chargemargin(i,j,k); 377 | end 378 | end 379 | end 380 | xlswrite('results\Output.xls',exportdata); 381 | -------------------------------------------------------------------------------- /matlab_functions/plotScripts/Plot_AirplaneAnalysis_ASFinalPaper_PlotOrderChanged.m: -------------------------------------------------------------------------------- 1 | function Plot_AirplaneDesign_ASFinalPaper_PlotOrderChanged(PerfResults, DesignResults, environment, plane, params, flightdata, vars, plotnr) 2 | 3 | close all; 4 | 5 | %-------------------------------------------------------------------------- 6 | %--- PLOT CONFIGURATION 7 | %-------------------------------------------------------------------------- 8 | % IMPORTANT: Set type of plot here (or get it via parameterlist of function) 9 | % 1 = standard plot axes, 2 = Pin/Pout plot axes 10 | choose_manual_labels = false; 11 | 12 | % Plot setup 13 | FontSize = 16; 14 | vmargin = 0.20; 15 | hmargin = 0.045; 16 | datevector = zeros(1,numel(vars(1).values)); 17 | ylabel_delta=0.0; 18 | if(plotnr==1) 19 | datevector = datenum(2015,1*ones(1,numel(vars(1).values)),1*ones(1,numel(vars(1).values)))-2; 20 | vars(1).values = floor(vars(1).values); 21 | elseif(plotnr==2) 22 | ylabel_delta=1.0; 23 | hmargin=0.056; 24 | elseif(plotnr==3) 25 | datevector = datenum(2015,1*ones(1,numel(vars(3).values)),1*ones(1,numel(vars(3).values)))-2; 26 | vars(3).values = floor(vars(3).values); 27 | end 28 | 29 | %set(0,'defaulttextinterpreter','latex'); 30 | %-------------------------------------------------------------------------- 31 | %--- OVERVIEW PLOTS 32 | %-------------------------------------------------------------------------- 33 | if(plotnr<3) 34 | if(numel(vars(2).values)<2 ||numel(vars(1).values)<2) 35 | display('ERROR: Not enough design variables specified, cannot plot results! Please specific at least the first two design variables.'); 36 | else 37 | for i = 1:numel(vars(3).values) 38 | %Configure figure 39 | str = strcat(vars(3).shortname, '=', num2str(vars(3).values(i))); 40 | figure('Name',str,'OuterPosition',[120 0 1200 900]); 41 | colormap(flipud(colormap(hot))); %colormap(jet); 42 | set(gcf, 'Color', 'w'); 43 | 44 | %Convert data first 45 | for k = 1:numel(vars(2).values) 46 | for j = 1:numel(vars(1).values) 47 | %display([i,' ',k,' ',j]); 48 | temp_t_exc(k,j) = PerfResults(i,k,j).t_excess; 49 | temp_min_SoC(k,j) = PerfResults(i,k,j).min_SoC; 50 | temp_chargemargin(k,j) = PerfResults(i,k,j).t_chargemargin; 51 | temp_endurance(k,j) = PerfResults(i,k,j).t_endurance; 52 | temp_m_total(k,j) = 0.0; 53 | if(~isempty(DesignResults)) DesignResults(i,k,j).m_no_bat + DesignResults(i,k,j).m_bat; end; 54 | if(isnan(temp_chargemargin(k,j))) temp_chargemargin(k,j) = 0.0; end %Remove NaNs to have smooth contour plotting below 55 | end 56 | end 57 | 58 | %NaN-check to avoid plotting errors below 59 | if(sum(~isnan(temp_endurance))==0) temp_endurance(:,:) = 0.0; end 60 | %if(sum(~isnan(temp_chargemargin))==0) temp_chargemargin(:,:) = 0.0; end 61 | 62 | %PLOT1 : Excess time. Draws contour surface, and contour lines 63 | ax(1) = subplot_tight(1,3,1,[vmargin hmargin]); 64 | grid on; set(ax(end),'GridLineStyle',':'); 65 | hold on 66 | [c2,hc2] = contourf(vars(1).values+datevector,vars(2).values+ylabel_delta,temp_t_exc,[0.0:0.05:min(max(max(max(temp_t_exc))),24.0)],'Linestyle','none'); 67 | %[c2,hc2] = contour(vars(1).values+datevector,vars(2).values+ylabel_delta,temp_t_exc,[0.05 0.05],'LineColor',[0 0 0]); 68 | [c2,hc2] = contour(vars(1).values+datevector,vars(2).values+ylabel_delta,temp_t_exc,[0:1:min(max(max(max(temp_t_exc))),24.0)],'LineColor',[0 0 0]); 69 | if(choose_manual_labels) clabel(c2,hc2,'manual'); 70 | else clabel(c2,hc2,[0:1:min(max(max(max(temp_t_exc))),24.0)],'LabelSpacing',144,'FontSize',FontSize); 71 | end 72 | title('Excess Time [h]','FontSize',FontSize); 73 | if(plotnr == 2) ylabel(ax(i),'P_{out}/P_{out,nom} [-]','FontSize',FontSize); 74 | else h = ylabel(vars(2).name,'FontSize',FontSize); 75 | end 76 | h = xlabel(vars(1).name,'FontSize',FontSize); 77 | cbar_handle(1) = colorbar('FontSize',FontSize-2,'Location','northoutside'); 78 | caxis([0,min(max(max(max(temp_t_exc))),24.0)]); 79 | 80 | % PLOT2 : Charge margin 81 | ax(end+1) = subplot_tight(1,3,2,[vmargin hmargin]); 82 | grid on; set(ax(end),'GridLineStyle',':'); 83 | hold on 84 | [c2,hc2] = contourf(vars(1).values+datevector,vars(2).values+ylabel_delta,temp_chargemargin, [0.0:0.05:min(max(max(max(temp_chargemargin))),24.0)],'Linestyle','none'); 85 | [c2,hc2] = contour(vars(1).values+datevector,vars(2).values+ylabel_delta,temp_chargemargin,'LevelStep',1.0,'LineColor',[0 0 0]); 86 | if(choose_manual_labels) clabel(c2,hc2,'manual'); 87 | else clabel(c2,hc2,[0:1:min(max(max(max(temp_chargemargin))),24.0)],'LabelSpacing',144,'FontSize',FontSize); 88 | end 89 | title('Charge margin [h]','FontSize',FontSize); 90 | %ylabel(vars(2).name); 91 | xlabel(vars(1).name,'FontSize',FontSize); 92 | cbar_handle(end+1) = colorbar('FontSize',FontSize-2,'Location','northoutside'); 93 | caxis([0,min(max(max(max(temp_chargemargin))),24.0)]); 94 | 95 | % PLOT3 : Endurance 96 | ax(end+1) = subplot_tight(1,3,3,[vmargin hmargin]); 97 | grid on; set(ax(end),'GridLineStyle',':'); 98 | hold on 99 | [c2,hc2] = contourf(vars(1).values+datevector,vars(2).values+ylabel_delta,temp_endurance, [0.0:0.1:max(max(max(temp_endurance)))],'Linestyle','none'); 100 | [c2,hc2] = contour(vars(1).values+datevector,vars(2).values+ylabel_delta,temp_endurance,'LevelStep',2.0,'LineColor',[0 0 0]); 101 | if(choose_manual_labels) clabel(c2,hc2,'manual'); 102 | else clabel(c2,hc2,[0:2:max(max(max(temp_endurance)))],'LabelSpacing',144,'FontSize',FontSize); 103 | end 104 | title('Endurance [h]','FontSize',FontSize); 105 | %ylabel(vars(2).name); 106 | xlabel(vars(1).name,'FontSize',FontSize); 107 | cbar_handle(end+1) = colorbar('FontSize',FontSize-2,'Location','northoutside'); 108 | caxis([0,max(max(max(temp_endurance(:,:))))]); 109 | 110 | % PLOT4: Optional plots can be chosen here 111 | 112 | % FINAL CONFIG 113 | for i = 1:numel(ax) 114 | set(ax(i),'FontSize',FontSize-2); 115 | if(plotnr<2) 116 | PlotEveryXthTick = 10; 117 | set(ax(i),'XTick',floor(vars(1).values(1:PlotEveryXthTick:end)+datevector(1:PlotEveryXthTick:end))); 118 | set(ax(i),'XTickLabel',datestr(floor(vars(1).values(1:PlotEveryXthTick:end)+datevector(1:PlotEveryXthTick:end)),'mmmdd')); 119 | xlim([vars(1).values(1)+datevector(1) vars(1).values(end)+datevector(end)]); 120 | ax(i).XTickLabelRotation=45; 121 | elseif(plotnr==2) 122 | xlabel(ax(i),'P_{in}/P_{in,nom} [-]','FontSize',FontSize); 123 | end 124 | set(ax(i),'layer','top') 125 | end 126 | end 127 | end 128 | elseif(plotnr==3) 129 | %Configure figure 130 | figure('Name','Payload plot','OuterPosition',[120 0 1200 680]); 131 | set(gcf, 'Color', 'w'); 132 | FontSize = 14; 133 | hmargin = 0.055; 134 | 135 | %Convert data first 136 | for i = 1:numel(vars(3).values) 137 | for k = 1:numel(vars(2).values) 138 | for j = 1:numel(vars(1).values) 139 | %display([i,' ',k,' ',j]); 140 | temp_t_exc(i,k,j) = PerfResults(i,k,j).t_excess; 141 | temp_min_SoC(i,k,j) = PerfResults(i,k,j).min_SoC; 142 | temp_chargemargin(i,k,j) = PerfResults(i,k,j).t_chargemargin; 143 | temp_endurance(i,k,j) = PerfResults(i,k,j).t_endurance; 144 | if(temp_t_exc(i,k,j)<0.001) 145 | temp_t_exc(i,k,j) = NaN; 146 | temp_min_SoC(i,k,j) = NaN; 147 | temp_chargemargin(i,k,j) = NaN; 148 | end 149 | temp_m_total(i,k,j) = 0.0; 150 | if(~isempty(DesignResults)) DesignResults(i,k,j).m_no_bat + DesignResults(i,k,j).m_bat; end; 151 | %if(isnan(temp_chargemargin(i,k,j))) temp_chargemargin(i,k,j) = 0.0; end %Remove NaNs to have smooth contour plotting below 152 | end 153 | end 154 | end 155 | 156 | StyleArr = {{'-b'};{'-g'};{':g'};{'-c'};{':c'};{'-r'};{':r'};{'--m'}}; 157 | 158 | %PLOT1 : Excess time. 159 | ax(1) = subplot_tight(1,2,1,[vmargin hmargin]); 160 | grid on; set(ax(end),'GridLineStyle',':'); 161 | hold on 162 | for k=1:numel(vars(2).values) 163 | plot(vars(3).values+datevector, temp_t_exc(:,k,k),StyleArr{k}{1,1},'LineWidth',2); %,CLRArr(i),'LineStyle',StyleArr(i) 164 | hold all 165 | str{k}=strcat('m_{pld}=',num2str(vars(1).values(k)),'kg, P_{pld}=',num2str(vars(2).values(k)),'W'); %(k-1)*numel(vars(1).values)+j 166 | end 167 | str{numel(vars(2).values)} = strcat(str{k},' (m_{bat}=3.8kg)'); 168 | 169 | %legend(str); 170 | t_exc_lim=0.10*plane.bat.m*params.bat.e_density/3600/(plane.ExpPerf.P_prop_level+plane.avionics.power+plane.payload.power); 171 | line([min(vars(3).values+datevector) max(vars(3).values+datevector)],[t_exc_lim t_exc_lim],'Color','red'); 172 | text((min(vars(3).values+datevector)+max(vars(3).values+datevector))/2.0,t_exc_lim+0.32,'Critical excess time (SoC=10%)','FontSize',12,'Color','red','BackgroundColor','w') 173 | xlabel('Day of year [-]','FontSize',FontSize); 174 | ylabel('Excess time T_{exc} [h]','FontSize',FontSize); 175 | 176 | %PLOT2 : Charge margin 177 | ax(end+1) = subplot_tight(1,2,2,[vmargin hmargin]); 178 | grid on; set(ax(end),'GridLineStyle',':'); 179 | hold on 180 | for k=1:numel(vars(2).values) 181 | plot(vars(3).values+datevector, temp_chargemargin(:,k,k),StyleArr{k}{1,1},'LineWidth',2); 182 | hold all 183 | str{k}=strcat('m_{pld}=',num2str(vars(1).values(k)),'kg, P_{pld}=',num2str(vars(2).values(k)),'W'); %(k-1)*numel(vars(1).values)+j 184 | end 185 | str{numel(vars(2).values)} = strcat(str{k},' (m_{bat}=3.8kg)'); 186 | 187 | xlabel('Day of year [-]','FontSize',FontSize); 188 | ylabel('Charge margin T_{cm} [h]','FontSize',FontSize); 189 | 190 | for i = 1:numel(ax) 191 | set(ax(i),'FontSize',FontSize); 192 | PlotEveryXthTick = 10; 193 | set(ax(i),'XTick',floor(vars(3).values(1:PlotEveryXthTick:end)+datevector(1:PlotEveryXthTick:end))); 194 | set(ax(i),'XTickLabel',datestr(floor(vars(3).values(1:PlotEveryXthTick:end)+datevector(1:PlotEveryXthTick:end)),'mmmdd')); 195 | xlim(ax(i),[vars(3).values(1)+datevector(1) vars(3).values(end)+datevector(end)]); 196 | ax(i).XTickLabelRotation=45; 197 | end 198 | legend(str,'FontSize',10); 199 | elseif(plotnr==4) 200 | %Configure figure 201 | figure('Name','Sensitivity plot','OuterPosition',[120 0 1200 680]); 202 | set(gcf, 'Color', 'w'); 203 | FontSize = 14; 204 | hmargin = 0.115; 205 | 206 | %Convert data first 207 | k=1; 208 | for i = 1:numel(vars) 209 | for j = 1:numel(vars(1).values) 210 | %display([i,' ',k,' ',j]); 211 | temp_t_exc(i,k,j) = PerfResults(i,k,j).t_excess; 212 | temp_min_SoC(i,k,j) = PerfResults(i,k,j).min_SoC; 213 | temp_chargemargin(i,k,j) = PerfResults(i,k,j).t_chargemargin; 214 | temp_endurance(i,k,j) = PerfResults(i,k,j).t_endurance; 215 | if(temp_t_exc(i,k,j)<0.001) 216 | temp_t_exc(i,k,j) = NaN; 217 | temp_min_SoC(i,k,j) = NaN; 218 | temp_chargemargin(i,k,j) = NaN; 219 | end 220 | temp_m_total(i,k,j) = 0.0; 221 | if(~isempty(DesignResults)) DesignResults(i,k,j).m_no_bat + DesignResults(i,k,j).m_bat; end; 222 | %if(isnan(temp_chargemargin(i,k,j))) temp_chargemargin(i,k,j) = 0.0; end %Remove NaNs to have smooth contour plotting below 223 | end 224 | end 225 | 226 | StyleArr = {{'b'};{'g'};{'c'};{'r'};}; 227 | 228 | %PLOT1 : Excess time. 229 | ax(1) = subplot_tight(1,2,1,[vmargin hmargin]); 230 | ax(end).XGrid='on'; ax(end).GridLineStyle=':'; 231 | hold on 232 | for k=1:numel(vars) 233 | plot(vars(1).values, squeeze(temp_t_exc(k,1,:)),StyleArr{k}{1,1},'LineWidth',2); %,CLRArr(i),'LineStyle',StyleArr(i) 234 | hold all 235 | end 236 | title('Excess time T_{exc} [h]','FontSize',FontSize); 237 | xlabel('Relative change of technological parameter','FontSize',FontSize); 238 | ylabel('Absolute performance metric','FontSize',FontSize); 239 | curticks_percent=[cellstr(num2str(get(ax(end),'xtick')'*100-100,'%+g'))]; 240 | new_ticks = [char(curticks_percent),char(ones(size(curticks_percent,1),1)*'%')]; 241 | set(ax(end),'xticklabel',new_ticks); 242 | %legend('e_{bat}/e_{bat}^{nom}', '\eta_{sm}/\eta_{sm}^{nom}', '\eta_{prop}/\eta_{prop}^{nom}', 'm_{dry}/m_{dry}^{nom}','Location','Northwest'); 243 | 244 | ax(end+1) = axes('Position',ax(end).Position,'XAxisLocation','top','YAxisLocation','right','Color','none'); 245 | nomval = temp_t_exc(1,1,find(vars(1).values == 1.0)); 246 | ax(end).YLim(1)=ax(end-1).YLim(1) / nomval; 247 | ax(end).YLim(2)=ax(end-1).YLim(2) / nomval; 248 | ax(end).YGrid='on'; ax(end).GridLineStyle=':'; 249 | ax(end).XTick=[]; 250 | ylabel(ax(end),'Relative performance metric change','FontSize',FontSize); 251 | curticks_percent=[cellstr(num2str(get(ax(end),'ytick')'*100-100,'%+g'))]; 252 | new_ticks = [char(curticks_percent),char(ones(size(curticks_percent,1),1)*'%')]; 253 | set(ax(end),'yticklabel',new_ticks); 254 | 255 | %PLOT2 : Charge margin 256 | plothandles = gobjects(numel(vars),1); 257 | ax(end+1) = subplot_tight(1,2,2,[vmargin hmargin]); 258 | ax(end).XGrid='on'; ax(end).GridLineStyle=':'; 259 | hold on 260 | for k=1:numel(vars) 261 | plothandles(k) = plot(vars(1).values, squeeze(temp_chargemargin(k,1,:)),StyleArr{k}{1,1},'LineWidth',2); %,CLRArr(i),'LineStyle',StyleArr(i) 262 | hold all 263 | end 264 | title('Charge margin T_{cm} [h]','FontSize',FontSize); 265 | xlabel('Relative change of technological parameter','FontSize',FontSize); 266 | ylabel('Absolute performance metric','FontSize',FontSize); 267 | curticks_percent=[cellstr(num2str(get(ax(end),'xtick')'*100-100,'%+g'))]; 268 | new_ticks = [char(curticks_percent),char(ones(size(curticks_percent,1),1)*'%')]; 269 | set(ax(end),'xticklabel',new_ticks); 270 | 271 | ax(end+1) = axes('Position',ax(end).Position,'XAxisLocation','top','YAxisLocation','right','Color','none'); 272 | nomval = temp_chargemargin(1,1,find(vars(1).values == 1.0)); 273 | ax(end).YLim(1)=ax(end-1).YLim(1) / nomval; 274 | ax(end).YLim(2)=ax(end-1).YLim(2) / nomval; 275 | ax(end).YGrid='on'; ax(end).GridLineStyle=':'; 276 | ax(end).XTick=[]; 277 | ylabel(ax(end),'Relative performance metric change','FontSize',FontSize); 278 | curticks_percent=[cellstr(num2str(get(ax(end),'ytick')'*100-100,'%+g'))]; 279 | new_ticks = [char(curticks_percent),char(ones(size(curticks_percent,1),1)*'%')]; 280 | set(ax(end),'yticklabel',new_ticks); 281 | 282 | legend(plothandles,'e_{bat}/e_{bat}^{nom}', '\eta_{sm}/\eta_{sm}^{nom}', '\eta_{prop}/\eta_{prop}^{nom}', 'm_{dry}/m_{dry}^{nom}','Location','Southeast'); 283 | 284 | for i = 1:numel(ax) 285 | set(ax(i),'XTickMode','manual','XLimMode','manual'); 286 | set(ax(i),'FontSize',FontSize-2); 287 | end 288 | end 289 | %-------------------------------------------------------------------------- 290 | %--- DETAILED TIME PLOTS 291 | %-------------------------------------------------------------------------- 292 | %DetailedAnalysisForm({designVars.AR_array,designVars.b_array,designVars.m_bat_array,results.flightdata_array,results.t_excess,results.t_endurance,results.t_chargemargin}); 293 | 294 | %-------------------------------------------------------------------------- 295 | %--- SIMPLE TIME PLOTS 296 | %-------------------------------------------------------------------------- 297 | % Allows to choose one configuration and plot detailed data. 298 | % for i = 1:numel(vars(3).values) 299 | % for k = 1:numel(vars(2).values) 300 | % for j = 1:numel(vars(1).values) 301 | % if(flightdata(i,k,j).b == 4.5 && flightdata(i,k,j).m_bat == 7.0) 302 | % Plot_BasicSimulationTimePlot(flightdata(i,k,j), environment, params, plane); 303 | % end 304 | % end 305 | % end 306 | % end 307 | 308 | end --------------------------------------------------------------------------------