1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// ---------------------------------------------------------------------------
// DOP853 coefficients (Hairer, Norsett & Wanner, 1993)
// Dormand-Prince 8(5,3) — 12 stages
// Reference: SciPy dop853_coefficients.py (verified against Hairer's code)
// ---------------------------------------------------------------------------
// Nodes (c_i)
pub const C2: f64 = 0.526001519587677318785587544488e-01;
pub const C3: f64 = 0.789002279381515978178381316732e-01;
pub const C4: f64 = 0.118350341907227396726757197510;
pub const C5: f64 = 0.281649658092772603273242802490;
pub const C6: f64 = 0.333333333333333333333333333333;
pub const C7: f64 = 0.25;
pub const C8: f64 = 0.307692307692307692307692307692;
pub const C9: f64 = 0.651282051282051282051282051282;
pub const C10: f64 = 0.6;
pub const C11: f64 = 0.857142857142857142857142857142;
// c12 = 1.0, c13 = 1.0 (used inline)
// a-matrix coefficients (stage dependencies)
// Source: SciPy A[i,j] → our A{i+1}{j+1} (1-indexed)
pub const A21: f64 = 5.26001519587677318785587544488e-2;
pub const A31: f64 = 1.97250569845378994544595329183e-2;
pub const A32: f64 = 5.91751709536136983633785987549e-2;
pub const A41: f64 = 2.95875854768068491816892993775e-2;
pub const A43: f64 = 8.87627564304205475450678981324e-2;
pub const A51: f64 = 2.41365134159266685502369798665e-1;
pub const A53: f64 = -8.84549479328286085344864962717e-1;
pub const A54: f64 = 9.24834003261792003115737966543e-1;
pub const A61: f64 = 3.7037037037037037037037037037e-2;
pub const A64: f64 = 1.70828608729473871279604482173e-1;
pub const A65: f64 = 1.25467687566822425016691814123e-1;
pub const A71: f64 = 3.7109375e-2;
pub const A74: f64 = 1.70252211019544039314978060272e-1;
pub const A75: f64 = 6.02165389804559606850219397283e-2;
pub const A76: f64 = -1.7578125e-2;
pub const A81: f64 = 3.70920001185047927108779319836e-2;
pub const A84: f64 = 1.70383925712239993810214054705e-1;
pub const A85: f64 = 1.07262030446373284651809199168e-1;
pub const A86: f64 = -1.53194377486244017527936158236e-2;
pub const A87: f64 = 8.27378916381402288758473766002e-3;
pub const A91: f64 = 6.24110958716075717114429577812e-1;
pub const A94: f64 = -3.36089262944694129406857109825;
pub const A95: f64 = -8.68219346841726006818189891453e-1;
pub const A96: f64 = 2.75920996994467083049415600797e1;
pub const A97: f64 = 2.01540675504778934086186788979e1;
pub const A98: f64 = -4.34898841810699588477366255144e1;
pub const A101: f64 = 4.77662536438264365890433908527e-1;
pub const A104: f64 = -2.48811461997166764192642586468;
pub const A105: f64 = -5.90290826836842996371446475743e-1;
pub const A106: f64 = 2.12300514481811942347288949897e1;
pub const A107: f64 = 1.52792336328824235832596922938e1;
pub const A108: f64 = -3.32882109689848629194453265587e1;
pub const A109: f64 = -2.03312017085086261358222928593e-2;
pub const A111: f64 = -9.3714243008598732571704021658e-1;
pub const A114: f64 = 5.18637242884406370830023853209;
pub const A115: f64 = 1.09143734899672957818500254654;
pub const A116: f64 = -8.14978701074692612513997267357;
pub const A117: f64 = -1.85200656599969598641566180701e1;
pub const A118: f64 = 2.27394870993505042818970056734e1;
pub const A119: f64 = 2.49360555267965238987089396762;
pub const A1110: f64 = -3.0467644718982195003823669022;
pub const A121: f64 = 2.27331014751653820792359768449;
pub const A124: f64 = -1.05344954667372501984066689879e1;
pub const A125: f64 = -2.00087205822486249909675718444;
pub const A126: f64 = -1.79589318631187989172765950534e1;
pub const A127: f64 = 2.79488845294199600508499808837e1;
pub const A128: f64 = -2.85899827713502369474065508674;
pub const A129: f64 = -8.87285693353062954433549289258;
pub const A1210: f64 = 1.23605671757943030647266201528e1;
pub const A1211: f64 = 6.43392746015763530355970484046e-1;
// 8th-order weights (b_i) = A[12, :] (FSAL row)
pub const B1: f64 = 5.42937341165687622380535766363e-2;
pub const B6: f64 = 4.45031289275240888144113950566;
pub const B7: f64 = 1.89151789931450038304281599044;
pub const B8: f64 = -5.8012039600105847814672114227;
pub const B9: f64 = 3.1116436695781989440891606237e-1;
pub const B10: f64 = -1.52160949662516078556178806805e-1;
pub const B11: f64 = 2.01365400804030348374776537501e-1;
pub const B12: f64 = 4.47106157277725905176885569043e-2;
// Error estimation coefficients
// BHH: 3rd-order embedded method weights (applied to k1, k9, k12)
pub const BHH1: f64 = 0.244094488188976377952755905512;
pub const BHH2: f64 = 0.733846688281611857341361741547;
pub const BHH3: f64 = 0.220588235294117647058823529412e-1;
// ER: 5th-order error coefficients (direct, not relative to b)
pub const ER1: f64 = 0.1312004499419488073250102996e-1;
pub const ER6: f64 = -0.1225156446376204440720569753e1;
pub const ER7: f64 = -0.4957589496572501915214079952;
pub const ER8: f64 = 0.1664377182454986536961530415e1;
pub const ER9: f64 = -0.3503288487499736816886487290;
pub const ER10: f64 = 0.3341791187130174790297318841;
pub const ER11: f64 = 0.8192320648511571246570742613e-1;
pub const ER12: f64 = -0.2235530786388629525884427845e-1;
// Step-size controller constants
pub const SAFETY: f64 = 0.9;
pub const MIN_FACTOR: f64 = 1.0 / 6.0;
pub const MAX_FACTOR: f64 = 6.0;
// Exponent for 8th-order method: 1/(q+1) = 1/8
pub const ORDER_EXP: f64 = 1.0 / 8.0;