I implemented a first draft of the Adams-Bashforth multistep-solver in C++. To make this method work, you need coefficients. In Wikipedia these are the bj in this formula:
y_n+1 = y_n + h * sum_over_j(bj * f(t_n-j, y_n-j))
I couldn't find any tables online that go beyond order 6 for these coefficients, so I tried calculating them myself with this Matlab script:
function bj = adamsBashforthCoefficients(order)
h = 1;
nodes = -(0:(order-1));
bj = zeros(1, order);
for j = 1:order
L = @(x) arrayfun(@(xi) prod((xi - nodes([1:j-1, j+1:end])) ./ (nodes(j) - nodes([1:j-1, j+1:end]))), x);
% bj(j) = integral(L, 0, 1) / h;
bj(j) = integral(L, 0, 1, 'AbsTol', 1e-12, 'RelTol', 1e-12) / h; % Test if tolerances were to high - they weren't
end
end
Up to order 6 this gives the same values as found online, so I assumed they are correct. However: Up to order 6 Adams-Bashforth seems to work fine, but order 7 or higher give frequent instabilities. Meaning: Some variables explode to huge values.
Can higher orders in Adams-Bashforth create instabilities where lower orders work? Should that already happen at order 7 (Matlabs ode113 goes up to order 11 or 12)? Or do I simply have the wrong coefficients?
If the coefficients are wrong, I would greatly appreciate it, if somebody could show me code how to calculate them correctly or simply point me to a table that goes to higher orders (at least 11-12). For comparison: Here is, what my script calculated for orders 6-8:
// Order 6
{ 2.970138888888889, -5.502083333333333, 6.931944444444445, -5.068055555555556, 1.997916666666667, -0.329861111111111 }
// Order 7
{ 3.285730820105820, -7.395634920634921, 11.665823412698412, -11.379894179894180, 6.731795634920635, -2.223412698412698, 0.315591931216931 }
// Order 8
{ 3.589955357142857, -9.525206679894177, 18.054538690476193, -22.027752976190477, 17.379654431216931, -8.612127976190475, 2.445163690476190, -0.304224537037037 }