bjmorgan / py-sc-fermi

py-sc-fermi is a materials modelling code for calculating self-consistent Fermi energies and defect concentrations under thermodynamic equilibrium (or quasi-equilibrium) given defect formation energies.
MIT License
25 stars 9 forks source link

RuntimeWarning: overflow encountered in exp + np.exp( #29

Closed chentingxi36 closed 1 year ago

chentingxi36 commented 1 year ago

I find this question in your API tutorial :"/Users/alex/work/py-sc-fermi/py_sc_fermi/dos.py:231: RuntimeWarning: overflow encountered in exp + np.exp(" , and I don't kown whether this warming will influence the result

alexsquires commented 1 year ago

Hi @chentingxi36

This occurs when numpy encounters very very large numbers. This can generally be ignored as long as your results look reasonable. It is usually a consequence of

  1. The solver trialling a Fermi energy that causes unrealistic defect concentrations (you can ignore this so long as your defect concentrations at the final Fermi energy look reasonable)
  2. Your input temperature is too high, and you are getting unphysically high defect concentrations (I have not encountered this at any meaningful temperature I have wished to simulate)

Please let me know if you have further questions, or else I will close this issue in the next couple of days.

Thanks for your interest in the code!

chentingxi36 commented 1 year ago

ok! Thank you for your explanation. I roughly understand it . I hope your work goes smoothly and your family is happy!

bjmorgan commented 1 year ago

@alexsquires The smart thing for us to do here is to catch this warning and add an additional "warning" that briefly covers your answer above.

chentingxi36 commented 1 year ago

May I know your email address? I am trying to use your code, but I am not sure if the results I obtained are correct. I would like you to help me take a look。Think you!

alexsquires commented 1 year ago

May I know your email address? I am trying to use your code, but I am not sure if the results I obtained are correct. I would like you to help me take a look。Think you!

My email address is available on my GitHub profile