0
$\begingroup$

Use the Euler Method to write down an iterative algorithm so that $y_{n+1} = y(t_{n+1})$ can be determined from $y_n=y(t_n)$, where $t_n=n \triangle t$ is the size of the time step, for the following Ordinary Differential Equation $\frac{dy}{dt}=y^2+\sin(t)$

I'm confused about this question because the question's I'm been doing upto this one is that I am given an initial $(x_0 , y_0)$ and then I draw up a table to find a $y$ value for a corresponding $x$ value.. so this question is very confusing as I have never came across a question such as this one.

2 Answers 2

1

Euler's method for the differential equation $y' = f(t,y)$ and step size $\Delta t$ gives:

$$\frac{y_{n+1} - y_{n}}{\Delta t} = f(t_n,y_n)$$

Where $t_n = n\Delta t$. This question is basically asking you to solve for $y_{n+1}$ in this specific case. So you get:

$$y_{n+1} = y_n + \Delta t(y_n^2 + \sin(n\Delta t))$$

1

The way I was taught this:

$$\frac{\Delta y}{\Delta t}\approx\frac{dy}{dt}=y^2+\sin(t)$$

$$y_{n+1}-y_n=\Delta y\approx\Delta t(y_n^2+\sin(t_n))$$

$$y_{n+1}\approx y_n+\Delta t(y_n^2+\sin(n\Delta t))$$

This allows you to take a given initial coordinate $(t_0,y_0)$ and $\Delta t$ and quickly run through points by an iterative algorithm in your calculator.