First principles calculations allow one to model materials from fundamental quantum mechanics without bias. Because the calculations contain detailed atomic coordinates and electron distributions as well as their wave functions, most measurable properties including the X-ray Absorption Near Edge Structures (XANES) can be simulated. We will present results of our recent research activity in utilizing (pseudopotential) first principles calculations of defects by supercell approach to XANES spectra. By comparing the simulated XANES with experimental measurements detailed geometry of defects can be positively identified. The examples covered in my talk include: (a) the identification of the manganese location in PZT crystal , (b) the proof of an arsenic complex model for p-type ZnO  that we have previously proposed , (c) our recently developed approach in conjunction with quantum chemists to simulate disordered systems such as ions in water that compared favorably with experimental measurements.
 S. Limpijumnong, S. Rujirawat, A. Boonchun, M.F. Smith, and B. Cherdhirunkorn, Appl. Phys. Lett. 90, 103113 (2007).
 S. Limpijumnong, M.F. Smith, and S.B. Zhang, Appl. Phys. Lett. 89, 222113 (2006).
 S. Limpijumnong, S.B. Zhang, S.-H. Wei, and C.H. Park, Phys. Rev. Lett. 92, 155504 (2004).