gyre: a new open-source stellar oscillation...

1
GYRE: A New Open-Source Stellar Oscillation Code Rich Townsend 1 , Seth Teitler 1 & Bill Paxton 2 1 Department of Astronomy, University of Wisconsin-Madison 2 Kavli Institute for Theoretical Physics, University of California-Santa Barbara We introduce GYRE, a new open-source stellar oscillation code which solves the adiabatic/non-adiabatic pulsation equations using a novel Magnus Multiple Shooting (MMS) numerical scheme. The code has a global error scaling of up to 6 th order in the grid spacing, and can therefore achieve high accuracy with few grid points. It is moreover robust and efficiently makes use of multiple processor cores and/or nodes. We present a selection of example calculations using GYRE, before discussing recent work to integrate GYRE into the asteroseismic optimization module of the MESA stellar evolution code. Another Oscillation Code? Interpreting the wealth of new observations provided by MOST, CoRoT and Kepler requires the theorist’s analog to the telescope: a stellar oscillation code which calculates the eigenfrequency spectrum of an arbitrary input stellar model. Comparing a calculated spectrum against a measured one provides a concrete metric for evaluating a model, and therefore constitutes the bread and butter of quantitative asteroseismology. There’s no shortage of oscillation codes available to the community; the nine codes reviewed in [1] are likely only a fraction of those being used on a day-to-day basis. However, automated asteroseismic optimization tools such as AMP [2] and MESA [3] are placing ever-increasing demands on these codes. A code will typically be executed hundreds or thousands of times during an optimization run, and must therefore make efficient use of available computational resources such as multi-processor hardware. The code must be robust, running and producing sensible output without manual intervention. The code must have an accuracy that matches or exceeds the frequency precision now achievable by satellite missions. Finally, it is preferable that the code address the various physical processes that inevitably complicate calculations, such as non-adiabaticity, rotation, and magnetic fields. Currently, there are no publicly available oscillation codes which address all of these requirements. This motivated us to develop another code, ‘GYRE’, which is built on a novel Magnus Multiple Shooting (MMS) scheme for solving pulsation boundary value problems (BVPs). GYRE and the MMS scheme are described in detail in a forthcoming paper [4]; below we briefly summarize them, before presenting example calculations using GYRE. The MMS Scheme The multiple shooting component of the MMS scheme is an extension of the single- or double-shooting schemes often used to solve pulsation BVPs, which enjoys much-improved numerical stability [5]. A normalized radius grid {x k } (k = 1,…,N) extending from the origin (x = 0) to the stellar surface (x = 1) divides the star into N-1 subintervals. In each subinterval an initial value problem (IVP) integrator is used to determine the fundamental solution matrix Y k+1;k relating the dependent variables y(x) on neighboring grid points: y(x k+1 ) = Y k+1;k y(x k ). Requiring continuity of these variables from one subinterval to the next leads to a set of algebraic equations, which combined with the boundary conditions can be expressed as the linear system S u = 0. Here, S is a large, sparse matrix which depends implicitly on the oscillation frequency ω, and u is a vector composed of the dependent variables at the grid points y(x k ). Non-trivial solutions to this system exist only when the determinant of S vanishes, and so the stellar eigenfrequencies are the roots of the discriminant function D(ω)det[S(ω)]. Example B: Dipole-mode linear eigenfrequencies of a 1.5 M MESA model, plotted as a function of stellar age during evolution through the RGB bump phase. Coupling between envelope p-modes and core g-modes is revealed in the avoided crossings; the reversal in the time-evolution of the crossing frequencies, between 2.700 and 2.705 Gyr, arises from the temporary contraction of the stellar envelope during the bump phase. Example C: The differential mode inertias dE/dx (proportional to the kinetic energy density) of two modes from Example B at an age 2.705 Gyr, plotted as a function of normalized radius x. Mode A is strongly coupled between the envelope and the core, and therefore has appreciable amplitude in both, whereas mode B is mainly confined to the core. The inset magnifies the centermost region, illustrating the very small spatial scale of the modes there (which is nevertheless well-resolved by GYRE). 10 0 10 1 10 2 n proc 10 0 10 1 10 2 Speedup n core =1 n core =2 n core =4 n core =6 n core =8 Example D: The speedup of GYRE running in parallel, plotted as a function of the total number of processors n proc = n core · n node used on a multi-core, multi-node cluster. Here, n node is the number of cluster nodes and n core is the number of cores per node. Parallelism across nodes is implemented using MPI, and across cores using OpenMP. The performance of GYRE remains reasonably close to the ideal linear speedup case shown by the dotted line. 2.696 2.698 2.700 2.702 2.704 2.706 2.708 2.710 Age (Gyr) 30 32 34 36 38 40 (μHz) 0.0 0.2 0.4 0.6 0.8 1.0 x 10 -7 10 -6 10 -5 10 -4 10 -3 10 -2 10 -1 10 0 10 1 10 2 10 3 10 4 10 5 dE /dx (MR 2 ) A: (,n p ,n g ) = (36 μHz, 8, 476) B: (,n p ,n g ) = (34 μHz, 7, 505) 0.0 0.2 0.4 0.6 0.8 1.0 x 10 4 10 0 10 1 10 2 10 3 The MMS scheme combines this multiple-shooting technique with IVP integrators based on Magnus’s theorem [6]. The simplest is the Magnus GL2 integrator (‘GL’ for Gauss-Legendre), which approximates the fundamental solution matrix as Y k+1;k = exp[A(x k + ½Δx k ) Δx k ]. Here, A(x) is the Jacobian matrix of the differential equations, and Δx k = x k+1 - x k is the grid spacing. The GL2 integrator is 2 nd -order accurate in Δx k ; the more-sophisticated Magnus GL4 and GL6 integrators yield expressions for Y k+1;k which are 4 th - and 6 th - order accurate in Δx k , respectively (see Appendix B of [4]). Introducing GYRE GYRE uses the MMS scheme to calculate the adiabatic and/or non- adiabatic eigenfrequencies and eigenfunctions of an input stellar model. It is is written in standard-conforming Fortran 2008 with a modular architecture that allows straightforward extension to handle more-complicated problems. To leverage multiple processor cores and/or cluster nodes it is parallelized using a combination of OpenMP and MPI. A typical GYRE run involves the following steps: first, a stellar model is either read from file or built analytically, and calculation grids are constructed. A scan through frequency space then searches for sign changes in the discriminant D(ω), which are used as initial guesses for the discriminant roots. After these roots are found, the corresponding eigenfunctions are reconstructed. GYRE is open for use and distribution under the GNU General Public License; our hope is that a community of practice will arise around the code, bringing together users and developers to shape the code’s future evolution in ways that best serve the field and its participants. Source code, documentation and other materials can be found at http://www.astro.wisc.edu/~townsend/gyre/ . Example Calculations using GYRE Example A: The absolute error in the dipole p 1 mode dimensionless eigenfrequency ω of the n = 0 polytrope, plotted as a function of the number of grid points N. The three curves correspond to GYRE’s Magnus GL2, GL4 and GL6 integrators, while the thick lines show the asymptotic scalings |ω - ω exact | N -2 , N -4 and N -6 , respectively; the close correspondence between the curves and the lines confirms the asymptotic error scaling of the integrators. 10 1 10 2 10 3 10 4 N 10 -15 10 -14 10 -13 10 -12 10 -11 10 -10 10 -9 10 -8 10 -7 10 -6 10 -5 10 -4 10 -3 10 -2 10 -1 10 0 |! - ! exact | / N -2 / N -4 / N -6 Magnus GL2 Magnus GL4 Magnus GL6 GYRE in MESA As of revision 5232, the MESA stellar evolution code [3] includes GYRE as one of the oscillation codes underpinning its asteroseismic optimization module (the other, currently, is the ADIPLS code [7]). Communication between MESA and GYRE is accomplished through a simple application programming interface: MESA passes a model to GYRE, which then returns a list of modes having eigenfrequencies in a given range. Example E, below, illustrates an optimization run using MESA/GYRE. Example E: The trajectory taken in the mass M vs. mixing-length parameter α plane during an asteroseismic optimization run by MESA/GYRE to determine the parameters of HD49385. The arrows show the (α,M) sequence followed by MESA’s simplex algorithm, with each node colored by the χ 2 statistic measuring the fit between observed (see [8]) and calculated frequencies of = 0,…,3 modes. This particular run is similar to the example described in Sec. 3.2 of [3]. Future Work Work is currently underway to add support for differential rotation in GYRE, using a variety of non-perturbative approaches. References [1] Moya A., et al. 2008, Ap&SS, 316, 231; [2] Metcalfe T. S., Creevey O. L., & Christensen-Dalsgaard J. 2009, ApJ, 699, 373; [3] Paxton B., et al. 2013, ApJS, in press (arXiv:1301:0319); [4] Townsend R. H. D., Teitler S. A. 2013, MNRAS, submitted; [5] Ascher U. M., Mattheij R. M. M., & Russell R. D. 1995, Numerical Solution of Boundary Value Problems for Ordinary Differential Equations. SIAM, Philadelphia; [6] Blanes S., et al. 2009, Phys. Rep., 470, 151; [7] Christensen-Dalsgaard J. 2008, Ap&SS, 316, 113; [8] Deheuvels S., et al. 2010, A&A, 515, 87 Acknowledgements The development of GYRE has been supported by NSF awards AST-0908688 and AST-0904607 and NASA award NNX12AC72G. 1.594 1.596 1.598 1.600 1.602 1.604 1.606 1.608 1.610 1.22 1.24 1.26 1.28 1.30 M (M ) 1.2 1.6 2.0 2.4 2.8 3.2 3.6 log 10 χ 2

Upload: lenhan

Post on 26-Aug-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

GYRE: A New Open-Source Stellar Oscillation CodeRich Townsend1, Seth Teitler1 & Bill Paxton2

1Department of Astronomy, University of Wisconsin-Madison2Kavli Institute for Theoretical Physics, University of California-Santa Barbara

We introduce GYRE, a new open-source stellar oscillation code which solves the adiabatic/non-adiabatic pulsation equations using a novel Magnus Multiple Shooting (MMS) numerical scheme. The code has a global error scaling of up to 6th order in the grid spacing, and can therefore achieve high accuracy with few grid points. It is moreover robust and efficiently makes use of multiple processor cores and/or nodes. We present a selection of example calculations using GYRE, before discussing recent work to integrate GYRE into the asteroseismic optimization module of the MESA stellar evolution code.

Another Oscillation Code?Interpreting the wealth of new observations provided by MOST, CoRoT and Kepler requires the theorist’s analog to the telescope: a stellar oscillation code which calculates the eigenfrequency spectrum of an arbitrary input stellar model. Comparing a calculated spectrum against a measured one provides a concrete metric for evaluating a model, and therefore constitutes the bread and butter of quantitative asteroseismology.

There’s no shortage of oscillation codes available to the community; the nine codes reviewed in [1] are likely only a fraction of those being used on a day-to-day basis. However, automated asteroseismic optimization tools such as AMP [2] and MESA [3] are placing ever-increasing demands on these codes. A code will typically be executed hundreds or thousands of times during an optimization run, and must therefore make efficient use of available computational resources such as multi-processor hardware. The code must be robust, running and producing sensible output without manual intervention. The code must have an accuracy that matches or exceeds the frequency precision now achievable by satellite missions. Finally, it is preferable that the code address the various physical processes that inevitably complicate calculations, such as non-adiabaticity, rotation, and magnetic fields. Currently, there are no publicly available oscillation codes which address all of these requirements. This motivated us to develop another code, ‘GYRE’, which is built on a novel Magnus Multiple Shooting (MMS) scheme for solving pulsation boundary value problems (BVPs). GYRE and the MMS scheme are described in detail in a forthcoming paper [4]; below we briefly summarize them, before presenting example calculations using GYRE.

The MMS SchemeThe multiple shooting component of the MMS scheme is an extension of the single- or double-shooting schemes often used to solve pulsation BVPs, which enjoys much-improved numerical stability [5]. A normalized radius grid {xk} (k  =  1,…,N) extending from the origin (x  =  0) to the stellar surface (x  =  1) divides the star into N-1 subintervals. In each subinterval an initial value problem (IVP) integrator is used to determine the fundamental solution matrix Yk+1;k relating the dependent variables y(x) on neighboring grid points: y(xk+1) = Yk+1;k y(xk). Requiring continuity of these variables from one subinterval to the next leads to a set of algebraic equations, which combined with the boundary conditions can be expressed as the linear system S  u = 0. Here, S is a large, sparse matrix which depends implicitly on the oscillation frequency ω, and u is a vector composed of the dependent variables at the grid points y(xk). Non-trivial solutions to this system exist only when the determinant of S vanishes, and so the stellar eigenfrequencies are the roots of the discriminant function D(ω)  ≡   det[S(ω)].

Example B: Dipole-mode linear eigenfrequencies of a 1.5  M☉

MESA model, plotted as a function of stellar age during evolution through the RGB bump phase. Coupling between envelope p-modes and core g-modes is revealed in the avoided crossings; the reversal in the time-evolution of the crossing frequencies, between 2.700 and 2.705 Gyr, arises from the temporary contraction of the stellar envelope during the bump phase.

Example C: The differential mode inertias dE/dx (proportional to the kinetic energy density) of two modes from Example B at an age 2.705 Gyr, plotted as a function of normalized radius x. Mode A is strongly coupled between the envelope and the core, and therefore has appreciable amplitude in both, whereas mode B is mainly confined to the core. The inset magnifies the centermost region, illustrating the very small spatial scale of the modes there (which is nevertheless well-resolved by GYRE).

100 101 102

nproc

100

101

102

Spee

dup

ncore = 1

ncore = 2

ncore = 4

ncore = 6

ncore = 8

Example D: The speedup of GYRE running in parallel, plotted as a function of the total number of processors nproc = ncore · nnode used on a multi-core, multi-node cluster. Here, nnode is the number of cluster nodes and ncore is the number of cores per node. Parallelism across nodes is implemented using MPI, and across cores using OpenMP. The performance of GYRE remains reasonably close to the ideal linear speedup case shown by the dotted line.

2.696 2.698 2.700 2.702 2.704 2.706 2.708 2.710Age (Gyr)

30

32

34

36

38

40

⌫(µ

Hz)

0.0 0.2 0.4 0.6 0.8 1.0x

10�7

10�6

10�5

10�4

10�3

10�2

10�1

100

101

102

103

104

105

dE/d

x(M

R2 )

A: (⌫, np, ng) = (36 µHz, 8, 476)

B: (⌫, np, ng) = (34 µHz, 7, 505)

0.0 0.2 0.4 0.6 0.8 1.0x ⇥ 104

100101102103

The MMS scheme combines this multiple-shooting technique with IVP integrators based on Magnus’s theorem [6]. The simplest is the Magnus GL2 integrator (‘GL’ for Gauss-Legendre), which approximates the fundamental solution matrix as Yk+1;k = exp[A(xk  +  ½Δxk) Δxk]. Here, A(x) is the Jacobian matrix of the differential equations, and Δxk = xk+1 - xk is the grid spacing. The GL2 integrator is 2nd-order accurate in Δxk; the more-sophisticated Magnus GL4 and GL6 integrators yield expressions for Yk+1;k which are 4th- and 6th-order accurate in Δxk, respectively (see Appendix B of [4]).

Introducing GYREGYRE uses the MMS scheme to calculate the adiabatic and/or non-adiabatic eigenfrequencies and eigenfunctions of an input stellar model. It is is written in standard-conforming Fortran 2008 with a modular architecture that allows straightforward extension to handle more-complicated problems. To leverage multiple processor cores and/or cluster nodes it is parallelized using a combination of OpenMP and MPI. A typical GYRE run involves the following steps: first, a stellar model is either read from file or built analytically, and calculation grids are constructed. A scan through frequency space then searches for sign changes in the discriminant D(ω), which are used as initial guesses for the discriminant roots. After these roots are found, the corresponding eigenfunctions are reconstructed.

GYRE is open for use and distribution under the GNU General Public License; our hope is that a community of practice will arise around the code, bringing together users and developers to shape the code’s future evolution in ways that best serve the field and its participants. Source code, documentation and other materials can be found at http://www.astro.wisc.edu/~townsend/gyre/.

Example Calculations using GYRE

Example A: The absolute error in the dipole p1 mode dimensionless eigenfrequency ω of then   =   0 polytrope, plotted as a function of the number of grid points N. The three curves correspond to GYRE’s Magnus GL2, GL4 and GL6 integrators, while the thick lines show the asymptotic scalings |ω   -   ωexact|   ∝   N-2, N-4 and N-6, respectively; the close correspondence between the curves and the lines confirms the asymptotic error scaling of the integrators.

101 102 103 104

N

10�1510�1410�1310�1210�1110�1010�910�810�710�610�510�410�310�210�1100

|!�

!ex

act|

/ N�2

/ N�4

/ N�6

Magnus GL2

Magnus GL4

Magnus GL6

GYRE in MESAAs of revision 5232, the MESA stellar evolution code [3] includes GYRE as one of the oscillation codes underpinning its asteroseismic optimization module (the other, currently, is the ADIPLS code [7]). Communication between MESA and GYRE is accomplished through a simple application programming interface: MESA passes a model to GYRE, which then returns a list of modes having eigenfrequencies in a given range. Example E, below, illustrates an optimization run using MESA/GYRE.

Example E: The trajectory taken in the mass M vs. mixing-length parameter α plane during an asteroseismic optimization run by MESA/GYRE to determine the parameters of HD49385. The arrows show the (α,M) sequence followed by MESA’s simplex algorithm, with each node colored by the χ2 statistic measuring the fit between observed (see [8]) and calculated frequencies of ℓ  =  0,…,3 modes. This particular run is similar to the example described in Sec. 3.2 of [3].

Future WorkWork is currently underway to add support for differential rotation in GYRE, using a variety of non-perturbative approaches.

References[1] Moya A., et al. 2008, Ap&SS, 316, 231; [2] Metcalfe T. S., Creevey O. L., & Christensen-Dalsgaard J. 2009, ApJ, 699, 373; [3] Paxton B., et al. 2013, ApJS, in press (arXiv:1301:0319); [4] Townsend R. H. D., Teitler S. A. 2013, MNRAS, submitted; [5] Ascher U. M., Mattheij R. M. M., & Russell R. D. 1995, Numerical Solution of Boundary Value Problems for Ordinary Differential Equations. SIAM, Philadelphia; [6] Blanes S., et al. 2009, Phys. Rep., 470, 151; [7] Christensen-Dalsgaard J. 2008, Ap&SS, 316, 113; [8] Deheuvels S., et al. 2010, A&A, 515, 87

AcknowledgementsThe development of GYRE has been supported by NSF awards AST-0908688 and AST-0904607 and NASA award NNX12AC72G.

1.594 1.596 1.598 1.600 1.602 1.604 1.606 1.608 1.610↵

1.22

1.24

1.26

1.28

1.30

M(M

�)

1.2

1.6

2.0

2.4

2.8

3.2

3.6

log 1

0�

2