Find the local truncation error (LTE) of $y'=e^{t-y}$ using Euler's Method, knowing that $y(0)=1$, $t=[0,1]$, $h=0.25$
I know the local truncation error (LTE) introduced by the Euler method is given by the difference between the numerical solution by the exact solution, in other words $e_{i}=|y_{i}-y_{t_{i}}|$, but I do not know exactly how to manipulate the values. I would like to have this exercise as an example for me to understand the steps better.
I have got to the values of $y_{i}$: $(0,1);(0.25,1.0920); (0.5,1.1997);(0.75,1.3239); (1,1.4647)$
If $y(t)=\phi(t;t_o,y_o)$ is the flow function, where varying the first argument gives the solution $y$ for the IVP with $y(t_o)=y_o$, then the local truncation error along the numerical solution is $$ \tau_i=\frac{|y_{i+1}-\phi(t_{i+1};t_i,y_i)|}{h}=\left|\frac{\phi(t_i+h;t_i,y_i)-y_i}{h}-f(t_i,y_i)\right| $$ As the equation is separable, one can directly integrate $$ e^y-e^t=e^{y_o}-e^{t_o}\implies \phi(t;t_o,y_o)=\ln(e^{y_o}+e^t-e^{t_o}) $$ This makes a direct computation of the truncation errors easily possible.