I am currently trying to find a minimum to the following function:
rent=@(x)8000-1000*norm(x);
where x is the vector [x,y]
There are furthermore 4 inequality constraint that need to be satisfied. They all state that the distance between x=[x;y] and a point in space does not exceed 10 units. So they are all of the following form:
sqrt((x-6)^2+(y-2)^2)<=10
My code so far looks the following:
P1=[6;2];P2=[-1;5];P3=[-5;-1];P4=[0;-8];d=10; %maximal distance
x=sym('x',[2,1]);%Inequality conditions
S1=@(x)norm([P1(1,1)-x(1,1);P1(2,1)-x(2,1)])-d;%<=0
S2=@(x)norm([P2(1,1)-x(1,1);P2(2,1)-x(2,1)])-d;%<=0S3=@(x)norm([P3(1,1)-x(1,1);P3(2,1)-x(2,1)])-d;%<=0S4=@(x)norm([P4(1,1)-x(1,1);P4(2,1)-x(2,1)])-d;%<=0%Function to minimize
rent=@(x)8000-1000*norm(x);
Is it possible to solve the problem using fmincon or what function should i use?
Best Answer