%% t = 0.4

[a, b, c] = euler_implicit(@(t, y) 3*exp(-201*t) - 5*exp(-t), 201, -2, 0, 1, 0.05);
% [a, b, c] = euler_explicit(@(x, y) -0.5*x^4 + 4*x^3 - 10*x^2 + 8.5*x + 1, @(x, y) -2*x^3 + 12*x^2 - 20*x + 8.5, 1, 0, 4, 0.5);

disp(['The Explicit Euler estimation at ', num2str(10)]);
disp(['is: ', num2str(a)]);
disp(['The actual value is ', num2str(b)]);
disp(['The relative percent of error is ', num2str(c)]);

%%

[a, b] = eu_explicit(@(x, y) 3*exp(-201*x) - 5*exp(-x), @(x, y) -201*y - 1000*exp(-x), -2, 0, 1, 0.0001);

% disp(['The Explicit Euler estimation at ', num2str(10)]);
% disp(['is: ', num2str(a)]);
% disp(['The actual value is ', num2str(b)]);
% disp(['The relative percent of error is ', num2str(c)]);

a
b

%%

[a, b] = eu_implicit(@(x, y) 3*exp(-201*x) - 5*exp(-x), 201, -2, 0, 1, 0.290);

a
b