How do I calculate an approximation of the solution of the begining values at the point t = 1 with Euler method?

151 Views Asked by At

I have already posted question where I was asking about sketching Euler method.

The explicit Euler method for numerically solving the begining values of differential equation $x′=f(t,x),x(t_0)=x_0$ on the interval $I = [t_0, T]$ is given by

$x_{k+1}=x_k+hf(t_k,x_k),k=0,…,N−1$ with $h = (T - t_0) / N, N ∈ N. $

$X_k$ is an approximation of the exact solution $x(t)$ of the begining values at time $t_k: = t_0 + kh, k = 0, ..., N.$ By linear interpolation between the points $(t_k, x_k)$ and $(t_{k + 1}, x_{k + 1}), k = 0, ..., N -1,$ we obtain a approximation solution $x_h(t)$.

I need to calculate an approximation of the solution of the begining values at the point $t = 1$

$x'=-t/x, x(0)=1$

I need to use h = 0.5. Specify $x_h (1)$ and calculate the error, that is difference $x_h (1) -x (1)$, where $x (1)$ is the value of the exact solution.

I really don't know how to start. How can I calulate $x$ or $x_h$ at all?

1

There are 1 best solutions below

7
On BEST ANSWER

You find $x$ by solving the differential equation. It has separeted variables, and the solutiion is easily found to be $x(t)=\sqrt{1-t^2}$. Then $x(1)=0$.

To apply Euler's method we have $t_0=0$, $T=1$, $x_0=1$, $h=0.5$ and hence $N=2$. Then $$ x_{k+1}=x_k-h\,\frac{k\,h}{x_k}. $$ Find $x_1$ and then $x_2$.