Skip to main content
U.S. Department of Energy
Office of Scientific and Technical Information

Implementing Ordinary Differential Equation Solvers in Rust Programming Language for Modeling Vehicle Powertrain Systems

Conference ·
DOI:https://doi.org/10.4271/2024-01-2148· OSTI ID:2370980
Efficient and accurate ordinary differential equation (ODE) solvers are necessary for powertrain and vehicle dynamics modeling. However, current commercial ODE solvers can be financially prohibitive, leading to a need for accessible, effective, open-source ODE solvers designed for powertrain modeling. Rust is a compiled programming language that has the potential to be used for fast and easy-to-use powertrain models, given its exceptional computational performance, robust package ecosystem, and short time required for modelers to become proficient. However, of the three commonly used (>3,000 downloads) packages in Rust with ODE solver capabilities, only one has more than four numerical methods implemented, and none are designed specifically for modeling physical systems. Therefore, the goal of the Differential Equation System Solver (DESS) was to implement accurate ODE solvers in Rust designed for the component-based problems often seen in powertrain modeling. DESS is a text-based software package that provides a flexible framework for building and solving systems of ODEs. This allows DESS to be included as a dependency for automotive powertrain models that require a variety of solvers and solver configurations. Seven explicit ODE solver methods have been implemented in DESS: Euler’s, Heun’s, midpoint, Ralston’s, classic Runge-Kutta, Bogacki-Shampine, and Cash-Karp. These represent five fixed-step methods and two adaptive-step methods. This paper shows that the solver implementations increase accuracy and computational efficiency compared to Euler's method when modeling a system of three thermal masses in Rust. DESS also includes features designed for modeling component-based physical systems. Users can define relationships between nodes in their system, which the package then translates into a system of equations, leading to simpler and more intuitive code. In the case of a three-thermal-mass system, the user can specify node thermal properties (e.g., thermal capacitance), how nodes are interconnected, and thermal conductance between nodes rather than providing a system of equations. The core contribution from this work is an open-source, text-based Rust package with ODE solvers for automotive powertrain modeling to support cost-free, fast, and accurate simulation.
Research Organization:
National Renewable Energy Laboratory (NREL), Golden, CO (United States)
Sponsoring Organization:
USDOE Office of Energy Efficiency and Renewable Energy (EERE), Transportation Office. Vehicle Technologies Office
DOE Contract Number:
AC36-08GO28308; AC36-08GO28308; AC36-08GO28308
OSTI ID:
2370980
Report Number(s):
NREL/CP-5400-87879; MainId:88654; UUID:08c65a98-2620-401a-a09a-efecf6158937; MainAdminId:72126
Country of Publication:
United States
Language:
English

References (6)

A 3(2) pair of Runge - Kutta formulas journal January 1989
Efficient Data Processing: Assessing the Performance of Different Programming Languages conference April 2023
Ueber die numerische Aufl�sung von Differentialgleichungen journal June 1895
Runge-Kutta methods with minimum error bounds journal January 1962
Evaluation of Rust code verbosity, understandability and complexity journal February 2021
A variable order Runge-Kutta method for initial value problems with rapidly varying right-hand sides journal September 1990