Determining chemical formula of a hydrate