KMDWARFPARAM


This program estimates the physical parameters of a star with mass M < 0.8 M_sun given one or more observational constraints. It makes use of the empirical relations from Hartman et al. 2014, arXiv:1408.1758. It is written in C.

The program is available without any warranty - use it at your own risk. If you do find a bug, please let me know so that I can fix it (jhartman AT astro DOT princeton DOT edu).

Citation: If you use this program, please cite Hartman et al. 2014, arXiv:1408.1758.

The Source Code (Newest version: Sep 10, 2014)

To install, right-click on the above link and save the file as kmdwarfparam.c. Open a terminal and go to the directory where you saved the file. Compile the code using the command: "gcc -o kmdwarfparam kmdwarfparam.c -lm". Change the C compiler as needed (e.g., on some systems it is cc rather than gcc). Type "./kmdwarfparam --help" for syntax and help on how to run the code.

Note, this code runs a Markov-Chain Monte Carlo procedure to estimate the parameter values and their uncertainties. Although the code has a built-in automated convergence test for terminating the chain, it is always a good idea to output and inspect the chain (using the --outchain option) to confirm that the chain has converged. If the chain still shows large correlated variations, use the --ntest option to force the chain to grow longer before applying the convergence test.


Example 1. Find the parameters for a star with measured apparent magnitudes V = 15.160 +- 0.024, J = 12.046 +- 0.024, H = 11.397 +- 0.023 and K = 11.224 +- 0.023, and measured stellar density ρ = 4.34 +- 0.13 g/cm^3. Allow for extinction, with a maximum optical extinction of AV = 0.175 mag. The MCMC chain is output to the file chain.txt. The call to the unix program "head" is used simply to show the format of the chain file. The call to gnuplot at the end is one way to inspect the chain, otherwise use your preferred plotting tool. Inspection of these plots shows that the chain appears to have converged.
$ ./kmdwarfparam -V 15.160:0.024 -J 12.046:0.024 -H 11.397:0.023 \
        -K 11.224:0.023 --rho 4.34:0.13 --useAV 0.175 --outchain chain.txt

#Parameters Determined From Empirical Model
#Parameter:   MedianValue  +-   1_sigma_Error
log10(rho):    0.638 +- 0.013
rho[cgs]: 4.35 +- 0.13
dlR: -0.0033 +- 0.0061
dMbol: 0.04 +- 0.14
log10(Mass): -0.242 +- 0.018
Mass[Msun]: 0.572 +- 0.024
log10(Radius): -0.2436 +- 0.0085
Radius[Rsun]: 0.571 +- 0.011
log10(Teff[K]): 3.5694 +- 0.0087
Teff[K]: 3710 +- 74
Mbol: 7.75 +- 0.11
absVmag: 9.27 +- 0.11
absJmag:  6.219 +- 0.093
absHmag:   5.582 +- 0.093
absKmag:    5.411 +- 0.091
Vmag: 15.159 +- 0.024
Jmag:  12.046 +- 0.024
Hmag:   11.399 +- 0.022
Kmag:	 11.222 +- 0.022
dist_modulus[mag]:  5.801 +- 0.091
distance[pc]: 144.6 +- 6.1
parallax[mas]: 6.92 +- 0.29
Angular_Diameter[mas]:  0.0367 +- 0.0012
V-J: 3.113 +- 0.034
V-H:  3.760 +- 0.033
V-K:   3.937 +- 0.033
J-H:    0.646 +- 0.032
J-K:	 0.824 +- 0.031
H-K:	  0.178 +- 0.031
AV[mag]:   0.094 +- 0.050

$ head -3 chain.txt

#logrho dlR dMbol log(M)  log(R)  log(Teff) Mbol BCV  BCJ  BCH  BCK  \
absVmag absJmag absHmag absKmag AV   distmod -2lnL
#[1]    [2] [3]   [4]     [5]     [6]       [7]  [8]  [9]  [10] [11] \
[12]    [13]    [14]    [15]    [16] [17]    [18]
0.64685163933482237 -0.011213455893407966 -0.041500021772412181 -0.2709083351544625 -0.25602779149642829 3.5649084637379049 \
7.8580543201030926 1.4790271464515852 -1.505244312943917 -2.1389679378350488 -2.3401824942619642 9.3370814665546771 6.3528100071591753 \
5.7190863822680438 5.5178718258411283 0.16177002390664141 5.6618771877401066 16.167199453560183

$ gnuplot
gnuplot > plot "chain.txt" u 1
gnuplot > plot "chain.txt" u 2
gnuplot > plot "chain.txt" u 3
gnuplot > plot "chain.txt" u 18

Example 2. Estimate the physical parameters of Barnard's star. Assume the following observational constraints: parallax π = 548.31 +- 1.51 mas, V = 9.511 +- 0.010 mag, J = 5.244 +- 0.020 mag, H = 4.83 +- 0.03 mag, K = 4.524 +- 0.020, angular diameter θ_LD = 1.004 +- 0.04 mas.
$ ./kmdwarfparam --plx 548.31:1.51 -V 9.511:0.010 -J 5.244:0.020 \
        -H 4.83:0.030 -K 4.524:0.020 --angdiam 1.004:0.04

#Parameters Determined From Empirical Model
#Parameter:   MedianValue  +-   1_sigma_Error
log10(rho):    1.543 +- 0.033
rho[cgs]: 34.9 +- 2.7
dlR: 0.0019 +- 0.0084
dMbol: -0.04 +- 0.12
log10(Mass):  -0.786 +- 0.021
Mass[Msun]: 0.1635 +- 0.0079
log10(Radius): -0.727 +- 0.014
Radius[Rsun]: 0.1877 +- 0.0061
log10(Teff[K]): 3.5099 +- 0.0094
Teff[K]: 3235 +- 69
Mbol: 10.763 +- 0.068
absVmag: 13.206 +- 0.012
absJmag:  8.939 +- 0.021
absHmag:   8.513 +- 0.030
absKmag:    8.215 +- 0.021
Vmag: 9.5113 +- 0.0099
Jmag:  5.244 +- 0.020
Hmag:   4.818 +- 0.029
Kmag:	 4.520 +- 0.020
dist_modulus[mag]: -3.6946 +- 0.0059
distance[pc]: 1.8242 +- 0.0050
parallax[mas]: 548.2 +- 1.5
Angular_Diameter[mas]: 0.957 +- 0.031
V-J: 4.267 +- 0.022
V-H:  4.693 +- 0.031
V-K:   4.991 +- 0.023
J-H:    0.426 +- 0.035
J-K:	 0.724 +- 0.028
H-K:	  0.298 +- 0.035


Support:

This material is based upon work supported by the National Science Foundation under Grant Number AST-1108686.

Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.


History:

September 10, 2014: Added maximum memory limit to restrict the total size of the chain that can be stored in memory. Put back cutoff on the total number of links that can be run in the chain. Added initial DHSX before running DEMC to hopefully improve convergence. Included hard limits on density that can be used. Revised some of the procedures for guess initial logrho, dlR and dMbol parameters based on the input observations.

August 28, 2014: Added Gelman and Rubin convergence criterion test to determine when to stop the MCMC.

August 8, 2014: Initial version.