Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdsharpe committed Nov 30, 2023
2 parents 406cc55 + 780ced6 commit cdaec1d
Show file tree
Hide file tree
Showing 7 changed files with 510 additions and 319 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Also, for at least one version before a breaking change, AeroSandbox development

#### 4.1.5

- PENDING DEPRECATION added: `asb.Airplane.export_XFLR()` has been renamed to `asb.Airplane.export_XFLR5_xml()`. This clarifies that the output is an XFLR5 XML file (which needs to be imported through the Plane menu in XFLR5), not an XFLR5 .xfl file - a point of user confusion. For now, both will work, but the old name will trigger a warning, and eventually will be removed.
- Added improvements to `asb.LiftingLine` to ensure mixed-backend compatibility.

#### 4.1.4
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,21 @@ You can print documentation and examples for any AeroSandbox object by using the

### Usage Details

One final point to note: **all inputs and outputs to AeroSandbox are expressed in base SI units, or derived units thereof** (e.g., m, N, kg, m/s, J, Pa) - "an elegant unit system, for a more civilized age".
#### Units

The only exception to this rule is when units are explicitly noted via variable name suffix. For example:
One final point to note: **all inputs and outputs to AeroSandbox are expressed in base SI units, or derived units thereof** (e.g., m, kg, sec, N, m/s, J, Pa). Since this unit system is [coherent](https://en.wikipedia.org/wiki/Coherence_(units_of_measurement)), an [enormous number of quantities](https://en.wikipedia.org/wiki/SI_derived_unit) can be converted without any scaling factors. This improves readability and reduces the likelihood of errors.

* `battery_capacity` → Joules
* `battery_capacity_watt_hours` → Watt-hours.
There are only two exceptions to this SI-everywhere rule:
1. If alternate units are noted in a variable name's suffix. For example:

All angles are in radians, except for α and β which are in degrees due to long-standing aerospace convention. (In any case, units are marked on all function docstrings.)
* `battery_capacity` → Joules
* `battery_capacity_watt_hours` → Watt-hours
* `aircraft_endurance` → Seconds
* `aircraft_endurance_hours` → Hours

2. Angle of attack (`alpha`, α) and sideslip angle (`beta`, β) are given in degrees due to long-standing aerospace convention. All other angles and angular rates use radians.

Also, in case of any confusion on the units of a function's inputs and outputs, units are listed on all function docstrings.

If you wish to use other units, consider using [`aerosandbox.tools.units`](./aerosandbox/tools/units.py) to convert easily.

Expand Down Expand Up @@ -272,7 +279,7 @@ If you find AeroSandbox useful in a research publication, please cite it using t
}
```

As the MIT License applies, use AeroSandbox for anything you want; attribution is strongly appreciated.
As the MIT License applies, use AeroSandbox for anything you want (commercial or noncommercial). Attribution is strongly appreciated but not required.

Commercial users: I'm more than happy to discuss consulting work for active AeroSandbox support if this package proves helpful - use the email address in the header of this README to get in touch.

Expand Down
32 changes: 23 additions & 9 deletions aerosandbox/geometry/airplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,14 +946,28 @@ def export_AVL(self,
)
avl.write_avl(filepath=filename)

def export_XFLR(self,
filename,
mass_props: MassProperties = None,
include_fuselages: bool = False,
mainwing: Wing = None,
elevator: Wing = None,
fin: Wing = None,
):
def export_XFLR(self, *args, **kwargs):
import warnings

warnings.warn(
"`Airplane.export_XFLR()` has been renamed to `Airplane.export_XFLR5_xml()`, to clarify\n"
"that it exports to XFLR5's XML format, not to a XFL file.\n"
"\n"
"Please update your code to use `Airplane.export_XFLR5_xml()` instead.\n"
"\n"
"This function will be removed in a future version of AeroSandbox.",
PendingDeprecationWarning
)
return self.export_XFLR5_xml(*args, **kwargs)

def export_XFLR5_xml(self,
filename,
mass_props: MassProperties = None,
include_fuselages: bool = False,
mainwing: Wing = None,
elevator: Wing = None,
fin: Wing = None,
):
"""
Exports the airplane geometry to an XFLR5 `.xml` file.
Expand Down Expand Up @@ -1398,4 +1412,4 @@ def ft(feet, inches=0): # Converts feet (and inches) to meters
)

airplane.draw_three_view()
# airplane.export_XFLR("test.xml", mass_props=asb.MassProperties(mass=1, Ixx=1, Iyy=1, Izz=1))
# airplane.export_XFLR5_xml("test.xml", mass_props=asb.MassProperties(mass=1, Ixx=1, Iyy=1, Izz=1))
1 change: 0 additions & 1 deletion aerosandbox/numpy/interpolate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from operator import is_
import numpy as _onp
import casadi as _cas
from aerosandbox.numpy.determine_type import is_casadi_type
Expand Down

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Lectures, Videos, GitHub repos, blog posts:
Academic literature:

* Griewank and Walther, "Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation", 2008. Great comprehensive overview.
* ["Automatic Diffferentiation in Machine Learning: a Survey" on ArXiV by Baydin et. al.](https://arxiv.org/abs/1502.05767) is another great read.
* ["Automatic differentiation of algorithms"](https://www.sciencedirect.com/science/article/pii/S0377042700004222?via%3Dihub) by Bartholomew-Biggs, et. al.
* ["Automatic Differentiation in Machine Learning: a Survey" on ArXiV by Baydin et. al.](https://arxiv.org/abs/1502.05767) is another great read.
* ["Automatic differentiation of algorithms"](https://www.sciencedirect.com/science/article/pii/S0377042700004222?via%3Dihub) by Bartholomew-Biggs, et. al.

0 comments on commit cdaec1d

Please sign in to comment.