Open sharkweek opened 5 years ago
Nope, in_base
is based on the dimension and people probably want energies a lot more often than moment of torque. That said we don’t have moment of torque in the unit system machinery at all and I haven’t thought about what would happen if you added two classes of units to a unit system with the same dimensions.
That makes sense. I assumed that was the case. I suppose this is just something that has to be dealt with unless there is a way to differentiate between units in the context of vectors.
I have tried addressing this by adding a new dimension type to my UnitSystem
, but can't because torque doesn't exist in the dimensions
module. Perhaps the issue could be addressed by adding an add_dimension
function to the dimensions
module for adding custom dimensions?
While torque may not be very common, I could see other uses for custom dimensions, especially for keeping track of different kinds of dimensionless quantities such as material strain or electrical gain that wouldn't necessarily make sense to bake in native functionality for. The other option is to have dimensions
be classes on their own that can be user-subclassed and added to UnitSystem
s and UnitRegistry
s.
This may be philosophical and esoteric, but hear me out: the change needed may not be in the way we talk about torque/energy, but in the way we talk about DISTANCE... work done is a force applied THROUGH a distance, while torque is a force applied AT a distance.. if we were to define adjacent but distinct versions of distance, one of which is a vector and yields energy when multiplied by an applied force, and the other scalar, yielding a torque when multiplied by an applied force, that could give a more consistent way to distinguish between the concepts... I huess the difference is between distance describing a process, like a traverse through space, and distance describing location. This paradigm would also permit more natural interpretation of torque times angular displacement yielding (dimensionally unchanged) units representing work rather than torque...
I am unsure if this is a feature request or a bug, but I seem to be having trouble in creating moment or torque units that are recognized by different base systems. It seems to be because they share the same base units as energy (i.e. (force)(length) or (length)*2(mass)/(time)**2).
I can create my own units that use these and convert them to different unit systems explicitly, but if I try using an
in_base
method, it always converts to energy. Is there a straightforward way of dealing with this that I am unaware of?