Euler’s Method y'+2y=2-e^(-4t) y(0)-1

  • Context: MHB 
  • Thread starter Thread starter karush
  • Start date Start date
  • Tags Tags
    Method
Click For Summary

Discussion Overview

The discussion revolves around applying Euler's Method to solve the initial value problem (IVP) given by the ordinary differential equation (ODE) \(y' + 2y = 2 - e^{-4t}\) with the initial condition \(y(0) = 1\). Participants are exploring the method's implementation, comparing approximate values obtained through the method with exact solutions at specified time points.

Discussion Character

  • Mathematical reasoning
  • Homework-related
  • Technical explanation

Main Points Raised

  • One participant suggests using a step size of \(h = 0.1\) to find approximate values of the solution at \(t = 0.1, 0.2, 0.3, 0.4, 0.5\) and compares them to exact values.
  • Another participant emphasizes expressing the ODE in the form \(y' = f(t, y)\) and outlines the iterative recursion for Euler's Method.
  • A participant describes the approximation of the derivative using the difference quotient and calculates the first few steps of the method, providing specific numerical values at each step.
  • There is a question raised about the formulation of the derivative, with one participant suggesting an alternative expression for \(y'\) and its implications for the calculation of \(\Delta y\).
  • Several participants reiterate the need to express \(f(t, y)\) correctly and calculate the values iteratively, with one providing a specific calculation for \(y(0.1)\) and comparing it to the exact solution.

Areas of Agreement / Disagreement

Participants generally agree on the steps to implement Euler's Method, but there is some disagreement regarding the correct formulation of the derivative and its impact on the calculations. The discussion remains unresolved on the best approach to express \(y'\) and its implications for the iterative process.

Contextual Notes

Some participants have not fully clarified their assumptions regarding the formulation of the ODE and the calculations involved in Euler's Method. There are also unresolved mathematical steps in the derivation of \(f(t, y)\) and its application in the iterative process.

karush
Gold Member
MHB
Messages
3,240
Reaction score
5
Use Euler’s Method with a step size of h=0.1h=0.1
to find approximate values of the solution at tt = 0.1, 0.2, 0.3, 0.4, and 0.5.
Compare them to the exact values of the solution at these points.

Given IVP
$$y'+2y=2-{{\bf{e}}^{- 4t}}\quad yt(0)=1$$
ok from a previous post we found that the general solution was
$$y( t ) = 1 + \frac{1}{2}{{\bf{e}}^{ - 4t}} - \frac{1}{2}{{\bf{e}}^{ - 2t}}$$ Steward gives this for Euler's Method so not real sure how to follow this
https://www.physicsforums.com/attachments/8742​
Have to go to class, but will back on this when I get back.


 
Physics news on Phys.org
First, express the ODE in the form:

$$y'=f(t,y)$$

And then iterate the recursion:

$$y_{n+1}=y_n+hf\left(t_n,y_n\right)$$

where:

$$t_{n+1}=t_n+h$$

$$h=0.1,\,t_0=0,\,y_0=1$$
 
Euler's method approximates the derivative, y'= \frac{dy}{dx}, by the "difference quotient \frac{\Delta y}{\Delta x}: here \frac{\Delta y}{\Delta x}= -2y- e^{-4t} or \Delta y= (-2y- e^{-4t})\Delta x.

Start with t= 0, y= 1. Taking \Delta t= 0.1, \Delta y= (-2- e^0)(0.1)= -0.3 so the next step is t= 0+ 0.1= 0.1, y= 1- 0.3= 0.7. Now, \Delta t is still 0.1 and \Delta y= (-2(0.7)- e^{-0.4})(0.1)= (-1.4- 0.67032)(0.1)= -0.20703. The third step is t= 0.1+ 0.1= 0.2 and y= 0.7- 0.20703= 0.492968. \Delta t= 0.1 and \Delta y= (-2(0.492968)- e^{-0.8})(0.1)= -0.14353. The fourth step is t= 0.2+ 0.1= 0.3 and y= 0.492968- 0.14353= 0.0492968. Continue two more times.
 
Country Boy said:
Euler's method approximates the derivative, y'= \frac{dy}{dx}, by the "difference quotient \frac{\Delta y}{\Delta x}: here \frac{\Delta y}{\Delta x}= -2y- e^{-4t} or \Delta y= (-2y- e^{-4t})\Delta x.

wait isn't
$$\displaystyle y'=\frac{\Delta y}{\Delta x}= (2-2y- e^{-4t})$$
$$\Delta y = (2-2y- e^{-4t}) \Delta x$$
 
MarkFL said:
First, express the ODE in the form:

$$y'=f(t,y)$$

And then iterate the recursion:

$$y_{n+1}=y_n+hf\left(t_n,y_n\right)$$

where:

$$t_{n+1}=t_n+h$$

$$h=0.1,\,t_0=0,\,y_0=1$$

so $$f(t,y)=f(0,1)=2-2(0)-e^{-4(0)}=2-1=1$$
 
karush said:
so $$f(t,y)=f(0,1)=2-2(0)-e^{-4(0)}=2-1=1$$

$$y'=f(t,y)=2-e^{-4t}-2y$$

And so:

$$y_{n+1}=y_n+h\left(2-e^{-4t_n}-2y_n\right)$$

We then begin with:

$$y(0)=y_0=1$$ and $$t_0=0$$

$$y(0.1)\approx y_1=y_0+h\left(2-e^{-4t_0}-2y_0\right)=1+0.1\left(2-e^{-4\cdot0}-2\cdot1\right)=1+0.1(2-1-2)=0.9$$

For comparison:

$$y(0.1)=1+\frac{1}{2}e^{-0.4}-\frac{1}{2}e^{-0.2}\approx0.9257946$$

Now, continue iterating and comparing. :)
 

Similar threads

Replies
2
Views
2K
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 6 ·
Replies
6
Views
3K
Replies
11
Views
5K
  • · Replies 9 ·
Replies
9
Views
6K