There are a lot of different parameters they can change, but the main ones are turbo boost and injection time. It is easy to find one set of values for each power output request that will make the engine run. Now you optimize. The combinations that is over the limits might not be that different than the values that is over the limits, so it is just a matter of trying them all to see what happens. This is done as an educated guess and refinement: we don't know exactly what any gives set will produce, but we have a good guess.