Sometimes we can give a problem enough assumptions (or break it down enough) that it or part of it becomes a convex optimization problem. As long as we know the objective function and the constraints, we can solve these types of problems.