-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathf1.m
More file actions
25 lines (14 loc) · 1.3 KB
/
f1.m
File metadata and controls
25 lines (14 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function hod = f1(x)
%hod = x(1)^2 + 2*x(2)^2 -0.3 * cos(3*pi*x(1)) -0.4 * cos(4*pi*x(2)) + 0.7; %bohachevsky %hessian nieje poz def?
%hod=(x(1) + 2*x(2) - 7)^2 + (2*x(1) + x(2) - 5)^2; %booth function %dogleg ok
%hod= 0.26 * (x(1)^2 + x(2)^2) + -0.48*x(1)*x(2); %matyas function %dogleg ok
%hod = (sin(x(1) + x(2))) + ((x(1) - x(2))^2) -(1.5*x(1)) + (2.5*x(2)) + 2.9133;
%%McCormick Function hessian nieje poz def?
%hod = (4-2.1*x(1)^2+(x(1)^4)/3) * x(1)^2 + x(1)*x(2) + (-4+4*x(2)^2) *x(2)^2; %Six-Hump Camel Function %pozor na poz def, funguje napr v [0.5;0.5]
%hod = 2*x(1)^2 -1.05*x(1)^4 + x(1)^6 / 6 + x(1)*x(2) + x(2)^2; %Three-Hump Camel Function ok v [0.5;0.5]
%hod = (1.5 - x(1) + x(1)*x(2))^2 + (2.25 - x(1) + x(1)*x(2)^2)^2 + (2.625 - x(1) + x(1)*x(2)^3)^2; %Beale Function % funguje pozor v x(2)=1 nieje hessian pozitivne definitny
%hod = 1 * (x(2) - (5.1/(4*pi^2))*x(1)^2 + (5/pi)*x(1) - 6)^2 + 10*(1-(1/(8*pi)))*cos(x(1)) + 10; %Branin Function %funguju napr [7.9;8] , [-4.6;3], [2;8]
%hod = 100*(x(2)-x(1)^2)^2+(x(1)-1)^2; %rosenbrock pred d=2
%hod = 100*(x(2)-x(1)^2)^2+(x(1)-1)^2 + 100*(x(3)-x(2)^2)^2+(x(2)-1)^2 + 100*(x(4)-x(3)^2)^2+(x(3)-1)^2 + 100*(x(5)-x(4)^2)^2+(x(4)-1)^2 ; %rosenbrock pre d=5
hod = (x(1)+10*x(2))^2 + 5 * (x(3)-x(4))^2 + (x(2)-2*x(3))^4 + 10*(x(1)-x(4))^4; %Powell function
end