wtbarnes / fiasco

Python interface to the CHIANTI atomic database
http://fiasco.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
21 stars 16 forks source link

Test that rate matrix is singular before ionization equilibrium calculation #41

Open wtbarnes opened 5 years ago

wtbarnes commented 5 years ago

The ionization equilibrium calculation uses the SVD to compute solutions to the homogeneous linear system of equations. For this to be applicable, the matrix composed of ionization and recombination rates must be singular (i.e. det(A)=0). If not, an error should be raised.

dstansby commented 4 years ago

Is this issue referring to this code: https://github.com/wtbarnes/fiasco/blob/cd89e7ccd01f07c6b10c8a075156b7469c4474d2/fiasco/ion.py#L347-L354 ?

wtbarnes commented 4 years ago

Well I was actually thinking of the ionization equilibrium calculation in Element,

https://github.com/wtbarnes/fiasco/blob/cd89e7ccd01f07c6b10c8a075156b7469c4474d2/fiasco/element.py#L93-L102

Though it may also apply to the level populations calculation as well.