I change your last equation rhs to 600 (otherwise there is NO solution).
Here is two methods to find the minimum norm solution.
- The first method needs this file on FEX, no toolbox is required.
- The second method needs FMINCON from the optimization toolbox.
Aeq = [3 5 11 14; ...
7 2 8 5];
beq = [100; 7];
Hx = diag([8 7 8 5]);
gx = [9; 5; 9; 6];
cx = -600;
x0 = pinv(Aeq)*beq;
Q = null(Aeq);
Hy = Q'*Hx*Q;
gy = Q'*(gx + 2*Hx*x0);
cy = cx + x0'*(Hx*x0 + gx);
y = ConicPrj([0; 0], Hy, gy, cy);
[~,imin] = min(sum(y.^2,1));
xellprj = x0+Q*y(:,imin)
[xfmincon,a,b,c] = fmincon(@(x) sum(x.^2), zeros(4,1), ...
[], [], ...
Aeq, beq, ...
[], [], @(x) deal([], x'*Hx*x + gx'*x + cx));
xfmincon
Both gives the same solution
>> test
xellprj =
-6.3652
2.9411
2.0611
5.8370
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the value of the optimality tolerance,
and constraints are satisfied to within the value of the constraint tolerance.
<stopping criteria details>
xfmincon =
-6.3652
2.9411
2.0611
5.8370
>>
Best Answer