Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compas_matlab_utils/BSEDetailedOutput.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ function BSEDetailedOutput(file)
' ', num2str(mass2(i)), ' ', num2str(type2(i))]);
end;

figure(1), plot(time, mass1, 'LineWidth', 3), set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Total mass 1, M_o')
figure(1), plot(time, mass1, time, massHe1, time, massCO1, 'LineWidth', 3), set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Mass 1, M_o'), legend('Total', 'He', 'CO')
%figure(2), scatter(time, radius1, 30, type1, 'filled'), set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Radius 1, R_o')
figure(2), plot(time, radius2, 'b', time, RL2, 'r'); set(gca,'FontSize',20), xlabel('Time, Myr'), ylabel('Radius, R_o'), legend('R_2', 'RL_2')
2 changes: 1 addition & 1 deletion compas_matlab_utils/CosmicHistoryIntegrator.m
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
dPdlogZ=dPdlogZ./(sum(dPdlogZ,1)*dlogZ); %normalise
for(i=1:length(Zvec))
index=find(exp(logZvec)>=Zvec(i), 1, 'first');
Zweight(:,i)=dPdlogZ(index,:)./PdrawZ; %weight is desired over sampled probabiluty
Zweight(:,i)=dPdlogZ(index,:)./PdrawZ; %weight is desired over sampled probability
end;
else %relevant for single-metallicity runs -- just give all binaries the same unit weight
Zvec=minZ;
Expand Down
4 changes: 2 additions & 2 deletions src/EAGB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ bool EAGB::ShouldSkipPhase() const {
#define timescales(x) m_Timescales[static_cast<int>(TIMESCALE::x)] // for convenience and readability - undefined at end of function

double McCOBAGB = CalculateCOCoreMassOnPhase(timescales(tHeI) + timescales(tHe));
double McSN = std::max(CalculateCoreMassAtSupernova_Static(MCH, m_GBParams[static_cast<int>(GBP::McBAGB)]), 1.05 * McCOBAGB); // hack from Hurley fortran code (not in the paper), protects in case core mass is already above threshold at base of AGB, but should no longer be needed following D adjustment
double McSN = std::max(CalculateCoreMassAtSupernova_Static(MCH, m_GBParams[static_cast<int>(GBP::McBAGB)]), 1.05 * McCOBAGB); // hack from Hurley fortran code (not in the paper), protects in case core mass is already above threshold at base of AGB

return (utils::Compare(McSN, m_COCoreMass) < 0); // skip phase if core is heavy enough to go supernova

Expand Down Expand Up @@ -1121,7 +1121,7 @@ bool EAGB::IsSupernova() const {
#define timescales(x) m_Timescales[static_cast<int>(TIMESCALE::x)] // for convenience and readability - undefined at end of function

double McCOBAGB = CalculateCOCoreMassOnPhase(timescales(tHeI) + timescales(tHe));
double McSN = std::max(CalculateCoreMassAtSupernova_Static(MCH, m_GBParams[static_cast<int>(GBP::McBAGB)]), 1.05 * McCOBAGB); // hack from Hurley fortran code, doesn't seem to be in the paper JR: do we know why? **Ilya**
double McSN = std::max(CalculateCoreMassAtSupernova_Static(MCH, m_GBParams[static_cast<int>(GBP::McBAGB)]), 1.05 * McCOBAGB); // hack from Hurley fortran code (not in the paper), protects in case core mass is already above threshold at base of AGB

return (utils::Compare(McSN, m_COCoreMass) <= 0); // core is heavy enough to go Supernova

Expand Down
7 changes: 2 additions & 5 deletions src/GiantBranch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ double GiantBranch::CalculateCoreMass_Luminosity_B_Static(const double p_Mass) {
/*
* Calculate the Core mass - Luminosity relation parameter D
*
* Hurley et al. 2000, eqs 31 - 38, adjusted to vary smoothly with mass
* and prevent AGB stars from having excessively high core masses at the base of the AGB (immediate supernovae)
* Hurley et al. 2000, eqs 31 - 38
*
*
* double CalculateCoreMass_Luminosity_D_Static(const double p_Mass, const double p_LogMetallicityXi, DBL_VECTOR &p_MassCutoffs)
Expand All @@ -118,9 +117,7 @@ double GiantBranch::CalculateCoreMass_Luminosity_D_Static(const double p_Mass, c
if (utils::Compare(p_Mass, massCutoffs(MHeF)) > 0) {
if (utils::Compare(p_Mass, 2.5) >= 0) {
double D2 = (0.5 * D0) - (0.06 * p_Mass);
D1 = D1 > -2.0 ? D1 + 2.0 : 0.0;
D2 = D2 > -2.0 ? D2 + 2.0 : 0.0;
logD = PPOW(PPOW(D1,(100.0/p_Mass)) + PPOW(D2,(100.0/p_Mass)) + 1.0, p_Mass/100.0) - 2.0;
logD = std::max(std::max(-1.0, D1), D2);
}
else { // Linear interpolation between end points
double gradient = (D0 - D1) / (massCutoffs(MHeF) - 2.5);
Expand Down
1 change: 0 additions & 1 deletion src/HeHG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ bool HeHG::IsSupernova() const {
utils::Compare(snMass, OPTIONS->MCBUR1()) >= 0 && utils::Compare(m_COCoreMass, m_Mass) < 0;

return (isCCSN || isECSN);
//return (utils::Compare(m_COCoreMass, CalculateCoreMassAtSupernova_Static(MECS, m_GBParams[static_cast<int>(GBP::McBAGB)])) >= 0); // Go supernova if CO core mass large enough
}

/*
Expand Down
4 changes: 3 additions & 1 deletion src/changelog.h
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,8 @@
// 03.33.01 IM - Nov 25, 2026 - Defect repairs:
// - Fixed a bug in the mass transfer code (introduced in 03.30.00) that could lead to accretors gaining mass during mass transfer (see issue #1512)
// - Corrected the treatment of He star SNe to match Hurley+ 2000 and be consistent with other SN treatments (see issue #1511)
// 03.33.02 IM - Dec 03, 2026 - Defect repair:
// - Revert D change in the Mc-L fit to Hurley prescription


// Version string format is MM.mm.rr, where
Expand All @@ -1746,7 +1748,7 @@
// if MM is incremented, set mm and rr to 00, even if defect repairs and minor enhancements were also made
// if mm is incremented, set rr to 00, even if defect repairs were also made

const std::string VERSION_STRING = "03.33.01";
const std::string VERSION_STRING = "03.33.02";


# endif // __changelog_h__