Each mechanical component has an associated coordinate system, called frame. This is true also for components in a simple domain like the 1D mechanical translational domain. Even the flanges in the 1D mechanical translational domain have their own coordinate systems. The connector classes Flange_a and Flange_b used for flanges in the 1D translational mechanical domain are identical but have slightly different roles, somewhat analogous to the roles of PositivePin and NegativePin in the electrical domain.
A flange_a connector is used at the "left" side of a component, whereas a flange_b connector is used at the "right" side of the component, represented by the empty square. Each flange has an internal coordinate system characterized by the unit vector n from left to right.
The connector classes PositivePin and NegativePin are identical to Pin and can be used in electrical components to help distinguish positive and negative pins.
In the idealized Resistor class below, the "coordinate system" (the direction of current flow in the resistor) is from p to n as inherited from TwoPin.
The partial base class Compliant below is extended by classes for compliant flexible mechanical components with two flanges. It can be regarded as a 1D mechanical analogue of the TwoPin base class from the electrical domain. A flange_a connector is used at the "left" side of a component, where as a flange_b connector is used at the "right" side of the component.
The Spring class below inherits all equations apart from the constitutive spring equation from its base class Compliant.