Opti Output
Opti Output
for l=1:4
for k = 1:iter_limit
% Calculate the penalty terms based on the constraints
pen_g1 = max(0, g1(x1, x2));
pen_g2 = max(0, g2(x1, x2));
pen_g3 = max(0, g3(x1, x2));
-1, 1);
% Output
fprintf('Iteration: %d, Function Value: %.6f, x: [%f, %f], p_g: %.6f\n' ,
...
k, new_penalty_fn, x1_new, x2_new, p_g);