Sure, should work just fine.
In case anyone wonders, we are dealing with the simple system of linear equations, say
$$\left \lbrace \, \begin{aligned}
a_{11} U_1 + a_{12} U_2 + a_{13} U_3 &= b_1 \\
a_{21} U_1 + a_{22} U_2 + a_{23} U_3 &= b_2 \\
a_{31} U_1 + a_{32} U_2 + a_{33} U_3 &= b_3 \\
\end{aligned} \right .$$
which in linear algebra is usually written as
$$\mathbf{A} \mathbf{U} = \mathbf{b}$$
where
$$\mathbf{A} = \left [ \begin{matrix} a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33} \\
\end{matrix} \right ], \quad \mathbf{U} = \left[ \begin{matrix} U_1 \\
U_2 \\
U_3 \\
\end{matrix} \right ], \quad \mathbf{b} = \left[ \begin{matrix} b_1 \\
b_2 \\
b_3 \\
\end{matrix} \right ]$$
Note that \$\mathbf{U}\$ and \$\mathbf{b}\$ are
column vectors, and that \$\mathbf{A}\$ has as many columns as \$\mathbf{U}\$ has elements, and as many rows as \$\mathbf{b}\$ has elements.
When \$\mathbf{A}\$ is square, i.e. \$\mathbf{U}\$ and \$\mathbf{b}\$ have the same number of elements, then if a solution exists it is
$$\mathbf{U} = \mathbf{A}^{-1} \mathbf{b}$$
where \$\mathbf{A}^{-1}\$ is the
matrix inverse of \$\mathbf{A}\$.
When \$\mathbf{A}\$ is not square, the best solution in the least squares sense is
$$\mathbf{U} = \mathbf{A}^{*} \mathbf{b}$$
where \$\mathbf{A}^{*}\$ is the
pseudoinverse or Moore–Penrose inverse of matrix \$\mathbf{A}\$.
The two inverse above link to corresponding Wikipedia articles, which list some of the common methods of computing the solutions. With numpy, you can use
numpy.linalg.inv() and
numpy.linalg.pinv(), respectively. In ones own C code, without any supporting matrix or linear algebra library, follow your course notes, or any of the many numerical computation approaches you find online and in references; but usually matrix inverse exercises are done using Cramer's rule, and pseudoinverse via singular value decomposition.