How can I calculate the pseudo inverse of a matrix of a set of linear equations with nonlinear constraints
4 views (last 30 days)
Show older comments
Hello, I would like to calculate the x values in a set of linear equations Cx=d subject to two constraints: 1. linear constraints for example 0<x1<10, .... 2. nonlinear constraints, (x1/x3)=(x2/x4),... Any help or suggestion ?? Thanks in advance
0 Comments
Answers (2)
Walter Roberson
on 14 May 2016
If there were bounds constraints or linear constraints but no nonlinear constraints the you could use http://www.mathworks.com/help/optim/ug/lsqlin.html
However, when you add in the nonlinear constraint, you need to switch to fmincon
John D'Errico
on 14 May 2016
They are no longer a system of linear equations when that nonlinear equality constraint is added. The pseudo-inverse is not defined. For that matter, even the bound constraints make it no longer valid.
It appears that you have a problem that must be solved by a tool like fmincon, given the nonlinear constraint. Formulate the objective function as the sum of squares of the residuals of those linear equations.
2 Comments
Walter Roberson
on 17 May 2016
Ratios can be coded by reducing by one variable. For example,
function r = myobjective(x)
x1 = x(1);
x2 = x(2);
x3 = x(3);
x13ratio = x1/x3;
x4 = x2 / x13ratio;
See Also
Categories
Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!