How to use inv(x) functions in constrain?