Charles, Marquis Cornwallis (1738-1805), The Defeat of Sultan Tipu