The Theory of the Replacement of Methane by Carbon Dioxide in Gas Hydrates