Use Euler's method with h=0.1 to find approximate values?

In summary: I prefer the table format since it's easier to read and understand. But it's nice to have the option to use either one.
  • #1
Math10
301
0

Homework Statement


Use Euler's method with h=0.1 to find approximate values of the solution of the initial-value problem y'+3y=7e^(4x), y(0)=2 at x=0, 0.1, 0.2, 0.3, ..., 1.0.

Homework Equations


f(x, y)=7e^(4x)-3y
x0=0, y0=2

The Attempt at a Solution


y(0.1)=y1=y0+f(0, 2)(0.1)=2+(0,1)f(0, 2)=2.1
y(0.2)=y2=y1+f(0.1, 2.1)(0.1)=2.1+(0.1)f(0.1, 2.1)=2.51428
And so on...
But am I doing it right? If not, then please correct me.
 
Physics news on Phys.org
  • #2
Looks good so far.

You could use a table format like this to show the rest of your results:

$$
\begin{array}{|c|c|c|c|c|c|c|}
\hline
\text{Step }n & y_n & x_n & f(x_n,y_n) & h & \Delta y & y_{n+1} \\
\hline
0 & 2 & 0 & 1 & 0.1 & 0.1 & 2.1 \\
\hline
1 & 2.1 & 0.1 & 4.1428 & 0.1 & 0.41428 & 2.51428 \\
\hline
2 & 2.51428 & 0.2 & ?? & 0.1 & ? & ?? \\
\hline
3 & ?? & 0.3 & ?? & 0.1 & ? & ?? \\
\hline
4 & ?? & 0.4 & ?? & 0.1 & ? & ?? \\
\hline
5 & ?? & 0.5 & ?? & 0.1 & ? & ?? \\
\hline
6 & ?? & 0.6 & ?? & 0.1 & ? & ?? \\
\hline
7 & ?? & 0.7 & ?? & 0.1 & ? & ?? \\
\hline
8 & ?? & 0.8 & ?? & 0.1 & ? & ?? \\
\hline
9 & ?? & 0.9 & ?? & 0.1 & ? & ?? \\
\hline
\end{array}
$$
 
  • #3
Do I nee to solve for y(1)? Because it says x=0, 0.1, 0.2, 0.3, ..., 1.0.
 
  • #4
Math10 said:
Do I nee to solve for y(1)? Because it says x=0, 0.1, 0.2, 0.3, ..., 1.0.
Yes. I don't know why you would think you don't need to.

y(1) means the y value when x = 1.0.
 
  • #5
Joffan said:
Looks good so far.

You could use a table format like this to show the rest of your results:

$$
\begin{array}{|c|c|c|c|c|c|c|}
\hline
\text{Step }n & y_n & x_n & f(x_n,y_n) & h & \Delta y & y_{n+1} \\
\hline
0 & 2 & 0 & 1 & 0.1 & 0.1 & 2.1 \\
\hline
1 & 2.1 & 0.1 & 4.1428 & 0.1 & 0.41428 & 2.51428 \\
\hline
2 & 2.51428 & 0.2 & ?? & 0.1 & ? & ?? \\
\hline
3 & ?? & 0.3 & ?? & 0.1 & ? & ?? \\
\hline
4 & ?? & 0.4 & ?? & 0.1 & ? & ?? \\
\hline
5 & ?? & 0.5 & ?? & 0.1 & ? & ?? \\
\hline
6 & ?? & 0.6 & ?? & 0.1 & ? & ?? \\
\hline
7 & ?? & 0.7 & ?? & 0.1 & ? & ?? \\
\hline
8 & ?? & 0.8 & ?? & 0.1 & ? & ?? \\
\hline
9 & ?? & 0.9 & ?? & 0.1 & ? & ?? \\
\hline
\end{array}
$$
PF now supports various table bbcode tags, an alternative to using LaTeX. Here are the header row and two rows of the first three columns of the table above.
Step (n)ynxn
[TD1]0[/TD1][TD1]2[/TD1] [TD1]0[/TD1] [TD1]1[/TD1][TD1]2.1[/TD1] [TD1]0.1[/TD1]
 
  • #6
So the answer starts with y1 to y10, right?
 
  • #7
Math10 said:
So the answer starts with y1 to y10, right?
Those are the numbers requested. Note that in the table I gave you, y10 is in the bottom right corner - this is our Euler-method estimate of y(1.0)
Mark44 said:
PF now supports various table bbcode tags, an alternative to using LaTeX. Here are the header row and two rows of the first three columns of the table above.
Step (n)ynxn
[TD1]0[/TD1][TD1]2[/TD1] [TD1]0[/TD1] [TD1]1[/TD1][TD1]2.1[/TD1] [TD1]0.1[/TD1]

Thanks... not sure which I prefer really, but the compact output is good.
 
Last edited:
  • Like
Likes Math10
  • #8
Joffan said:
Thanks... not sure which I prefer really, but the compact output is good.
I don't which I like better either. It's pretty much six of one, half a dozen of the other.
 
  • #9

1. What is Euler's method?

Euler's method is a numerical technique used to approximate the solution to a first-order ordinary differential equation (ODE). It involves breaking down the continuous ODE into smaller, discrete steps and using the derivative at each step to calculate the next point.

2. How do you use Euler's method with h=0.1?

To use Euler's method with a step size of h=0.1, you would first need to know the initial condition and the derivative at that point. Then, you would use the following formula to find the approximate value at the next point:
yn+1 = yn + h * f(xn,yn)
where h is the step size, xn and yn are the coordinates of the previous point, and f(xn,yn) is the derivative at that point.

3. Why is Euler's method used?

Euler's method is used because it provides a simple and efficient way to approximate the solution to an ODE. It is also versatile and can be applied to a wide range of problems, making it a useful tool in many scientific fields.

4. What are the benefits and limitations of using Euler's method?

The benefits of using Euler's method include its simplicity and versatility, as well as its ability to provide a quick approximation of the solution to an ODE. However, it also has limitations, such as its tendency to accumulate error over multiple steps and its inability to accurately handle complex or nonlinear equations.

5. How accurate are the approximate values obtained using Euler's method with h=0.1?

The accuracy of the approximate values obtained using Euler's method with h=0.1 depends on the complexity of the ODE and the number of steps taken. Generally, the smaller the step size, the more accurate the approximate values will be. However, even with a small step size, Euler's method may not provide highly accurate results for complex or nonlinear equations.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
3K
  • Calculus and Beyond Homework Help
Replies
12
Views
2K
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
Replies
7
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
9K
  • Differential Equations
Replies
9
Views
2K
  • Differential Equations
Replies
11
Views
3K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
Back
Top