Last | Top | Next

Mathematical Methods for Engineers (10. 539/24.539)
List of Matlab Demos

This page contains a summary list of the Matlab demos available for this course. The list is organized roughly by topic and by the order that the files are discussed in the Lecture Notes. Some of these files will be discussed in detail in class, but all of them are discussed to some extent in the notes. They hopefully can serve as a guide for many of the Matlab assignments given throughout the semester. Careful study of these sample files should introduce you to a variety of Matlab programming features and also give you a solid understanding of the various mathematical problem-solving strategies and techniques discussed over the course of the semester.

You can view a particular Matlab file or download it by simply clicking the right mouse button on the link over the file name. From here you can either choose "open in new window" to view the file online or "save target as" to download the file directly to your PC (note that these commands might differ slightly depending on your choice of web browser). In any case, once the file is on your machine, you can run it just like any other Matlab script file (make sure you do not inadvertently change any file names).

Review of Introductory Differential Equations and Linear Algebra
Plotting and function evaluation with Matlab for the sliding chain problem in Example 1.5.
Plotting and function evaluation with Matlab for the orthogonal trajectory problem in Example 1.6.
Sample problem to illustrate Picard’s iteration method.
Demo that illustrates the solution of a single IVP with the use of Matlab’s ode23 routine. These files, which are discussed in Example 1.7, also show how to use fzero to plot an analytical solution if it is given in implicit form.
Files for Example 1.8 to illustrate the solution of a single IVP with the use of Matlab’s ode23 routine.
Files associated with Example 1.9: Flow from a Damaged Oil Tank.
Simple demo to illustrate some linear algebra capability in Matlab (see Chapter 3 in the Lecture Notes).

General Solution to IVPs
Simulation of a simple mechanical system. This demo is discussed as part of Example 4.4, which illustrates how to use ode23 to solve of system of ODEs.
Simulation of the Dynamics of a Semi-Batch Chemical Reactor as discussed in Example 4.5 (a typical IVP).

General Solution to BVPs
Demo to illustrate the solution of a 2nd order BVP via the Shooting Method. These files implement the manual method discussed in Example 5.1.
This is a general-purpose routine that implements an automated solution procedure based on the Shooting Method for 2nd order BVPs. In its present form, it is restricted to problems with linear BCs.
This is the automated version of Example 5.1 (uses bvp2sh.m).
Example of Finite Difference method for solving BVPs. These files are associated with two versions of the solution to Example 5.2.
Solution to Example 5.3A: Shooting Method Solution for the Circular Fin Problem. These files use bvp2sh.m.
Solution to Example 5.3B: Finite Difference Solution for the Circular Fin Problem.

Numerical Solution of Algebraic Equations
Function file to implement a simple version (no partial pivoting) of the Gauss Seidel iteration scheme with successive relaxation (SR) for solving linear equations.
Demo to illustrate the behavior of the SR method for a simple 3x3 system as discussed in Example 6.3. Uses the sr.m routine.

Power Series Solution Method
Demo to illustrate the evaluation of infinite power series expansions using a recurrence relation as discussed in Chapter 7.

Special Functions and Orthogonality
Demo to plot several low-order Legendre polynomials and to demonstrate their orthogonality property. Uses Matlab’s quadl routine to do the numerical integration.
Script file to plot some low-order Bessel functions.
Analytical solution, which involves Bessel functions, for the Cylindrical Fin Problem. This file is associated with Example 8.3 in the Lecture Notes.

Sturm-Liouville Theory and Generalized Fourier Series
Demo of Fourier Series Representation for f(x) = 1.
Demo of Fourier Series Representation for f(x) = x(L-x).
Demo for using Fourier Series for solving BVPs. This file is associated with Case 1 of Example 9.2.
Demo for using Fourier Series for solving BVPs. This file is associated with Case 2 of Example 9.2.

Analytical Solution of PDEs
Heat Transfer in a 1-D Finite Bar using the Separation of Variables (SOV) method (Example 10.1 in Class Notes).
Heat Transfer in a 1-D Finite Bar using the (SOV) method (Example 10.2 in Class Notes).
Heat Transfer in a 1-D Finite Bar using the (SOV) method (Example 10.3 in Class Notes).
2-D Heat Conduction in a Rectangular Block via the SOV method (Example 10.5 in Class Notes).

Numerical Solution of PDEs using Finite Difference Methods
Heat Transfer in a 1-D Finite Bar using the EXPLICIT FD method (Example 11.1 in Class Notes). This is HT Example #2 which is solved using several techniques -- here we use the explicit Euler method.
Heat Transfer in a 1-D Finite Bar using the IMPLICIT FD method (Example 11.2 in Class Notes). This is HT Example #2 which is solved using several techniques -- here we use the implicit Crank-Nicolson method.
Heat Transfer in a 1-D Finite Bar using the State-Space FD method (Example 11.3 in Class Notes). This is HT Example #2 which is solved using several techniques -- here we FD the spatial part and use ode23 to solve the system of 1st order ODEs.
Heat Transfer in a 1-D Finite Bar using the State-Space FD method (Example 11.4 in Class Notes). This is HT Example #3 which has a time-dependent BC on the right side. This was solved earlier using the Eigenfunction Expansion Method (similar to SOV method), but here we FD the spatial part and use ode23 to solve the resulting system of 1st order ODEs.
2-D Heat Conduction in a 2-D Rectangular Block via the FD method (Example 11.5 in Class Notes). This was solved previously using the SOV method in Example 10.5.

Numerical Solution of PDEs using FEMLAB
Heat Transfer in a 1-D Finite Bar using FEMLAB (ver 3.0.a). This is HT Example #2 which has already been solved using several techniques (see above). Here we simply demonstrate how to solve a parabolic PDE in 1-D within FEMLAB. The zip file contains a *.fl file which can be opened in FEMLAB and a *.m file with an example of some simple post-processing of the FEMLAB results in Matlab.
Heat Transfer in a 1-D Finite Bar using FEMLAB (ver 3.0.a). This is HT Example #3 (Example 10.4 and 11.4 in Class Notes) which has a time-dependent BC on the right side. This is another example of how to solve a parabolic PDE in 1-D within FEMLAB. The zip file contains a *.fl file which can be opened in FEMLAB and a *.m file with an example of some simple post-processing of the FEMLAB results in Matlab.
2-D Heat Conduction in a 2-D Rectangular Block using FEMLAB. This was solved previously using the SOV method in Example 10.5 and the FD method in Example 11.5. The zip file given here contains a *.mat file that was saved during the FEMLAB (ver 2.3a) run, so the exact setup within FEMLAB can be reproduced. Some post-processing is also done in Matlab with the *.m file (see comments within the file) contained within the zip archive.

Note: The Matlab demos listed here are related directly to the examples in the Math Methods Lecture Notes. Some of the Matlab files associated with the examples done in class are also available under the Additional Resources link. In addition, several other of my courses also have a series of Matlab related demos that may be of interest to the student studying this material. These files can be found at the following URL: www.profjrwhite.com/courses.htm.

Last updated by Prof. John R. White (Sept. 2005)

Last | Top | Next

 
 
Main | Current Activities | Courses | Research | Vitae | Misc. Goodies