.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/aerodynamics/forces/plot_01_bernoulli_dynamic_pressure.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_aerodynamics_forces_plot_01_bernoulli_dynamic_pressure.py: Bernoulli's dynamic pressure and the pitot-static airspeed ========================================================== Daniel Bernoulli's *Hydrodynamica* (1738) traded pressure for speed along a streamline: :math:`p + \tfrac12\rho V^2` is constant. A pitot tube brings the flow to rest and reads the total pressure; the static port reads :math:`p`; their difference is the dynamic pressure :math:`q = \tfrac12\rho V^2` from :func:`~engineeringkit.aerodynamics.dynamic_pressure`. Inverting it gives the airspeed, but only if the right density is used: the same pitot reading means a higher true airspeed at altitude. .. GENERATED FROM PYTHON SOURCE LINES 16-21 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.aerodynamics import dynamic_pressure, isa_atmosphere .. GENERATED FROM PYTHON SOURCE LINES 22-24 Dynamic pressure grows with the square of speed ----------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 24-30 .. code-block:: Python V = np.linspace(0, 120, 121) rho_sl = float(isa_atmosphere(0.0).density) q = dynamic_pressure(rho_sl, V) print(f"q at 50 m/s, sea level: {float(dynamic_pressure(rho_sl, 50.0)):.1f} Pa") .. rst-class:: sphx-glr-script-out .. code-block:: none q at 50 m/s, sea level: 1531.3 Pa .. GENERATED FROM PYTHON SOURCE LINES 31-37 The same pitot reading at altitude ---------------------------------- Inverting Bernoulli, :math:`V = \sqrt{2q/\rho}`. An airspeed indicator is calibrated with sea-level density, so it shows the *equivalent* airspeed; the true airspeed is larger by :math:`\sqrt{\rho_0/\rho}`. .. GENERATED FROM PYTHON SOURCE LINES 37-56 .. code-block:: Python altitudes = np.array([0.0, 3000.0, 6000.0, 9000.0, 12000.0]) rho = isa_atmosphere(altitudes).density q_reading = float(dynamic_pressure(rho_sl, 70.0)) true_speed = np.sqrt(2 * q_reading / rho) for h, v in zip(altitudes, true_speed, strict=True): print(f"h = {h / 1e3:4.0f} km: indicated 70.0 m/s -> true {v:5.1f} m/s") assert np.allclose(dynamic_pressure(rho, true_speed), q_reading) fig, axes = plt.subplots(1, 2, figsize=(9, 3.5)) axes[0].plot(V, q / 1e3) axes[0].set(xlabel="speed V [m/s]", ylabel="dynamic pressure q [kPa]", title="q = rho V^2 / 2 at sea level") axes[1].plot(altitudes / 1e3, true_speed, "o-") axes[1].axhline(70, color="gray", ls="--", label="indicated (sea-level calibration)") axes[1].set(xlabel="altitude [km]", ylabel="true airspeed [m/s]", title="Same pitot reading, thinner air") axes[1].legend() fig.tight_layout() plt.show() .. image-sg:: /api/gallery/aerodynamics/forces/images/sphx_glr_plot_01_bernoulli_dynamic_pressure_001.png :alt: q = rho V^2 / 2 at sea level, Same pitot reading, thinner air :srcset: /api/gallery/aerodynamics/forces/images/sphx_glr_plot_01_bernoulli_dynamic_pressure_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none h = 0 km: indicated 70.0 m/s -> true 70.0 m/s h = 3 km: indicated 70.0 m/s -> true 81.3 m/s h = 6 km: indicated 70.0 m/s -> true 95.4 m/s h = 9 km: indicated 70.0 m/s -> true 113.5 m/s h = 12 km: indicated 70.0 m/s -> true 139.0 m/s .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.200 seconds) .. _sphx_glr_download_api_gallery_aerodynamics_forces_plot_01_bernoulli_dynamic_pressure.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../../lite/lab/index.html?path=api/gallery/aerodynamics/forces/plot_01_bernoulli_dynamic_pressure.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_bernoulli_dynamic_pressure.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_bernoulli_dynamic_pressure.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_bernoulli_dynamic_pressure.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_