+++ /dev/null
-%% Center
-
-D_x_center = diag(0.5*ones(5,1),1) - diag(0.5*ones(5,1),-1);
-D_x_center(1,1) = 1;
-D_x_center(6,6) = 1;
-interval = [0:1/5:1];
-h = 1/5;
-D_x_center
-
-f_x_1 = [1;1;1;1;1;1];
-f_x_2 = interval.';
-f_x_3 = (interval.^2).';
-
-diff1 = 1/h * D_x_center * f_x_1
-diff2 = 1/h * D_x_center * f_x_2
-diff3 = 1/h * D_x_center * f_x_3
-
-%% Forward
-
-D_x_forward = diag(ones(5,1),1) - diag(ones(6,1), 0);
-D_x_forward(6,5) = -1;
-D_x_forward(6,6) = 1;
-
-interval = [0:1/5:1];
-h = 1/5;
-
-f_x_1 = [1;1;1;1;1;1];
-f_x_2 = interval.';
-f_x_3 = (interval.^2).';
-
-diff1 = 1/h * D_x_forward * f_x_1
-diff2 = 1/h * D_x_forward * f_x_2
-diff3 = 1/h * D_x_forward * f_x_3
-
-%% Backwards
-
-D_x_back = D_x_forward;
-
-interval = [0:1/5:1];
-h = 1/5;
-
-f_x_1 = [1;1;1;1;1;1];
-f_x_2 = interval.';
-f_x_3 = (interval.^2).';
-
-diff1 = 1/h * D_x_back * f_x_1
-diff2 = 1/h * D_x_back * f_x_2
-diff3 = 1/h * D_x_back * f_x_3
-
-
-
-%% Bias
-
-bound_low = ((-3*f_x_1(1)) + (4*f_x_1(2)) - (f_x_1(3)))/(2*h)
-bound_up = ((f_x_1(4)) - (4*f_x_1(5)) + (3*f_x_1(6)))/(2*h)
\ No newline at end of file
%% EXP
+N = 100;
-D_x_center = diag(0.5*ones(5,1),1) - diag(0.5*ones(5,1),-1);
+D_x_center = diag(0.5*ones(N,1),1) - diag(0.5*ones(N,1),-1);
D_x_center(1,1) = 1;
-D_x_center(6,6) = 1;
+D_x_center(N+1,N+1) = 1;
+
+D_x_forward = diag(ones(N,1),1) - diag(ones(N+1,1), 0);
+D_x_forward(N+1,N) = -1;
+D_x_forward(N+1,N+1) = 1;
-N = 5;
interval = [0:1/N:1];
h = 1/N;
-
+f = zeros(length(interval), 1);
f_prim = zeros(length(interval), 1);
for i=1:length(interval)
+ f(i) = 4*exp(sin(4*interval(i)));
f_prim(i) = 4*exp(sin(4*interval(i)))*cos(4*interval(i));
end
+
+D_x_center
+interval
+f
+
+approx = (1/h) * D_x_center * f
f_prim
+