4 unknown 3 nonlinear equation solution with minimum norm

1 回表示 (過去 30 日間)
Murat YAPICI
Murat YAPICI 2020 年 11 月 16 日
コメント済み: Murat YAPICI 2020 年 11 月 17 日
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.

採用された回答

Bruno Luong
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.
  • The first method needs this file on FEX, no toolbox is required.
  • The second method needs FMINCON from the optimization toolbox.
% 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
>>
  1 件のコメント
Murat YAPICI
Murat YAPICI 2020 年 11 月 17 日
Thank you so much for your response.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by