Solving the Initial Value Problem with Euler's Method

In summary: DIn summary, the problem involves using Euler's method to approximate values of the solution at different points, and then comparing the results for two different step sizes. The results are reasonably close for some points, but quite different for others due to the fact that the slope of the tangent line to the solution is parallel to the y-axis at certain points. This leads to a significant difference in the calculated values and shows the limitations of numerical methods.
  • #1
DivGradCurl
372
0
Consider the initial value problem

[tex]y^{\prime} = \frac{3t^2}{3y^2 - 4} \mbox{,} \qquad y(1) = 0\mbox{.}[/tex]

(a) Use Euler's method with [tex]h=0.1[/tex] to obtain approximate values of the solution at [tex]t=1.2\mbox{, }1.4\mbox{, }1.6\mbox{, and } 1.8[/tex].

(b) Repeat part (a) with [tex]h=0.05[/tex].

(c) Compare the results of parts (a) and (b). Note that they are reasonably close for [tex]t=1.2\mbox{, }1.4\mbox{, and }1.6[/tex], but are quite different for [tex]t=1.8[/tex]. Also note (from the differential equation) that the line tangent to the solution is parallel to the y-axis when [tex]y=\pm 2/\sqrt{3}\approx \pm 1.155[/tex]. Explain how this might cause such a difference in the calculated values.

My work: (PARTS A & B ARE OK)

(a)

Approximate values of the solution, which were found using the Euler method, follow below:

[tex]\begin{equation*}\begin{array}{|c|r|} \hline \multicolumn{1}{|c|}{t} & \multicolumn{1}{c|}{h=0.1} \\ \hline 1.2 & -0.166134 \\ 1.4 & -0.410872 \\ 1.6 & -0.804660 \\ 1.8 & 4.15867 \\ \hline \end{array} \end{equation*}[/tex]

(b)

Approximate values of the solution, which were found using the Euler method, follow below:

[tex]\begin{equation*} \begin{array}{|c|r|r|} \hline \multicolumn{1}{|c|}{t} & \multicolumn{1}{c|}{h=0.1} & \multicolumn{1}{c|}{h=0.05} \\ \hline 1.2 & -0.166134 & -0.174652 \\ 1.4 & -0.410872 & -0.434238 \\ 1.6 & -0.804660 & -0.889140 \\ 1.8 & 4.15867 & -3.09810 \\ \hline \end{array} \end{equation*}[/tex]

(c)

I've plotted the direction field with the solution. You can find it at: http://myplot.cjb.net

The graph shows that the line tangent to the solution is parallel to the y-axis when [tex]y=\pm 2/\sqrt{3}\approx \pm 1.155[/tex]. That's when the denominator of the fraction in the given differential equation equals zero.

My approximate solution (found with the aid of mathematica's NDSolve) is valid for [tex]t\leq 1.5978094538975247[/tex]. So, it seems to me that the values found should not be even taken into consideration from that point on. However, if I were to consider values beyond [tex]t = 1.5978094538975247[/tex], I'd say that the significant difference in step size may lead each particular approximation to tangent lines with completely different slopes, which ultimately gives those values. I'm not sure. :confused:

Any help is highly appreciated.
 
Physics news on Phys.org
  • #2
Thiago, Mathematica's nice huh? You know when you solve it directly, you get an implicit function of y in terms of t. Try this code in Mathematica to see what it looks like and note the problem beyond the vertical slope:

Code:
<<Graphics`ImplicitPlot`

ImplicitPlot[y^3-4y== t^3-1,{t,-3,3}]
You should get the plot below.
 

Attachments

  • implicit plot1.JPG
    implicit plot1.JPG
    6.5 KB · Views: 496
  • #3
You bet, saltydog! Mathematica is great. Well, thanks for the code. I didn't know how to do that. I've got the same plot here, but then I joined that with the direction field. You can view it at: http://myplot.cjb.net

Anyway, here's what I think I should have for part (c):

In part (a), the closest value to [tex]y=-2/\sqrt{3}[/tex] is [tex]y\left( 1.7 \right)[/tex], which has a large positive slope (check out the graph). As a result, it follows (Euler method) that [tex]y\left( 1.8 \right)[/tex] is positive and reasonably close to the true value ([tex]\approx 2.445[/tex]).

In part (b), the closest value to [tex]y=-2/\sqrt{3}[/tex] is [tex]y\left( 1.65 \right)[/tex], which has a large negative slope (check out the graph). As a result, it follows (Euler method) that [tex]y\left( 1.7 \right)[/tex] is negative.

Is that it? Thanks again. :smile:
 
  • #4
thiago_j said:
As a result, it follows (Euler method) that [tex]y\left( 1.8 \right)[/tex] is positive and reasonably close to the true value ([tex]\approx 2.445[/tex]).

Took some time for me to analyze it too Thiago. You're probably done but this is my take:

I found it a tough problem to analyze but very interesting and illustrates how numerical methods are sometimes limited. I agree with your analysis except for one thing: your assumption above connecting the behavior to the "true value". I don't think they're related in any way. It just so happens that y(1.7)=-1.178, was below the critical line [itex]-2/\sqrt{3}[/itex] with slope (53.366) and so just happen to push the next value up to the point (1.8, 4.159).

Think I might spend a little more time on it in Mathematica.
 
  • #5
You're right about that. "Reasonably close" doesn't exactly fit the description of the difference between those numbers. But, other than that, the solution of part (c) seems to be alright. Thank you
 
Last edited:

1. What is Euler's Method and how does it work?

Euler's Method is a numerical method used to approximate solutions to initial value problems in calculus. It works by using small steps to approximate the derivative at each point, and then using this derivative to estimate the next point on the curve.

2. How is Euler's Method used to solve initial value problems?

Euler's Method is used by breaking down the initial value problem into smaller steps, and then using the derivative at each step to estimate the next point on the curve. By repeating this process, we can approximate a solution to the entire problem.

3. What are the advantages of using Euler's Method?

Euler's Method is relatively easy to understand and implement, making it a useful tool for solving initial value problems. It is also computationally efficient compared to other numerical methods.

4. What are the limitations of using Euler's Method?

One limitation of Euler's Method is that it can give inaccurate solutions if the step size is too large. It also does not guarantee an exact solution, as it is only an approximation method. Additionally, it may not work well for functions that have steep changes or curves with complex behavior.

5. How can I determine the accuracy of the solution obtained using Euler's Method?

The accuracy of the solution obtained using Euler's Method can be determined by comparing it to the exact solution or by using a smaller step size and checking for convergence. Additionally, the error can be calculated and compared to the expected error for the chosen step size.

Similar threads

Replies
7
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
807
  • Introductory Physics Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Introductory Physics Homework Help
Replies
6
Views
536
Replies
20
Views
3K
  • Differential Equations
Replies
1
Views
717
  • General Math
2
Replies
38
Views
10K
  • Differential Equations
Replies
9
Views
2K
Replies
6
Views
769
Back
Top