Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a 2nd ODE: ${d^2u \over dt^2} =5tu+\sin ({du\over dt})$, $u(0)=1$, ${du\over dt}(0)=0$. Iwas reading my notes and it asked to write the 2nd order ODE as a system of 1st order ODEs. And then to construct a forward euler discretisation of the ODE with step size $\tau =1/2$ and interval $[0,2]$.

What was done in the notes was:

$\text{Let }v={du \over dt}\\{dv \over dt}={d^2u \over dt^2}\\ \Rightarrow {dv \over dt}=5tu+\sin v, \ v(0)=0.$

I understood the above, but I'm not sure what was done after that. Could someone explain to me what was done below? Let

$w= \left( \begin{array}{c} u \\ v \end{array} \right)$, then ${dw \over dt}=f(t,w), \ w(0)=w_0$ where $f(t,w)=\left( \begin{array}{c} v \\ 5tu+\sin v \end{array} \right)$ and $w_0=\left( \begin{array}{c} 1 \\ 0 \end{array} \right)$

Continuing on from there, how does the following work? In particular how does $f(t_0, W^0)= \left( \begin{array}{c} V^0 \\ 5\cdot 0 \cdot U^0 + \sin V^0 \end{array} \right) = \left( \begin{array}{c} 0 \\ 0 \end{array} \right)$?

Forward euler for the 1st order system: Given $W^0=w_0$, find $W^{n+1}$ such that $W^{n+1}=W^n+\tau f(t_n,w)$.

$n=0$, $W^0= \left( \begin{array}{c} 1 \\ 0 \end{array} \right) \\f(t_0, W^0)= \left( \begin{array}{c} V^0 \\ 5\cdot 0 \cdot U^0 + \sin V^0 \end{array} \right) = \left( \begin{array}{c} 0 \\ 0 \end{array} \right) \\ \Rightarrow W^1 = W^0 +\tau \left( \begin{array}{c} 0 \\ 0 \end{array} \right) \Rightarrow W^1 = W^0$

share|cite|improve this question
up vote 2 down vote accepted

$w$ as defined is a $2$-dimensional vector of functions, the first component of which is the function $u$ and the second component of which is the function $v=\frac{du}{dt}$. When we differentiate, we differentiate componentwise: $$ \frac{dw}{dt}=\begin{bmatrix}\tfrac{du}{dt} \\ \tfrac{dv}{dt}\end{bmatrix}. $$ However, we know both $\frac{du}{dt}$ and $\frac{dv}{dt}$ (you said you understood this part). Just plugging these in, we have that $$ \frac{dw}{dt}=\begin{bmatrix}v \\ 5tu+\sin (v)\end{bmatrix}. $$ Same thing with the initial condition: $$ w(0)=\begin{bmatrix}u(0) \\ v(0)\end{bmatrix}=\begin{bmatrix}1 \\ 0\end{bmatrix}. $$

As for the numerical part, it seems that you should adust your equation $W^{n+1}=W^n+\tau f(t_n,w)$ to read $$ W^{n+1}=W^n+\tau f(t_n,W^n). $$ In any case, when you actually started to work out the problem, it seems as if this is what you did. (Also keep in mind that $t_{n+1}=t_n+\tau$).

share|cite|improve this answer
Thanks @JohnathanGleason , I understood everything you did. I just have one more question -- How do I get from $f(t_0, W^0)= \left( \begin{array}{c} V^0 \\ 5\cdot 0 \cdot U^0 + \sin V^0 \end{array} \right) = \left( \begin{array}{c} 0 \\ 0 \end{array} \right) $? In particular, shouldnt $U^0 =1$? – Richard May 9 '12 at 0:45
Yes, $U^0=u(0)=1$ and $V^0=u(0)=u'(0)=0$. – Jonathan Gleason May 9 '12 at 0:53
Thanks, understood it. Much appreciated again. – Richard May 9 '12 at 0:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.