Plane Graphs Example#
This example demonstrates how to use flight-mech to plot the polar and thrust-velocity graphs of a plane.
Imports#
[1]:
# Python imports
import os
import sys
sys.path.append("..")
# Additional imports
import numpy as np
import matplotlib.pyplot as plt
# Flight-Mech imports
from flight_mech.plane import Plane
Plane definition#
Let us use in this case the Cessna Citation III defined in the database.
[2]:
# Load the plane
plane = Plane("cessna_citation_III")
Polar Graph#
We can now set the \(C_{L\alpha}\) coefficient which is missing in this model and plot the polar graph.
[3]:
# Set the missing lift coefficient
plane.C_L_alpha = np.pi
# Plot the polar graph
plane.plot_polar_graph()

Thrust-Velocity graph#
The thrust-velocity graph can be generated for a given list of altitude. It allows to visualize at which velocities the plane can fly for the given thrust.
[4]:
# Plot the thrust speed graph at several altitudes
plane.plot_gliding_TV_graph([0, 3000, 6000, 9000, 13000])
c:\Users\paulc\Documents\Projets\Flight-Mechanics-Calculator\examples\..\flight_mech\plane.py:1207: RuntimeWarning: divide by zero encountered in divide
T_array = self.P / self.f(alpha_array)
c:\Users\paulc\Documents\Projets\Flight-Mechanics-Calculator\examples\..\flight_mech\plane.py:302: RuntimeWarning: divide by zero encountered in divide
v = np.sqrt(self.P / (.5 * rho * self.S * self.C_L(alpha)))
