Перейти к содержимому
Hub Nexus

Автора пока нетВзять себе

Версия 2Обновлено 5 мин чтения

Поддержка

Chemical engineers use thermodynamic software every day, yet most thermodynamics courses never show how that software computes its answers. A paper on arXiv describes a short course meant to close that gap, built around the open-source Clapeyron.jl package and interactive Julia notebooks, and reports a pilot with 16 students. This summary attributes the claims to the paper's authors.

The gap the course addresses

The authors say computational methods have become increasingly important in chemical-engineering research and practice, but traditional teaching gives students little exposure to them. That leaves graduates unprepared for the state of the art in industry and academia. Easy-to-use open-source thermodynamics codes are an opening for educators, with one condition: the models and packages should not be treated as "black boxes" that magically produce answers. Students should also be able to explore the numerics and algorithms underneath.

The course is for advanced undergraduates and graduate students who already know the basics, such as the laws of thermodynamics, Maxwell relations and phase equilibria. Some introductory coding is expected but not strictly required, because the material is delivered so that students write only a small amount. It is modular, so self-directed learners and other educators can take parts of it, and all course material and code are openly available on GitHub.

Why Julia and Pluto notebooks

An earlier course by the same group used Python scripts and PDFs. Students struggled to set up the Python environment, and without structured learning activities their engagement suffered. For this course the authors chose Julia, whose syntax is similar to MATLAB and Python and whose built-in package tools reduce the setup work, though it is less mature than those languages.

They also chose Pluto notebooks, which put lecture notes and code in one file. Pluto is reactive: when a student changes a cell and reruns it, every other cell updates, including hidden plotting code, so a chart redraws automatically. The authors believe this makes students engage more with the material.

A Pluto notebook page from the course, with explanatory text, example code and an embedded chart of carbon dioxide's isobaric heat capacity

Figure 1 of the paper (CC BY 4.0): an example from the Pluto notebook used in the course. Explanatory text is highlighted in yellow and example code in green; students reveal the hidden plotting code with a symbol marked in red. The chart shows the isobaric heat capacity of carbon dioxide from different equations of state, and students can change the species and equation of state.

Three sections

Each of the three sections is a three-hour lecture, with two ten-minute breaks.

SectionContent
  1. Fundamentals
A refresher on thermodynamic state variables and state functions, plus numerical methods: automatic differentiation, root-finding (Newton–Raphson, fixed-point iteration) and optimization. Delivered mostly as slides, with the rest of the time spent making sure every student has a working notebook
  1. Implementing models
Five classes of model, from familiar to advanced: the ideal gas, activity-coefficient models, cubic equations of state, SAFT equations of state and empirical equations of state
  1. Employing models
Computational methods: volume solvers, saturation solvers for pure components (including the critical point), chemical-stability analysis and the isothermal flash problem

In section 2 the authors give the most time to cubic equations of state, the most common class in industry. Students complete a code template for a generalized cubic equation and get live feedback in a text box that updates as they work. They are then challenged to build their own cubic equation that improves on an existing predictive one. The paper's example compares the predictive PSRK model with a custom cubic for a benzene and methanol mixture, and says a better model is not necessarily hard to obtain with the tools students have.

An exercise in the cubic equation of state section, where students complete commented parts of the code and a text box below updates with their progress

Figure 3 of the paper (CC BY 4.0): an example exercise from the cubic equation of state section.

The authors present SAFT equations at a high level, since their derivation is complex and they are not usually taught. They say these equations have recently been shown to describe experimental data more accurately than cubics for a larger range of properties and species, but at a significant computational cost. For every model class their message is the same: to choose the best approach for an application, compare predictions with experimental data.

Section 3 shows how the models turn into useful properties. One example is the Rachford–Rice equation at the heart of most flash algorithms, which students solve themselves. The authors also stress practical lessons: good initial guesses, rescaling variables for numerical stability, and the fact that stability analysis with a local optimizer can fail.

The pilot

A remote pilot ran in the summer of 2022 with 16 participants, both undergraduates beyond second year and graduate students. Surveys before and after were approved by the ethics committee at Imperial College London and made anonymous with help from the StudentShapers programme.

  • At the start, most students were not at all or only slightly confident programming in Julia, but were mostly quite or extremely confident in MATLAB and Python. Even so, most set up the environment successfully and picked up the syntax quickly.
  • The authors report positive feedback on content and structure, with the arrangement of content and purpose of each section very well received and most students agreeing the examples were relevant to chemical engineering.
  • Asked whether the course improved their confidence in mastering and applying computational thermodynamics, students showed what the authors call a near-total increase.
  • The main area for improvement was the instructions sent before the course for setting up the environment. Students also asked for more activity sessions; the course had just two, to keep it quick. And with three three-hour days, concentration dropped in the final hour, so the authors suggest five or six sessions in future.
  • Julia's thinner documentation and smaller pool of forum answers, compared with Python and MATLAB, were a barrier, which the authors expect to ease as Julia matures.

The authors caution that the pilot was small, so further evaluation is needed to know whether the format works for a larger cohort.

Sources

  • "Confronting the thermodynamics knowledge gap: A short course on computational thermodynamics in Julia," arXiv:2310.13234 (https://arxiv.org/abs/2310.13234), licensed under CC BY 4.0; figures 1 and 3 are from the paper. Changed here: condensed and rewritten in hubnx's own words, equations and references left out.

Комментарии

Spinner Logo

Ещё на тему «Образование»

Автор: Hub Nexus editorsПросмотры: 282
A demo for the Hub Nexus content editor, showing what could be created, and at the same time teaching how to create them with each syntax. It follows general markdown syntax, gfm, and more advanced like various charts and graphs code syntax.
Автор: Hub Nexus Nomad
The Success Podcast Myth & The Illusion of Control
Автор: Abdul Ariwoola
Random article
CC0 1.0 (общественное достояние)
U.S. increases funding to help legal immigrants, but a bill to aid undocumented children is halted for now | EDUCATION REPORT
CC BY-SA 4.0
3D Printing, Post Processing
CC BY-SA 4.0
Network programming under UNIX is relatively simple in C. This guide assumes you already have a good general idea about C, UNIX and networks. ## A simple client To start with, we'll look at one of the simplest things you can do: initialize a stream connection and receive a message from a remote serv