Two linear equation with absolute value equation
Show older comments
Hello,
I have two linear equation and one absolute value equation. Is there a easy way to obtain minimum norm solution ?

Accepted Answer
More Answers (1)
Alan Stevens
on 13 Jan 2021
Do you mean something like this
X0 = [-50 -5];
[X, Fval] = fminsearch(@(X) fn(X),X0);
x2 = X(1); x1 = 50-x2;
x4 = X(2); x3 = 10-x4;
disp([x1 x2 x3 x4])
disp(x1+x2+x3+x4)
disp(x1+x2-x3-x4)
disp(abs(x1)+abs(x2)-abs(x3)-abs(x4))
function F = fn(X)
x2 = X(1); x1 = 50-x2;
x4 = X(2); x3 = 10-x4;
F = norm(abs(x1)+abs(x2)-abs(x3)-abs(x4)-120);
end
1 Comment
Murat YAPICI
on 13 Jan 2021
Categories
Find more on Systems of Nonlinear Equations 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!
