Lake Pollution: calculations and modelling

Dan Morgan, Vanderbilt University, Earth and Environmental Sciences
Author Profile
Initial Publication Date: October 6, 2026
DOI | Cite this

Summary

This is a homework exercise for students to practice both their math and their Matlab coding. The setup is to imagine a set of two connected lakes and pollution is being deposited into the first lake, which then transits into the second lake. In the first part, students go through a series of calculations to determine the steady-state concentration of pollution that each lake will reach. In the second part, students write a Matlab code to model this situation, but do it on a daily basis so they can see how the concentration of pollution builds up over time and find the specific day(s) that pollution will cross a given threshold.

Share your modifications and improvements to this activity through the Community Contribution Tool »

Learning Goals

Concepts and content:
Box models (input/output)
Steady-state solutions
For-loops

MATLAB is used in the second part to build a computational model for the lake-pollution system that students describe mathematically in the first part.

Students need to understand how for-loops work and that they are not doing exactly the same math in each iteration of the for-loop that they did in the steady-state calculation. At this point of the semester, students should be comfortable defining variables, setting up initial conditions, and tracking the important information in new variables in the for-loop.

At this point, I ask students to turn in their math and their code. I have considered turning this into a written report where students would have to describe their methods and results to a theoretical town or environmental group.

Context for Use

This is a 2000-level, intermediate course for Earth & Environmental Science majors. The goals are to build mathematical and computational comfort and skills in our students that they can apply to upper-division courses. In our major, students have options for supporting sciences they take, like CHEM, PHYS, BSCI, MATH, Comp. Sci., Data Science, and Stats. Not all students take math and/or computer science, and many students in this class lack confidence with math and/or coding. The spirit of this class is very much to make math and coding fun and useful with a variety of Earth & Environmental Science examples.

This assignment is given about the 7th or 8th week of class after we have done box models, steady-state solutions, and written other codes with for-loops.

Description and Teaching Materials

This activity includes the written assignment given to the students, a key for the math portion, and a key for the MATLAB code.
Student assignment for Lake Pollution (Microsoft Word 2007 (.docx) 25kB Sep24 26)

Teaching Notes and Tips

By design, I've gone step by step through the math portion because I find my students have more struggles with that. For the MATLAB code, I've given them very little besides "code it" because they have a few examples at this point in the semester, and they should be able to follow the steps they do in the math portion. Depending on your students, you may want to give them more guidance on the code, or lest guidance on the math.

Assessment

Students are scored for correct answers and neatness. All my assignments in this class have a neatness grade because I emphasize that science needs to be communicated and repeatable. I find code-writing helps reinforce good math writing. I emphasize that both math and code steps are written out line-by-line in vertical series, and that the use of space is important. I do not grade on hand-writing.


References and Resources

Later in the semester, I have adapted the "Modeling Mono Lake's Water Balance" exercise posted by Phil Resor to this site (https://serc.carleton.edu/teachearth/activities/221269.html). We use lakes as examples of box models for a variety of exercises. My adaptation of Mono Lake is to do a Monte Carlo simulation for lake elevation using the given climate data.