function priklad1_1d()

% -2*u''(x) = 10 v (0,1/2)
% -5*u''(x) = 10 v (1/2,1)
% u(0) = -1
% 5*u'(1) = 2
% podm. prechodu

m = 8;
n = m+1; h = 1/m;

f = 10*ones(1,m);
k = 2*ones(1,m); k((m/2+1):end) = 5;
tau = 2;

% diskretizace
x = linspace(0,1,n);
E = [1:(n-1);2:n];

% okr. podm.
Dirichlet = [1]; uD = [-1];
Neumann = [n]; tau = 2;

% MKP
Ae = @(ke,xe) (ke/(xe(2)-xe(1))*[1,-1;-1,1]);
be = @(fe,xe) (fe*(xe(2)-xe(1))/2*[1;1]);
[A,b] = MKP(x,E,{Ae},{k},{be},{f},Dirichlet,uD,Neumann,tau);

% reseni
u = A\b;
plot(x,[uD,u'])

