├── .gitattributes ├── .gitignore ├── Aerodynamics ├── Aerodynamics.m ├── Airfoils │ ├── FX7112030.dat │ ├── FX7112030m30.dat │ ├── FX7112030p30.dat │ ├── MH139F.dat │ ├── MH139Fm20.dat │ ├── MH139Fp20.dat │ ├── naca0005_-15.txt │ ├── naca0005_0.dat │ ├── we_-15.txt │ ├── we_0.txt │ └── we_15.txt ├── Polars │ └── old │ │ ├── MH139F-120000.dat │ │ ├── MH139F-120000.png │ │ ├── MH139F-1920000.dat │ │ ├── MH139F-1920000.png │ │ ├── MH139F-240000.dat │ │ ├── MH139F-240000.png │ │ ├── MH139F-2840000.dat │ │ ├── MH139F-2840000.png │ │ ├── MH139F-30000.dat │ │ ├── MH139F-30000.png │ │ ├── MH139F-480000.dat │ │ ├── MH139F-480000.png │ │ ├── MH139F-60000.dat │ │ ├── MH139F-60000.png │ │ ├── MH139F-960000.dat │ │ └── MH139F-960000.png ├── calculate_polar.m ├── calculate_polar_angle.m ├── init.m └── libf2c.lib ├── AirplaneAnalysis.m ├── AirplaneDesign.m ├── LICENSE.txt ├── _old └── designSpace_Environment_HTAIL_SolarCell_TradeOff.m ├── _org └── SimTool_org.zip ├── libraries └── stdatmo.zip ├── matlab_functions ├── ChargeLimiter.m ├── VAR.m ├── _old │ ├── DetailedAnalysisForm.fig │ ├── DetailedAnalysisForm.m │ ├── performanceEvaluator_FWpropagation.m │ └── performanceEvaluator_extended.m ├── aerodynamics │ ├── CalcFlightPars_OptCruise.m │ ├── CalcOptimalFlyingSpeedsFromPolars.m │ ├── CalcPFromPolars.m │ ├── PreparePars_OptCruise.m │ ├── findAir.m │ ├── init.m │ ├── initop.m │ └── stdatmo.m ├── evaluateSolution.m ├── hOptimizer.m ├── initParameters.m ├── performanceEvaluator.m ├── plotScripts │ ├── Plot_AirplaneAnalysis_ASFinalPaper_PlotOrderChanged.m │ ├── Plot_AirplaneAnalysis_DifferentPlaces.m │ ├── Plot_AirplaneAnalysis_FSRPaper.m │ ├── Plot_AirplaneAnalysis_Standard.m │ ├── Plot_AirplaneDesignEnvironment_ASFinalPaper.m │ ├── Plot_AirplaneDesign_ASFinalPaper_PlotOrderChanged.m │ ├── Plot_AirplaneDesign_Standard.m │ ├── Plot_BasicSimulationTimePlot.m │ └── Plot_BasicSimulationTimePlot_ASJFR81hFlightPaper.m ├── solar │ ├── CalculateIncomingSolarPower.m │ └── solar_radiation_on_surface2.m ├── structure │ ├── StructureDesigner.m │ ├── StructureDesignerRibWing.m │ └── mat_data.m └── subplot_tight.m └── readme.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.m diff -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | results/* 2 | *.asv 3 | *.jpg 4 | *.eps 5 | *.png 6 | *.jpg -------------------------------------------------------------------------------- /Aerodynamics/Aerodynamics.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/Aerodynamics.m -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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_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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-120000.dat: -------------------------------------------------------------------------------- 1 | -10.000 -0.350 0.121 -0.042 2 | -9.500 -0.357 0.111 -0.045 3 | -9.000 -0.329 0.103 -0.040 4 | -8.500 -0.323 0.098 -0.039 5 | -8.000 -0.341 0.094 -0.039 6 | -7.000 -0.434 0.090 -0.028 7 | -6.500 -0.413 0.077 -0.043 8 | -6.000 -0.363 0.070 -0.049 9 | -5.500 -0.313 0.058 -0.068 10 | -5.000 -0.251 0.051 -0.079 11 | -4.500 -0.166 0.032 -0.088 12 | -3.500 -0.011 0.023 -0.097 13 | -3.000 0.061 0.021 -0.100 14 | -2.500 0.138 0.019 -0.104 15 | -2.000 0.200 0.017 -0.106 16 | -1.500 0.252 0.016 -0.102 17 | -1.000 0.324 0.016 -0.103 18 | -0.500 0.390 0.016 -0.106 19 | 0.000 0.454 0.016 -0.107 20 | 0.500 0.513 0.016 -0.107 21 | 1.000 0.575 0.016 -0.108 22 | 1.500 0.631 0.016 -0.107 23 | 2.000 0.686 0.016 -0.106 24 | 2.500 0.742 0.016 -0.105 25 | 3.000 0.798 0.016 -0.105 26 | 3.500 0.849 0.016 -0.103 27 | 4.000 0.901 0.016 -0.102 28 | 4.500 0.951 0.016 -0.100 29 | 5.000 1.002 0.017 -0.098 30 | 5.500 1.053 0.017 -0.097 31 | 6.000 1.101 0.017 -0.095 32 | 6.500 1.146 0.018 -0.092 33 | 7.000 1.189 0.019 -0.090 34 | 7.500 1.230 0.020 -0.087 35 | 8.000 1.269 0.021 -0.085 36 | 8.500 1.304 0.022 -0.082 37 | 9.000 1.336 0.024 -0.078 38 | 9.500 1.362 0.026 -0.074 39 | 10.000 1.380 0.027 -0.068 40 | 10.500 1.391 0.030 -0.062 41 | 11.000 1.399 0.033 -0.057 42 | 11.500 1.409 0.036 -0.052 43 | 12.000 1.421 0.040 -0.048 44 | 12.500 1.428 0.043 -0.045 45 | 13.000 1.444 0.048 -0.042 46 | 13.500 1.447 0.053 -0.039 47 | 14.000 1.448 0.058 -0.036 48 | 14.500 1.440 0.066 -0.034 49 | 15.500 1.386 0.083 -0.034 50 | 16.000 1.339 0.096 -0.038 51 | -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-120000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/Polars/old/MH139F-120000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-1920000.dat: -------------------------------------------------------------------------------- 1 | -9.000 -0.497 0.013 -0.109 2 | -8.500 -0.446 0.012 -0.109 3 | -8.000 -0.395 0.012 -0.108 4 | -7.500 -0.343 0.011 -0.107 5 | -7.000 -0.290 0.010 -0.107 6 | -6.500 -0.235 0.010 -0.107 7 | -6.000 -0.180 0.009 -0.107 8 | -5.500 -0.124 0.008 -0.107 9 | -5.000 -0.067 0.008 -0.107 10 | -4.500 -0.011 0.008 -0.107 11 | -4.000 0.046 0.007 -0.107 12 | -3.500 0.103 0.007 -0.107 13 | -3.000 0.161 0.007 -0.107 14 | -2.500 0.219 0.007 -0.108 15 | -2.000 0.276 0.006 -0.108 16 | -1.500 0.333 0.006 -0.108 17 | -0.500 0.446 0.005 -0.109 18 | 0.000 0.502 0.005 -0.109 19 | 0.500 0.559 0.005 -0.109 20 | 1.000 0.614 0.005 -0.109 21 | 1.500 0.669 0.005 -0.109 22 | 2.000 0.723 0.005 -0.108 23 | 2.500 0.776 0.005 -0.108 24 | 3.000 0.825 0.006 -0.106 25 | 3.500 0.882 0.006 -0.106 26 | 4.000 0.935 0.006 -0.106 27 | 4.500 0.988 0.007 -0.106 28 | 5.000 1.041 0.007 -0.105 29 | 5.500 1.092 0.008 -0.104 30 | 6.000 1.144 0.008 -0.104 31 | 6.500 1.195 0.009 -0.103 32 | 7.000 1.245 0.009 -0.102 33 | 7.500 1.294 0.010 -0.101 34 | 8.000 1.340 0.011 -0.100 35 | 8.500 1.385 0.012 -0.098 36 | 9.000 1.428 0.012 -0.096 37 | 9.500 1.471 0.013 -0.095 38 | 10.000 1.514 0.014 -0.093 39 | 10.500 1.552 0.015 -0.090 40 | 11.000 1.590 0.016 -0.087 41 | 11.500 1.619 0.017 -0.083 42 | 12.000 1.650 0.018 -0.079 43 | 12.500 1.679 0.019 -0.076 44 | 13.000 1.702 0.021 -0.072 45 | 13.500 1.725 0.022 -0.068 46 | 14.000 1.749 0.024 -0.065 47 | 14.500 1.767 0.027 -0.062 48 | 15.000 1.777 0.030 -0.059 49 | 15.500 1.792 0.033 -0.056 50 | 16.000 1.805 0.036 -0.054 51 | -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-1920000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/Polars/old/MH139F-1920000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-240000.dat: -------------------------------------------------------------------------------- 1 | -10.000 -0.340 0.112 -0.042 2 | -9.500 -0.348 0.101 -0.044 3 | -9.000 -0.339 0.096 -0.042 4 | -8.500 -0.336 0.091 -0.042 5 | -8.000 -0.351 0.086 -0.039 6 | -7.500 -0.357 0.080 -0.043 7 | -6.500 -0.147 0.021 -0.098 8 | -5.500 -0.131 0.033 -0.109 9 | -5.000 -0.067 0.020 -0.110 10 | -4.500 -0.007 0.016 -0.111 11 | -4.000 0.053 0.015 -0.112 12 | -3.500 0.107 0.014 -0.111 13 | -3.000 0.162 0.013 -0.111 14 | -2.500 0.216 0.011 -0.112 15 | -2.000 0.268 0.010 -0.111 16 | -1.500 0.321 0.010 -0.110 17 | -1.000 0.370 0.010 -0.107 18 | -0.500 0.412 0.010 -0.103 19 | 0.000 0.485 0.009 -0.105 20 | 0.500 0.540 0.010 -0.105 21 | 1.000 0.596 0.010 -0.105 22 | 1.500 0.651 0.010 -0.105 23 | 2.000 0.705 0.010 -0.105 24 | 2.500 0.758 0.010 -0.104 25 | 3.000 0.811 0.010 -0.103 26 | 3.500 0.864 0.010 -0.102 27 | 4.000 0.916 0.011 -0.101 28 | 4.500 0.967 0.011 -0.100 29 | 5.000 1.016 0.011 -0.099 30 | 5.500 1.064 0.012 -0.097 31 | 6.000 1.109 0.013 -0.095 32 | 6.500 1.153 0.014 -0.093 33 | 7.000 1.195 0.015 -0.091 34 | 7.500 1.238 0.015 -0.089 35 | 8.000 1.278 0.016 -0.087 36 | 8.500 1.315 0.018 -0.084 37 | 9.000 1.350 0.019 -0.081 38 | 9.500 1.377 0.020 -0.077 39 | 10.000 1.402 0.022 -0.072 40 | 10.500 1.420 0.024 -0.068 41 | 11.000 1.434 0.026 -0.063 42 | 11.500 1.443 0.030 -0.058 43 | 12.000 1.453 0.033 -0.055 44 | 12.500 1.458 0.037 -0.051 45 | 13.000 1.469 0.041 -0.049 46 | 13.500 1.467 0.046 -0.046 47 | 14.000 1.467 0.051 -0.043 48 | 14.500 1.470 0.056 -0.042 49 | 15.000 1.470 0.062 -0.042 50 | 15.500 1.463 0.068 -0.041 51 | 16.000 1.443 0.077 -0.040 52 | -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-240000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/Polars/old/MH139F-240000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-2840000.dat: -------------------------------------------------------------------------------- 1 | -9.000 -0.501 0.013 -0.108 2 | -8.500 -0.452 0.012 -0.107 3 | -8.000 -0.402 0.010 -0.107 4 | -7.500 -0.348 0.009 -0.107 5 | -7.000 -0.293 0.009 -0.107 6 | -6.500 -0.237 0.008 -0.107 7 | -6.000 -0.180 0.008 -0.107 8 | -5.500 -0.124 0.008 -0.107 9 | -5.000 -0.067 0.007 -0.107 10 | -4.500 -0.009 0.007 -0.107 11 | -4.000 0.048 0.007 -0.107 12 | -3.500 0.106 0.007 -0.108 13 | -3.000 0.163 0.006 -0.108 14 | -2.500 0.221 0.006 -0.108 15 | -2.000 0.279 0.006 -0.109 16 | -1.500 0.336 0.006 -0.109 17 | -1.000 0.393 0.005 -0.109 18 | -0.500 0.449 0.005 -0.109 19 | 0.000 0.505 0.005 -0.110 20 | 0.500 0.561 0.005 -0.110 21 | 1.000 0.617 0.005 -0.110 22 | 1.500 0.672 0.005 -0.109 23 | 2.000 0.727 0.005 -0.109 24 | 2.500 0.781 0.005 -0.109 25 | 3.000 0.835 0.006 -0.108 26 | 3.500 0.887 0.006 -0.108 27 | 4.000 0.939 0.006 -0.107 28 | 4.500 0.991 0.007 -0.106 29 | 5.000 1.044 0.007 -0.106 30 | 5.500 1.097 0.007 -0.106 31 | 6.000 1.150 0.008 -0.105 32 | 6.500 1.201 0.008 -0.105 33 | 7.000 1.251 0.009 -0.104 34 | 7.500 1.300 0.009 -0.103 35 | 8.000 1.347 0.010 -0.101 36 | 8.500 1.393 0.011 -0.100 37 | 9.000 1.439 0.012 -0.099 38 | 9.500 1.485 0.012 -0.097 39 | 10.000 1.527 0.013 -0.095 40 | 10.500 1.571 0.014 -0.093 41 | 11.000 1.609 0.015 -0.091 42 | 11.500 1.646 0.016 -0.088 43 | 12.000 1.677 0.016 -0.084 44 | 12.500 1.704 0.018 -0.080 45 | 13.000 1.735 0.019 -0.076 46 | 13.500 1.761 0.020 -0.073 47 | 14.000 1.780 0.022 -0.069 48 | 14.500 1.803 0.024 -0.066 49 | 15.000 1.824 0.026 -0.063 50 | 15.500 1.839 0.029 -0.060 51 | 16.000 1.848 0.032 -0.057 52 | -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-2840000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/Polars/old/MH139F-2840000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-30000.dat: -------------------------------------------------------------------------------- 1 | -10.000 -0.320 0.131 -0.018 2 | -9.500 -0.305 0.124 -0.017 3 | -9.000 -0.292 0.118 -0.016 4 | -8.500 -0.286 0.114 -0.014 5 | -8.000 -0.304 0.113 -0.009 6 | -7.500 -0.250 0.100 -0.010 7 | -7.000 -0.230 0.094 -0.007 8 | -6.500 -0.204 0.087 -0.004 9 | -4.500 -0.404 0.069 -0.026 10 | -4.000 -0.360 0.058 -0.039 11 | -3.500 -0.300 0.049 -0.049 12 | -3.000 -0.235 0.042 -0.054 13 | -2.500 -0.176 0.038 -0.057 14 | -2.000 -0.117 0.035 -0.058 15 | -1.500 -0.065 0.032 -0.054 16 | -1.000 -0.046 0.030 -0.046 17 | -0.500 0.002 0.031 -0.048 18 | 0.000 0.047 0.033 -0.050 19 | 0.500 0.088 0.034 -0.051 20 | 1.000 0.128 0.036 -0.052 21 | 1.500 0.166 0.039 -0.053 22 | 2.000 0.202 0.041 -0.054 23 | 2.500 0.235 0.044 -0.055 24 | 3.000 0.267 0.047 -0.056 25 | 3.500 0.335 0.052 -0.064 26 | 4.000 0.417 0.057 -0.074 27 | 4.500 0.485 0.061 -0.081 28 | 5.000 0.543 0.066 -0.086 29 | 5.500 0.593 0.071 -0.089 30 | 6.000 0.634 0.075 -0.090 31 | 6.500 0.670 0.080 -0.091 32 | 7.000 0.698 0.085 -0.091 33 | 8.000 0.683 0.101 -0.094 34 | 8.500 0.652 0.108 -0.094 35 | 9.000 0.782 0.112 -0.094 36 | 9.500 0.704 0.122 -0.097 37 | 10.500 0.744 0.136 -0.099 38 | 11.500 0.798 0.154 -0.103 39 | 12.000 0.826 0.164 -0.105 40 | 12.500 0.835 0.171 -0.105 41 | 13.000 0.847 0.177 -0.105 42 | 13.500 0.862 0.184 -0.106 43 | 14.000 0.889 0.195 -0.108 44 | 14.500 0.878 0.195 -0.108 45 | 15.000 0.885 0.201 -0.110 46 | 15.500 0.908 0.211 -0.112 47 | 16.000 0.945 0.227 -0.114 48 | -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-30000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/Polars/old/MH139F-30000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-480000.dat: -------------------------------------------------------------------------------- 1 | -10.000 -0.340 0.107 -0.037 2 | -9.500 -0.336 0.100 -0.039 3 | -9.000 -0.336 0.094 -0.041 4 | -8.500 -0.345 0.087 -0.042 5 | -8.000 -0.335 0.077 -0.052 6 | -6.500 -0.222 0.019 -0.109 7 | -6.000 -0.165 0.017 -0.110 8 | -5.500 -0.111 0.015 -0.110 9 | -5.000 -0.058 0.013 -0.109 10 | -4.500 -0.005 0.012 -0.109 11 | -4.000 0.050 0.011 -0.108 12 | -3.500 0.105 0.010 -0.108 13 | -3.000 0.161 0.010 -0.108 14 | -2.500 0.217 0.009 -0.108 15 | -2.000 0.271 0.008 -0.109 16 | -1.500 0.326 0.008 -0.108 17 | -1.000 0.381 0.008 -0.108 18 | -0.500 0.434 0.007 -0.107 19 | 0.000 0.486 0.007 -0.106 20 | 0.500 0.532 0.007 -0.103 21 | 1.000 0.597 0.007 -0.105 22 | 1.500 0.653 0.007 -0.105 23 | 2.000 0.709 0.007 -0.104 24 | 2.500 0.763 0.007 -0.104 25 | 3.000 0.817 0.008 -0.104 26 | 3.500 0.870 0.008 -0.103 27 | 4.000 0.922 0.008 -0.102 28 | 4.500 0.973 0.009 -0.102 29 | 5.000 1.023 0.009 -0.100 30 | 5.500 1.072 0.010 -0.099 31 | 6.000 1.118 0.011 -0.098 32 | 6.500 1.166 0.011 -0.097 33 | 7.000 1.212 0.012 -0.095 34 | 7.500 1.258 0.013 -0.094 35 | 8.000 1.302 0.014 -0.092 36 | 8.500 1.343 0.015 -0.090 37 | 9.000 1.382 0.016 -0.087 38 | 9.500 1.417 0.017 -0.084 39 | 10.000 1.444 0.018 -0.080 40 | 10.500 1.468 0.020 -0.075 41 | 11.000 1.489 0.022 -0.071 42 | 11.500 1.509 0.024 -0.067 43 | 12.000 1.524 0.027 -0.063 44 | 12.500 1.545 0.029 -0.060 45 | 13.000 1.549 0.033 -0.056 46 | 13.500 1.555 0.037 -0.053 47 | 14.000 1.568 0.041 -0.051 48 | 14.500 1.572 0.045 -0.050 49 | 15.000 1.564 0.051 -0.048 50 | 15.500 1.541 0.060 -0.047 51 | 16.000 1.544 0.065 -0.047 52 | -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-480000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/Polars/old/MH139F-480000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-60000.dat: -------------------------------------------------------------------------------- 1 | -10.000 -0.385 0.134 -0.038 2 | -9.500 -0.324 0.117 -0.032 3 | -9.000 -0.332 0.113 -0.034 4 | -8.500 -0.391 0.116 -0.036 5 | -8.000 -0.320 0.101 -0.032 6 | -7.500 -0.372 0.101 -0.029 7 | -7.000 -0.386 0.095 -0.023 8 | -6.500 -0.390 0.091 -0.017 9 | -5.500 -0.435 0.084 -0.009 10 | -5.000 -0.445 0.079 -0.008 11 | -4.500 -0.443 0.074 -0.005 12 | -3.500 -0.277 0.041 -0.055 13 | -3.000 -0.218 0.036 -0.057 14 | -2.500 -0.164 0.032 -0.059 15 | -2.000 -0.093 0.030 -0.063 16 | -1.500 0.005 0.026 -0.070 17 | -1.000 0.054 0.026 -0.066 18 | -0.500 0.140 0.028 -0.074 19 | 0.000 0.221 0.029 -0.081 20 | 0.500 0.295 0.030 -0.086 21 | 1.000 0.364 0.031 -0.089 22 | 1.500 0.435 0.032 -0.093 23 | 2.000 0.509 0.033 -0.096 24 | 2.500 0.572 0.034 -0.097 25 | 3.000 0.642 0.035 -0.099 26 | 3.500 0.720 0.034 -0.101 27 | 4.000 0.784 0.034 -0.100 28 | 4.500 0.844 0.034 -0.099 29 | 5.000 0.888 0.035 -0.096 30 | 5.500 0.950 0.034 -0.094 31 | 6.000 1.015 0.033 -0.092 32 | 6.500 1.085 0.031 -0.091 33 | 7.000 1.149 0.031 -0.090 34 | 7.500 1.191 0.032 -0.086 35 | 8.000 1.251 0.032 -0.085 36 | 8.500 1.284 0.033 -0.081 37 | 9.000 1.330 0.034 -0.078 38 | 9.500 1.355 0.037 -0.074 39 | 10.000 1.391 0.039 -0.070 40 | 10.500 1.404 0.042 -0.065 41 | 11.000 1.416 0.045 -0.059 42 | 11.500 1.429 0.050 -0.054 43 | 12.000 1.442 0.054 -0.050 44 | 12.500 1.415 0.060 -0.043 45 | 13.000 1.429 0.067 -0.040 46 | 13.500 1.131 0.109 -0.053 47 | 14.000 1.300 0.090 -0.036 48 | 14.500 1.049 0.149 -0.068 49 | 15.000 1.018 0.168 -0.077 50 | 15.500 0.956 0.202 -0.100 51 | 16.000 0.950 0.206 -0.105 52 | -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-60000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/Polars/old/MH139F-60000.png -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-960000.dat: -------------------------------------------------------------------------------- 1 | -9.000 -0.520 0.025 -0.097 2 | -8.500 -0.453 0.021 -0.102 3 | -8.000 -0.381 0.019 -0.107 4 | -7.500 -0.326 0.016 -0.109 5 | -7.000 -0.278 0.013 -0.109 6 | -6.500 -0.227 0.012 -0.108 7 | -6.000 -0.174 0.011 -0.108 8 | -5.500 -0.120 0.010 -0.107 9 | -5.000 -0.065 0.010 -0.107 10 | -4.500 -0.010 0.009 -0.107 11 | -4.000 0.046 0.009 -0.107 12 | -3.500 0.103 0.008 -0.107 13 | -3.000 0.159 0.008 -0.107 14 | -2.500 0.216 0.008 -0.107 15 | -2.000 0.272 0.007 -0.108 16 | -1.500 0.328 0.007 -0.108 17 | -1.000 0.384 0.006 -0.108 18 | -0.500 0.440 0.006 -0.108 19 | 0.000 0.497 0.006 -0.108 20 | 0.500 0.551 0.006 -0.108 21 | 1.000 0.605 0.006 -0.107 22 | 1.500 0.655 0.006 -0.105 23 | 2.000 0.714 0.006 -0.106 24 | 2.500 0.768 0.006 -0.105 25 | 3.000 0.823 0.006 -0.105 26 | 3.500 0.876 0.007 -0.105 27 | 4.000 0.929 0.007 -0.104 28 | 4.500 0.981 0.008 -0.103 29 | 5.000 1.031 0.008 -0.103 30 | 5.500 1.082 0.009 -0.102 31 | 6.000 1.132 0.009 -0.101 32 | 6.500 1.182 0.010 -0.100 33 | 7.000 1.231 0.010 -0.099 34 | 7.500 1.278 0.011 -0.098 35 | 8.000 1.324 0.012 -0.097 36 | 8.500 1.367 0.013 -0.095 37 | 9.000 1.409 0.014 -0.092 38 | 9.500 1.447 0.015 -0.090 39 | 10.000 1.483 0.016 -0.087 40 | 10.500 1.512 0.017 -0.083 41 | 11.000 1.544 0.018 -0.079 42 | 11.500 1.567 0.020 -0.075 43 | 12.000 1.595 0.021 -0.071 44 | 12.500 1.619 0.023 -0.068 45 | 13.000 1.632 0.026 -0.064 46 | 13.500 1.655 0.028 -0.061 47 | 14.000 1.674 0.030 -0.058 48 | 14.500 1.683 0.034 -0.056 49 | 15.000 1.677 0.039 -0.053 50 | 15.500 1.688 0.043 -0.051 51 | 16.000 1.693 0.048 -0.050 52 | -------------------------------------------------------------------------------- /Aerodynamics/Polars/old/MH139F-960000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/Polars/old/MH139F-960000.png -------------------------------------------------------------------------------- /Aerodynamics/calculate_polar.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/calculate_polar.m -------------------------------------------------------------------------------- /Aerodynamics/calculate_polar_angle.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/calculate_polar_angle.m -------------------------------------------------------------------------------- /Aerodynamics/libf2c.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/Aerodynamics/libf2c.lib -------------------------------------------------------------------------------- /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') -------------------------------------------------------------------------------- /_org/SimTool_org.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/_org/SimTool_org.zip -------------------------------------------------------------------------------- /libraries/stdatmo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/libraries/stdatmo.zip -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /matlab_functions/VAR.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/matlab_functions/VAR.m -------------------------------------------------------------------------------- /matlab_functions/_old/DetailedAnalysisForm.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/matlab_functions/_old/DetailedAnalysisForm.fig -------------------------------------------------------------------------------- /matlab_functions/_old/DetailedAnalysisForm.m: -------------------------------------------------------------------------------- 1 | function varargout = DetailedAnalysisForm(varargin) 2 | % DETAILEDANALYSISFORM MATLAB code for DetailedAnalysisForm.fig 3 | % DETAILEDANALYSISFORM, by itself, creates a new DETAILEDANALYSISFORM or raises the existing 4 | % singleton*. 5 | % 6 | % H = DETAILEDANALYSISFORM returns the handle to a new DETAILEDANALYSISFORM or the handle to 7 | % the existing singleton*. 8 | % 9 | % DETAILEDANALYSISFORM('CALLBACK',hObject,eventData,handles,...) calls the local 10 | % function named CALLBACK in DETAILEDANALYSISFORM.M with the given input arguments. 11 | % 12 | % DETAILEDANALYSISFORM('Property','Value',...) creates a new DETAILEDANALYSISFORM or raises the 13 | % existing singleton*. Starting from the left, property value pairs are 14 | % applied to the GUI before DetailedAnalysisForm_OpeningFcn gets called. An 15 | % unrecognized property name or invalid value makes property application 16 | % stop. All inputs are passed to DetailedAnalysisForm_OpeningFcn via varargin. 17 | % 18 | % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one 19 | % instance to run (singleton)". 20 | % 21 | % See also: GUIDE, GUIDATA, GUIHANDLES 22 | 23 | % Edit the above text to modify the response to help DetailedAnalysisForm 24 | 25 | % Last Modified by GUIDE v2.5 24-May-2012 16:09:29 26 | 27 | % Begin initialization code - DO NOT EDIT 28 | gui_Singleton = 1; 29 | gui_State = struct('gui_Name', mfilename, ... 30 | 'gui_Singleton', gui_Singleton, ... 31 | 'gui_OpeningFcn', @DetailedAnalysisForm_OpeningFcn, ... 32 | 'gui_OutputFcn', @DetailedAnalysisForm_OutputFcn, ... 33 | 'gui_LayoutFcn', [] , ... 34 | 'gui_Callback', []); 35 | if nargin && ischar(varargin{1}) 36 | gui_State.gui_Callback = str2func(varargin{1}); 37 | end 38 | 39 | if nargout 40 | [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); 41 | else 42 | gui_mainfcn(gui_State, varargin{:}); 43 | end 44 | % End initialization code - DO NOT EDIT 45 | 46 | % --- Executes just before DetailedAnalysisForm is made visible. 47 | function DetailedAnalysisForm_OpeningFcn(hObject, eventdata, handles, varargin) 48 | % This function has no output args, see OutputFcn. 49 | % hObject handle to figure 50 | % eventdata reserved - to be defined in a future version of MATLAB 51 | % handles structure with handles and user data (see GUIDATA) 52 | % varargin command line arguments to DetailedAnalysisForm (see VARARGIN) 53 | 54 | % Choose default command line output for DetailedAnalysisForm 55 | handles.output = hObject; 56 | 57 | % Update handles structure 58 | guidata(hObject, handles); 59 | 60 | % This sets up the initial plot - only do when we are invisible 61 | % so window can get raised using DetailedAnalysisForm. 62 | %-------------------------------------------------------------------------- 63 | % INITIALIZE THE GUI HERE 64 | %-------------------------------------------------------------------------- 65 | %cla; 66 | 67 | %Get data from varargin 68 | AR_array=varargin{1}{1}; 69 | b_array=varargin{1}{2}; 70 | m_bat_array=varargin{1}{3}; 71 | global flightdata2_array; 72 | global performance2; 73 | flightdata2_array=varargin{1}{4}; 74 | performance2.t_excess=varargin{1}{5}; 75 | performance2.t_endurance=varargin{1}{6}; 76 | performance2.t_chargemargin=varargin{1}{7}; 77 | 78 | %PopupMenus 79 | tmp=0; 80 | for i=1:length(AR_array); tmp(i)=AR_array(i); end 81 | set(handles.PM_AR, 'String',tmp); 82 | set(handles.PM_AR, 'Value',1); 83 | tmp=0; 84 | for i=1:length(b_array); tmp(i)=b_array(i); end 85 | set(handles.PM_b, 'String',tmp); 86 | set(handles.PM_b, 'Value',1); 87 | tmp=0; 88 | for i=1:length(m_bat_array); tmp(i)=m_bat_array(i); end 89 | set(handles.PM_mbat, 'String',tmp); 90 | set(handles.PM_mbat, 'Value',1); 91 | 92 | %Update with first dataset 93 | PB_Update_Callback(hObject, eventdata, handles); 94 | 95 | % UIWAIT makes DetailedAnalysisForm wait for user response (see UIRESUME) 96 | %uiwait(handles.figure1); 97 | 98 | 99 | 100 | 101 | % --- Outputs from this function are returned to the command line. 102 | function varargout = DetailedAnalysisForm_OutputFcn(hObject, eventdata, handles) 103 | % varargout cell array for returning output args (see VARARGOUT); 104 | % hObject handle to figure 105 | % eventdata reserved - to be defined in a future version of MATLAB 106 | % handles structure with handles and user data (see GUIDATA) 107 | 108 | % Get default command line output from handles structure 109 | varargout{1} = handles.output; 110 | 111 | % --- Executes on button press in PB_Update. 112 | function PB_Update_Callback(hObject, eventdata, handles) 113 | % hObject handle to PB_Update (see GCBO) 114 | % eventdata reserved - to be defined in a future version of MATLAB 115 | % handles structure with handles and user data (see GUIDATA) 116 | 117 | %figure(handles.figure1); 118 | 119 | cla(handles.axes1); 120 | cla(handles.axes2); 121 | cla(handles.axes3); 122 | cla(handles.axes4); 123 | 124 | %Get selected configuration 125 | ARidx = get(handles.PM_AR, 'Value'); 126 | bidx = get(handles.PM_b, 'Value'); 127 | mbatidx = get(handles.PM_mbat, 'Value'); 128 | 129 | global flightdata2_array; 130 | global performance2; 131 | 132 | %------------------------------------------------- 133 | % OUTPUT PERFORMANCE DATA 134 | %------------------------------------------------- 135 | tmp1=['b: ' num2str(flightdata2_array(bidx,mbatidx,ARidx).b) 'm']; 136 | tmp2=['mbat: ' num2str(flightdata2_array(bidx,mbatidx,ARidx).m_bat) 'kg']; 137 | tmp3=['AR: ' num2str(flightdata2_array(bidx,mbatidx,ARidx).AR)]; 138 | 139 | tmp4=['turbulence: ' num2str(flightdata2_array(bidx,mbatidx,ARidx).turbulence)]; 140 | tmp5=['clearness: ' num2str(flightdata2_array(bidx,mbatidx,ARidx).clearness)]; 141 | 142 | tmp6=['t_excess: ' num2str(performance2.t_excess(bidx,mbatidx,ARidx))]; 143 | tmp7=['t_endurance: ' num2str(performance2.t_endurance(bidx,mbatidx,ARidx))]; 144 | tmp8=['t_chargemargin: ' num2str(performance2.t_chargemargin(bidx,mbatidx,ARidx))]; 145 | 146 | %check if we have data to draw!! 147 | if(isempty(flightdata2_array(bidx,mbatidx,ARidx).t_array)) 148 | set(handles.E_Performance,'String',{tmp1 tmp2 tmp3 ' ' tmp4 tmp5 ' ' tmp6 tmp7 tmp8}); 149 | return; 150 | end 151 | 152 | deltat=flightdata2_array(bidx,mbatidx,ARidx).t_array(2)-flightdata2_array(bidx,mbatidx,ARidx).t_array(1); 153 | overallt=flightdata2_array(bidx,mbatidx,ARidx).t_array(length(flightdata2_array(bidx,mbatidx,ARidx).t_array))-flightdata2_array(bidx,mbatidx,ARidx).t_array(1); 154 | distancetravelled=0; 155 | for i=1:length(flightdata2_array(bidx,mbatidx,ARidx).t_array) 156 | distancetravelled=distancetravelled+flightdata2_array(bidx,mbatidx,ARidx).v_array(i)*deltat; 157 | end 158 | tmp9=['distance: ' num2str(distancetravelled/1000,'%.2f') 'km/' num2str(overallt/3600.0,'%.1f') 'h']; 159 | 160 | %Find night duration 161 | idx_sunset=find(flightdata2_array(bidx,mbatidx,ARidx).irr_array<=0.1,1,'first'); 162 | idx_sunrise=idx_sunset+find(flightdata2_array(bidx,mbatidx,ARidx).irr_array(idx_sunset:end)>0,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/_old/performanceEvaluator_FWpropagation.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/matlab_functions/_old/performanceEvaluator_FWpropagation.m -------------------------------------------------------------------------------- /matlab_functions/_old/performanceEvaluator_extended.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ethz-asl/fw_conceptual_design/19ff0f2e37588f166555eeb9f8a35a71842a493c/matlab_functions/_old/performanceEvaluator_extended.m -------------------------------------------------------------------------------- /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/aerodynamics/CalcOptimalFlyingSpeedsFromPolars.m: -------------------------------------------------------------------------------- 1 | function [v_rmax v_tmax] = CalcOptimalFlyingSpeedsFromPolars() 2 | % THIS FUNCTION IS UNTESTED AND HAS TO BE ADAPTED TO WORK 3 | 4 | %Just a calculation of optimum flying speed (lowest power and best glide 5 | %ratio) 6 | 7 | g = parameters.physics.g; 8 | if(environment.usemars==1) 9 | [rho,mu] = findMarsAir(environment.h,environment.T_ground); 10 | else 11 | [rho,mu] = findAir(environment.h,environment.T_ground); 12 | end 13 | v_tmax=sqrt(2*(m_distr+m_central+m_struct+masses.m_prop)*g/(rho*b^2/AR*mean(polar.c_L_cn))); 14 | %refine iteratively 15 | delta_v_tmax=1; 16 | while abs(delta_v_tmax)>0.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 -------------------------------------------------------------------------------- /matlab_functions/aerodynamics/CalcPFromPolars.m: -------------------------------------------------------------------------------- 1 | function [ P_elec_level ] = CalcPFromPolars( plane, params, rho, mu) 2 | %UNTITLED6 Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | %STEP 1a: Calc Re,Cl,Cd for flight at h_0: 6 | A_wing = plane.struct.b^2/plane.struct.AR; 7 | v = sqrt(2*(plane.m_no_bat+plane.bat.m)*params.physics.g/(rho*A_wing*mean(plane.polar.c_L_cn))); 8 | 9 | %refine iteratively 10 | delta_v = 1; 11 | while abs(delta_v) > 0.01 12 | Re = min([rho*A_wing/plane.struct.b*v/mu,plane.polar.ReList(length(plane.polar.ReList))]); 13 | if Re 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)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 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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_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 | -------------------------------------------------------------------------------- /matlab_functions/plotScripts/Plot_BasicSimulationTimePlot_ASJFR81hFlightPaper.m: -------------------------------------------------------------------------------- 1 | function [] = Plot_BasicSimulationTimePlot_ASJFR81hFlightPaper(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 | %figure('Name',str); 10 | figure 11 | 12 | [ax,hLine1,hLine2]=plotyy([time',time',time'],... 13 | [flightdata.P_solar_array',flightdata.P_elec_tot_array',flightdata.P_charge_array'],... 14 | time',... 15 | flightdata.bat_array'/3600); 16 | l1=legend('P_{solar} [W]','P_{out} [W]','P_{bat} [W]','E_{bat} [Wh]'); 17 | xlabel('Time [h]'); 18 | ylabel(ax(1),'Power [W]'); 19 | ylabel(ax(2),'Energy [Wh]'); 20 | ylim(ax(1),[-60.0 max(flightdata.P_solar_array)*1.5]); 21 | ylim(ax(2),[-104.0 max(flightdata.bat_array/3600)*1.05]); 22 | 23 | hLine2.LineWidth=2; 24 | hLine2.Color=[1 0 0]; 25 | ax(2).YColor=[1 0 0]; 26 | hLine1(1).Color=[0 0 1]; 27 | hLine1(2).Color=[0 1 0]; 28 | set(ax,'FontSize',24); 29 | 30 | %set(gcf, 'Position', [100 100 150 150]); 31 | end 32 | 33 | -------------------------------------------------------------------------------- /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/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 cosz