%TEMPLE5044_RK_ORDER_CONDITIONS_EXAMPLE
%   Applies the program
%   TEMPLE5044_RK_ORDER_CONDITIONS
%   to three examples:
%   Crank-Nicolson, RK4, and Gauss-Legendre (two-stage).
%
% (C) 2019/02/06 by Benjamin Seibold
%                   http://www.math.temple.edu/~seibold/

fprintf('Crank-Nicolson:\n')
A = [0,0;1/2,1/2];
b = [1/2,1/2];
temple5044_rk_order_conditions(A,b)

fprintf('RK4:\n')
A = [0,0,0,0;.5 0 0 0;0 .5 0 0;0 0 1 0];
b = [1;2;2;1]/6;
temple5044_rk_order_conditions(A,b)

fprintf('Gauss-Legendre (two-stage):\n')
s = sqrt(3)/6;
A = [1/4,1/4-s;1/4+s,1/4];
b = [1/2;1/2];
temple5044_rk_order_conditions(A,b)
