I have a system of linear equations representing a simple statics example (like the struts on a bridge or a stack of blocks or something along those lines). I can form the equation:Aj=b, where A is an nxn matrix of coefficients, and j and b are n-vectors. I want to find j given b. And I have a book (Numerical Recipes 3rd edition) to help me do that. So far so good.

But now there's an interesting twist, and I don't know how to handle it. Suppose that each element in j has a bounds on it. Something like 0 <= j<sub>2</sub> <= 80 or something along those lines. This would represent something like a stack of blocks (each block can only push on other blocks, they can't pull on each other), or a bridge giving way (some strut can only handle 8000 Newtons of force (is force the right label here?) before it gives way).

So how do I address this case? The brute force solution I had was to invert the matrix and find j, then find the first element out of its bounds in j and clamping it to the bounds. Then rebuild a new matrix and solve again, etc. But this would have an absolutely terrible run time performance of O(n^4), and I'm not even sure it would give the right answer in the end.