3
$\begingroup$

I am trying to solve simple, small linear systems, with parameters. I would like to have the result shown for various values of the parameter. RowReduce[], Solve[], LinearSolve[], Reduce[], etc., all show "generic" solutions, without special values for the parameters. (Note that Wolfram|Alpha does show this extra analysis.)
If the matrix of coefficients is square, Det[] helps to find the parameter values of interest:

m = {{1, 1, k}, {1, k, 1}, {k, 1, 1}};
FindInstance[Det[m] == 0, k, Reals, 3]

produces: {{k -> -2}, {k -> 1}}.
However, I would like to work with non-square coefficient matrices as well.
I have tried MatrixRank[], e.g.:

FindInstance[MatrixRank[m] < 3, k, Reals, 3]

which just produces: {}. The same goes for all of the other functions which perform elimination (NullSpace[], RowReduce[], amongst others).
Any suggestions how to make this work?
Thank you

Editing: I was trying to keep it simple. For example:

FindInstance[MatrixRank[m] == 2, k, Reals, 3]

I would want the output of: {{k -> -2}} . I think if I can understand that, I will be able to handle the rest, and would be happy to include it here, once I have done that.

$\endgroup$
  • $\begingroup$ An example that provides the full generality, along with desired output, would be helpful. $\endgroup$ – Daniel Lichtblau Feb 4 '18 at 23:40
  • 1
    $\begingroup$ Maybe something along these lines: In[604]:= Solve[ Apply[PolynomialLCM, Flatten[Denominator[ RowReduce[Join[m, IdentityMatrix[Length[m]], 2]]]]] == 0] Out[604]= {{k -> -2}, {k -> 1}} $\endgroup$ – Daniel Lichtblau Feb 5 '18 at 19:22
  • 1
    $\begingroup$ Thank you! That did the trick -- for rectangular coefficient matrices as well, retaining the divisions of interest in the augmented part of the matrix. (I just added Reals to the Solve[].) Since I was looking at rectangular systems as well, I used PseudoInverse[] and noticed the parameters of interest in the denominators. However, with the parameters sometimes in the coefficient matrix, sometimes on the right hand side of the equation, and sometimes in both, while this worked almost always, I found a couple of cases that it did not. $\endgroup$ – Aharon Naiman Feb 6 '18 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.