I was trying to solve an optimization problem involving rank of a matrix and experimenting with a very simple one. A 2x2 matrix which contains only one parameter a11
is {{a11,2},{2,4}}
and I want to minimize the rank of this matrix. Obviously, the matrix can have a minimum rank of 1 when a11
equals 1. But when I use the following commands,
answ = NMinimize[{MatrixRank[{{a11, 2}, {2, 4}}]}, {a11}]
It gives the answer
{2., {a11 -> 0}}
which indicates a rank of 2 with a11=0
. I do not quite understand why this is the case. Is it the NMinimize function has difficulties handing the MatrixRank
computation? Any comment is welcomed.
NMinimize
are being evaluated first, and with symbolica11
,MatrixRank[{{a11, 2}, {2, 4}}]
immediately evaluates to the constant 2, so you are effectively doingNMinimize[2, a11]
. $\endgroup$Solve[Det[{{a11, 2}, {2, 4}}] == 0, a11]
$\endgroup$