Talk:Euler method

From Wikipedia, the free encyclopedia

WikiProject Mathematics
This article is within the scope of WikiProject Mathematics, which collaborates on articles related to mathematics.
Mathematics rating: Start Class Mid Priority  Field: Applied mathematics
One of the 500 most frequently viewed mathematics articles.

Contents

[edit] Bias towards trajectories

Shouldn't this article discuss the use of the Euler method for solving general ODEs rather then using trajectories as a specific example? Thydzik 15:12, 9 November 2005 (UTC)

It should indeed. I'd be very grateful if you could amend the article to talk about the general case. -- Jitse Niesen (talk) 15:29, 9 November 2005 (UTC)

(After more than a year): Nothing has changed... just sad (130.113.128.11 19:54, 24 November 2006 (UTC))

The bias towards trajectories has been removed. Trajectories are not a good example of use of the Euler method, since as 2nd-order systems, they require an (admittedly trivial) reformulation to make them conducive to Euler integration. I've removed the link to the (inherently 2nd-order) Verlet integration for the same reason, and replaced it with links to the more general Runge-Kutta and Adams-Bashforth style integrators. I've also removed references to t as time - it is a general independent variable - though I've kept it as t rather than x for consistency with the Numerical_ordinary_differential_equations page. Chrisjohnson 21:25, 24 March 2007 (UTC)

[edit] Error discussion

In the "Error" section, someone said

Even if the Δt2 term is removed through a common adjustment to the Euler integrator, the error still contains third-order terms in Δt.

I'm assuming the "common adjustment" is changing:

x(t0 + Δt) = x(t0) + Δtv(t0)

to

x(t_0 + \Delta t) = x(t_0) + \Delta t v(t_0) + \frac{1}{2}\Delta t^2 a(t_0)

Given this, would the error be zero if acceleration were constant (e.g., gravity only)? It seems like this might be worth expanding on - I'm just a little new to the subject matter, so don't want to make bold changes just yet.

Also, what about Verlet Leapfrog and Velocity Verlet? I can't find them on Wikipedia, maybe they should have articles? --- MickWest 20:14, 29 March 2006 (UTC)

I think you're right about what you guess the "common adjustment" means; I'd call it the second-order Taylor method, but I'm sure there are other names for it. It is indeed exact when the acceleration is constant; this might be worthwhile to add.
We do have an article about the Verlet method at Verlet integration. We should probably add some redirects to it though. Where did you look for it? The list of numerical analysis topics might be helpful next time you're looking for an article. We don't have an article on velocity Verlet as far as I'm aware, so please write one (it is mentioned in Beeman's algorithm). -- Jitse Niesen (talk) 00:02, 30 March 2006 (UTC)
I saw the Verlet integration article, but I was looking for "Verlet leapfrog", red-linked as leapfrog method. from Discrete element method, see [1]. I need to do some more research before I edit anything here, but will hopefull get to it soon. Thanks for the response. MickWest 02:22, 30 March 2006 (UTC)
Fair enough. The Verlet method and the leapfrog method are almost the same, so that's why they are sometimes taken together and called the Verlet/leapfrog method. To wit, the website you provide defines the leapfrog method as
 x_{k+1} = x_k + \Delta t \, v_{k+1/2}
 v_{k+3/2} = v_{k+1/2} + \Delta t \, f(x_{k+1})
From the first equation, we get
 x_{k+1} - 2x_k + x_{k-1} = (x_{k+1}-x_k) - (x_k-x_{k-1}) = \Delta t \, v_{k+1/2} - \Delta t \, v_{k-1/2}
and from the second equation, this is equal to t)2f(xk), so we get
 x_{k+1} - 2x_k + x_{k-1} = (\Delta t)^2 f(x_k). \,
This is equivalent to
 x_{k+1} = 2x_k - x_{k-1} + (\Delta t)^2 f(x_k), \,
which is the formula on Verlet integration.
Yes, this should most definitely be added to that page. -- Jitse Niesen (talk) 02:43, 30 March 2006 (UTC)

[edit] Error Correction

In the part that compares Euler’s integration and Taylor expansion, the difference between both expressions has a sign mistake. The 1/2 part sould be -1/2 instead of the postivie expression shown in the article.

Yep, you're right. Thanks for catching that. -- Jitse Niesen (talk) 12:30, 14 April 2006 (UTC)

[edit] A few problems with the current article

I was planning on wikilinking this article to calculus(my baby)but decided not to because this article is not accessible to the layman for two reasons. There needs to be a picture that illustrates this method. I.E. a picture that would show a function and then the Euler's integration approximations with varying sampling rates. Further The article seems too technical for the average reader ODEs and Tayler approximations in the first couple sentences, and no mention is made of the uses that Euler integration has outside of ODEs. I will attempt to correct this within the week if no one objects--Cronholm144 23:57, 19 May 2007 (UTC)

I made two pictures. Oleg Alexandrov (talk) 04:04, 20 May 2007 (UTC)

Fast work!:) I tweaked the first paragraph. I also came across some pretty good pictures myself, showing how the variation of step sizes affects the graph, but they are in black and white and I have no clue how to insert/colorize (pardon my American) them:( Maybe I could send them to you? Although the article isn't long enough yet to warrant any more insertions.--Cronholm144 05:26, 20 May 2007 (UTC)

Sure, you can send them to me. I could draw something based on them if need be, if not for this article, then for the other numerical differential equations ones. Oleg Alexandrov (talk) 15:06, 20 May 2007 (UTC)

Much better, I am having a little trouble getting those images to you, but I think what you have done is definitely sufficient. Thanks!--Cronholm144 04:26, 22 May 2007 (UTC)

P.S. I added your pics to Midpoint method as well, it seemed appropriate.

Pictures have one "error". Midpoint needs two evaluations of function "f(t,y)" in every step, while Euler needs only one. Which means that the Midpoint method should be aproximately twice slower than Euler. It would be fair to use twice longer step size "h" in Midpoint method. (Anyway I guess Midpoint would win.) --EnJx 23:54, 23 May 2007 (UTC)

You are correct that the midpoint method takes more function evaluations. But these pictures are for illustrative purposes only, and in general, function evaluations are cheap anyway. I agree that the point of function evaluation versus order of convergence needs to be stated somewhere, but I'd argue that the pictures are not that place. Oleg Alexandrov (talk) 02:38, 24 May 2007 (UTC)
Actually, in general function evaluations might be VERY expensive when solving some difficult dynamical system with many variables bound together. And I think that it wouldn't be problem to show that even with the twice longer step the midpoint method would be still much better than euler. And little notice like "... to be fair the Midpoint method was calculated with twice longer step because each step involves two evaluations of the function f(t,y)..." in the image description wouldn't matter. That's my opinion. --EnJx 12:20, 24 May 2007 (UTC)
Comparisons are indeed usually done in terms of number of function evaluations. However, what is the point of the pictures? Is it that the midpoint rule converges faster or that it is more precise? In the former case, it doesn't matter what step sizes are used; the important point is that the step size is halved when going from the first to the second picture. In the latter case, we should make clear that the midpoint rule (with the same number of function evaluations) is not always better.
Anyway, I think that the red curve (exact solution) should be smooth. -- Jitse Niesen (talk) 13:13, 24 May 2007 (UTC)
I also thought that the exact solution should be smooth, I'll do it. About the point of the pictures, um, I don't know. Just to show that there are different methods, and some are more efficient in most cases. Feel free to reword the captions, as long as they don't get too large, the fine details could belong better in the text I think. Oleg Alexandrov (talk) 16:18, 24 May 2007 (UTC)