LeastSquares[A,B] would give least square solution for an overdetermined linear system,e.g I have three variables (x,y,z) with 20 equation so A is a rectangular 20x3 matrix and B is 20x1 constant column matrix. But I have a constraint where the all elements of B[i]( [B]>0). But when solving by normal Leastsquares[A,B] solutions are X={a,b,c} such that when I again calculate Bth=A.X to check with actual B(experimental), few Bth elements are negative. So I need a solution in MATHEMATICA please that Is it possible to put a constraint such that the X are optimized in such a way in the LeastSquare so that all the elements Bth(=A.X)>0 or say any other constraint {where the solution elements of X are to be optimized along with least error/residuals} as per constraint..