2
$\begingroup$

I have equation: \begin{align*} \frac{\mathrm{d}y}{\mathrm{d}t} = -0.04\sqrt{y} \end{align*}

How would I find the expression for Euler's method? I know the general expression is:

$$y_n=y_{n-1}+h\cdot F(t_{n-1},y_{n-1})$$

but I am confused with what to use as x and y and how I could convert $-0.04\sqrt{y}$ into that form.

Edit: increments of $1$ second, $y(0) = 3$.

$\endgroup$
  • $\begingroup$ What is the initial condition ? $\endgroup$ – gimusi Oct 17 '18 at 20:07
  • $\begingroup$ In your case the general formula is $$y_n=y_{n-1}+h\cdot F(t_{n-1},y_{n-1})$$ $\endgroup$ – gimusi Oct 17 '18 at 20:17
  • 2
    $\begingroup$ You do not need to convert anything, you just have to read off $F(t,y)=-0.04\sqrt{y}$. $\endgroup$ – LutzL Oct 17 '18 at 20:46
  • $\begingroup$ Try to obtain a solution according to the given method. If something is not clear do not hesitate to ask for further details. $\endgroup$ – gimusi Oct 17 '18 at 20:56
0
$\begingroup$

Let's consider the initial condition

$$y(0)=y_0.$$

Then

$$y'(0)=F(0,y_0)=-0.04 \sqrt{y_0}.$$

Then assuming a time step $\Delta t=h$ we can estimate

$$y(h)\approx y_1= y(0)+y'(0)\cdot \Delta t=y_0+y'_0\cdot h \implies F(h,y_1)=-0.04 \sqrt{y_1}.$$

Then

$$y(2h)\approx y_2=y_1+h\cdot F(h,y_0) \implies F(2h,y_2)=-0.04 \sqrt{y_2}$$

and so on.

Refer also to

$\endgroup$
  • $\begingroup$ what does y′0 represent? $\endgroup$ – Jytrex Oct 18 '18 at 3:07
  • $\begingroup$ @Jytrex $y'(0)$ is the dy/dt at $t=0$, that is $F(0,y_0)$ according to the general expression. $\endgroup$ – gimusi Oct 18 '18 at 6:14
  • $\begingroup$ @Jytrex I've changed the notation accordingly. $\endgroup$ – gimusi Oct 18 '18 at 6:18
  • $\begingroup$ I am still a little confused on how I would find dy/dt at each time. For example when doing y1, I dont have any other points to do dy/dt $\endgroup$ – Jytrex Oct 19 '18 at 4:25
  • $\begingroup$ Let start from the first step. We know y(0)=3 then we can evaluate the derivative at $t=0$ that is $dy/dt=F(0,3)=-0.04\sqrt 3$. The idea is to estimate $y(h)$ by $y_1=y_0+h\cdot F(0,3)$. Once we have $y_1$ we can evaluate $F(h,y_1)$ and proceed step by step. $\endgroup$ – gimusi Oct 19 '18 at 6:21

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.