Permanent magnet definition for stem - a Simulation Toolbox for Electric Motors.
The full API documentation is available at https://docs.rs/stem_magnet/0.2.0/stem_magnet.
Feedback welcome!
Found a bug, missing docs, or have a feature request?
Please open an issue on GitHub.
This crate provides the Magnet trait for permanent magnets in the stem
(Simulation Toolbox for Electric Motors) framework (see the
stem book). The trait itself has
little logic and mainly specifies an interface for using permanent magnets in
simulation models.
The following predefined implementors of Magnet are available:
BlockMagnet: A cuboid magnet, possibly with fillets.BreadLoafMagnet: A cuboid magnet for surface mounting where the surface facing the air gap is curved to improve the air gap field.ArcParallelMagnet: A curved magnet for surface mounting in rotary machines where the sides are parallel to each other.ArcSegmentMagnet: A curved magnet for surface mounting in rotary machines where the sides are radially oriented.
The image below shows some of the magnet shapes possible with these types:
If those magnet types do not suffice, it is very easy to define your own magnet
type by implementing Magnet. See the trait documentation for details.
If the serde feature is enabled, all magnet types from this crate can be
serialized and deserialized. During deserialization, the invariants are
validated (to e.g. prevent negative length for a BlockMagnet).
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.
The technical drawings used in the docstrings have been created using LibreCAD (https://librecad.org/).