function [x,y] = ese3kernel(m,timesteps,method)
% du/ dt = d^2u/dt^2+2/exp(t)*sin(x), 0<x<pi/2
% u(0,x) = sin(x)
% u(t,0) = 0
% du/dx (t,pi/2) = 0
a = 0;
b = pi/2;
x = linspace(a,b,m)';
h = (b-a) / (m-1);
A = toeplitz(sparse([1,1],[1,2],[-2,1]/h^2,1,m));
A(1,1:2) = [0,0];
A(m,m-1:m) = [2/h^2,-2/h^2];
t0 = 0;
tstar = 1-t0;
k = tstar/timesteps;
E = expm(k*A);
P = phi1m(k*A);
t = 0;
y0 = sin(x);
y = y0;
for n = 1:timesteps
  g = 2*exp(t+(method-1)*k/2)*sin(x);
  g(1) = 0;
  y = E*y+k*P*g;
  t = t+k;
end
