Background

MUSE 2.0 is planned as the successor to the original MUSE project (on which the RSE team have previously worked and continue to maintain). Like the original MUSE, MUSE 2.0 is an economic tool for simulating energy systems all the way from production (e.g. gas extraction, solar power) to consumption (e.g. residential heating). Users provide certain information about the system as input to the model: for example, this could be demand for electricity over time for a given region. "Agents" in the system make investment decisions to meet their needs (e.g. choosing coal vs solar power), subject to constraints, such as how the availability of processes (e.g. solar power plants) varies over the course of a year or whether there is a carbon tax. It differs from MUSE 1.0 in that certain simplifications have been made to the model, which reduce the complexity of the code along with memory and CPU usage. Additionally, some seldom used features will not be implemented for MUSE 2.0, so the code should overall be simpler and easier to maintain. The project has been open source from the start and source code and documentation are available on GitHub (albeit both are works in progress at the time of writing).

Our Contribution

With this being a new project, it gave the team and researchers an opportunity to re-evaluate the technologies to use. The decision was made to write the new model using Rust, rather than Python, as was done for MUSE 1.0. This was primarily due to a desire to get the best possible performance from the model, though there have been other benefits. For instance, Rust's strict typing system proved very useful for validating input data, ensuring that all required properties are present, of the correct type and within correct bounds, where appropriate. This is harder to do consistently with Python and spurious results caused by invalid input data have been a perennial source of bugs in MUSE 1.0. As this was the first Rust-based project the team has tackled, there was a learning curve, but we have found the documentation, tooling and package ecosystem for Rust to be excellent, particularly in comparison to other low-level languages such as C++. At the heart of the model is an optimisation step for which we are using the HiGHS solver (via Rust bindings) though there are plans to allow the user to select other solvers.

Outcomes

While the model is not currently production ready, we have made steady progress towards making MUSE 2.0 a viable option for running energy systems models. We have another engagement booked with the research team, which will add the remaining pieces needed for MUSE 2.0 to simulate a simple model from beginning to end. Once that is completed, we will be able to flesh out the model further, such as allowing users additional flexibility in model constraints.