if 1 == 1   % ex 1
    dx=1;
    F=10;
    E=1;

    A=[1 0 0 0 0; 1 -2 1 0 0; 0 1 -2 1 0; ...
    0 0 1 -2 1; 0 0 0 -1 1];
    D = [ 0 0 0 0 dx*F/E];
    U = dx^2*inv(A)*D'
    plot(U)
    xlabel('y')
    ylabel('u')
end




if 1 == 0      % ex 2
    dx=1;
    F=-10;
    E=1;

    A=[1 -1 0 0 0; 1 -2 1 0 0; 0 1 -2 1 0; ...
    0 0 1 -2 1; 0 0 0 0 1];
    D = [dx*F/E 0 0 0 0 ];
    U = dx^2*inv(A)*D'
    figure(1)
    plot(U)
    xlabel('y')
    ylabel('D')
end

if 1 == 0      % ex 3
    dx=1;
    F=-10;
    E=1;

     A=[1 -1 0 0 0; 1 -2 1 0 0; 0 1 -2 1 0; ...
    0 0 1 -2 1; 0 0 0 0 1];
    D = [ 0  0 10 0   0 ];
    U = dx^2*inv(A)*D'
    figure(1)
    plot(U)
    xlabel('y')
    ylabel('D')
    (U(5)-U(4))/dx
    
    (U(2)-U(1))/dx
end

 

 

    
    




