Skip to content

Commit eb7e42a

Browse files
committed
[ci skip] iterate on opacity interpolation changelog entry
1 parent 6ef689d commit eb7e42a

File tree

1 file changed

+25
-33
lines changed

1 file changed

+25
-33
lines changed

docs/source/changelog.rst

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -68,40 +68,28 @@ options for :ref:`kap/defaults:kap_lowT_prefix`:
6868

6969
MESA interpolates across opacity tables in the :math:`X–Z` plane through the use of two consequtive 1D splines.
7070
Previous versions of MESA have offered the users the ability to choose linear or cubic interpolation for these splines,
71-
while leaving the default as linear interpolation.
71+
while leaving the default as linear interpolation::
7272

73-
+ ``cubic_interpolation_in_X = .false.``
74-
+ ``cubic_interpolation_in_Z = .false.``
73+
cubic_interpolation_in_X = .false.
74+
cubic_interpolation_in_Z = .false.
7575

76-
We have refrained from adopting cubic interpolation as the default, as the interpolated opacity derivatives with respect to
77-
density and temperature were not very robust. Their derivatives often disagreed with the numerical derivatives produced via nearest neighbor
78-
richardson extrapolation. By directly comparing these derivatives to the numerical derivatives generated
79-
via richardson extrapolation, shown in the figure below.
76+
We have refrained from adopting cubic interpolation as the default due to poor quality interpolated opacity derivatives with respect to
77+
density and temperature, which often disagreed with the numerical derivatives produced via nearest neighbor
78+
Richardson extrapolation. The figure below shows this comparison on a logarithmic scale, where in general red indicates poor quality
79+
derivatives and blue indicates high quality derivatives.
8080

8181
.. figure:: changelog_plots/cubic_dfridr_dkapdT.png
8282
:alt: old cubic relative kap derivative error
8383

84-
This figure shows the relative derivative error, :math:`\partial \kappa / \partial T` (:math:`X` = 0.625, :math:`Z` = 0.015),
84+
This figure shows the relative error in the derivative :math:`\partial \kappa / \partial T` (:math:`X` = 0.625, :math:`Z` = 0.015),
8585
for an OPAL opacity table grid using Grevesse & Sauval (1998) abundances, generated from MESA’s kap module, using cubic interpolation.
8686
The OPLIB log(:math:`R`) = −8, 1.5 table boundaries are marked with a solid black line and the OPAL/OP log(:math:`R`) = 1.0 boundary is shown with a dashed line.
8787
The approximate location of the Z-dependent transition to an electron conduction dominated opacity is marked with dot-dash blue curve. Regions for Atomic, molecular,
8888
and compton scattering opacity are labeled and presented with their associated blending regions.
8989

9090

91-
This is in stark contrast to the relative derivative error achieved with linear interpolation only, see the figure below.
92-
93-
.. figure:: changelog_plots/linear_dfridr_dkapdT.png
94-
:alt: relative kap derivative error
95-
96-
This figure shows the relative derivative error, :math:`\partial \kappa / \partial T` (:math:`X` = 0.625, :math:`Z` = 0.015),
97-
for an OPAL opacity table grid using Grevesse & Sauval (1998) abundances, generated from MESA’s kap module using linear interpolation.
98-
The OPLIB log(:math:`R`) = −8, 1.5 table boundaries are marked with a solid black line and the OPAL/OP log(:math:`R`) = 1.0 boundary is shown with a dashed line.
99-
The approximate location of the Z-dependent transition to an electron conduction dominated opacity is marked with dot-dash blue curve. Regions for Atomic, molecular,
100-
and compton scattering opacity are labeled and presented with their associated blending regions.
101-
102-
103-
While the opacity derivatives do not directly appear in the canonical equations of stellar structure, they do appear in the jacobian matrix
104-
MESA solves. The opacity derivatives are used to implicitly solve the stellar structure equations and reach a converged solution. Numerically unstable opacity derivatives can
91+
While the opacity derivatives do not directly appear in the canonical equations of stellar structure, they do appear in the Jacobian matrix for the MESA implicit solver.
92+
The opacity derivatives are used to implicitly solve the stellar structure equations and reach a converged solution. Numerically unstable opacity derivatives can
10593
halt the progress of the solver and ultimately crash a calculation.
10694

10795
To improve the numerical stability of MESA's cubic opacity interpolation routines, we have implemented
@@ -110,21 +98,25 @@ in the :math:`X–Z` plane are computed by taking the derivative of the interpol
11098
has resulted in a significant reduction in the relative derivative error and results in an increase in the numerical accuracy of opacity derivatives computed with cubic interpolation.
11199

112100
.. figure:: changelog_plots/cubic_dfridr_dkapdT_ad.png
113-
:alt: relative kap derivative error
101+
:alt: new cubic relative kap derivative error
114102

115-
This figure shows the relative derivative error, :math:`\partial \kappa / \partial T` (:math:`X` = 0.625, :math:`Z` = 0.015),
116-
for an OPAL opacity table grid using Grevesse & Sauval (1998) abundances, generated from MESA’s kap module using cubic interpolation with automatic differentation.
117-
The OPLIB log(:math:`R`) = −8, 1.5 table boundaries are marked with a solid black line and the OPAL/OP log(:math:`R`) = 1.0 boundary is shown with a dashed line.
118-
The approximate location of the Z-dependent transition to an electron conduction dominated opacity is marked with dot-dash blue curve. Regions for Atomic, molecular,
119-
and compton scattering opacity are labeled and presented with their associated blending regions.
103+
Same as previous figure, but for new cubic interpolation scheme taking advantage of automatic differentiation.
104+
105+
106+
This new implementation of cubic interpolation in composition for opacity tables comes close to achieving the derivative quality of the linear interpolation
107+
option (shown below), while also providing more accurate opacity physics between opacity table grid points.
108+
109+
.. figure:: changelog_plots/linear_dfridr_dkapdT.png
110+
:alt: linear relative kap derivative error
120111

112+
Same as previous figure, but for linear interpolation instead of cubic.
121113

122-
Some areas in the figure still seems to disagree with the numerical derivatives achieved via richardson extrapolation, however there is ongoing development to
123-
discearn whether these remaining differences are a product of the interpolation method, or rather the implementation of richardson extrapolation in MESA. The entire
124-
MESA test_suite has been tested with these improvements to the opacity derivatives without error.
125114

126-
For this MESA release, linear interpolation will remain the default interpolation opacity method. Although, we implore users to experiment with cubic interpolation, as it has been shown to consistently increase the overall
127-
opacity of a model, and can directly effect the structure of solar models, see Appendix B & C in Farag et al. 2024. We anticipate making cubic interpolation the default in a future MESA release version.
115+
For this MESA release, linear interpolation remains the default method for interpolating in composition between opacity tables
116+
while we continue to investigate the residual areas where cubic interpolation appears to occasionally produce lower quality derivatives.
117+
However, we recommend users experiment with cubic interpolation, as it has been shown to consistently increase the overall
118+
opacity of a model, and can directly effect the structure of solar models, see Appendix B & C in Farag et al. 2024.
119+
We anticipate making cubic interpolation the default in a future MESA release version.
128120
We encourage users to experiment with these different opacity interpolation routines and be mindful of the effect they can have on their stellar models.
129121

130122

0 commit comments

Comments
 (0)