This disclosure teaches a method of controlling a direct injection internal combustion engine and predicting the behaviour of a direct injection internal combustion engine. An estimation of initial cylinder pressure, air flow and EGR flow (if applicable) is used to establish a system that provides engine behaviour by integrating an injection module, combustion module and engine control module to provide data indicative of engine behaviour such as brake torque and power, air flow, EGR flow, cylinder pressure, brake specific fuel consumption, start of combustion, heat release rate, turbo-charger speed and other variables. These values can then be used to adjust commanded variables such as start of injection, commanded pulse width, rail pressure to meet operator demand. Also the output data can be used as a tool to determine how a conceptualised engine design will behave. This is particularly useful for gaseous-fueled internal combustion engines where cylinder pressure influences behaviour of injected gases in light of the fact that rail pressure and cylinder pressure are, generally, of a similar magnitude.