Welcome to our community

Be a part of something great, join today!

[SOLVED] 2.7.15 Euler's Method

karush

Well-known member
Jan 31, 2012
2,886
Consider the IVP
$$y'=\frac{3t^2}{3y^2-4}, \quad y(1)=0$$
find estimates for t =0.1; 0.2; 0.4
using step sizes of h = 0.1; 0.05; and 0.025
using Euler's Method

ok ran out of time to do more steps but asume separation of variables is next
 

skeeter

Well-known member
MHB Math Helper
Mar 1, 2012
854
Consider the IVP
$$y'=\frac{3t^2}{3y^2-4}, \quad y(1)=0$$
find estimates for t =0.1; 0.2; 0.4
using step sizes of h = 0.1; 0.05; and 0.025
using Euler's Method

ok ran out of time to do more steps but asume separation of variables is next
You are given the initial condition y(1)= 0. I'll show you one of these so maybe you can get on the right track.

To estimate y(0.4) with a step size of h = 0.1, you will need to make iterative estimates for y(0.9), y(0.8), y(0.7), y(0.6), and y(0.5) to ultimately reach an estimate for y(0.4). Also note the steps will be in a decreasing direction, i.e. $h = \Delta t = -0.1$, because you're moving from t = 1 to t = 0.4.

$y(0.9) \approx y(1) + y'(1) \cdot (\Delta t) = 0 + \dfrac{3(1^2)}{3(0^2)-4} \cdot (-0.1) = 0.075$

$y(0.8) \approx y(0.9) + y'(0.9) \cdot (\Delta t) = 0.075 + \dfrac{3(0.9^2)}{3(0.075^2)-4} \cdot (-0.1) = 0.1360073749$

... note the values get messy, so an iterative numerical program will make this process much easier. I have such a program in my old TI-83 ...

$y(0.7) \approx y(0.8) + y'(0.8) \cdot (\Delta t) = 0.1846826718$

$y(0.6) \approx y(0.7) + y'(0.7) \cdot (\Delta t) = 0.2223974446$

$y(0.5) \approx y(0.6) + y'(0.6) \cdot (\Delta t) = 0.2504376076$

$y(0.4) \approx y(0.5) + y'(0.5) \cdot (\Delta t) = 0.2701131293$



To check the estimate, solving the DE by separation of variables yields the equation $y^3-4y = t^3-1$

Using this equation, $t = 0.4 \implies y \approx 0.2373424609$. The estimate of y(0.4) using Euler differs by about 0.03. Use of a smaller $\Delta t$ will yield a closer estimate.
 

karush

Well-known member
Jan 31, 2012
2,886
ok not real sure how you got $y$

oh wait $y(1)=0$

how did you get this?
$y^3-4y = t^3-1$
 
Last edited:

skeeter

Well-known member
MHB Math Helper
Mar 1, 2012
854
ok not real sure how you got $y$

oh wait $y(1)=0$

how did you get this?
$y^3-4y = t^3-1$
$\dfrac{dy}{dt} = \dfrac{3t^2}{3y^2-4}$

as I stated in my response, separate variables ...

$(3y^2-4) \, dy = 3t^2 \, dt$

integrate ...

$y^3 - 4y = t^3 + C$

$y(1) = 0 \implies C = -1$
 

karush

Well-known member
Jan 31, 2012
2,886
let me see if i did first step correct on the next one given:
$\quad y'=2y-1 \quad y(0)=1\\
h=0.1,\quad 0.05,\quad 0.025,\quad 0.01 \\
t=0.5 \quad 1, \quad 1.5, \quad 2.5$
$$y(0.5)\approx y(1) + 2(0.5) \cdot (0.1) =0+1(0.1)=0.1$$




xket.png
 
Last edited:

skeeter

Well-known member
MHB Math Helper
Mar 1, 2012
854
let me see if i did first step correct on the next one given:
$\quad y'=2y-1 \quad y(0)=1\\
h=0.1,\quad 0.05,\quad 0.025,\quad 0.01 \\
t=0.5 \quad 1, \quad 1.5, \quad 2.5$
$$y(0.5)\approx y(1) + 2(0.5) \cdot (0.1) =0+1(0.1)=0.1$$
I have no idea what you are doing ... can you post the problem as written instead of your interpretation?
 

karush

Well-known member
Jan 31, 2012
2,886
View attachment 8724
#2

$\quad y'=2y-1 \quad y(0)=1$
then
$y(0.5)\approx y(1) + 2(0.5) \cdot (0.1) =0+1(0.1)=0.1$


book answers are {just did the first one)

$h=0.1\quad 0.05,\quad 0.025,\quad 0.01 \\
t=0.5 \quad 1, \quad 1.5, \quad 2.5$
 
Last edited:

skeeter

Well-known member
MHB Math Helper
Mar 1, 2012
854
the image helps a lot ...

#2 $y' = 2y-1$ , $y(0) = 1$

(a) $y(0.1) \approx y(0) + y'(0) \cdot h$

$y(0.1) \approx 1 + (1) \cdot (0.1) = 1.1$


$y(0.2) \approx y(0.1) + y'(0.1) \cdot h$

$y(0.2) \approx 1.1 + (1.2) \cdot (0.1) = 1.22$


$y(0.3) \approx y(0.2) + y'(0.2) \cdot h$

$y(0.3) \approx 1.22 + (1.44) \cdot (0.1) = 1.364$


$y(0.4) \approx y(0.3) + y'(0.3) \cdot h$

$y(0.4) \approx 1.364 + (1.728) \cdot (0.1) = 1.5368$


now ... you try part (b) which reduces the step size to half that of part (a).
Note that will require twice the number of iterations
 

karush

Well-known member
Jan 31, 2012
2,886
OK well for (b) we have $h=0.05$ so

$\displaystyle\int 2y-1 \, dy = y^2-y+c$
$y(0)=0^2-0+c=1$
$c=1$
so
$y()=y^2-y+1$

\begin{align}
(a)\quad y(0.05)& \approx y(0) + y'(0) \cdot (0.05)\\
&\approx 1+1(0.05) = 1.05\\
(b)\quad y(0.2)&\approx y(1.05)+y'(0) \cdot (0.05)\\

\end{align}
 
Last edited:

skeeter

Well-known member
MHB Math Helper
Mar 1, 2012
854
OK well for (b) we have $h=0.05$ so

$\displaystyle\int 2y-1 \, dy = y^2-y+c$
$y(0)=0^2-0+c=1$
$c=1$
so
$y()=y^2-y+1$

\begin{align}
(a)\quad y(0.05)& \approx y(0) + y'(0) \cdot (0.05)\\
&\approx 1+1(0.05) = 1.05\\
(b)\quad y(0.2)&\approx y(1.05)+y'(0) \cdot (0.05)\\

\end{align}
why are you solving the DE? (incorrectly, I might add) ... the solution to $y'=2y-1$ with initial condition $y(0) = 1$ is $y = \dfrac{e^{2t}+1}{2}$

I don't think you understand the purpose of Euler's method. Recommend you have a look see at this linked video ...

 

karush

Well-known member
Jan 31, 2012
2,886
sorry i'm mostly deaf can't really hear these vids very good better in text

ok well you didn't show the general solution in your example
 

skeeter

Well-known member
MHB Math Helper
Mar 1, 2012
854
sorry i'm mostly deaf can't really hear these vids very good better in text

ok well you didn't show the general solution in your example
Are you not able to activate the closed-captioning in the video?

$\dfrac{dy}{dt} = 2y-1$

$\dfrac{dy}{2y-1} = dt$

$\dfrac{2}{2y-1} \,dy = 2 \, dt$

$\ln|2y-1| = 2t+C$

$2y-1 = e^{2t+C}$

$y = \dfrac{e^{2t+C} + 1}{2}$