Results 1 to 6 of 6

Thread: Convert 2nd order ode to first order ODES

  1. #1
    Newbie
    Joined
    Aug 2009
    Posts
    21

    Convert 2nd order ode to first order ODES

    Hello,
    I have the DE:

    $\displaystyle y''(t) + y = 0$

    with IC's:

    $\displaystyle y'(0) = 1$hs

    $\displaystyle y(0) = 0$

    If I convert this to a system of 1st order ODES is it just:

    $\displaystyle \frac{dy_1}{dt} = y_2, \ \ \ \frac{dy_2}{dt} = -y_1 $


    How about if the DE is:

    $\displaystyle y''(t) + y = \sin(2t)$ and the same IC's.

    Thanks
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member AllanCuz's Avatar
    Joined
    Apr 2010
    From
    Canada
    Posts
    384
    Thanks
    4
    Quote Originally Posted by RoyalFlush View Post
    Hello,
    I have the DE:

    $\displaystyle y''(t) + y = 0$

    with IC's:

    $\displaystyle y'(0) = 1$hs

    $\displaystyle y(0) = 0$

    If I convert this to a system of 1st order ODES is it just:

    $\displaystyle \frac{dy_1}{dt} = y_2, \ \ \ \frac{dy_2}{dt} = -y_1 $


    How about if the DE is:

    $\displaystyle y''(t) + y = \sin(2t)$ and the same IC's.

    Thanks
    The first question is a second order homogenious equation. We find the roots by computing the characteristic equation.

    $\displaystyle \lambda^2 + 1 = 0 $

    Clearly this has the imaginary roots $\displaystyle -i $ and $\displaystyle i $

    So,

    $\displaystyle y = c_1 e^{-i x} + c_2 e^{ i x } $

    Compute and sub in initial conditions.

    The second question can be computed by method of comparing co-efficients (we can also use variation of paramters but co-efficients is easiast here).

    For $\displaystyle y''(t) + y = \sin(2t)$ the general solution is the solution from question 1 plus the particular solution.

    For the particular solution,

    Let $\displaystyle y = Asin(2t) + Bcos(2t) $

    So,

    $\displaystyle y^{ \prime } = 2Acos(2t) -2Bsin(2t) $

    $\displaystyle y^{ \prime \prime } = -4Acos(2t) - 4Bcos(2t) $

    Subbing into the equation we get,

    $\displaystyle -4Acos(2t) - 4Bcos(2t) + Asin(2t) + Bcos(2t) = sin(2t) $

    $\displaystyle cos(2t) [ - 4A - 3B ] + Asin(2t) = sin(2t) $

    $\displaystyle A = 1 $

    $\displaystyle -4 -3B = 0 $

    $\displaystyle B = - \frac{4}{3} $

    And $\displaystyle y = sin(2t) - \frac{4}{3}cos(2t) $
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    12,880
    Thanks
    1946
    Quote Originally Posted by AllanCuz View Post
    The first question is a second order homogenious equation. We find the roots by computing the characteristic equation.

    $\displaystyle \lambda^2 + 1 = 0 $

    Clearly this has the imaginary roots $\displaystyle -i $ and $\displaystyle i $

    So,

    $\displaystyle y = c_1 e^{-i x} + c_2 e^{ i x } $

    Compute and sub in initial conditions.
    You should really use Euler's Formula to clean this up...
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member AllanCuz's Avatar
    Joined
    Apr 2010
    From
    Canada
    Posts
    384
    Thanks
    4
    Quote Originally Posted by Prove It View Post
    You should really use Euler's Formula to clean this up...
    You mean, actually do work? Pshh...

    $\displaystyle y = c_1 e^{ -ix} + c_2 e^{ix} $

    $\displaystyle = c_1 [ cosx - isinx ] + c_2 [cosx + isinx] $

    $\displaystyle = [c_1 + c_2]cosx + [ i c_2 - i c_1 ] sinx $

    Let $\displaystyle A = c_1 + c_2 $ and $\displaystyle B = i c_2 - i c_2 $

    $\displaystyle y = Acosx + Bsinx $

    This is actually the result of a seperation of variables of a wave equation :O!
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor

    Joined
    Apr 2005
    Posts
    19,731
    Thanks
    3011
    That's very clever, guys, but it doesn't actually answer the question asked, does it?

    Royal Flush, yes, if you let $\displaystyle y_1= y$ and $\displaystyle y_2= \frac{dy}{dt}$, then we have immediately that $\displaystyle \frac{dy_1}{dt}= y_2$ and then $\displaystyle \frac{d^2y}{dt^2}= \frac{d}{dt}\frac{dy_1}{dt}= \frac{dy_2}{dt}$ so that $\displaystyle \frac{d^2y}{dt^2}+ y= \frac{dy_2}{dt}+ y_1= 0$ so that $\displaystyle \frac{dy_2}{dt}= -y_1$

    And your initial conditions are $\displaystyle y_1(0)= 0$ and $\displaystyle y_2(0)=1$.

    This can also be written as the "matrix" equation:
    $\displaystyle \frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}= \begin{pmatrix}y_2 \\ -y_1\end{pmatrix}= \begin{pmatrix}0 & 1 \\-1 & 0\end{pmatrix}\begin{pmatrix}y_1 \\ y_2\end{pmatrix}$ subject to the initial condition $\displaystyle \begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}$.

    In the same way, the equation y"+ y= sin(2t) becomes the pair of equations $\displaystyle \frac{dy_1}{dt}= y_2$ and $\displaystyle \frac{dy_2}{dt}= -y_1+ sin(2t)$ with the same intial conditions.

    That also can be written as a "matrix" equation:
    $\displaystyle \frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}=$$\displaystyle \begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix}\begin{pmatrix}y_1 \\ y_2\end{pmatrix}+ \begin{pmatrix}0 \\ sin(2t)\end{pmatrix}$
    with initial condition $\displaystyle \begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}$.

    Of course, the eigenvalues of the matrix $\displaystyle \begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix}$ are i and -i which lead to the complex exponentials (sine and cosine) solutions Prove It and AllenCuz show.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Senior Member AllanCuz's Avatar
    Joined
    Apr 2010
    From
    Canada
    Posts
    384
    Thanks
    4
    Quote Originally Posted by HallsofIvy View Post
    That's very clever, guys, but it doesn't actually answer the question asked, does it?

    Royal Flush, yes, if you let $\displaystyle y_1= y$ and $\displaystyle y_2= \frac{dy}{dt}$, then we have immediately that $\displaystyle \frac{dy_1}{dt}= y_2$ and then $\displaystyle \frac{d^2y}{dt^2}= \frac{d}{dt}\frac{dy_1}{dt}= \frac{dy_2}{dt}$ so that $\displaystyle \frac{d^2y}{dt^2}+ y= \frac{dy_2}{dt}+ y_1= 0$ so that $\displaystyle \frac{dy_2}{dt}= -y_1$

    And your initial conditions are $\displaystyle y_1(0)= 0$ and $\displaystyle y_2(0)=1$.

    This can also be written as the "matrix" equation:
    $\displaystyle \frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}= \begin{pmatrix}y_2 \\ -y_1\end{pmatrix}= \begin{pmatrix}0 & 1 \\-1 & 0\end{pmatrix}\begin{pmatrix}y_1 \\ y_2\end{pmatrix}$ subject to the initial condition $\displaystyle \begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}$.

    In the same way, the equation y"+ y= sin(2t) becomes the pair of equations $\displaystyle \frac{dy_1}{dt}= y_2$ and $\displaystyle \frac{dy_2}{dt}= -y_1+ sin(2t)$ with the same intial conditions.

    That also can be written as a "matrix" equation:
    $\displaystyle \frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}=$$\displaystyle \begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix}\begin{pmatrix}y_1 \\ y_2\end{pmatrix}+ \begin{pmatrix}0 \\ sin(2t)\end{pmatrix}$
    with initial condition $\displaystyle \begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}$.

    Of course, the eigenvalues of the matrix $\displaystyle \begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix}$ are i and -i which lead to the complex exponentials (sine and cosine) solutions Prove It and AllenCuz show.
    He said "if I convert to" which I took to mean he was trying to solve the problem via that method, and it wasn't specifically asked of him.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. First order ODEs
    Posted in the Differential Equations Forum
    Replies: 4
    Last Post: Oct 2nd 2011, 08:20 AM
  2. Modelling with second order ODEs
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: Sep 7th 2010, 10:14 PM
  3. second order odes
    Posted in the Differential Equations Forum
    Replies: 5
    Last Post: Aug 22nd 2009, 06:09 AM
  4. n-th order ODEs as n-th dimensional system of first order ODEs
    Posted in the Differential Equations Forum
    Replies: 0
    Last Post: May 6th 2009, 07:32 PM
  5. Replies: 2
    Last Post: Jan 9th 2009, 07:31 PM

Search Tags


/mathhelpforum @mathhelpforum