Linear Algebra – Finding Nonnegative Solutions to an Underdetermined Linear System

linear algebralinear programmingnumerical linear algebranumerical methods

Here's the environment of my problem: I have a linear system of 4 equations in 8 unknowns (i.e. $Ax = b$, where $A$ is $4 \times 8$, $x$ is $8 \times 1$, and $b$ is $4 \times 1$, with $A$ given and $b$ varying with some exogenous parameters, i.e. essentially given). So, after reducing the system, the solution space can be described by a linear function $f \, : \, \mathbb{R}^4 \rightarrow \mathbb{R}^4$, which I can find explicitly.

Because of the nature of the problem, I am interested only in nonnegative values for each of the 8 unknowns. So, I can restrict the function $f$ to the domain $\mathbb{R}^4_{\geq 0}$ (i.e. examine only nonnegative values for each of the 4 free variables). What I'm interested in knowing (and classifying for different parameter values, which will change $b$) is whether solutions exist for which all 8 unknowns are nonnegative–or equivalently, whether the function $f$ takes nonnegative values in the nonnegative domain $\mathbb{R}^4_{\geq 0}$.

If there's a way to figure this out analytically, that would be great; alternatively, if there's a good way to do this numerically (I use MATLAB), that would be only slightly less great. Thanks in advance!


Thank you all so much for your answers–this has been a huge help. Working out the solution by hand using the LL Dines paper may prove to be too cumbersome, as it requires knowing the sign of the coefficients, and we examine thousands of different sets of coefficients (as we vary several parameters); however, if nothing else, it's really nice to know that there is an algorithm for (analytically) determining the existence of nonnegative solutions. Moreover, all of the software advice given has been extremely helpful. I've looked into all of your suggestions, and for now I think we'll try using lsqnonneg. Thanks again for your help!

Best Answer

Matlab has a function lsqnonneg which can minimize $\| Ax - b\|_2$ subject to the constraint that $x \geq 0$.

The minimum value will be $0$ if and only if there exists a nonnegative solution to $Ax = b$.

Related Question