Literature indicate that Calcium cannot be simply substituted by Magnesium in the hydroxylapatite (HAP) structure. The geometry (hence the packing) is different in magnesium doped HAP. Is it possible to get coordinates of magnesium doped HAP?
Mg can be easily doped in HA and it is confirmed by XRD of pure HA and Mg-doped HA. XRD of Mg-doped HA revealed that there is slight peak shift towards lower angle representing the incorporation of Mg in HA. For more detail you can read the following paper.