comparison +time/+rk/butcherTableau.m @ 1011:e0560bc4fb7d feature/advectionRV

Add todo:s for time stepping with RV
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 15 Nov 2018 13:49:11 -0800
parents c6fcee3fcf1b
children
comparison
equal deleted inserted replaced
1010:f753bada1a46 1011:e0560bc4fb7d
1 function [s,a,b,c] = butcherTableau(order) 1 function [s,a,b,c] = butcherTableau(order)
2 2 % TODO: Change order from a double to string.
3 switch order 3 switch order
4 4
5 case 3 5 case 3
6 % TVD (Total Variational Diminishing) 6 % TVD (Total Variational Diminishing)
7 s = 3; 7 s = 3;
17 a(2,1) = 1/2; 17 a(2,1) = 1/2;
18 a(3,1) = 0; a(3,2) = 1/2; 18 a(3,1) = 0; a(3,2) = 1/2;
19 a(4,1) = 0; a(4,2) = 0; a(4,3) = 1; 19 a(4,1) = 0; a(4,2) = 0; a(4,3) = 1;
20 b = [1/6 1/3 1/3 1/6]; 20 b = [1/6 1/3 1/3 1/6];
21 c = [0, 1/2, 1/2, 1]; 21 c = [0, 1/2, 1/2, 1];
22 % case 4-3/8
23 % % 3/8 RK4 (Kuttas method). Lower truncation error, more flops
24 % s = 4;
25 % a = zeros(s,s-1);
26 % a(2,1) = 1/3;
27 % a(3,1) = -1/3; a(3,2) = 1;
28 % a(4,1) = 1; a(4,2) = -1; a(4,3) = 1;
29 % b = [1/8 3/8 3/8 1/8];
30 % c = [0, 1/3, 2/3, 1];
22 case 6 31 case 6
23 % Runge-Kutta 6 from Alshina07 32 % Runge-Kutta 6 from Alshina07
24 s = 7; 33 s = 7;
25 a = zeros(s,s-1); 34 a = zeros(s,s-1);
26 a(2,1) = 4/7; 35 a(2,1) = 4/7;