Sarah Poon

PrOMMiS · Flowsheet Inspector

Beyond the code: Helping engineers understand and validate computational models

Designing a visual layer for inspecting complex optimization models, including those developed with AI assistance.

Background & Motivation

Why computational modeling is challenging

Rare earth elements are critical to many modern technologies, but producing them is a complex and resource-intensive process. Although these elements aren't actually that rare, refining them into usable products requires extracting and processing them from raw materials, and these capabilities are much more scarce. Building the infrastructure for such processes demands significant time and investment.

Computational simulation and optimization can help. The PrOMMiS project is a multi-institutional collaboration developing a software modeling platform to accelerate the design and deployment of extraction and purification processes for critical minerals and rare earth elements. At its core is a Python-based library that represents these systems as mathematical equations, enabling engineers and planners to simulate and optimize process models before building physical systems.

Although these methods are powerful, they come with a steep learning curve. Many experienced process engineers are experts in their domain but less familiar with programming and equation-oriented optimization. Across interviews, workshops, and meetings, users described challenges learning the framework and understanding or debugging the models they built.

Diagram of a rare earth material processing system
A representation of a processing plant that takes in a raw material, such as brackish water, and produces a concentration of rare earth materials.
Workshop feedback describing challenges understanding computational models
During a workshop, users described difficulties with the opacity of computational models and optimization results.

Research insights

The challenge wasn't just writing code

Understanding the model was harder than constructing it

Through user research, I learned that writing code was only part of the challenge. Constraints and relationships defined in one part of a model could have downstream effects that weren't apparent from reading the code alone. Even when a solver reported an optimal solution, users could struggle to determine whether the model accurately represented their intentions.

AI-generated code introduced another layer of uncertainty

In one instance, an engineer used AI to help build a model. Although the generated code initially appeared plausible, an expert reviewing the work discovered fabricated results. This reinforced the importance of helping users inspect and evaluate the models they create, regardless of whether the code was written by a person or generated by AI.

Design reframing

From easier model building to better model understanding

The team had long envisioned a drag-and-drop interface, similar to the graphical tools engineers use for process simulation. But developing such an interface for equation-oriented optimization would require substantial engineering resources. More importantly, my research suggested that making models easier to construct would not necessarily make them easier to understand.

These findings shifted my focus from simplifying the act of constructing a model to helping engineers inspect what they had constructed, whether they wrote the code themselves or used AI.

Original question

How might we make it easier for engineers to build optimization models?

Reframed question

How might we help engineers understand and inspect the models they create, so they can assess whether those models represent their intentions?

Concept

Making the model visible alongside the code

Using agentic AI to help write code is becoming increasingly common, especially when working with unfamiliar codebases and libraries. In response to a prompt, AI agents often provide a narrative explanation of the changes they suggest and why they made them. When integrated into an IDE such as VS Code, they may also generate code diffs so users can visually inspect the updates.

This approach could be a major step forward in helping new users work with the PrOMMiS framework. However, code diffs alone may not provide enough context for users to fully understand or verify the changes an AI agent makes on their behalf.

I drew inspiration from my experiences using agentic AI to update frontend web code . In frontend development, the rendered interface acts as a feedback layer: even when I didn't fully understand every code modification, I could inspect the resulting UI and judge whether it matched my intent. I wanted to explore an analogous feedback layer for mathematical models, whose structure and behavior are not directly visible in the source code.

This suggested another approach for scientific modeling: pair code with a visual representation of the interpreted model. A conceptual model could bridge the gap between implementation and domain understanding, giving users another way to inspect whether a model reflects what they intended, without claiming that a visualization alone proves its validity.

Code diff showing changes generated by an AI coding agent
A code diff helps users inspect exactly what an AI agent changed, but understanding the code does not necessarily tell a domain expert whether the resulting model matches their intent.

Design hypothesis

Code diffs show users what AI changed. A visual conceptual model could help them interpret those changes in domain terms and inspect whether the resulting model reflects their intent.

Design

Flowsheet Inspector: a VS Code extension for PrOMMiS

To explore this idea, we chose to surface the conceptual model directly within VS Code, where users could work with their code, an AI agent, and the model representation in the same environment.

I focused on some of the most common challenges faced by novice users, particularly understanding how the model represented in code was structured and behaved. These insights came from interviews with both new users and the mentors who frequently support them.
 

Implemented Flowsheet Inspector VS Code extension
A prototype of the Flowsheet Inspector. The execution panel on the left exposes the functional structure of the flowsheet. After the flowsheet runs, the center panel reveals aspects of the underlying model definition. Here, an AI coding agent can be used to develop the code while Flowsheet Inspector provides a visual way to inspect whether the resulting model matches the user's intent.

The role of UX

AI can lower the barrier to writing unfamiliar code, but generating code is only part of the problem. For domain experts, UX can provide an interpretable layer between code and the system it represents, helping users inspect and assess their own work or AI-generated work.

← Back to Projects