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

Math10
Messages
301
Reaction score
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
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}
$$
 
Do I nee to solve for y(1)? Because it says x=0, 0.1, 0.2, 0.3, ..., 1.0.
 
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.
 
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]
 
So the answer starts with y1 to y10, right?
 
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
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.
 
Back
Top