
%  driver_fdbvp_2nd

%  -u'' + u = f, u(0)=u(1)=0 
%
%  u(x) = exp(sin(pi*x))-1 
%  f(x) = pi^2(sin(pi*x)-cos(pi*x).^2).*exp(sin(pi*x))+exp(sin(pi*x))-1 

N = 8192;
a = 0;  b= 1; alpha = 0;  beta = 0; 

sigma = '1';
f = '(pi^2)*(sin(pi*x)-cos(pi*x)^2)*exp(sin(pi*x))+exp(sin(pi*x))-1';

[xh,vh,stime] = fdbvp_2nd(N,a,b,alpha,beta,sigma,f);

disp(' ')
disp(['solve time :',num2str(stime)])
disp(' ')

x=0:0.01:1;  u=exp(sin(pi*x))-1;
err = norm(exp(sin(pi*xh))-1-vh,'inf')
figure(1)
plot(x,u,xh,vh,'o')
title([' N = ',num2str(N),'   error = ',num2str(err)]);



