Skip to main content

Crate stem_wire

Crate stem_wire 

Source
Expand description

§stem_wire

Feedback welcome!
Found a bug, missing docs, or have a feature request?
Please open an issue on GitHub.

This crate contains the Wire trait which serves as the basic building block for defining wires within the stem (Simulation Toolbox for Electric Motors) ecosystem, see the stem book for an introduction to the framework.

Additionally, the following predefined wire types are provided:

  • RoundWire: A round, possible hollow wire with insulation.
  • RectangularWire: A rectangular wire with insulation.
  • StrandedWire: A stranded wire composed of multiple other wires.
  • SffWire: An abstract wire type defined by its slot fill factor.
  • CastWire: A wire bar casted directly into the slot of a magnetic core.

The resistance module provides formulas for calculating resistances of different basic geometric bodies like cylinders, cuboids, spheres etc.

§Serialization and deserialization

If the serde feature is enabled, all wire types from this crate can be serialized and deserialized. During deserialization, the invariants are validated (to e.g. prevent negative diameters for a RoundWire).

Units and quantities can be deserialized from strings representing SI units via the dyn_quantity crate. Similarily, it is possible to serialize the quantities of a wire as value-unit strings using the serialize_with_units function.

See the chapter serialization and deserialization of the stem book for details.

§Documentation

The full API documentation is available at https://docs.rs/stem_wire/0.1.2/stem_wire/.

Modules§

cast
This module contains the predefined Wire type CastWire.
error
This module contains the Error enum, which represents the different ways building one of the predefined wires can fail due to invalid input data. The Error::Other variants supports arbitrary errors resulting from user-created wire types.
prelude
This module reexports all wire types defined in stem_wire, the Wire trait as well as the stem_material::prelude module to simplify the usage of this crate.
rectangular
This module contains the predefined Wire type RectangularWire.
resistance
Provides analytical formulas for computing the electrical resistance of homogeneous conductors with idealized geometries, including rectangular prisms (cuboids), cylindrical segments (axial, radial, and tangential), and hollow spheres.
round
This module contains the predefined Wire type RoundWire.
sff
This module contains the predefined Wire type SffWire.
stranded
This module contains the predefined Wire type StrandedWire formed from multiple WireGroups.
wire
The Wire trait for defining wires in stem.