clear all

xi=linspace(-5,5,201);

rho=exp(-xi.^2);
v=exp(-rho);
f=rho.*v;
%c(rho)
c=(1-rho).*exp(-rho);


figure(100)
plot(xi,rho,'r',xi,c,'b','linewidth',2)
xlabel('$\xi$','Interpreter','Latex')
ylabel('$\rho$, $c(\rho)$','Interpreter','Latex')
set(gca,'Fontsize',24)
grid on
drawnow

xlim([-10 10])

t=0.1;
dt=0.01;
for it=1:500
    t=(it-1)*dt;
x=xi+t*c;
figure(101)
plot(x,rho,'r',xi,rho,'--b','linewidth',2)
xlabel('$x$','Interpreter','Latex')
ylabel('$\rho(x,t)$','Interpreter','Latex')
title(['$t =$',num2str(t)],'Interpreter','latex')
set(gca,'Fontsize',24)
grid on
drawnow
%pause(0.2)
end






