Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Alan W. Irwin <irwin@be...>  20061220 03:51:43

This is a status report for FreeEOS for extreme conditions (i.e., the conditions in the envelopes of extreme LMS stars) where it has convergence difficulties. When I released FreeEOS2.0.0 last January I thought I had nearly finished a BFGS implementation that promised to give robust initial convergence wherever my normally trusty NewtonRaphson iteration was diverging. I am now sadder but wiser. Here are some issues I encountered: * The BFGS algorithm for finding the minimum of a function should do that task robustly. All it should need are the function and gradient as functions of the independent variables. However, the BFGS algorithm implementation I first tried turned out to be nonrobust. Fortunately, "Practical Methods of Optimization" by Fletcher (where Fletcher is the "F" in the author initials making up the BFGS acronym) gives a clear description of the BFGS algorithm which allowed me to implement my own independent version which I completely understand. Fletcher already discusses certain robustness issues and how his algorithm avoids them, but if any more turn up during my FreeEOS experiments, I should be in a good position to deal with them. * If incorrect independent variables are chosen the minimization of the free energy obviously does not correspond to the solution of the EOS. I was bitten twice by this problem with lots of useless gradient programming as a result. * Even when correct independent variables are chosen, you can run into problems with the robustness of maintaining the constraints (such as the abundance conservation and overall charge neutrality equations) that must be satisfied by the EOS solution. This bit me several times with much useless programming as a result. So I am now in the middle of doing a "final" BFGS implementation that has the same auxiliary variables I iterate to convergence in my NewtonRaphson scheme as the independent variables. These variables are welldesigned to be free of limit issues (aside from the usual numerical underflow and overflow floatingpoint limits). An iteration on the degeneracy parameter insures minimization of the free energy using these variables is consistent with the solution of the EOS. Here are some additional details of that last absolutely essential point. Normally for fixed T and abundance, the FreeEOS solution determines number densities and mass density, rho, as functions of the degeneracy parameter, fl, and a set of auxiliary variables. (See Paper II at http://freeeos.sourceforge.net/solution.pdf for details.) For FreeEOS2.0.0 both fl and the set of auxiliary variables are simultaneously iterated (using the NewtonRaphson technique) to convergence defined by consistency between the calculated rho and input rho, and consistency between auxiliary variables calculated from the number densities and the input auxiliary variables. When that NewtonRaphson technique fails to converge, then the formulation will be changed as follows: for fixed input auxiliary variables, iterate just on fl for consistency between the calculated and input rho. In this way, fl is implicitly eliminated in terms of the input rho so the solution of the EOS and in particular the number densities become implicit functions of just the input auxiliary variables for fixed (input) rho, T, and abundance. Under these special conditions (and only these conditions) with fl implicitly eliminated, it is straightforward to show that minimizing the free energy as a function of auxiliary variables is equivalent to minimizing the free energy as a function of number densities which (see Paper II) is exactly equivalent to the solution of the EOS using the NewtonRaphson technique. The only conditions on this general theoretical result are (1) the iteration on fl with fixed input auxiliary variables must converge, and (2) the derivatives of number densities with respect to those auxiliary variables must not be zero. These two conditions are also necessary for the NewtonRaphson technique to converge so a BFGS minimization based on this formulation should not be less robust than the NewtonRaphson technique in this respect, and should be considerably more robust when the NewtonRaphson technique is diverging for other reasons (such as having a poor starting approximation). This fundamental theoretical analysis has encouraged me to move ahead with the implementation I have outlined above, and recently I have been making good progress on it (the fl iteration is done), but there is considerable programming and a lot of testing still to go to express the free energy and its gradient in terms of the auxiliary variables with fl implicitly eliminated. If this final BFGS implementation performs as expected (and I am obviously somewhat concerned about that issue since I have already spent quite an effort on the BFGS idea with few positive results, yet), then I should be able to calculate FreeEOS for much more dense conditions automatically without any hand intervention. That in turn should make it much more convenient to adjust the semiempirical Coulomb and pressureionization coefficients in FreeEOS to get a better match with Forrest Rogers' recent OPAL EOS results for his highest tabulated densities (roughly corresponding to conditions in a ~0.1 solarmass model) while constraining the fit in the following two ways: * Maintain the existing excellent fit to OPAL results for conditions in a solarmass model (and by implication all models with relatively low densities). * Give a physically reasonable and smooth extrapolation at higher densities than covered by OPAL so at least the hydrogen burning limit of the main sequence near 0.07 solar masses can be reached with FreeEOS. Anyhow, that constrained OPAL fit is the dream that has motivated this BFGS effort since FreeEOS2.0.0 was released. I feel I am finally on the right track, but some substantial gradient programming still needs to be completed before I will know for sure. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equationofstate implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick frontend to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linuxpowered Science __________________________ 
From: Alan W. Irwin <irwin@be...>  20061221 22:11:47

On 20061221 14:430500 Aaron Dotter wrote: > Hello Alan, > > I found your report from earlier this week intriguing. Making stellar models > down to the Hburning limit is a particular goal of mine and I've had limited > success doing it with FreeEOS but only by cheating in a couple of different > ways. > Hi Aaron: I would like to encourage more list discussion of FreeEOS problems by everybody that is using that software since that is an excellent way to motivate improvements to it. I also strongly encourage those who are using FreeEOS to give a short summary of their various research projects where FreeEOS is currently used or where there may be future plans to use it. Thus, if there is anything list members wish to to discuss about FreeEOS, I strongly encourage them to post their email to freeeosgeneral@... rather than me. In that spirit, Aaron, I hope that you don't mind that I am moving my reply to your comment above to the list. Thanks, Aaron, for your continuing interest in the solution of the highdensity problem for FreeEOS. Your results (you have to cheat to get much below 0.1 solar masses with the current FreeEOS) confirms results Don VandenBerg calculated with the original version of FreeEOS and also results by Pietrinferni with a later version of FreeEOS that he used for his thesis work. The problem is FreeEOS (like other equations of state) yields at least a double solution for high densities, i.e., there is simultaneously a valid mostly unionized solution and a valid mostly ionized solution for a range of high densities for a given isotherm. If you move along an isotherm toward higher densities you eventually run into density where the low ionization solution is no longer valid, and the whole solution wildly diverges because the initial solution (inferred from a Taylor series based on a slightly higher density) is so far from the valid highionization solution. This discontinuity is also found in other equations of state, but typically ~1 dex higher in density than for FreeEOS. So sub0.1 solarmass models are affected for FreeEOS while higherdensity models (i.e. hot browndwarf models beyond the hydrogenburning limit) are affected for the other equations of state. Ideally I would like move the FreeEOS discontinuity ~1 dex higher in density while simultaneously preserving the good fit I now have to OPAL work at lower (especially solar) densities. To do that I need to calculate EOS grids that extend to high density to see how the location of the discontinuity in the rhoT plane is affected by the various Coulomb and pressureionization coefficients I use in FreeEOS to fit the OPAL work. Of course, calculating those grids is extremely laborious if you have to hand intervene to get the FreeEOS solution to converge each time it hits a discontinuity for _every_ isotherm. So that is my motivation for trying yet again to get the BFGS technique to work in the robust manner that all optimization books claim it fundamentally must have compared to NewtonRaphson techniques. I believe I now understand all the negative results I have had before so I hope this time I have the BFGS answer with regard to the FreeEOS formulation of the EOS. Thus, with luck, I hope to to report a positive result to this list in the next few weeks, but there is lots of derivative programming I have to do before I know for sure. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equationofstate implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick frontend to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linuxpowered Science __________________________ 
From: Alan W. Irwin <irwin@be...>  20070101 05:55:51

On 20061219 19:510800 Alan W. Irwin wrote: > So I am now in the middle of doing a "final" BFGS implementation[....] > [...]for fixed input auxiliary variables, iterate > just on fl for consistency between the calculated and input rho. In this > way, fl is implicitly eliminated in terms of the input rho so the solution > of the EOS and in particular the number densities become implicit functions > of just the input auxiliary variables for fixed (input) rho, T, and > abundance. Under these special conditions (and only these conditions) with > fl implicitly eliminated, it is straightforward to show that minimizing the > free energy as a function of auxiliary variables is equivalent to minimizing > the free energy as a function of number densities which (see Paper II) is > exactly equivalent to the solution of the EOS using the NewtonRaphson > technique. More progress.... Before I had implemented the ideal component of the freeenergy using a formula that was only correct in chemical equilibrium (since it depended on equilibrium conditions being true). Now I have changed that formulation to the fundamental one (see MHD, Paper II). The other issue was that before some components of the freeenergy formulation were evaluated at the "old" number densities, while others were evaluated at the "new" number densities of the NR iteration. Now, all components are evaluated consistently with the "new" number densities. Those in turn are a function of the degeneracy parameter, fl, and the "old" auxiliary variables of the NR iteration. These two changes now meet the theoretical conditions that are required to minimize the freeenergy as a function of auxiliary variables (assuming fl has implicitly been eliminated in terms of the input rho). I am extremely happy to say that the numerical result is just what was theoretically predicted above. The freeenergy (for implicitly eliminated fl) is minimized (actually quartically) by the NewtonRaphson convergence and is equal to the freeenergy calculated by equilibrium relations at NR convergence as expected since NR convergence means chemical equilibrium has been obtained. So I now have a proof of concept that the "final" BFGS implementation is going to work. The next steps are to (1) implement a calculation of the gradient of the freeenergy with respect to the auxiliary variables in this formulation (for fixed input rho, T, and abundance), and (2) use the freeenergy and its gradient to minimize the freeenergy using the BFGS technique when the existing NewtonRaphson technique is failing to converge. So there is still a long way to go, but I am happy the proof of concept finally worked on the last day in 2006, and I am hoping for a good BFGS result early in 2007 as a result of this breakthrough. Happy New Year, everybody! Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equationofstate implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick frontend to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linuxpowered Science __________________________ 
From: Alan W. Irwin <irwin@be...>  20070120 00:58:38

On 20061231 21:550800 Alan W. Irwin wrote: > I am extremely happy to say that the numerical result is just what was > theoretically predicted above. The freeenergy (for implicitly eliminated > fl) is minimized (actually quartically) by the NewtonRaphson convergence > and is equal to the freeenergy calculated by equilibrium relations at NR > convergence as expected since NR convergence means chemical equilibrium has > been obtained. > > So I now have a proof of concept that the "final" BFGS implementation is > going to work. The next steps are to (1) implement a calculation of the > gradient of the freeenergy with respect to the auxiliary variables in this > formulation (for fixed input rho, T, and abundance), and (2) use the > freeenergy and its gradient to minimize the freeenergy using the BFGS > technique when the existing NewtonRaphson technique is failing to converge. > So there is still a long way to go, but I am happy the proof of concept > finally worked on the last day in 2006, and I am hoping for a good BFGS > result early in 2007 as a result of this breakthrough. More good news. I have just completed (1) for the EOS1 freeenergy model (other models of the freeenergy gradient are programmed, but not tested yet.) I did my final EOS1 partial derivative check (comparing results with centred numerical differences) this morning, and completed the programming of transforming those derivatives to the required gradient just now. The code now satisfies the following interesting tests: the NewtonRaphson iteration zeroes the gradient quadratically as expected for pure H, pure He, and full (20 different elements) abundance mix tests cases for EOS1, kif=2 at log T = 5, and log rho = 2. This is a good comprehensive test at reasonably high density that all freeenergy derivatives for these particular test cases are fine. Note the tested freeenergy and gradient are exactly the input required by the BFGS technique to converge to the vicinity of the minimum in a robust way. I note that the NR iterations did not reduce the gradient very much until extremely close to the minimum. Which illustrates, as well known, that the NR technique is not very good far from the minimum. This shows why I need the BFGS technique to robustly move the solution close enough to the minimum that the NR technique can take over for the final rapid convergence. The next steps are to finish programming the BFGS technique in this formulation and test it for a wide variety of physical conditions for EOS1, kif=2. Those tests will show just how much help the BFGS technique is actually going to be. If this pans out, then I will need to extend the programming to my other freeenergy models (e.g., EOS3, etc.) and other kif values (selection of independent variables used for the calculation). In sum, this particular BFGS formulation continues to look quite promising, but there is still some uncertainty ahead and also (if the technique works well for EOS1, kif=2) a substantial amount of programming effort before I can release this improvement to my iteration technique. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equationofstate implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick frontend to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linuxpowered Science __________________________ 
From: Alan W. Irwin <irwin@be...>  20070603 18:12:49

After a large number of false starts I do finally have the BFGS technique working reasonably correctly now, but there are some limitations. It is (1) extremely slow (one BFGS convergence is equivalent to roughly 300 NewtonRaphson iterations), and (2) it sometimes minimizes so poorly that the subsequent NR iterations fail to converge. Because of issue (1) I only use the BFGS technique as an emergency measure that is invoked automatically if the NR technique fails to converge in 100 iterations. Because I use the previous call to make a Taylor series approximation to the starting solution for the next FreeEOS call, the NR technique normally converges in 2 iterations for sufficiently small changes in physical conditions, and for larger step sizes it rarely takes more than 10 iterations to converge. However, when a discontinuity occurs, the Taylor series gives an obviously unreliable starting solution, and it is this special case (normally marked by more than 100 NR iterations without convergence) where the BFGS technique has proved to be the most useful. Despite issue (2), the current BFGS technique has allowed me to take at least some test calculations to much higher densities/lower temperatures than before. This has revealed a number of special issues in FreeEOS that I have solved for those conditions. Furthermore, the improved starting solutions near discontinuities delivered by the BFGS technique has helped to clarify what was previously causing some of the NR divergences, and this has allowed me to improve the robustness of the NR iterations by improving some of the heuristics I have used to limit the derived NR changes. At this point, there is at least one remaining NR convergence issue that is characterized by a nonconverging series of NR steps where some of the derived auxiliary variables are alternatively zero (due to internal underflows) or not. Underflowzeroed auxiliary variables also seem to be causing troubles for the BFGS convergence. Currently, I am implementing improved scaling of the auxiliary variable calculations to reduce the conditions where such underflows occur. In sum, I am not yet anywhere done with this project, but it does feel like the convergence problems FreeEOS has always had for extreme LMS conditions are at last beginning to come into focus, and the progress I am making solving some of these convergence issues encourages me to continue. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equationofstate implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linuxpowered Science __________________________ 
Sign up for the SourceForge newsletter:
No, thanks