Ptera Software is a fast, easy-to-use, and open-source package for analyzing flapping-wing flight using unsteady and steady vortex lattice methods.
- Multiple Simulation Methods: Steady horseshoe VLM, steady ring VLM, and unsteady ring UVLM
- Customizable Aircraft Geometry: Multi-wing aircraft with arbitrary wing cross sections and airfoils
- Time-Dependent Motion: Custom prescribed flapping motions
- Formation Flight: Multi-airplane simulations supported since v2.0.0
- High-Speed Computing: JIT compilation via Numba for fast simulations
- Trim Analysis: Automatic search for trim operating points
- Convergence Analysis: Automatic search for converged parameters
- GUI Interface: Basic GUI available (beta stage)
- Visualization Tools: 3D mesh visualization and 2D plotting of results
- Save and Load: JSON serialization of solved simulations without pickle security risks
- Extensive Testing: Comprehensive unit and integration tests for reliability
Requires Python 3.11, but active development is done in 3.13
- NumPy/SciPy: Core numerical computations
- Numba: JIT compilation for performance-critical loops
- PyVista: 3D mesh processing and visualization
- PySide6: GUI framework
- Matplotlib: 2D plotting and analysis output
.github/: Directory with GitHub configuration filesISSUE_TEMPLATE/: Directory with issue templatesbug_report.mdfeature_request.md
workflows/: Directory with GitHub Actions workflowsblack.ymlcodespell.ymlmypy.ymltests.yml
pull_request_template.md
.venv/: Directory for the Python virtual environment (not included in version control)experimental/: Directory with experimental scripts and prototypes (not included in version control)docs/: Directory with documentation filesexamples expected output/: Example output files for verificationprivate/: Directory with documentation not included in this repository's version controlkatz_plotkin_12_2/: A recreation of Chapter 12.2, which describes efficiently including the effects of symmetry and ground effect for vortex lattice methods, from the textbook "Low-Speed Aerodynamics" by Katz and Plotkinkatz_plotkin_13_12/: A recreation of Chapter 13.12, which describes the UVLM, from the textbook "Low-Speed Aerodynamics" by Katz and Plotkinkatz_plotkin_d/: A recreation of Appendix D, which includes example Fortran programs, from the textbook "Low-Speed Aerodynamics" by Katz and Plotkinlambert_2015_2_3__2_4/: A recreation of Sections 2.3 and 2.4 from Thomas Lambert's thesis "Modeling of aerodynamic forces in flapping flight with the unsteady vortex lattice method"
website/: Directory with the source files for generating the documentation websiteANGLE_VECTORS_AND_TRANSFORMATIONS.md: Conventions and definitions for angle vectors and transformations READ BEFORE CONTRIBUTING ANY CODE, PARTICIPATING IN DISCUSSIONS REGARDING, OR PLANNING RELATED TO VECTOR-VALUED VARIABLESAXES_POINTS_AND_FRAMES.md: Conventions and definitions for axis systems, points, and reference points: READ BEFORE CONTRIBUTING ANY CODE, PARTICIPATING IN DISCUSSIONS REGARDING, OR PLANNING RELATED TO VECTOR-VALUED VARIABLESCLASSES_AND_IMMUTABILITY.md: Description of class structure and attribute immutability.CODE_STYLE.md: Code style guidelines: READ BEFORE CONTRIBUTING ANY CODERUNNING_TESTS_AND_TYPE_CHECKS.md: Instructions for running tests and type checks READ BEFORE RUNNING TESTS OR TYPE CHECKS LOCALLYTYPE_HINT_AND_DOCSTRING_STYLE.md: Guidelines for type hinting and docstring formatting: READ BEFORE CONTRIBUTING ANY CODE OR WRITING ANY DOCSTRINGSWRITING_STYLE.md: Guidelines for writing style in comments and documentation: READ BEFORE WRITING ANY DOCUMENTATION, DOCSTRINGS, OR COMMENTS
examples/: Directory with example scripts for usersgui/: Directory with GUI source codepterasoftware/: Main package with modular solver architecture_vortices/: Package with vortex classes_line_vortex.py: LineVortex classhorseshoe_vortex.py: HorseshoeVortex classring_vortex.py: RingVortex class
geometry/: Package with aircraft geometry classes_airfoils/: Directory containing data files with airfoil coordinates_meshing.py: Wing mesh generationairfoil.py: Airfoil class with coordinate generationairplane.py: Airplane class with coordinate transformationswing.py: Wing class with symmetry processingwing_cross_section.py: WingCrossSection class with validation
movements/: Package with movement classes (definitions for time-dependent motion)_functions.py: Movement utility functionsairplane_movement.py: Airplane motion definitionsmovement.py: Core Movement classoperating_point_movement.py: Operating condition changeswing_cross_section_movement.py: Wing cross section motionwing_movement.py: Wing flapping motion
_aerodynamics_functions.py: Induced velocity functions_functions.py: Shared utility functions_logging.py: Contains function for setting up logging_panel.py: Panel class for discretized mesh elements_parameter_validation.py: Input validation functions_serialization.py: JSON serialization and deserialization (save/load)_transformations.py: Coordinate transformations and rotationsconvergence.py: Convergence analysis toolsoperating_point.py: OperatingPoint classoutput.py: Visualization and results processingproblems.py: SteadyProblem and UnsteadyProblem classessteady_horseshoe_vortex_lattice_method.py: Steady horseshoe VLM solversteady_ring_vortex_lattice_method.py: Steady ring VLM solvertrim.py: Trim analysis functionalityunsteady_ring_vortex_lattice_method.py: Unsteady ring UVLM solver
tests/: Directory with unit and integration testsbenchmarks/: Performance benchmark scripts and saved resultsbench_serialization.pybench_slots.py
integration/: Integration tests for combined functionalityfixtures/: Fixtures for integration testsairplane_fixtures.pymovement_fixtures.pyoperating_point_fixtures.pyproblem_fixtures.pysolver_fixtures.py
test_output.pytest_serialization_output.pytest_steady_convergence.pytest_steady_horseshoe_vortex_lattice_method.pytest_steady_ring_vortex_lattice_method.pytest_steady_trim.pytest_unsteady_convergence.pytest_unsteady_ring_vortex_lattice_method_multiple_wing_static_geometry.pytest_unsteady_ring_vortex_lattice_method_multiple_wing_variable_geometry.pytest_unsteady_ring_vortex_lattice_method_static_geometry.pytest_unsteady_ring_vortex_lattice_method_variable_geometry.pytest_unsteady_ring_vortex_lattice_method_wake_truncation.py
unit/: Unit tests for individual classes and functionsfixtures/: Fixtures for unit testsaerodynamics_function_fixtures.pyairplane_movement_fixtures.pygeometry_fixtures.pyhorseshoe_fixtures.pymovement_fixtures.pymovement_function_fixtures.pyoperating_point_fixtures.pyoperating_point_movement_fixtures.pyproblem_fixtures.pyring_vortex_fixtures.pyserialization_fixtures.pywing_cross_section_movement_fixtures.pywing_movement_fixtures.py
test_aerodynamics_functions.pytest_airfoil.pytest_airplane.pytest_airplane_movement.pytest_horseshoe_vortex.pytest_movement.pytest_movement_functions.pytest_operating_point.pytest_operating_point_movement.pytest_package_init.pytest_panel.pytest_problems.pytest_ring_vortex.pytest_serialization.pytest_slots.pytest_transformations.pytest_wing.pytest_wing_cross_section.pytest_wing_cross_section_movement.pytest_wing_movement.py
.codespell-ignore: File listing words to ignore in spell checking.gitignore: Git ignore file.pre-commit-config.yaml: Pre-commit configuration fileBUILD.md: Instructions for building the GUICONTRIBUTING.md: Contribution guidelines for developersmake_installer.iss: Inno Setup script for building Windows installerMANIFEST.in: Manifest file for packagingmypy.ini: MyPy configuration filepterasoftware.spec: PyInstaller specification file for building executablespyproject.toml: Project configuration fileREADME.md: Project overview and installation instructions for developersrequirements.txt: Full list of runtime dependencies with version constraintsrequirements_dev.txt: Full list of development dependencies with version constraintssetup.cfg: Setup configuration file
When running scripts outside the main pterasoftware directory that import the package (e.g., scripts in experimental/), you need to set PYTHONPATH to the project root:
cd ${WORKSPACE}/experimental && PYTHONPATH="$PWD/.." ../.venv/Scripts/python.exe script_name.pyOn Unix-like systems:
cd ${WORKSPACE}/experimental && PYTHONPATH="$PWD/.." ../.venv/bin/python script_name.pyThis pattern:
- Changes to the script's directory
- Sets
PYTHONPATHto the parent directory (project root) - Runs the script using the virtual environment's Python interpreter
- Forgetting to read RUNNING_TESTS_AND_TYPE_CHECKS.md before running tests and trying to use pytest (Ptera Software uses unittest)
- Forgetting to read CODE_STYLE.md before contributing code
- Forgetting to read TYPE_HINT_AND_DOCSTRING_STYLE.md before writing docstrings
- Forgetting to read ANGLE_VECTORS_AND_TRANSFORMATIONS.md and AXES_POINTS_AND_FRAMES.md before working with vector-valued variables. If in doubt, before writing code, read both of these documents
- Forgetting to read WRITING_STYLE.md before writing documentation, docstrings, or comments