Hello Søren,
Thanks for the nice feedback!
In response to Bamdev's last remark: a classical trick to work on an interval [a, b] is to do a change of variable. For example, you can do this:
Let x be a scalar, unconstrained, and
Let y = (a+b)/2 + abs(b-a)/2 * sin(x)
In this fashion, y is always in the correct interval. Of course, this does not exclude the bounds (a and b) and this induces some complications in the formulas for the cost and the gradient, but nothing too horrible.
I have no experience using this trick myself, so if you end up trying it, I'd love to hear about your experience.
Let us know if you have more questions / if this doesn't help.
Cheers,
Nicolas