Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

image

Note: As of Spring 2026, the stem framework and its documentation are under active development. Hence, this book will be expanded substantially over time.

stem is a Simulation Toolbox for Electric Motors written in Rust, consisting of multiple crates (packages / libraries) for defining electric motors, calculation of their properties and simulation of their operating behaviour. This framework offers a huge variety of features, such as:

  • calculate winding factors, resistance, inductance, wire length etc. of arbitrary windings,
  • get the leakage inductances for a wide variety of slot geometries,
  • draw the components for visual inspection (see above),
  • define custom magnetic simulation models or use predefined ones to determine the torque of a motor,
  • simulate the S1 torque characteristic of a motor using coupled magnetic / thermal models,
  • predict the start-up behaviour (maximum currents and torque) of an asynchronous motor starting at the power grid with different loads,
  • create interactive GUIs for winding analysis,
  • … and many more!

The individual crates of the ecosystem are designed to be modular and extensible. This makes it easy to define your own custom motor components (e.g. custom magnets), magnetic / thermal models or even optimization routines.

This book is a tutorial / manual for stem, showcasing how to use it, its general design philosophy, its components and how to extend it. The API documentation of the individual crates can be found on https://docs.rs/. Where appropriate, this book provides links to them. The book assumes knowledge of Rust and yaml.

As of now, all the features hinted at above exist, but most of the ecosystem is not yet uploaded to crates.io due to a lack of documentation (and in practice, software without good documentation is hardly usable). Over the following months, I strive to fix this one crate at a time and to upload them individually to Github and crates.io

License

Every crate in the framework as well as this book itself is licensed under the MIT license.

Ecosystem overview

Crates belonging to the ecosystem are prefixed with stem_ and can be sorted into three different layers:

  • The “description layer” offers the fundamental building blocks for defining a motor: Its components, its geometry, its materials, its winding design and so on.
  • The “model layer” is centered around the stem_physical_model crate which defines interfaces (traits) for magnetic and thermal models. All other crates within this layer are based on it and describe a particular magnetic or thermal model.
  • Crates within the “application layer” either provide complex routines for e.g. the calculation of operational behaviour combining magnetic and thermal models or form fully self-contained applications such as the stem_winding_gui for interactive evaluation of winding properties.

image

Crates belonging to stem

TODO: List the crates here over time

Description layer

Model layer

Application layer