3 ms·
Perhaps the sanest approach is we type every column of X and Y separately... Typing every column of a matrix is not sufficiently general. Each element of the
by dmlorenzetti 11y ago
Perhaps the sanest approach is we type every column of X and Y separately...
Typing every column of a matrix is not sufficiently general. Each element of the matrix can have its own type.
Suppose you're solving a linear algebra problem in two unknowns. Say it's an electromechanical system, and we want to find a voltage and a pressure that gives us some desired flow rates. So let x [=] (V, Pa), for example, and let y [=] (mA, kg/s).
Then the matrix-vector product Ax = y requires the units:
[ mA/V , mA/Pa ] * ( V ) = ( mA )
[ kg/V/s , kg/Pa/s ] ( Pa ) ( kg/s )
Of course those units in A have nicer reductions, but it doesn't teach us anything to figure them out. The point is that the matrix A represents the system design, so the units don't have to have familiar names, let alone be consistent within a column. If the system involves Johnny reading a value off a meter, and then phoning somebody up to tell them to pedal a stationary bike a little faster, that process has some kind of units associated with it, and the matrix A must include those units in order to represent the system.
- leni536 11y agoTyping every column of a matrix is not sufficiently general. Each element of the matrix can have its own type. While this is true, letting every matrix element have an arbitrary type is too general. The matrix' determinant should have a well defined type to be invertable. In your example mA/Pa * kg/V/s and mA/V * kg/V/s are compatible, so it works out.
- porges 11y agoEach element of your matrix doesn't really have its own type, each column and row has a type: 1 +--- V | V Pa | Pa V^-1 Pa^-1 +--------------- +----- mA | mA/V mA/Pa | mA kg/s | kg/V/s kg/Pa/s | kg/s I can imagine a system that types this quite well.
- kvb 11y agoIt's not true that each element can have its own units; given an MxN matrix there are only M+N-1 degrees of freedom (basically you can choose arbitrary units for each element in the first row and then a single multiplicative factor between the first row and each other row). Otherwise you'll find that either left or right multiplication won't have any compatible vector types.