I am trying to implement an exterior penalty function method for minimizing the below problem.
min f(x)=100*(x(2)-x(1)^2)^2+(1-x(1))^2
s.t, x(1)+2x(2)<=1
2x(1)+x(2)=1
First of all, I have found the minimum using fmincon
, which the answer is x
: array([ 0.4149, 0.1701])
and f(x)=0.34
.
Then I am trying to find the minimum using my implementation of exterior penalty function method. I am using this penalty function:
F(x,a)=f(x)+a*(x(1)+2*x(2)-1)^2+a*(2*x(1)+x(2)-1)^2
with start point x_0=[1,1]
, a=10
(in each iteration a= a^2) , which gives me x
: array([ 0.3333, 0.3333])
and f(x)=5.3
.
Where is the mistake in my implementation? Thanks.