========== User Guide ========== This user guide to pyAPP6 is structured into four parts. First, an overview over the :ref:`package strcuture` is provided. The second section describes how to :ref:`read and write APP files ` (aircraft, missions and performance charts) using Python. The last two sections describe how to execute APP's :ref:`mission computations ` and :ref:`performance chart computations ` by using Python and parse the results written by APP. .. _package_structure: Package Structure ============================= The pyAPP6 package comprises the following modules: Files Classes for `Reading and Writing APP Files`_. Mission Classes for executing `Mission Computations`_ and reading the results. Performance Classes for executing `Performance Charts`_ computations and reading the results. Database Helper class to read APP's string table. Global Constants as used in APP. Units Unit conversion factors as used in APP. .. _reading_writing_files: Reading and Writing APP Files ============================= .. image:: images/welcome.png For each APP6 filetype, pyAPP6 offers a class to read, manipulate and write a file. The classes are located in the Files module: ========================== ============================ APP File pyAPP6 Class ========================== ============================ Aircraft (.acft) Files.AircraftModel Mission Computation (.mis) Files.MissionComputationFile Performance Charts (.perf) Files.PerformanceChartFile ========================== ============================ The classes are located in the Files module: .. autoclass:: pyAPP6.Files.AircraftModel .. autoclass:: pyAPP6.Files.MissionComputationFile .. autoclass:: pyAPP6.Files.PerformanceChartFile NExtReal -------- APP defines two custom data types: NExtReal and XTables. When using pyAPP6 to manipulate APP files, it is important to understand these data types. NExtReals are recognizable in the APP user interface by a text followed by a value and a unit: .. image:: images/NExtReal.PNG .. autoclass:: pyAPP6.Files.NExtReal :members: XTable ------- XTables are used everywhere you see a spreadsheet-like table in APP. pyAPP6 uses the **numpy** module to store data tables. **numpy** offers a lot of functionality to manipulate arrays. pyAPP6 defines four different tables, with increasing dimensionality: X0Table, X1Table, X2Table and X3Table. The X0Table is used for one-column data ranges, for example in performance charts for the **X-Range** and **Parameter** range. .. autoclass:: pyAPP6.Files.X0Table The X1Table is a simple two-column table. An example would be the Mach limit or CLmax table. The data is stored in a two-dimensional numpy array. .. autoclass:: pyAPP6.Files.X1Table The X2Table is a list of two-column tables. An example would be the induced drag tables or the max. thrust tables. The data is stored in a list of two-dimensional numpy arrays (*table* attribute). Each table also has a value (for the induced drag table that would be a Mach number). The values are stored in the *value* list. The *table* and *value* list have the same length and same ordering. .. autoclass:: pyAPP6.Files.X2Table The X3Table class is used in APP for the fuel flow table. The X3Table consists of a list of X2Tables and corresponding values. .. autoclass:: pyAPP6.Files.X3Table Variables ========== When executing APP via the command line, the user can specify what variables will be written in the output result file. By default, pyAPP6 uses the included *ParameterList_All.par* file to specify the variables. The ouput data is stored in a large numpy table, and the variable can be best accessed by it's index. The following table presents the current mapping of indices to the variables when using the default parameter list file. ====== ======================== ========= ========== Index Variable Name (SI) (British) ------ ------------------------ --------- ---------- 0 (M/SFC)(L/D) [-] [-] 1 Acceleration [m/sec2] [ft/sec2] 2 Advance Ratio [-] [-] 3 Altitude [m] [ft] 4 AoA [deg] [deg] 5 Attitude [deg] [deg] 6 CAS [m/sec] [nm/hr] 7 CD [-] [-] 8 CD0 [-] [-] 9 CDi [-] [-] 10 CDs [-] [-] 11 CL [-] [-] 12 CL/CD [-] [-] 13 Climb Angle [deg] [deg] 14 Climb Speed [m/sec] [ft/sec] 15 CLmax [-] [-] 16 CO2 Mass [kg] [lbs] 17 CP [-] [-] 18 CT [-] [-] 19 Density [kg/m3] [slug/ft3] 20 Distance [km] [nm] 21 Drag [N] [lbf] 22 Drag Area [m2] [ft2] 23 dT [K] [K] 24 Dynamic Pressure [N/m2] [lbf/ft2] 25 EAS [m/sec] [nm/hr] 26 Ekin [Nm] ft] 27 Energy Height [m] [ft] 28 Engine Revolution [rpm] [rpm] 29 Epot [Nm] ft] 30 Etot [Nm] ft] 31 Fuel Flow [kg/sec] [lbs/hr] 32 Fuel Mass [kg] [lbs] 33 Fuel Percent [%] [%] 34 Fuel Percent (Internal) [%] [%] 35 Lift [N] [lbf] 36 Lift Area [m2] [ft2] 37 Load Factor [-] [-] 38 Mach [-] [-] 39 Mass [kg] [lbs] 40 Max. Thrust [N] [lbf] 41 Min. Thrust [N] [lbf] 42 Payload [%] [%] 43 Placard Mach [-] [-] 44 Power Setting [%] [%] 45 Pressure [N/m2] [lbf/ft2] 46 Pressure Altitude [m] [ft] 47 Propeller Beta [deg] [deg] 48 Propeller Efficency [%] [%] 49 Pull-Up Rate [deg/sec] [deg/sec] 50 Reference Area [m2] [ft2] 51 Seg. CO2 Mass [kg] [lbs] 52 Seg. Dist. [km] [nm] 53 Seg. Fuel [kg] [lbs] 54 Seg. Time [min] [min] 55 SEP [m/sec] [ft/sec] 56 SFC N)] lbf)] 57 Shaft Power [W] [shp] 58 Specific Range [km/kg] [nm/lbs] 59 Speed of Sound [m/sec] [ft/sec] 60 Stall Speed [m/sec] [nm/hr] 61 Stall Speed (CAS) [m/sec] [nm/hr] 62 T/Tmax [-] [-] 63 TAS [m/sec] [nm/hr] 64 Temperature [K] [K] 65 Thrust [N] [lbf] 66 Thrust cos(AoA+sigma) [N] [lbf] 67 Time [sec] [sec] 68 Turn Radius [m] [ft] 69 Turn Rate [deg/sec] [deg/sec] 70 Turns [turn] [turn] 71 Velocity [m/sec] [nm/hr] 72 Vx [m/sec] [nm/hr] 73 X-Acc. [m/sec2] [ft/sec2] ====== ======================== ========= ========== .. _mission_computations: Mission Computations ==================== The Mission module, specifically the class *MissionComputation*, is used to run the APP command line mode for mission computations and parse the result text file. .. autoclass:: pyAPP6.Mission.MissionComputation A result from an APP command line computation can also be directly read by using the MissionResult class. .. autoclass:: pyAPP6.Mission.MissionResult .. _performance_computations: Performance Charts ================== The Performance module, specifically the class *PerformanceChart*, is used to run the APP command line mode for performance chart computations and parse the result text file. .. autoclass:: pyAPP6.Performance.PerformanceChart A result from an APP command line computation can also be directly read by using the PerformanceChartResult class. .. autoclass:: pyAPP6.Performance.PerformanceChartResult