Eulers Method to Approximate Differential Eq.

Click For Summary
SUMMARY

The forum discussion focuses on using Euler's Method to approximate the solution of the initial value problem defined by the differential equation y' = 2xy with the initial condition y(0) = 1. The estimates for y(1) are calculated using step sizes of 0.2 for 5 steps and 0.1 for 10 steps. The correct function for f(t, y) is identified as f(t, y) = 2ty, which is crucial for calculating the iterative values. The final estimates converge towards the exact solution y(x) = e^(x^2), approximately equal to 2.7182818.

PREREQUISITES
  • Understanding of Euler's Method for numerical approximation
  • Familiarity with differential equations, specifically first-order equations
  • Basic knowledge of iterative algorithms and numerical methods
  • Experience with MATLAB for implementing numerical solutions
NEXT STEPS
  • Implement Euler's Method in MATLAB for various differential equations
  • Explore the Runge-Kutta methods for improved accuracy in numerical solutions
  • Study the convergence properties of numerical methods for differential equations
  • Learn about the error analysis associated with Euler's Method
USEFUL FOR

Students and professionals in mathematics, engineering, and computer science who are working with numerical methods for solving differential equations, particularly those using Euler's Method and MATLAB for simulations.

brunie
Messages
62
Reaction score
0
(** underscores refer to subscripts)

Consider inital value problem y'=2xy, y(0) = 1
Use Eulers Methos to estimate y(1) with 5 and 10 steps.

for 5 steps, increments are by 0.2
for 10 steps, increments are by 0.1

y_n+1 = y_n + h f(t_n , y_n)

where h is step size

the answer to the DE itself is y(x) = e^(x^2)
so these estimates should be close to e or 2.7182818...

i understand how to go from steps to step but i do not understand how to get the values for f(t_n , y_n)
all the examples I've looked at only had one variable so it is hard to compare

so for

y_1 = 1 + 0.2 f(t_1 , y_1)
y_2 = y_1 + 0.2 f(t_2 , y_2)
.
.

any help is appreciated
 
Physics news on Phys.org
brunie said:
(** underscores refer to subscripts)

Consider inital value problem y'=2xy, y(0) = 1
Use Eulers Methos to estimate y(1) with 5 and 10 steps.

for 5 steps, increments are by 0.2
for 10 steps, increments are by 0.1

y_n+1 = y_n + h f(t_n , y_n)

where h is step size

the answer to the DE itself is y(x) = e^(x^2)
so these estimates should be close to e or 2.7182818...

i understand how to go from steps to step but i do not understand how to get the values for f(t_n , y_n)

One thing that may be causing trouble is that you have your algorithm in terms of "t" and "y" but your differential equation was given in terms of "x" and "y"! Either rewrite the equation as y'= 2ty or rewrite your algorithm in terms of x and y.
In any case, you are told that f(x,y)= 2xy or that f(t,y)= 2ty.

so for

y_1 = 1 + 0.2 f(t_1 , y_1)
= 1+ 0.2 (2(0)(1))= 1

y_2 = y_1 + 0.2 f(t_2 , y_2)
= 1+ 0.2(2(.2)(1))= 1.08

y_3= 1.08+ 0.2(2(.4)(1.08)= 1.08+ .1728= 1.2528

y_4= 1.2528+ 0.2(2(.6)(1.2528))= 1.5535 ...
 
If you are using MATLAB I have some code which can get you started.
 

Similar threads

Replies
10
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
Replies
2
Views
1K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
6
Views
2K
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K