# Question:NLP-Solve: Maxima is outside the domain.

## Question:NLP-Solve: Maxima is outside the domain.

Maple

Hi.
I try to find the Maximum of the function F1 under some linear constraints with the NLP-Solve command. In the NLP-Solve command I set assume= nonnegativ and the range of the variable y[2]
is given by y[2]=[0..4.9999].
The porblem is that NLP-Solve finds the maximum at
x[2] = 6.33333333333333392, y[2] = -2.22044604925031308*10^(-16)
y[2] is nearly zero, but it is negative an so it is not in the domain of F1. How can that happen if I set  "assume=nonnegativ"

F1:=(1/256)*(sqrt(((b*x[2]-a*x[1]-b*y[1]+a*y[2])*delta-x[2]+x[1])^2+(8*(x[2]-x[1]))*(y[1]-y[2]))-((b*x[2]-a*x[1]-b*y[1]+a*y[2])*delta-x[2]+x[1]))^3/((x[2]-x[1])*(y[1]-y[2])):

x[1]:=2:
y[1]:=5:
xmax:=10:
xmin:=0:
ymax:=10:
ymin:=0:
delta:=1:
a:=1:
b:=2:

constraint1:=(b*x[2]-a*x[1]-b*y[1]+a*y[2])*delta >= (y[1]-y[2])-(x[2]-x[1]):
constraint2:=x[2]-x[1] <= y[1]-y[2]:
Optimization[NLPSolve](F1, {constraint1, constraint2 },x[2]=x[1]+0.0001..xmax, y[2]=ymin..y[1]-0.0001, assume=nonnegative, maximize);