-
-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differences between NLTE calculation results #784
Comments
Hi, I'm getting some weird results with NLTE. Am I missing something? Thanks, |
@livnehra Hey, I'm currently not able to test this but this might be working as intended. If it's a bug or not depends on whether Nice catch! This part of the code could be written differently to better reflect what is going on. I hope this explanation helped. |
@yeganer Hi, of course you are correct and this is not a bug. After some more digging, I think I may have found the issue - Finally I noticed that this is what happens:
I believe that the NLTE treatment was meant to affect only the levels without changing the ionization state. Also, using the Saha equation after messing with the partition function doesn't seem valid... Thanks! |
So... Do you think this may be a bug or am I missing something obvious? Thanks, |
@chvogl may be able to provide you with more information (and correct me if I am wrong) but for now NLTE was only implemented for the excitation balance. That means that only the level populations are calculated based on the rates equation. Ionization still has to be determined following the standard recipies, i.e. either LTE or nebular (which is an approximate NLTE treatment). Of course from a physical standpoint, you should rather use the nebular description than pure LTE. |
That's exactly what I understood, but I see that turning on NLTE species does change the ionization significantly. I found that the reason for this is that the partition function is calculated by the NLTE code and then the ionization is erroneously calculated based on this new partition function. Hoping to get some help to avoid messing with the code myself :) |
Well, that's the thing. In my opinion this is actually not a bug. If you combine NLTE excitation with some approximate-NLTE (i.e. nebular) ionization scheme, I think the NLTE partition function should be used instead of an LTE one. |
Even if that is true, the way that the code is implemented, the Z for the particular ion selected for NLTE treatment is always identically set to 1.0, while the other Z's of that species remain at their "nebular" values. For example, before I turn on NLTE for Si-2, the Si partition functions are: After turning on NLTE for Si-2, the partition functions are: I don't think that represents anything physical. |
Would be good to hear @wkerzendorf's and in particular @yeganer's (who has spent a lot of time fixing NLTE) thoughts on this |
@livnehra I think it would be great to get a better insight into your problem. Can we skype or email or something |
Of course! Thanks, |
Hi, After correspondence with @wkerzendorf, I suggest changing partiton_function.py Line #192 to
This leaves the partition function as it was. Thanks, |
Sure, First I tried: This resulted in:
This still changes the ion_number_density drastically, when all we wanted was to change the excitation levels. I propose instead: This gives:
The partition function is very similar. What do you think? Thanks, |
Hello Ran - I think that this all depends on what "level_boltzmann_factor" is. Why is is the value for "general_level_boltzmann_factor" that is being changed? Can we be a little clearer here about which physical quantity is which, and what we are trying to get right? It looks to me that "general_level_boltzmann_factor" and "level_boltzmann_factor" are both level populations here. What are they supposed to be? How are they used elsewhere in the code? There is more to getting this correct that just getting the partition function correct, right? I think our effective definition of the partition function is Z = g_0 * N_ion / n_0 where g_0 is the ground state statistical weight, n_0 is the ground state population and N_ion is the total ion population. Which of those expressions does this correspond to? If (as it seems) there is doubt about what these variables mean we should check back in the older version of the code. It's going to be extremely important that this is all consistent - so I think a clear statement of all the definitions of the variable here is needed. |
PS. If the formula on line 58 is correct (and that is the same "general_level_boltzmann_factor" that we want here), then the equivalent thing we'd want in NLTE would (I think) be general_level_boltzmann_factor (level_i) = g_0 * n_i / n_0 = Z / N_ion * n_i ...but I don't know if that latex formula in the code is completely correct. (If this is correct then I think it might be equivalent to the first suggestion in the post two before this one.) |
Perhaps, But the way the code is implemented, the What triggered my examination of this code is that I got a ~4x factor between Si II ion population with and without NLTE. When I implemented the first suggestion there still remained a factor of almost 2x. Maybe the solution is only to disconnect the excitation calculation from the ionization calculation when using NLTE? |
I agree with you that it is somewhat surprising that the NLTE mode changes the partition function by as much as a factor of 2x, but I think it would be good to figure out why that is so - i.e. why is it that the partition function drops so much when the NLTE calculation is active: which levels are depopulating and why? One could opt to keep the LTE partition functions (e.g. for testing purposes) but I don't think it's physically consistent to use a partition function in the ion calculation that is different from the one implied by the level populations. But it would be good to check for consistency with the calculations in the paper - i.e. compare to the version of the code used then: I think @wkerzendorf knows how to did out that old version for comparison? |
@wkerzendorf is in Ghana and will be available next week |
@livnehra check out tag v0.9 that should be used as a reference. |
Hi, Glancing at v0.9.2, it seems this was once dealt with directly and not through
|
I think it's easiest to just run it and see what the difference will be. |
@chvogl Brought to my attention that the NLTE result I obtained last week does not match the spectrum in figure 10 of the KerzendorfSim2014 paper very well near 3000 angstrom. Today's results don't have that problem, however the region between 4000 and 5000 angstrom does not match as well as before.
The goal of this issue is to document this behavior and provide a centralized platform for discussion, especially whether we need to look more closely at the underlying problem.
I believe this might be related to convergence criteria but I haven't confirmed anything yet.
Here are the plots (please note that for some reason the colors are reversed in both plots):
Carsus:
Last week after fixing NLTE:
The text was updated successfully, but these errors were encountered: