function ShowStiff(y0)
% Look at y'(t) = -100*y(t) + 100*t + 101 y(0) = y0
% Solution curves: y(t) = 1 + t + c*exp(-100t)
% Exact: y(t) = 1 + t + (y0-1)*exp(-100t)

% Interesting choices for y0: 1+10^(-d), d = 1:8

% Four steps of Euler with h = .1
yc = y0;
tc = 0;
h = .1;
for k=1:4
yc = yc + h*f(tc,yc)
tc = tc+h;
end
clc
fprintf(sprintf('At t = .4\n Euler = %10.5f \n Exact = %10.5f\n',yc,1+tc+(y0-1)*exp(-100*tc)))

function yp = f(t,y)
yp = -100*y + 100*t + 101;