Examine the principles of thermodynamics applied to internal combustion engines. How do engineers optimize engine performance by balancing factors such as compression ratio, air - fuel mixture, and combustion timing?