matrix function



An example which occurs in practice is forming the state variable 
equations, of a linear electrical
circuit.  A tree is formed containing all the capacitors, and non of the 
inductors.  Then matrixes are
formed to eliminate link resistors, and tree resistors, from the 
equations.  Some circuits have no
link resistors, or tree resistors, in this case these matrixes have one 
dimension 0, but the other
dimension equal to the number of  capacitors, or inductors respectively.
Dan Stanger
Stavros Macrakis wrote:

>     (%i1) n: matrix();
>     (%o1)                              matrix()
>     (%i3) length(n);
>     (%o3)                                  0
>     (%i4) n2: matrix([]);
>     (%o4)                             matrix([])
>     (%i6) length(n2);
>     (%o6)                                  1
>
>
> Maxima is treating matrix() as a 0x0 matrix and matrix([]) as a 1x0 
> matrix.
> In general, matrix([],[],...) is an mx0 matrix.  There is no way to 
> represent a 0xn matrix (n>0).
> Maxima is moderately consistent in its treatment of these trivial 
> matrices:
>
>    m() . m() => m()
>    m() . m([]) => m()
>    m([]) . m() => m([])
>    m() . m([], []) => m()
>    m([],[]) . m() => m([],[])
>    m([]) . m([],[]) => incompatible dimensions
> etc.
>
> but not completely, and I suspect that no special effort is being made 
> for these cases.
>
>     transpose(matrix([],[])) => matrix()  -- no representation for 0x2
>     load(linearalgebra)$
>     matrix_size(matrix([])) => internal error
>
> If these are actually useful in some real application (if only for 
> consistency in some trivial cases), we should probably define some 
> representation for 0xn and make sure to have relevant test cases in 
> the test suite. If not, we can just leave the status quo in the usual 
> informal Maxima style or perhaps give an error when generating mx0 
> matrices.
>
>                 -s
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Maxima mailing list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima
>  
>