% OCW Universidad de Cantabria
% Cálculo Simbólico y Numérico en Ecuaciones Diferenciales
% © Cursos 2001-2014,  M. Eugenia Pérez, UC
%
syms  x y t
f= heaviside(y+1)*(y+1)-heaviside(y)*(y+1)+ heaviside(y)*(-y+1)- heaviside(y-1)*(-y+1)
% en versiones previas de Matlab utilizar sym
% f=sym('Heaviside(y+1)'*(y+1))-sym('Heaviside(y)'*(y+1))+sym('Heaviside(y)'*(-y+1))-sym('Heaviside(y-1)'*(-y+1));
figure(1)
ezplot(f,-10,10)
axis([-10,10,0,2])
pause
u=(1/sqrt(4*pi*t))*int(f*exp(-(x-y)^2/(4*t)),y,-1,1);
'solucion F. Poisson ='
pretty(u)
figure(2)
u1=subs(u,t,0.1);
ezplot(u1,-10,10)
axis([-10,10,0,2])
pause
hold on
u1=subs(u,t,0.2);
ezplot(u1,-10,10)
axis([-10,10,0,2])
pause
u1=subs(u,t,0.5);
ezplot(u1,-10,10)
axis([-10,10,0,2])
pause
u1=subs(u,t,0.8);
ezplot(u1,-10,10)
axis([-10,10,0,2])
pause
u1=subs(u,t,1);
ezplot(u1,-10,10)
axis([-10,10,0,2])
hold off
pause
figure(3)
ezsurf(u,[0.01,10],[-10,10])
 
 
 
  
