Skip to content

NLTE Solver population checks#88

Open
jpollin98 wants to merge 2 commits intodevelopfrom
nebular-25-cubed
Open

NLTE Solver population checks#88
jpollin98 wants to merge 2 commits intodevelopfrom
nebular-25-cubed

Conversation

@jpollin98
Copy link
Copy Markdown
Contributor

@jpollin98 jpollin98 commented Jun 11, 2024

I have been thinking about the errors in the multid nebular runs. I think a check at the end of the NLTE solver would be a good idea. We would need to check for two cases:

  1. when the population may become sufficiently small to cause problems with floating point numbers. (On this point, I also think min pop should be changed to something larger, 1e-35 to ensure we are not close to the float limit)

  2. The case when we have a population inversion. The division by the groundpop when we have a successful solution with a population inversion can cause significant problems at the point the partition function is cast from a double to a float. There is no physical justification for not allowing a population inversion thus simply setting the population to LTE might not be the best approach. Thus, I suggest some tolerance on what we would accept.

As such, I have attempted to introduce two checks on the solved populations. I believe the changes in the outputs are from numerical round-offs as the spec.out files are the same. Although I'd appreciate some sanity checking of the implementation for the 2nd case. Do you think there's a better way to implement this safety mechanism on the NLTE solver?

@lukeshingles
Copy link
Copy Markdown
Member

Does running this code solve the problem with your multiD runs? Do you know what is going wrong in the NLTE solver that requires the populations to be clamped afterwards?

I would prefer to move in the direction of eliminating arbitrary parameters like MINPOP that must be manually adjusted. Ideally, the code will automatically set it to some sensible value, if it is really needed at all. I know one of the main uses is to prevent nne from going to zero, but it should not be a problem for an ion or level population to be zero.

@lukeshingles lukeshingles force-pushed the develop branch 2 times, most recently from 2781e4b to d8f50ec Compare August 26, 2025 13:04
@lukeshingles lukeshingles force-pushed the develop branch 3 times, most recently from 095a45f to 7da884b Compare September 11, 2025 10:33
@lukeshingles lukeshingles force-pushed the develop branch 3 times, most recently from fefa384 to 0b6e44f Compare October 1, 2025 10:24
@lukeshingles lukeshingles force-pushed the develop branch 2 times, most recently from f10b3ac to 8fecd57 Compare October 13, 2025 15:03
@lukeshingles lukeshingles force-pushed the develop branch 3 times, most recently from 1386401 to 9c1b024 Compare October 28, 2025 13:18
@lukeshingles lukeshingles force-pushed the develop branch 3 times, most recently from 2873d47 to d1b5cb9 Compare October 31, 2025 12:37
@lukeshingles lukeshingles force-pushed the develop branch 3 times, most recently from 9d04064 to 5ab61a7 Compare December 17, 2025 16:48
@lukeshingles lukeshingles force-pushed the develop branch 4 times, most recently from 838fba6 to 78bf7c8 Compare February 10, 2026 15:57
@lukeshingles lukeshingles force-pushed the develop branch 4 times, most recently from 428265c to 8e3dbf6 Compare February 25, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants