A pair of simultaneous linear matrix equations A1XB1 = C1, A2XB2 = C2 and a matrix programming problem

Necessary and sufficient conditions are obtained for a pair of matrix equations A1XB1 = C1, A2XB2 = C2 on a general field F to have a common solution, along with the expression for a general common solution when certain conditions hold. Common solutions of minimum rank are described. A matrix programming problem is solved en route.