nyx_space/propagators/rk_methods/verner.rs
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
/*
Nyx, blazing fast astrodynamics
Copyright (C) 2018-onwards Christopher Rabotin <christopher.rabotin@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use super::RK;
/// `Verner56` is an RK Verner integrator of order 5-6.
///
/// Coefficients taken from [here (PDF)](http://people.math.sfu.ca/~jverner/classify.1992.ps).
pub(crate) struct Verner56 {}
impl RK for Verner56 {
const ORDER: u8 = 6;
const STAGES: usize = 8;
const A_COEFFS: &'static [f64] = &[
1.0 / 6.0,
4.0 / 75.0,
16.0 / 75.0,
5.0 / 6.0,
-8.0 / 3.0,
5.0 / 2.0,
-165.0 / 64.0,
55.0 / 6.0,
-425.0 / 64.0,
85.0 / 96.0,
-8_263.0 / 15_000.0,
124.0 / 75.0,
-643.0 / 680.0,
-81.0 / 250.0,
2_484.0 / 10_625.0,
3_501.0 / 1_720.0,
-300.0 / 43.0,
297_275.0 / 52_632.0,
-319.0 / 2_322.0,
24_068.0 / 84_065.0,
3_850.0 / 26_703.0,
12.0 / 5.0,
-8.0,
4_015.0 / 612.0,
-11.0 / 36.0,
88.0 / 255.0,
0.0,
0.0,
];
const B_COEFFS: &'static [f64] = &[
3.0 / 40.0,
0.0,
875.0 / 2_244.0,
23.0 / 72.0,
264.0 / 1_955.0,
125.0 / 11_592.0,
43.0 / 616.0,
0.0,
13.0 / 160.0,
0.0,
2_375.0 / 5_984.0,
5.0 / 16.0,
12.0 / 85.0,
0.0,
0.0,
3.0 / 44.0,
];
}