function u = InitialCondition(X,problem)

if problem == 1
[npt o]=size(X);
u0 = ones(npt,1);
for i=1:npt
    
    if X(i)>=0.64 && X(i)<=0.84
        u0(i)=1-(X(i)-0.64)/(0.2);
    elseif X(i)>0.84
        u0(i)=0;
    end
    
end
u=u0;
elseif problem == 2
    nx = 30; ny = 30; 
    ax = 7;  ay = 7; 
    bx = 1/sqrt(2); by = 0; 
    aux = exp(-ax*(X+1-bx).^nx).*exp(-ay*(1-X-by).^ny) ; 
    k = 10*pi; 
    u = aux.*sin(k*X); 
elseif problem == 3
    nx = 30; ny = 30; 
    ax = 7;  ay = 7; 
    bx = 1/sqrt(2); by = 0; 
    aux = exp(-ax*(X+1-bx).^nx).*exp(-ay*(1-X-by).^ny) ; 
    k = 20*pi; 
    u = aux.*sin(k*X);     
elseif problem == 4
    x0 = 0.2; 
    ind = find(X <=x0); 
    u = zeros(size(X)); 
    u(ind) = 1; 
end