This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
OM/Claudio_Maggioni_5/uzawa.m
2021-06-01 16:19:05 +02:00

12 lines
312 B
Matlab

function [x, lambda] = uzawa(G, c, A, b, x, lambda, tol, max_itr)
w = 1;
old_x = ones(size(G, 1)) * 124000000;
i = 0;
while i < max_itr && norm(x - old_x) > tol
old_x = x;
x = G \ (c - (A' * lambda));
lambda = lambda + w * (A * x - b);
i = i + 1;
end
end