close all;
clear all;

size = 10000;
x = linspace(0,4,size);
soln = 3/4*ones(1,size);

for n=1:400
   an = 1/(n*pi)*(1 - cos(n*pi/2))+2/(n*pi)*(cos(n*pi/2)-cos(n*pi)); 
   bn = -1/(n*pi)*sin(n*pi/2);
   soln = soln + an*sin(n*pi*x/2) + bn*cos(n*pi*x/2);
end
plot(x,soln);
grid on;
