magnesium chemistry analysis