Skip to content

A collection of teaching scripts showing applications of partial differential equations to traffic modeling, battery thermal modeling, diffusion, and more.

License

Notifications You must be signed in to change notification settings

MathWorks-Teaching-Resources/Applied-PDEs

Repository files navigation

Applied Partial Differential Equations

View on File Exchange or Open in MATLAB Online

MATLAB Versions Tested

Curriculum Module

Created with R2024a. Compatible with R2024a and later releases. Chemical engineering

Information

This curriculum module contains interactive MATLAB® live scripts that teach various topics suitable for a first class in partial differential equations.

Background

You can use these live scripts as demonstrations in lectures, class activities, or interactive assignments outside class. This module covers classification of second-order PDEs, solving first order wave equations analytically, solving second order wave equations numerically, systems of partial differential equations, and implementing both explicit and implicit finite difference methods. It also includes examples of shocks and rarefaction waves in traffic, diffusion of carbon through iron, a chemical morphogenesis model, a thermal model of a battery, and an approach to modeling an ultrasound.

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 EndIcon.png Stop button in the RUN section of the Live Editor tab in the MATLAB Toolstrip.

Contact Us

Contact the MathWorks teaching resources team if you would like to provide feedback or have a question.

Prerequisites

This module assumes fluent knowledge of single-variable calculus. If you would like to brush up on these topics, you could review with the calculus courseware:

Getting Started

Accessing the Module

On MATLAB Online:

Use the OpenInMO.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 AppliedPDEs.prj. It will add the appropriate files to your MATLAB path and open an app that asks you 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 AddOnsIcon.png Add-Ons > Get Add-Ons.

Products

MATLAB is used throughout. Tools from the Symbolic Math Toolbox™ are also frequently used. The function range from the Statistics and Machine Learning Toolbox™ is used in Diffusion.mlx and the Partial Differential Equation Toolbox™ is used in ReactionDiffusion.mlx, in an extension example.

Scripts

Classification.png
In this script, students will...
$\bullet$ Review the terminology of classifying differential equations including homogeneity, order, and linearity.
$\bullet$ Classify second-order PDEs as elliptic, parabolic, or hyperbolic.
Academic disciplines
$\bullet$ Mathematics
CharactericsticCurve.png
In this script, students will...
$\bullet$ Solve a transport equation using the method of characteristic lines.
$\bullet$ Investigate applying the method of characteristics to first-order 1-D PDEs with nonconstant coefficients.
Academic disciplines
$\bullet$ Mathematics
CharacteristicCurveWithShock.png
In this script, students will...
$\bullet$ Calculate a simple traffic model involving a nonlinear transport equation.
$\bullet$ Identify and resolve rarefaction regions in a characteristic plot.
$\bullet$ Identify and resolve shocks in a characteristic plot.
Academic disciplines
$\bullet$ Mathematics
Discretizing.png
In this script, students will...
$\bullet$ Implement an explicit method.
$\bullet$ Implement an implicit method
$\bullet$ Implement a Crank-Nicolson solver
Academic disciplines
$\bullet$ Mathematics
Diffusion.gif
In this script, students will...
$\bullet$ Explore the basic theory of diffusion and the diffusion equation.
$\bullet$ Implement a finite difference solution for the diffusion equation.
$\bullet$ Visualize the results of diffusion simulations.
Academic disciplines
$\bullet$ Mathematics
$\bullet$ Materials science
$\bullet$ Chemical engineering
ReactionDiffusion.gif
In this script, students will...
$\bullet$ Explore diffusion equation.
$\bullet$ Implement a finite difference solution for the diffusion equation.
$\bullet$ Visualize the results of diffusion simulations.
Academic disciplines
$\bullet$ Mathematics
$\bullet$ Chemical engineering
UltrasoundZoom.png
Credit: Terry J. DuBose
In this script, students will...
$\bullet$ Identify the necessary initial and boundary value knowledge required to numerically approximate a second-order wave equation.
$\bullet$ Explore the basic theory of solving differential equations with boundary conditions.
$\bullet$ Identify challenges involved in numerically solving a simple-looking PDE.
Academic disciplines
$\bullet$ Mathematics
$\bullet$ Medical technology
$\bullet$ Acoustics
Battery.gif
In this script, students will...
$\bullet$ Explore the basic theory of the heat equation.
$\bullet$ Use cylindrical coordinates to model a battery cell.
$\bullet$ Implement a variety of initial conditions and visualize the results.
Academic disciplines
$\bullet$ Mathematics
$\bullet$ Electrical engineering
$\bullet$ Chemical engineering

License

The license for this module is available in LICENSE.md.

Related Courseware Modules

Courseware Module
Sample Content
Available on:
Numerical Methods with Applications
NumMethodsIcon.png
OpenInFX.png
OpenInMO.png
GitHub
Fourier Analysis
FourierAnalysisIcon.png
OpenInFX.png
OpenInMO.png
GitHub

Or feel free to explore our other modular courseware content.

Educator Resources

Contribute

Looking for more? Found 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 2024 The MathWorks™, Inc