How can I calculate the pseudo inverse of a matrix of a set of linear equations with nonlinear constraints

4 views (last 30 days)
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

Answers (2)

Walter Roberson
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
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
Ahmed Ragib Kafi
Ahmed Ragib Kafi on 17 May 2016
Dear Mr. John, Thanks for your answer, but as I know there can be a linear system with nonlinear constraints. For example you can imagine any linear set of equations but it need that the ratio of x1/x3 is equal to the ration of x2/x4 and it is nonlinear contraints. Any way, I will try solving using fmincon as per your suggestion. Thanks again for your help.
Walter Roberson
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;

Sign in to comment.

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!