Mercurial > repos > public > sbplib
changeset 916:d1c1615bd1a5 feature/timesteppers
Add comment in butcherTableau about rk4-3/8 being irreducible.
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Mon, 26 Nov 2018 16:08:54 -0800 |
parents | f5e14e5986b5 |
children | 878652b22157 |
files | +time/+rk/butcherTableau.m |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/+time/+rk/butcherTableau.m Thu Nov 15 17:29:30 2018 -0800 +++ b/+time/+rk/butcherTableau.m Mon Nov 26 16:08:54 2018 -0800 @@ -19,25 +19,26 @@ % Standard RK4 s = 4; a = zeros(s,s-1); - a(2,1) = 1/2; + a(2,1) = 1/2; a(3,1) = 0; a(3,2) = 1/2; a(4,1) = 0; a(4,2) = 0; a(4,3) = 1; b = [1/6 1/3 1/3 1/6]; c = [0, 1/2, 1/2, 1]; case "rk4-3/8" - % 3/8 RK4 (Kuttas method). Lower truncation error, more flops + % 3/8 RK4 (Kuttas method). Lower truncation error, more flops. + % Irreducible, unlike standard rk4. s = 4; a = zeros(s,s-1); - a(2,1) = 1/3; + a(2,1) = 1/3; a(3,1) = -1/3; a(3,2) = 1; a(4,1) = 1; a(4,2) = -1; a(4,3) = 1; b = [1/8 3/8 3/8 1/8]; c = [0, 1/3, 2/3, 1]; case "rk6" - % Runge-Kutta 6 from Alshina07 + % Runge-Kutta 6 from Alshina07 s = 7; a = zeros(s,s-1); - a(2,1) = 4/7; + a(2,1) = 4/7; a(3,1) = 115/112; a(3,2) = -5/16; a(4,1) = 589/630; a(4,2) = 5/18; a(4,3) = -16/45; a(5,1) = 229/1200 - 29/6000*sqrt(5); a(5,2) = 119/240 - 187/1200*sqrt(5); a(5,3) = -14/75 + 34/375*sqrt(5); a(5,4) = -3/100*sqrt(5); @@ -46,5 +47,5 @@ b = [1/12 0 0 0 5/12 5/12 1/12]; c = [0, 4/7, 5/7, 6/7, (5-sqrt(5))/10, (5+sqrt(5))/10, 1]; otherwise - error('That Runge-Kutta method is not implemented', method) + error('That Runge-Kutta method is not implemented', method) end \ No newline at end of file