{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Plane Range Example\n", "\n", "This example demonstrates how to use flight-mech to compute the range of a plane in various conditions." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Imports" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Python imports\n", "import os\n", "import sys\n", "sys.path.append(\"..\")\n", "\n", "# Additional imports\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "# Flight-Mech imports\n", "from flight_mech.plane import Plane" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plane definition\n", "\n", "Let us use in this case the Cessna Citation III defined in the database." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Load the plane\n", "plane = Plane(\"cessna_citation_III\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Range computation\n", "\n", "We can now define an altitude and compute the range for a fixed altitude and at a fixed pre-defined velocity." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "max range at 6700m [m] 5826348.502702705\n", "v [m.s-1] 121.49114223719054\n", "max range at fixed speed [m] 5739785.452624167\n" ] } ], "source": [ "# Define the altitude\n", "z = 6700 # m\n", "\n", "# Print the results\n", "print(\"max range at 6700m [m]\", plane.compute_max_range_at_fixed_altitude(z))\n", "speed = plane.compute_reference_speed(z)\n", "print(\"v [m.s-1]\", speed)\n", "print(\"max range at fixed speed [m]\",\n", " plane.compute_range_at_fixed_speed(speed, f=plane.f_max))" ] } ], "metadata": { "kernelspec": { "display_name": "venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.4" } }, "nbformat": 4, "nbformat_minor": 2 }