function prikladyMKP1d()

% diskretizace (0,1)
l = 1; h = 0.1; uzly = 0:h:l; n = round(l/h)+1; prvky = [1:n-1;2:n]; m = n-1;

a = 0.5;

% Priklad 1: -u''=10 v (0,1), u(0) = 1, 1*u'(1) = 2
k1 = 1; k2 = 1; F = 10; u0 = 1; tau = 2;
xx = 0:0.01:l; [uu,auu] = analytickeReseni1d(k1,k2,a,l,F,u0,tau,xx); auu
k = ones(1,m); f = F*ones(1,m);
[A,b] = mkp1d(uzly,prvky,k,f,u0,tau);
uH = A\b; u = [u0;uH]; plot(uzly',u,'b',xx,uu,'r')
hold on
pause

% Priklad 2: -[k(x)*u'(x)]' = 10, u(0) = 1, k(1)*u'(1) = 2
%            k(x) := 1 na (0,1/2), k(x) := 4 na (1/2,1)
k1 = 1; k2 = 4; F = 10; u0 = 1; tau = 2;
xx = 0:0.01:l; uu = analytickeReseni1d(k1,k2,a,l,F,u0,tau,xx);
k(6:end) = k2;
[A,b] = mkp1d(uzly,prvky,k,f,u0,tau);
uH = A\b; u = [u0;uH]; plot(uzly',u,'b',xx,uu,'r')
pause

% Priklad 3: -[k(x)*u'(x)]' = 10, u(0) = 1, k(1)*u'(1) = 0
%            k(x) := 1 na (0,1/2), k(x) := 4 na (1/2,1)
tau = 0;
xx = 0:0.01:l; uu = analytickeReseni1d(k1,k2,a,l,F,u0,tau,xx);
[A,b] = mkp1d(uzly,prvky,k,f,u0,tau);
uH = A\b; u = [u0;uH]; plot(uzly',u,'b',xx,uu,'r')
pause

% Priklad 3 na hrubsi diskretizaci
h = 0.25; uzly = 0:h:l; n = round(l/h)+1; prvky = [1:n-1;2:n]; m = n-1;
k = [1,1,4,4]; f = [10,10,10,10]; u0 = 1; tau = 0;
[A,b] = mkp1d(uzly,prvky,k,f,u0,tau);
uH = A\b; u = [u0;uH]; plot(uzly',u,'g')
