diff --git a/compas_matlab_utils/BSEDetailedOutput.m b/compas_matlab_utils/BSEDetailedOutput.m index ae57fb826..6619fae32 100644 --- a/compas_matlab_utils/BSEDetailedOutput.m +++ b/compas_matlab_utils/BSEDetailedOutput.m @@ -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') diff --git a/compas_matlab_utils/CosmicHistoryIntegrator.m b/compas_matlab_utils/CosmicHistoryIntegrator.m index 6d261a440..dea7bf473 100644 --- a/compas_matlab_utils/CosmicHistoryIntegrator.m +++ b/compas_matlab_utils/CosmicHistoryIntegrator.m @@ -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; diff --git a/src/EAGB.cpp b/src/EAGB.cpp index 6dce1b885..0339da687 100755 --- a/src/EAGB.cpp +++ b/src/EAGB.cpp @@ -1080,7 +1080,7 @@ bool EAGB::ShouldSkipPhase() const { #define timescales(x) m_Timescales[static_cast(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(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(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 @@ -1121,7 +1121,7 @@ bool EAGB::IsSupernova() const { #define timescales(x) m_Timescales[static_cast(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(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(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 diff --git a/src/GiantBranch.cpp b/src/GiantBranch.cpp index b3c2aad64..e7d977892 100644 --- a/src/GiantBranch.cpp +++ b/src/GiantBranch.cpp @@ -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) @@ -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); diff --git a/src/HeHG.cpp b/src/HeHG.cpp index de8158d13..a40176bed 100755 --- a/src/HeHG.cpp +++ b/src/HeHG.cpp @@ -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(GBP::McBAGB)])) >= 0); // Go supernova if CO core mass large enough } /* diff --git a/src/changelog.h b/src/changelog.h index cd1be87af..2e128267f 100644 --- a/src/changelog.h +++ b/src/changelog.h @@ -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 @@ -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__