Mathmematically you could define another constraint function
h(x) := sup { g(y): y in [0,x] }
then optimize your objective function:
argmin obj(x), with the constraint
h(x) <= somevalue
Now the problem becomes "how to compute h(x)?"
But that's is now on your side, and you might able to do it with specific formula of g(x).
You can of course use fmincon or such to compute h(x). But that might be costly. In this case the confun becomes (quick and dirty):
function [c,ceq]=confun(X)
lb = zeros(size(X));
ub = X;
afun = @(X) -0.35*X(3)+0.35*X(9)+1.3333*X(10);
bfun = @(X) 0.3333*X(13)+0.3182*X(3)-0.6364*X(6)+0.3182*X(9)-X(17);
g = @(X) (afun(X).^2-bfun(X).^2);
X = fmincon(@(X) -g(X), X, [], [], [], [], lb, ub);
c = g(X)-(0.015/2)^2;
end
In some problems, it is sometime easier to find a formula for another function that is slightly greater than h(x):
Note: "sup" is loosely speaking "max" for people who are not familiar with the notation.
Best Answer