dschick / udkm1Dsim

A Python Simulation Toolkit for 1D Ultrafast Dynamics in Condensed Matter
http://udkm1dsim.readthedocs.io
MIT License
21 stars 16 forks source link

Wrong math for Debye Waller Factor in x-Ray class #148

Open jpudell opened 11 months ago

jpudell commented 11 months ago

Wrong math in ref/trans factors for Debye Waller Factor: Units cell Class requires de_wal_fac in units of m^2. The math in get_atom_reflection/trasmission_factor, requires the unit of m instead of m^2. Also the comment section shows different equations as used in the function.

dschick commented 11 months ago

Hi @jpudell

many thanks for revising the code and math!

However, I think the code in the Xray class is correct, but the unit of the dbf in the UnitCell class should be changed from to m?

Could you also point explicitly to the difference between docstring and code equations? I might not see it after so long time

jpudell commented 11 months ago

Hi dschick,

both is possible. In the literature it is more common to use the < u >^2 for the Debye Waller instead of < u >. In the Matlab version < u >^2 is used, so I suggest to also use it here.

The doc string was correct for the < u > version. (I mixed up / and ...) and corrected it for the < u >^2 version.