0
$\begingroup$

I have to solve the following ODE: $y'(t)=y(t)+t$, $y(0)=0$ with Eulers Method in two steps, where $h=0.1$. I tried the following: $y'(0)=y(0)+0=0$ and then I get $y(0.1)=y(0)+h*y'(0)=0$ but then everything will be 0. I do not get how to solve this.

$\endgroup$
  • $\begingroup$ $y=0$ is the solution for initial condition $y(0)=0$. Choose a more interesting initial condition e.g. $y(0)=1$ and try again. $\endgroup$ – xidgel Jan 23 at 18:56
  • $\begingroup$ @xidgel : No, there is a non-zero forcing term, the general solution is $y(t)=ce^t-1-t$ and $c=1$ for $y(0)=0$. $\endgroup$ – LutzL Jan 23 at 19:14
  • $\begingroup$ @LutzL Thanks for catching that. $\endgroup$ – xidgel Jan 23 at 19:16
0
$\begingroup$

In the next step you get $f(0.1, 0)=0.1$ so that you get a non-zero value for the approximation at $0.2$.


The leading error coefficient in $y_k=y(t_k)+c(t_k)h+O(h^2)$ is a solution of $$c'(t)=f_y(t,y)c-\frac12y''=c-\frac12e^t, \\~~\text{ so that }~~ (e^{-t}c)'=-\frac12\implies c(t)=-\frac12te^t $$

Plotting the actual error coefficient $\frac{y_k-y(t_k)}h$ against this first term curve for several values of $h$ gives the image

enter image description here

So that indeed the Euler points are below the exact solution, for large $h$ this can be a large error, and for $h=0.1$ the error is as large as the value of the solution.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.