Skip to main content

Aircraft Design Recipes in Python: a library of aircraft conceptual design tools.

Project description

ADRpy

Aircraft Design Recipes in Python

PyPI version Build Status

A library of aircraft conceptual design and performance analysis tools, including virtual (design) atmospheres, constraint analysis methods, propulsion system performance models, conversion functions and much else.

For a detailed description of the library, please consult the Documentation. To get started, follow the instructions below.

For video tutorials and explainers (a.k.a. ADRpy Shorts) scroll to the bottom of this page.

author: Andras Sobester

Installation / Usage

ADRpy is written in Python 3 and tested in Python 3.6 through to Python 3.12.

It is not available for Python 2.

On most systems you should be able to simply open an operating system terminal and at the command prompt type

$ pip install ADRpy

or

$ python -m pip install ADRpy

NOTE: pip is a Python package; if it is not available on your system, download get-pip.py and run it in Python by entering

$ python get-pip.py

at the operating system prompt.

An alternative approach to installing ADRpy is to clone the GitHub repository, by typing

$ git clone https://github.com/sobester/ADRpy.git

at the command prompt and then executing the setup file in the same directory by entering:

$ python setup.py install

A 'hello world' example: atmospheric properties

There are several options for running the examples shown here: you could copy and paste them into a .py file, save it and run it in Python, or you could enter the lines, in sequence, at the prompt of a Python terminal. You could also copy and paste them into a Jupyter notebook (.ipynb file) cell and execute the cell.

from ADRpy import atmospheres as at
from ADRpy import unitconversions as co

# Instantiate an atmosphere object: an ISA with a +10C offset
isa = at.Atmosphere(offset_deg=10)

# Query the ambient density in this model at 41,000 feet 
print("ISA+10C density at 41,000 feet (geopotential):", 
      isa.airdens_kgpm3(co.feet2m(41000)), "kg/m^3")

You should see the following output:

ISA+10C density at 41,000 feet (geopotential): 0.274725888531 kg/m^3

A design example: wing/powerplant sizing for take-off

# Compute the thrust to weight ratio required for take-off, given
# a basic design brief, a basic design definition and a set of 
# atmospheric conditions

from ADRpy import atmospheres as at
from ADRpy import constraintanalysis as ca
from ADRpy import unitconversions as co


# The environment: 'unusually high temperature at 5km' atmosphere
# from MIL-HDBK-310. 

# Extract the relevant atmospheric profiles...
profile_ht5_1percentile, _ = at.mil_hdbk_310('high', 'temp', 5)

# ...then use them to create an atmosphere object 
m310_ht5 = at.Atmosphere(profile=profile_ht5_1percentile)

#====================================================================

# The take-off aspects of the design brief:
designbrief = {'rwyelevation_m':1000, 'groundrun_m':1200}

# Basic features of the concept:
# aspect ratio, engine bypass ratio, throttle ratio 
designdefinition = {'aspectratio':7.3, 'bpr':3.9, 'tr':1.05}

# Initial estimates of aerodynamic performance:
designperf = {'CDTO':0.04, 'CLTO':0.9, 'CLmaxTO':1.6,
              'mu_R':0.02} # ...and wheel rolling resistance coeff.

# An aircraft concept object can now be instantiated
concept = ca.AircraftConcept(designbrief, designdefinition,
                             designperf, m310_ht5)

#====================================================================

# Compute the required standard day sea level thrust/MTOW ratio reqd.
# for the target take-off performance at a range of wing loadings:
wingloadinglist_pa = [2000, 3000, 4000, 5000]

tw_sl, liftoffspeed_mpstas, _ = concept.twrequired_to(wingloadinglist_pa)

# The take-off constraint calculation also supplies an estimate of
# the lift-off speed; this is TAS (assuming zero wind) - we convert 
# it to equivalent airspeed (EAS), in m/s:
liftoffspeed_mpseas = \
m310_ht5.tas2eas(liftoffspeed_mpstas, designbrief['rwyelevation_m'])

print("Required T/W and V_liftoff under MIL-HDBK-310 conditions:")
print("\nT/W (std. day, SL, static thrust):", tw_sl)
print("\nLiftoff speed (KEAS):", co.mps2kts(liftoffspeed_mpseas))

You should see the following output:

Required T/W and V_liftoff under MIL-HDBK-310 conditions:

T/W (std. day, SL, static thrust): [ 0.19618164  0.2710746   0.34472518  0.41715311]

Liftoff speed (KEAS): [  96.99203483  118.79049722  137.1674511   153.35787248]

More extensive examples - a library of notebooks

To view them on GitHub, go to ADRpy's notebooks folder.

Alternatively, grab the whole repository as a .zip by clicking the big, green 'Code' button at the top of this page.

ADRpy Shorts - video tutorials and explainers

1. An Aircraft Engineer's Brief Introduction to Modelling the Atmosphere

1. An Aircraft Engineer's Brief Introduction to Modelling the Atmosphere

2. On V-n Diagrams and How to Build them in ADRpy

2. On V-n Diagrams and How to Build them in ADRpy

3. Speed in aviation - GS, WS, TAS, IAS, CAS and EAS

3. Speed in aviation - GS, WS, TAS, IAS, CAS and EAS

4. Wing and propulsion system sizing with ADRpy

4. Wing and propulsion system sizing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ADRpy-0.2.6.tar.gz (11.6 MB view details)

Uploaded Source

Built Distribution

ADRpy-0.2.6-py2.py3-none-any.whl (1.3 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file ADRpy-0.2.6.tar.gz.

File metadata

  • Download URL: ADRpy-0.2.6.tar.gz
  • Upload date:
  • Size: 11.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for ADRpy-0.2.6.tar.gz
Algorithm Hash digest
SHA256 517c46682d42ff3d82273902be5cd26b43abaeeb3c2de7c0f09a4f698b244b90
MD5 8b8a9ef94ea97b27c24325818c70fc36
BLAKE2b-256 2be0919b701febb18c0fc9c1198f509b4a7b3da8c7df102a60b92284d75fe765

See more details on using hashes here.

File details

Details for the file ADRpy-0.2.6-py2.py3-none-any.whl.

File metadata

  • Download URL: ADRpy-0.2.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for ADRpy-0.2.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ef9d981b84152506366dab143fd819f32f5c22a84bd086dad6780324dd9b4bee
MD5 e4f7e317695f356403082b444208835b
BLAKE2b-256 c16940743924b08397e5797598adedcc27dc66cafcac46d61ba1a64a7a061d86

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page