The work extends a methodology, for searching for optimal heat release profiles, by adding complex constraints on states. To find the optimum heat release profile a methodology, that uses available theory and methods, was developed that enables the use of state of the art optimal control software to find the optimum combustion trace for a model. The methodology is here extended to include constraints and the method is then applied to study how sensitive the solution is to different effects such as heat transfer, crevice flow, maximum rate of pressure rise, maximum pressure, knock and NO generation. The Gatowski single zone model is extended to a pseudo two zone model, to get an unburned zone that is used to describe the knocking and a burned zone for NO generation. A modification of the extended Zeldovich mechanism that makes it continuously differentiable, is used for NO generation. Previous results showed that the crevice effect had a significant influence on the shape for the unconstrained case where a two mode combustion was seen, one initial pressure rise and one constant pressure phase. Here it is shown that it still has a significant influence on the appearance until the maximum pressure limit is reached and becomes the dominating constraint. In the unconstrained case no conditions had combustion before TDC all started after, but when limitations are considered and come into play the combustion can now start before TDC to avoid excessive losses during the expansion. When introducing constraints on the NO formation through the extended Zeldovich mechanism the combustion takes the shape of a three mode combustion, one initial rapid burning, one later rapid burning and a constant pressure phase. In summary it is shown that the methodology is able to cope with the introduced constraints.