AM_corrector

mth-order Adams-Moulton corrector.

Back to IVP Solver Toolbox Contents.

Contents

Syntax

eqn = AM_corrector(m)
AM_corrector(m,'print')

Description

eqn = AM_corrector(m) returns a string storing the mth-order Adams-Moulton corrector.

AM_corrector(m,'print') prints the mth-order Adams-Moulton predictor to the Command Window.

Input/Output Parameters

Variable Symbol Description Format
Input m order of Adams-Moulton corrector 1×1
double
print - (OPTIONAL) specify as 'print' if you want to print the coefficients to the command window char
Output eqn - mth-order Adams-Moulton corrector 1×1
string

Example #1: Return a string.

Return the string storing the 3rd-order Adams-Moulton corrector.

AM3_eqn = AM_corrector(3);

Example #2: 1st-order Adams-Moulton corrector.

AM_corrector(1,'print');
1st-order Adams-Moulton corrector:
y(n+1) = y(n) + h(f(n+1))


Example #3: 2nd-order Adams-Moulton corrector.

AM_corrector(2,'print');
2nd-order Adams-Moulton corrector:
y(n+1) = y(n) + (h/2)(f(n+1) + f(n))


Example #4: 3rd-order Adams-Moulton corrector.

AM_corrector(3,'print');
3rd-order Adams-Moulton corrector:
y(n+1) = y(n) + (h/12)(5f(n+1) + 8f(n) - f(n-1))


Example #5: 4th-order Adams-Moulton corrector.

AM_corrector(4,'print');
4th-order Adams-Moulton corrector:
y(n+1) = y(n) + (h/24)(9f(n+1) + 19f(n) - 5f(n-1) + f(n-2))


Example #6: 5th-order Adams-Moulton corrector.

AM_corrector(5,'print');
5th-order Adams-Moulton corrector:
y(n+1) = y(n) + (h/720)(251f(n+1) + 646f(n) - 264f(n-1) + 106f(n-2) - 19f(n-3))


Example #7: 6th-order Adams-Moulton corrector.

AM_corrector(6,'print');
6th-order Adams-Moulton corrector:
y(n+1) = y(n) + (h/1440)(475f(n+1) + 1427f(n) - 798f(n-1) + 482f(n-2) - 173f(n-3) + 27f(n-4))


Example #8: 7th-order Adams-Moulton corrector.

AM_corrector(7,'print');
7th-order Adams-Moulton corrector:
y(n+1) = y(n) + (h/60480)(19087f(n+1) + 65112f(n) - 46461f(n-1) + 37504f(n-2) - 20211f(n-3) + 6312f(n-4) - 863f(n-5))


Example #9: 8th-order Adams-Moulton corrector.

AM_corrector(8,'print');
8th-order Adams-Moulton corrector:
y(n+1) = y(n) + (h/120960)(36799f(n+1) + 139849f(n) - 121797f(n-1) + 123133f(n-2) - 88547f(n-3) + 41499f(n-4) - 11351f(n-5) + 1375f(n-6))


See also

AB_coefficients | AM_coefficients | AB_corrector | ABM_equations