ODE with Euler Method

58 Views Asked by At

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.

1

There are 1 best solutions below

0
On BEST ANSWER

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.