I have a polynomial that I use for least squares regression on experimental data to find coefficients $a_0,a_1,a_2$:
$$f(x)=a_0+a_1 x+a_2 x^2$$
I have a constraint for $f(x)$, e.g. :
and I know the range of the variable $x$. How do I apply this knowledge to constrain parameters $a_0$,$a_1$,$a_2$?
My solution was to create a linearly spaced vector of values in the allowed range of $x$ and supplying them to the polynomial. The result of the polynomial was then checked against the constraint. Is there a better way to do this? I used Matlab and fmincon function.