distribution/ivanov.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "terraingen/distribution/ivanov.h" | ||
| 2 | |||
| 3 | #include <cmath> | ||
| 4 | #include <stdexcept> | ||
| 5 | |||
| 6 | namespace terraingen { | ||
| 7 | |||
| 8 | namespace { | ||
| 9 | |||
| 10 | 1095 | void CheckAge(double ageGyr) { | |
| 11 | 1095 | if (!(ageGyr >= 0.0 && ageGyr <= kMaxMarsAgeGyr)) { | |
| 12 | 3 | throw std::domain_error("Martian surface age must be between 0 and 4.6 Gyr"); | |
| 13 | } | ||
| 14 | 1092 | } | |
| 15 | |||
| 16 | } // namespace | ||
| 17 | |||
| 18 | 1090 | double IvanovMarsChronology(double ageGyr) { | |
| 19 | 1090 | CheckAge(ageGyr); | |
| 20 | 1088 | return (2.68e-14 * std::expm1(6.93 * ageGyr) + 4.13e-4 * ageGyr) / 1e6; | |
| 21 | } | ||
| 22 | |||
| 23 | 5 | double IvanovMarsChronologyRate(double ageGyr) { | |
| 24 | 5 | CheckAge(ageGyr); | |
| 25 | 4 | return (2.68e-14 * 6.93 * std::exp(6.93 * ageGyr) + 4.13e-4) / 1e6; | |
| 26 | } | ||
| 27 | |||
| 28 | 22 | LogPolynomialSfd IvanovMarsProductionFunction() { | |
| 29 | return LogPolynomialSfd({-3.383677, -3.197453, 1.256814, 7.915374e-1, -4.860814e-1, | ||
| 30 | -3.630098e-1, 1.015683e-1, 6.755923e-2, -1.180639e-2, -4.753462e-3, | ||
| 31 | 6.232845e-4, 5.805492e-5}, | ||
| 32 | 66 | DiameterRange{15.0, 362000.0}, SfdKind::ProductionRate, 1000.0, 1e6); | |
| 33 | } | ||
| 34 | |||
| 35 | } // namespace terraingen | ||
| 36 |