Euler's method for second order DE

Click For Summary

Discussion Overview

The discussion revolves around the application of the Euler approximation method to solve a second-order differential equation, specifically the equation ##\ddot x=\omega^2 x##. Participants explore the formulation of the problem, initial conditions, and the implications of using the Euler method for higher-order differential equations.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant questions whether the Euler method can be applied to higher-order differential equations and presents a specific case with initial conditions.
  • Another participant suggests that the Euler method should dictate a different formulation for the derivatives, indicating a potential misunderstanding in the original post.
  • A third participant agrees that higher-order differential equations can be solved by converting them into a system of first-order equations and provides a detailed formulation of the problem.
  • There is a discussion about the nature of the equation resembling a free harmonic oscillator, with a question raised regarding the sign of the term involving ##\omega^2##.
  • Participants share experiences and tips on quoting equations and names in the forum, indicating a meta-discussion about forum usage.

Areas of Agreement / Disagreement

Participants express differing views on the correct application of the Euler method to the problem, with no consensus reached on the formulation or the necessity of the sign in front of ##\omega^2##. The discussion remains unresolved regarding the correct approach to the Euler method for the given differential equation.

Contextual Notes

Some participants note that the equation is taken from a mathematics book rather than a physics context, which may influence the interpretation of the terms involved. There is also mention of potential confusion regarding the quoting of equations in the forum.

Karol
Messages
1,380
Reaction score
22
Can the Euler approximation method be used to solve higher order DE?
I have ##\ddot x=\omega^2 x## which i rewrite as ##y''=\omega^2y##. initial conditions y(0)=0, y'(0)=1.
The Euler method: ##y_{n+1}=y_n+h\cdot y'_n##. i use this to make:
$$y''_{n+1}=y'_n+h\cdot y''_n~~\rightarrow~~\omega^2y_{n+1}=y'_n+h\omega^2 y_n$$
$$\omega^2(y_n+hy'_n)=y'_n+h\omega^2 y_n$$
$$\rightarrow~y'_n=\left[ \frac{\omega^2(1-h)}{1-\omega^2h} \right]y_n$$
But this contradicts the initial condition y'(0)=1, after i substitute y(0)=0 in the formula i found.
 
Physics news on Phys.org
Wouldn't the Euler method dictate $$y'_{n+1} = y'_n + h\omega^2y_n$$ ?
 
Karol said:
Can the Euler approximation method be used to solve higher order DE?
Yes, every explicit first order method can be used to solve higher-order DE by writing the DE in vector form as a system of first-order DE, also see below.
Karol said:
I have ##\ddot x=\omega^2 x## which i rewrite as ##y''=\omega^2y##. initial conditions y(0)=0, y'(0)=1.
I do not quite understand the purpose of introducing ##y##, but it does no harm. Also, this equation looks like a free harmonic oscillator. Are you sure there should not be a minus in front of ##\omega^2##?
Karol said:
The Euler method: ##y_{n+1}=y_n+h\cdot y'_n##.
BvU said:
Wouldn't the Euler method dictate $$y'_{n+1} = y'_n + h\omega^2y_n$$ ?
I think that the OP and @BvU both have one half of the method for this problem :wink:.

As I alluded to at the start, you can solve higher order DE by converting them into a system of first order DE. Although not strictly necessary, this works best by introducing new symbols for the derivatives. For this example, set ##v := y'##, then the DE ##y''(t) = \omega^2y(t)## is equivalent to
$$
\left\{
\begin{align*}
y'(t) &= v(t)\\
v'(t) &= \omega^2y(t)
\end{align*}
\right.
$$
with the initial conditions ##y(0) = 0##, ##v(0) = 1##. Then Euler forward with stepsize ##h > 0## just reads
$$
\begin{align*}
\begin{bmatrix}
y_{n+1}\\
v_{n+1}
\end{bmatrix}
&\approx
\begin{bmatrix}
y_n\\
v_n
\end{bmatrix}
+
h
\begin{bmatrix}
y'(nh)\\
v'(nh)
\end{bmatrix}\\
&=
\begin{bmatrix}
y_n\\
v_n
\end{bmatrix}
+
h
\begin{bmatrix}
v_n\\
\omega^2y_n
\end{bmatrix}
\end{align*}
$$
where ##y_n := y(nh)## and ##v_n := v(nh)## for ##n = 0, 1,\ldots##. The first component is what the OP called the Euler method, while the second component appears in post #2.
 
Krylov said:
this equation looks like a free harmonic oscillator. Are you sure there should not be a minus in front of ##\omega^2## ?
It is taken from a mathematics book, teaching DE, not a physics book.
I thank you very much BvU and Krylov.
How do you quote exactly also the equations in the posts, since when i use the "+Quote" function that is given in this site, or i mark a part of a post and select "+Quote" from the context menu that appears, and then insert these quotes in the reply box the equations come out messed, while the text is good. i manually fix these equations, almost completely write them anew.
And also, how can you copy a poster's name, like Krylov did in the last post:
Snap1.jpg
 
Karol said:
It is taken from a mathematics book, teaching DE, not a physics book.
I thank you very much BvU and Krylov.
Ok. Whenever I see an ##\omega^2## somewhere, I start to think of ##\tfrac{k}{m}##.
You are welcome!
Karol said:
How do you quote exactly also the equations in the posts, since when i use the "+Quote" function that is given in this site, or i mark a part of a post and select "+Quote" from the context menu that appears, and then insert these quotes in the reply box the equations come out messed, while the text is good. i manually fix these equations, almost completely write them anew.
I recognize this and it is a bit uncomfortable. Probably there are better ways, but what usually do, is put the cursor where I want the quote (with formulas) to appear and then press "reply". This quotes the entire message with formulas correctly. Then I remove the excess text that I do not want quoted.

You can also right-click on an equation, then "Show Math As", then "TeX Commands". This opens a pop-up containing the ##\LaTeX## source. That context menu has some other options, too, it appears.
Karol said:
And also, how can you copy a poster's name, like Krylov did in the last post:
You write the member name with an "@" in front, like @Karol. When the member has enabled this, it will show him a message that he has been "mentioned" in a certain thread.
 
Thank you very much BvU and Krylov
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 0 ·
Replies
0
Views
4K
  • · Replies 1 ·
Replies
1
Views
925
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K