Cloud-Based Docker Containers Forge Career-Ready Engineering Skills

Students Focus on Mathematical Modeling Instead of Software Setup

Anthony Patera has taught mechanical engineering at MIT since 1982, after earning his bachelor’s, master’s, and doctoral degrees at the school. Although engineers have used scientific computing that whole time, it has remained largely absent from many core courses. The reasons range from difficulty running the software on all computers to a lack of machines with sufficient computational power. He has tried to use more software in his classes several times in his career. “I gave up,” he says.

He recently implemented an elegant solution in one of his courses. Patera’s postdoctoral researcher, Kento Kaneko, packaged the code that performs a key calculation into an easily accessible component that students could access from the cloud. “This changes the depth of the problem sets,” Patera says, “and the extent to which we can make things more relevant and interesting.”

From Research to the Classroom

The solution began with a grant from the Office of Naval Research. Using partial differential equations (PDEs), Patera’s lab developed a way to provide error estimates for a widely used heat transfer approximation to solutions of the time-dependent conduction problem. However, the estimator requires solving a single, elliptic PDE. Sharing their work with professionals around the globe proved challenging: Distributing source code files requires that the recipients recreate the environment and dependencies.

“For years, I’ve struggled to prepare students for the workplace. The workplace is simulation-dominated. The key point in simulation isn’t getting the numbers. It’s knowing they’re right. Until now, I didn’t have the vehicle to get students to exercise those skills.”

They contemplated sharing as an executable file, but deploying updates would be challenging. Additionally, each recipient would need administrative rights to run executables, which are occasionally blocked by IT departments for security purposes. After discussions with MathWorks, they found an optimal approach to sharing their work: a Docker® container microservice.

A container is a self-contained unit of software that packages up code and all its dependencies, so the application runs identically across any computing environment. Docker is a popular implementation of containers and the de facto standard for distributing software. The Docker container encapsulates the operating system, supporting libraries, execution run times, the MATLAB® code that solves the PDE, and an HTTP API endpoint to invoke the MATLAB code—also known as a microservice. Existing MATLAB code can be easily turned into a Docker container microservice using MATLAB Compiler SDK™. A client user of the Docker container microservice can provide the object’s geometry as inputs and receive a solution plus estimates of the error through a web app intermediary or directly through the microservice API.

The MATLAB PDE software was developed by Patera and Kaneko in collaboration with Professor Masayuki Yano of the University of Toronto. “It occurred to us that the process is also great for students,” Patera says. He and Kaneko implemented the same Docker microservice approach in Patera’s Intermediate Heat and Mass Transfer class. Three problem sets use the Heat Transfer Microservice (HTM).

One of the problem sets covers thermal bridging. Students receive a diagram of a wall cross-section, with the building’s inside on the left and the outside on the right. The wall is mostly insulated, except for some regions with steel studs. The studs carry heat effectively from inside the building to the outside. The HTM creates a temperature plot for students that looks like a warped two-dimensional sheet. Students must convince Patera that the chart is correct within specified error bounds.

“For years, I’ve struggled to prepare students for the workplace,” Patera says. “The workplace is simulation-dominated. The key point in simulation isn’t getting the numbers. It’s knowing they’re right. Until now, I didn’t have the vehicle to get students to exercise those skills.” The HTM allows students to spend more time developing those critical evaluation skills instead of performing rote computation or IT software configuration.

Patera emphasizes the importance of simulation in undergraduate education. Students can work on realistic problems related to topics they might be interested in, such as building energy efficiency. They also extend their modeling skills, which they’ll need for solving many kinds of complex problems. “This helps them develop their ‘blunder’ detection skills,” Patera says. “They must determine if the simulation is correct.”

“Microservices are the key enabler,” Patera adds. “The essential pedagogical elements are unencumbered by practical barriers associated with administration, implementation, and access.”

A plot created by the Heat Transfer Microservice that charts the temperature distribution of a thermal bridging problem.

The Heat Transfer Microservice generates and transfers the PDE solution for a plot displaying the temperature distribution on the client software. (Image credit: Kento Kaneko)

In the Cloud

Screenshot showing a list of updated image filenames and configuration for the container with fields for the image URL, the container port, arguments, memory allocation, and number of CPUs allocated to each instance of the container.

The Google Cloud Run configuration. (Image credit: Kento Kaneko)

“I think this is a prime example of microservices democratizing the educational process.”

The HTM Docker microservice runs on Google Cloud Platform™, allowing students to access it from anywhere. According to Kaneko, the HTM is easy to update. It’s efficient, reliable, and scalable. The Google® Cloud Run service ensures that if multiple people want to use HTM simultaneously, it scales resources as needed to manage the load. This is done automatically, and Kaneko does not have to worry about provisioning hardware.

Even if students ran the components on their personal computers, they wouldn’t necessarily get the same performance they get from the cloud service. Patera eventually wants to share the HTM with students at other universities with fewer resources. “I think this is a prime example of microservices democratizing the educational process,” he says.

Enter ChatGPT

The students performed very well in the class and didn’t lodge any complaints about the software. He notes that students tend to be polite—except when software doesn’t work. “But over the course of the semester, there has not been one grumble,” he says. “That doesn’t tell me that they’re enjoying the pedagogical experience. But it does tell me that the software is working.”

Patera and Kaneko have also made their system compatible with ChatGPT so that users can just describe the problem in natural language, which calls the HTM to obtain the results. They haven’t offered this option to students yet because they don’t have ChatGPT licenses for everyone.

MATLAB isn’t just for running experiments on desktops. In both professional and learning environments, teams can distribute their code with MATLAB Compiler SDK in an industry-standard format, including all the accompanying dependencies. This ensures that MATLAB applications run consistently across various operating systems and cloud platforms.

By running Docker microservices in the cloud, users can interact with MATLAB applications through a multitude of interfaces, ranging from a simple command line to sophisticated natural language chat interfaces, enabling them to concentrate on the essence of their work—critical thinking and problem-solving—rather than software setup and IT administration.

Patera and Kaneko are looking toward the future, where their students learn the modeling principles of heat transfer without coding a single line. Eventually, they say, you’ll be able to show ChatGPT a picture of an apple or another object, and it will enter all the parameters into the HTM function. “What that means is that you’re accessing a PDE without even knowing it. Of course, the student must still make the final decision—to accept or reject the result.”

Patera and Kaneko have also made their system compatible with ChatGPT so that users can just describe the problem in natural language, which calls the HTM to obtain the results.

Screenshot of the ChatGPT user interface showing the problem statement to calculate the heat transfer of an apple removed from a refrigerator, JSON-formatted data, and the suggested filename of “apple-dunking-room-environment.json”.

A problem statement entered into ChatGPT, from which it generates JSON-formatted data and provides a suggested filename. (Image credit: Kento Kaneko)

A diagram of phi (a geometry-based quantity used for error analysis), a screenshot of heat transfer coefficients, and a  graph showing the temperature evolution of an apple over time.

The ChatGPT-generated JSON file is passed to a GUI, which in turn interacts with the Heat Transfer Microservice. (Image credit: Kento Kaneko)

Read Other Stories

Panel Navigation


Brewing Biofuel with AI and IoT

Online Interface Gets Students into the Lab—Virtually

Panel Navigation
Panel Navigation