The Otto engine is an ideal four-stroke internal combustion engine. In the pressure-volume diagram of an Otto cycle, adiabatic compression takes place along A-B. The fuel, once ignited, adds heat to the system at a constant volume. The heated fuel then expands adiabatically along C-D. The gas is further cooled isochorically by exhausting heat, and this cyclic process continues. Consider the expression for heat in terms of temperature. Recalling the equation for efficiency and temperature-volume relationship gives the thermal efficiency, which is always less than one. The efficiency increases by increasing the compression ratio. However, this increases the temperature, which could lead to fuel explosion through pre-ignition. If the fuel is an ideal gas, the theoretical efficiency is around 56%. A diesel engine works similarly, but it has a self-ignition mechanism. The fuel is injected at a constant pressure just before the power stroke, and the high temperature ignites the fuel. This is a significant advantage as it prevents pre-ignition. The compression ratio can go higher, drastically improving the efficiency compared to Otto engines.