Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi,
Will this program perform bound and constraint linear least squares? The requirement is 3 vairables bound between 0 --> 1, and the constraint is the sum of the variables must = 1 (they are percentages of a whole). It's an overdetermined system so there will be ~10 rows in the equation matrix. MATLAB's 'lsqlin' function does exacly what I need, but we currently only have a Mathcad license.
Thanks!
Erik
Don't think so, at least not out of the box, but then I may be wrong.
You can use minerr() with a solve block but the costraints are not handled as hard constraints by Mathcad. Maybe a look at geninv is useful for overconstrained systems, too. Also lsolve will return a least-squares solution, but not constrained.
If you are using Mathcad 15 or below you may search the net for the Mathcad E-Book/Handbook "Inside Mathcad: Solving". It used to be a free download from the Ressource pages of the Mathcad homepage, but PTC used to break all those useful goodies.
EDIT: Its here: http://communities.ptc.com/community/mathcad/blog/2010/05/13/inside-mathcad-series-programming-solving-and-ode-solvers
So setup and post a worksheet with your problem and constraints and tell us what result you expect.