-
Notifications
You must be signed in to change notification settings - Fork 8
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
solve for ne instead of using atmospheric value #179
Conversation
OK, so I spent some time speeding this up and it's actually a bit faster than the old implementation now for cool stars where chemical equilibrium is more complicated (more molecules). new implementation: 70ms (sun), 148ms (cool giant) |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #179 +/- ##
==========================================
+ Coverage 82.52% 82.71% +0.18%
==========================================
Files 22 22
Lines 1402 1423 +21
==========================================
+ Hits 1157 1177 +20
- Misses 245 246 +1
☔ View full report in Codecov by Sentry. |
Github actions is currently down, but the tests pass on my computer. This is ready for review. |
This branch is an experiment where Korg solves for the electron number density self-consistently, rather than assuming the model-atmospheric value is correct. For the MARCS solar atmosphere, this adds about 0.1s to synthesis time, which is roughly double for a small wavelength range.
Notably, this implementation doesn't crash on any model atmospheres (at least at solar metallicity). Contrast with the current method (#129), which sometimes fails for cool stars.
Here's the reletive difference in the$n_e$ that Korg infers using the old method and this one. Solar atmosphere on the left, cool star (Teff = 3200K, logg=2.0 very close to the parameters which crash the current implementation) on the right:


The agreement between the methods is worse for the cool star, which is consistent with Korg's solver failing near there. Completely unexpectedly (to me), the new method actually produces closer agreement with the model atmosphere pretty much everywhere. I'd really like to know what the cause for disagreement with the atmosphere is, but my guess is charged molecules.
The seems like a slam dunk except that it's slow.
TODO