I am trying to solve a set of equations in the form ui+vj=cij up until now I have done a rather complicated work around which is not entirely satisfactory.
What I would like to do is to use the vectors u and v inside the Solve command instead of the ugly solution I've come up with. I want to be able to write something like u[[i]]+v[[j]]==c[[i,j]]
Is is possible?
c = {{36, 32, 33, 19}, {10, 8, 7, 20}, {12, 17, 16, 29}, {23, 15, 16,
28}} // MatrixForm
uivj = Solve[{ 0 + v1 == c[[1, 1, 1]],
0 + v4 == c[[1, 1, 4]],
u2 + v1 == c[[1, 2, 1]],
u2 + v2 == c[[1, 2, 2]],
u2 + v3 == c[[1, 2, 3]],
u3 + v1 == c[[1, 3, 1]],
u4 + v2 == c[[1, 4, 2]]}, {u2, u3, u4, v1, v2, v3, v4}]
u = {{0}, {uivj[[1, 1, 2]]}, {uivj[[1, 2, 2]]}, {uivj[[1, 3, 2]]}}
v = {{uivj[[1, 4, 2]], uivj[[1, 5, 2]], uivj[[1, 6, 2]],
uivj[[1, 7, 2]]}}

MatrixForm. It is a display wrapper and interferes with evaluation. – Roman Feb 15 '21 at 15:54