Engineer, inventor and chemist whose improvements to the steam engine helped to power the industrial revolution