Modeling the Steady State Geothermal Gradient

Kendra Murray, Idaho State University, Geosciences

Author Profile
Initial Publication Date: October 6, 2026
DOI | Cite this

Summary

Students use several analytical solutions to solve for the steady-state geothermal gradient given various boundary conditions, internal heat production scenarios, and exhumation rates. This activity showcases how to build and use user-defined MATLAB functions.

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

Learning Goals

TBD

Context for Use

Overview

I will use this problem set as a homework assignment in my "MATLAB for the Geosciences" course for undergraduate and graduate students. The course prerequisites are introductory geology, no previous programming experience is necessary. Typically students are advanced undergraduates and MS students. It will be one of the later homework assignments, because as written it assumes some MATLAB script writing experience. This is a problem set designed for students to work on during their own time, but it could easily operate as a lab assignment or extended in-class activity.

The problem set this assignment is based upon was originally designed in Excel for a graduate-level thermochronology course. Here, I re-tooled it for a MATLAB programming class with a mix of undergraduate and graduate geosciences students in the Geosciences. (I've removed the thermochronology-specific context and questions, but I'd be happy to share them with anyone who is interested.)

Student backgrounds

Geoscience background: Students will need to have some familiarity with the geothermal gradient and heat flow in the Earth.

Mathematical background: The handout includes mathematical background information (e.g., the foundational PDEs), but the equations students actually implement in MATLAB are analytical and mathematically simple. The most difficult part is keeping track of units and order of operations.

MATLAB background: This homework will follow in-class assignments on user-defined functions. Students should also already know the basics of making arrays and plots, including the subplot function.

Description and Teaching Materials

This is designed as a homework assignment.

Assignment Overview (from the handout)

The geothermal gradient ("geotherm") is how the temperature changes with depth in the Earth. In the lithosphere, the rigid outermost layer of the Earth that includes the crust and the lithospheric mantle, heat is transported primarily by conduction. However, when rocks move fast on geological timescales (for example, during fault motion or erosional exhumation), they commonly also transport heat with them via advection. Thus, heat conduction and advection, combined with conditions such as the temperature at Earth's surface and crustal heat production due to radioactive decay of K, control the shape of the geothermal gradient in space and time.

When we are interested in quantifying something that varies simultaneously in space and in time, like the Earth's geotherm, the most general mathematical descriptions use partial differential equations (such as the diffusion equation, which when used to describe heat conduction is called Fourier's Law). However, there are useful, published simplifications of these equations that can be solved analytically in a spreadsheet or MATLAB script—no numerical modeling required.

Several now-classic papers (Stüwe et al., 1994; Mancktelow and Graseman, 1997), and the Geodynamics textbook by Turcotte and Schubert, have treated the problems of steady-state geotherms with various complications involving heat production, exhumation (e.g., rocks getting closer to Earth's surface via a process such as erosion), and topography. Not only are these approachable analytical solutions but they also provide important end-member cases that place constraints on a wide range of geological problems involving heatflow in the Earth. In many cases, especially those involving slow advection rates (~<0.5 mm/yr), these solutions may be all you need to make real progress on a problem of interest.

The approach presented here is mostly following notations and conventions of Mancktelow and Graseman (the appendix), but it pulls from Turcotte and Schubert's textbook as well. This assignment is modified from an Excel-based problem set by Peter Reiners.

In MATLAB, students  implement several analytical solutions to the geotherm equation as user-defined functions, which they then call in scripts to calculate the steady-state geotherm given specific conditions. They then answer some questions about the results.

Materials for students

Murray_MATLABworkshop2026_steadystategeotherm.docx (Microsoft Word 2007 (.docx) 420kB Sep27 26)

Part1_geotherm_noexhumation.m (Matlab File 3kB Sep27 26)SSGEOTHERM_NOEXHUMATION.m (Matlab File 1kB Sep27 26)

Part2_geotherm_withexhumation.m (Matlab File 2kB Sep27 26)SSGEOTHERM_WITHEXHUMATION.m (Matlab File 1kB Sep27 26)

Keys

Part1_geotherm_noexhumation_KEY.m (Matlab File 7kB Sep27 26)SSGEOTHERM_NOEXHUMATION_KEY.m (Matlab File 996bytes Sep27 26)

Part2_geotherm_withexhumation_KEY.m (Matlab File 2kB Sep27 26)SSGEOTHERM_WITHEXHUMATION_KEY.m (Matlab File 1kB Sep27 26)

Teaching Notes and Tips

An emphasis on user-defined functions addresses a common student struggle

In my experience, writing and using user-defined functions is one of the things that students struggle with most in a MATLAB programming class. This exercise is designed as a Geoscience-specific example of why user-defined functions are so...useful.

Note for workshop (remove for published activity)

I used building this assignment as an opportunity to take Claude out for a spin, asking it to help me transform an existing Excel based problem set into a MATLAB assignment. It did a remarkably good job. I'm eager to discuss how gen AI tools are transforming how we build assignments, and what students actually really need to learn in programming classes going forward.


Assessment

The homework assignment is graded on the completeness of the functions and scripts, including how well they are commented, as well as the quality of the narrative answers to specific questions in the assignment.

References and Resources

Mancktelow, N.S., and Grasemann, B., 1997, Time-dependent effects of heat advection and topography on cooling histories during erosion: Tectonophysics, v. 270, p. 167–195, doi:10.1016/s0040-1951(96)00279-x.

Turcotte, D.L., and Schubert, G., 2002, Geodynamics: Cambridge University Press, Cambridge University Press.