Skip to content

Commit 8578b92

Browse files
committed
Defect repairs
1 parent 4941c41 commit 8578b92

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/BaseStar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,8 @@ void BaseStar::CalculateAnCoefficients(DBL_VECTOR &p_AnCoefficients,
578578
RConstants(C_BETA_R) = (a[69] * 16384.0) / (a[70] + PPOW(16.0, a[71])); // Hurley et al. 2000, eq 22a
579579
RConstants(B_DELTA_R) = (a[38] + a[39] * 8.0 * M_SQRT2) / (a[40] * 8.0 + PPOW(2.0, a[41])) - 1.0; // Hurley et al. 2000, eq 17
580580

581-
GammaConstants(B_GAMMA) = a[76] + (a[77] * PPOW((1.0 - a[78]), a[79])); // Hurley et al. 2000, eq 23
582-
GammaConstants(C_GAMMA) = (utils::Compare(a[75], 1.0) == 0) ? GammaConstants(B_GAMMA) : a[80]; // Hurley et al. 2000, eq 23
581+
GammaConstants(B_GAMMA) = max(0.0, a[76] + (a[77] * PPOW((1.0 - a[78]), a[79]))); // Hurley et al. 2000, eq 23
582+
GammaConstants(C_GAMMA) = (utils::Compare(a[75], 1.0) <= 0) ? GammaConstants(B_GAMMA) : a[80]; // Hurley et al. 2000, eq 23
583583

584584
#undef GammaConstants
585585
#undef RConstants

src/changelog.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,9 @@
16591659
// - Corrected calculations for Hurley A(n) and B(n) coefficients (see Hurley et al. 2000, appendix)
16601660
// - Changed utils::GetGSLVersion() to avoid compiler warning "warning: ignoring attributes on template argument ‘int (*)(FILE*)’ [-Wignored-attributes]"
16611661
// - Reverted Makefile line "SOURCES := $(wildcard *.cpp)" to listing actual source files
1662+
// 03.25.02 JR - August 20, 2025 - Defect repairs:
1663+
// - Corrected calculations for Hurley Gamma constant C (C_GAMMA - see Hurley et al. 2000, just after eq 23, should use a(75) <= 1.0, not a(75) == 1.0 - confirmed in BSE Fortran source)
1664+
// - Clamped B_GAMMA to [0.0, B_GAMMA] (per discussion just after eq 23 - confirmed in BSE Fortran source)
16621665
//
16631666
// Version string format is MM.mm.rr, where
16641667
//
@@ -1669,7 +1672,7 @@
16691672
// if MM is incremented, set mm and rr to 00, even if defect repairs and minor enhancements were also made
16701673
// if mm is incremented, set rr to 00, even if defect repairs were also made
16711674

1672-
const std::string VERSION_STRING = "03.25.01";
1675+
const std::string VERSION_STRING = "03.25.02";
16731676

16741677

16751678
# endif // __changelog_h__

0 commit comments

Comments
 (0)