Fluid Mechanics

Interactive courseware that introduces foundational-level concepts as taught in introductory courses in fluid mechanics.
Updated 30 Apr 2024

Fluid Mechanics

Curriculum Module

Created with R2023a. Compatible with R2023a and later releases.

View on File Exchange or Open in MATLAB Online

MATLAB Versions Tested
MATLAB Versions Tested
MATLAB Versions Tested


This curriculum module contains interactive MATLAB® live scripts that teach fundamental concepts of fluid mechanics. Topics addressed include dimensional analysis, control volume analysis, internal flow analysis, mass, momentum, and energy conservation equation. You can explore various fluid dynamics applications from your home plumbing to leaving the earth’s orbit and flying on another planet.


You can use these live scripts as demonstrations in lectures, class activities, or interactive assignments outside class. The module is divided into five interactive instructional scripts.

The instructions inside the live scripts will guide you through the exercises and activities. Get started with each live script by running it one section at a time. To stop running the script or a section midway (for example, when an animation is in progress), use the image_0.png Stop button in the RUN section of the Live Editor tab in the MATLAB Toolstrip.

Contact Us

Solutions are available upon instructor request. Contact the MathWorks teaching resources team if you would like to request solutions, provide feedback, or if you have a question.


These scripts assume knowledge common with basic derivative and integral calculus and common mechanical and thermodynamics concepts such as energy and temperature. There is minimal MATLAB and Simulink knowledge required to complete the module. ManOnTheMoon is the only script that comes with no expected knowledge computing knowledge. It is highly encouraged to complete additional training for the rest of the module, starting with and Introduction to Symbolic Math with MATLAB. Those interested in additional training should consider completing Simulink Onramp & Simscape Onramp as a further learning exploration.

Getting Started

Accessing the Module

On MATLAB Online:

Use the image_1.png link to download the module. You will be prompted to log in or create a MathWorks account. The project will be loaded, and you will see an app with several navigation options to get you started.

On Desktop:

Download or clone this repository. Open MATLAB, navigate to the folder containing these scripts, and double-click [fluid-mechanics.prj](matlab: openProject("fluid-mechanics.prj")). It will add the appropriate files to your MATLAB path and open an app asking where you would like to start.

Ensure you have all the required products (listed below) installed. If you need to include a product, add it using the Add-On Explorer. To install an add-on, go to the Home tab and select image_2.png Add-Ons > Get Add-Ons.


MATLAB®, Mapping Toolbox™ (optional), Symbolic Math Toolbox™, Simulink®, Simscape™


If you are viewing this in a version of MATLAB prior to R2023b, you can view the learning outcomes for each script here

In this script, students will...
- Learn about conservation laws.
- Apply the control volume method.
- Develop theoretical models of a rocket launch.
In this script, students will...
- Learn about the link between pressure and velocity.
- Explore Bernoulli's equation
In this script, students will...
- Learn about energy and power in a fluid system.
- Apply the conservation of energy.
- Analyze the potential of renewable energy sources.
In this script, students will...
- Learn about the concept of head losses in a pipping network.
- Model a house plumbing using Simscape fluid.
- Explore time-dependent simulations.
In this script, students will...
- Learn about the concept of dimensionless numbers.
- Explore the design of the Ingenuity copter.
- Perform a complete dimensional analysis.

Related Courseware Modules

Available on:

Or feel free to explore our other modular courseware content.

Educator Resources


Looking for more? Find an issue? Have a suggestion? Please contact the MathWorks teaching resources team. If you want to contribute directly to this project, you can find information about how to do so in the CONTRIBUTING.md page on GitHub.

Copyright 2023 The MathWorks™, Inc

Cite As

Valentin Boutrouche (2024). Fluid Mechanics (https://github.com/MathWorks-Teaching-Resources/Fluid-Mechanics), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2023a
Compatible with R2023a and later releases
Platform Compatibility
Windows macOS Linux
More Files in the  Distance Learning Community

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

Change release to default branch

See release notes for this release on GitHub: https://github.com/MathWorks-Teaching-Resources/Fluid-Mechanics/releases/tag/v2.0.0

See release notes for this release on GitHub: https://github.com/MathWorks-Teaching-Resources/Fluid-Mechanics/releases/tag/v1.0.2

See release notes for this release on GitHub: https://github.com/MathWorks-Teaching-Resources/Fluid-Mechanics/releases/tag/v1.0.1


To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.