- The first method needs this file on FEX, no toolbox is required.
- The second method needs FMINCON from the optimization toolbox.
4 unknown 3 nonlinear equation solution with minimum norm
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I have 3 nonlinear equation with 4 unknown variable
I want to obtain the minimum norm solution like pseudoinverse(pinv). Which method do you prefer ?
Thanks for your help.
댓글 수: 0
채택된 답변
Bruno Luong
2020년 11월 16일
편집: Bruno Luong
2020년 11월 16일
I change your last equation rhs to 600 (otherwise there is NO solution).
Here is two methods to find the minimum norm solution.
% 1st & 2nd equations: Aeq*x = beq
Aeq = [3 5 11 14; ...
7 2 8 5];
beq = [100; 7];
% 3rd equation: x'*Hx*x + gx'*x + cx = 0
Hx = diag([8 7 8 5]);
gx = [9; 5; 9; 6];
cx = -600;
% Method 1, using ConicPrj
% on FEX https://www.mathworks.com/matlabcentral/fileexchange/27711-euclidian-projection-on-ellipsoid-and-conic
x0 = pinv(Aeq)*beq;
Q = null(Aeq);
Hy = Q'*Hx*Q;
gy = Q'*(gx + 2*Hx*x0);
cy = cx + x0'*(Hx*x0 + gx);
% File exchange to be downloaded
y = ConicPrj([0; 0], Hy, gy, cy);
[~,imin] = min(sum(y.^2,1));
xellprj = x0+Q*y(:,imin)
% Method 2: FMINCON
[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
>>
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!