function testBVP

N = 10 ;
[ A, b, X1, Y1 ] = bvp( N, @ff, ye(0), ye(1) ) ;
N = N*2 ;
[ A, b, X2, Y2 ] = bvp( N, @ff, ye(0), ye(1) ) ;
N = N*2 ;
[ A, b, X3, Y3 ] = bvp( N, @ff, ye(0), ye(1) ) ;
N = N*2 ;
[ A, b, X4, Y4 ] = bvp( N, @ff, ye(0), ye(1) ) ;
N = N*2 ;
[ A, b, X5, Y5 ] = bvp( N, @ff, ye(0), ye(1) ) ;

EX1 = ye(X1) ;
EX2 = ye(X2) ;
EX3 = ye(X3) ;
EX4 = ye(X4) ;
EX5 = ye(X5) ;

E1 = norm( Y1 - EX1, inf ) ;
E2 = norm( Y2 - EX2, inf ) ;
E3 = norm( Y3 - EX3, inf ) ;
E4 = norm( Y4 - EX4, inf ) ;
E5 = norm( Y5 - EX5, inf ) ;

disp( sprintf( 'E1 = %g', E1 ) ) ; 
disp( sprintf( 'E2 = %g', E2 ) ) ; 
disp( sprintf( 'E3 = %g', E3 ) ) ; 
disp( sprintf( 'E4 = %g', E4 ) ) ; 
disp( sprintf( 'E5 = %g', E5 ) ) ; 

disp( sprintf( 'order = %g', log( E1/E2 ) / log( 2 ) ) ) ;
disp( sprintf( 'order = %g', log( E2/E3 ) / log( 2 ) ) ) ;
disp( sprintf( 'order = %g', log( E3/E4 ) / log( 2 ) ) ) ;
disp( sprintf( 'order = %g', log( E4/E5 ) / log( 2 ) ) ) ;

end

function res = ff(x)
  res = 100*sin(10*x) ;
end

function res = ye(x)
  res = -sin(10*x) ;
end

