MATLAB: How can i describe this inequality on fmincon command

fminconoptimization

a*x - b*x^2 > C - D
There are x and x^2 and i don't know how i can describe inequality for using fmincon. What is b at this inequality?
x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub)
Thanks

Best Answer

Hi,
due to you have to use a nonlinear inequality. See details here:
In general you have to write a function like this:
function [c,ceq] = mycon(x)
c = ... % Compute nonlinear inequalities at x.
ceq = ... % Compute nonlinear equalities at x.
end
where c(x) is the array of nonlinear inequality constraints at x. fmincon attempts to satisfy:
c(x) <= 0
for all entries of c. ceq(x) is the array of nonlinear equality constraints at x. fmincon attempts to satisfy:
ceq(x) = 0
for all entries of ceq.
So it is needed to rewrite your condition i a way, that this condition is fulfilled. A good resource with example you find here:
Best regards
Stephan