Rouben Rostamian

MATH 625:  Computational Mathematics
and C Programming

Spring 2025 Course information

Class Time/Place:    TuTh 11:30pm–12:45pm, SOND 202
Office: MP 402
Phone: 410–455–2458
Email: rostamian@umbc.edu
Office hours: TuTh 1:30pm–2:30pm

Course content

This is a hands-on computational mathematics course with emphasis on programming in C. The goal is quickly to impart the necessary algorithmic and programming skills to enable the students build moderate- to large-scale application programs and gain a mastery of the C programming language in the context of scientific computing.

Prior experience with some programming language is assumed—this is not an “Introduction to Programming” course—but I will fill in the essential details of programming in C as we go along. A substantial part of the course deals with moderate to advanced topics in C with special emphasis on common idioms of scientific computing. Through the semester you gradually will build your own computing library and will apply it to solve increasingly complex computational projects.

Prerequisites

Math 221 (linear algebra), Math 251 (multivariable calculus), and a working knowledge of some programming language.

Textbooks

The textbook Programming Projects in C is an outgrowth of my having taught this course for many years. You will find it at UMBC Bookstore, SIAM's bookstore, amazon.com, and possibly elsewhere. SIAM gives 30% discount to its members, and I think membership is free to students. The textbook's website provides resources such as supplementary files and other information that you may need to complete specific projects.

The textbook assumes a working knowledge of C; it is not a C primer. I recommend Kochan's, Programming in C (4th edition) for an introduction to C, or brushing up on your C skills, and as a reference. The older 3rd edition is just as good and you may be able to buy it for just a few dollars. But don't get an earlier edition.

Warning: Please stay away from C tutorials on the web. I haven't seen a decent one yet; most of them will teach you the wrong programming ideas and bad habits which you will struggle to correct later. You've been warned!

Grading method

I will collect and grade the programming assignments. Course grade will be based on cumulative performance on these assignments.

Computer requirements

We will be doing some heavy-duty C programming in this course. I will briefly sketch the history of the development of C in the first lecture where we will see that the C programming language and the Unix operating system where born alongside each other in the early 1970s. Although C programming is now possible on just about any operating system, it feels much more natural in the Unix environment than anywhere else. For that reason, we will be doing our programming under Unix throughout this course.

I suppose that your have a computer running one of Linux, Mac, or Windows operating systems.

If you have a computer running Linux (which is a variant of Unix), then you are all set. I use Linux myself. There are dozens of Linux distributions. They are cosmetically different but otherwise pretty much identical under the hood. I use the Ubuntu MATE (pronounced (MAH-te) distribution. Don't worry if your Linux distribution is different.

If you have a Mac, you may already know that Apple's macOS and iOS are variants of Unix. You should be able to do essentially everything that I do in Linux. You will need to know how to install a few large software packages when the time comes.

Writing a C program under Windows is somewhat a cumbersome affair. Microsoft's web page Walkthrough may have the information that you need to get started. That said, you may find it easier—and more natural—to install Linux on your computer and use that instead.

Sample projects

The textbook presents quite a few programming projects. One semester is not enough to do all of them, so we will pick and chose a few, depending in the interests of the majority of the class. Here are a few samples.

Simulated Evolution

Bugs (red dots) evolve into two distinct species in response to environmental factors. A region where food (green dots) is plentiful (near the center) leads to the emergence of a sluggish species that tends to stay in one place. A region where food is scarce (away from the center) leads to the emergence of a species that tends to move about a lot.
[evolution.gif]

The Nelder-Mead minimization algorithm

The Nelder-Mead algorithm is a gradient-free method for minimization of functions of the type f : Rn → R. It works through a moving and deforming adaptive simplex (a triangle in 2D) that “sniffs around” for the location of the minimum.
[nelder-mead.gif] [energy.png]

Large deformations of trusses

Our truss solver handles statically indeterminate trusses with nonlinear elastic members and large deformations (assuming that no buckling occurs).

The large deformations of a Pratt truss under variable load

[pratt.gif]

The large deformations of a cantilever truss under variable load

[cantilever.gif]

A finite element solver

Solutions of Poisson's PDE (2 u + f = 0) on: (a) an L-shaped domain with zero Dirichlet boundary data; and (b) on an annular domain with mixed Dirichlet and Neumann boundary data. This finite element solver uses linear elements on an unstructured triangular mesh.
[l-shaped.png] [annulus.png]

Images filtered through Haar wavelets

A grayscale image sample

The sequence of images illustrates the effect of filtering a grayscale image through the Haar wavelet transform.
[aya_mtsuura-animated.gif]

A color image sample

The original 256×256 image was transformed via Haar wavelets. Then the least significant coefficients were dropped and the image was reconstructed with the remaining coefficients. The relative L2 errors of truncation in the three reconstructed images are 2, 3, and 6 percent. The information from the original image retained are 10%, 5%, and 1%, respectively.

[vivian000.jpg]
Original image
[vivian000.jpg]
...with 10% of the original information
[vivian000.jpg]
...with 5% of the original information
[vivian000.jpg]
...with 1% of the original information

Course calendar and activity log

Calendar
Tue Jan 28  
Thu Jan 30  
Tue Feb 4  
Thu Feb 6  
Tue Feb 11  
Thu Feb 13  
Tue Feb 18  
Thu Feb 20  
Tue Feb 25  
Thu Feb 27  
Tue Mar 4  
Thu Mar 6  
Tue Mar 11  
Thu Mar 13  
Tue Mar 18 Spring Break
Thu Mar 20 Spring Break
Tue Mar 25  
Thu Mar 27  
Tue Apr 1  
Thu Apr 3 Tomorrow is the deadline for withdrawing from courses
Tue Apr 8  
Thu Apr 10  
Tue Apr 15  
Thu Apr 17  
Tue Apr 22  
Thu Apr 24  
Tue Apr 29  
Thu May 1  
Tue May 6  
Thu May 8  
Tue May 13  

Notes & Comments

Registrar's info
Registrar's Office Dates and Deadlines

 

UMBC Honors Code

By enrolling in this course, each student assumes the responsibilities of an active participant in UMBC's scholarly community in which everyone's academic work and behavior are held to the highest standards of honesty. Cheating, fabrication, plagiarism, and helping others to commit these acts are all forms of academic dishonesty, and they are wrong. Academic misconduct could result in disciplinary action that may include, but is not limited to, suspension or dismissal.

Student Disability Services (SDS)

Services for students with disabilities are provided for all students qualified under the Americans with Disabilities Act of 1990, the ADAA of 2009, and Section 504 of the Rehabilitation Act who request and are eligible for accommodations. The Office of Student Disability Services is the UMBC department designated to coordinate accommodations that would allow for students to have equal access and inclusion in their courses.

A message from the Office of Equity and Civil Rights

This Title IX policy is provided by UMBC's Office of Equity and Civil Rights.