Results 1 to 6 of 6

Math Help - 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:

    y''(t) + y = 0

    with IC's:

    y'(0) = 1hs

    y(0) = 0

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

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


    How about if the DE is:

    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:

    y''(t) + y = 0

    with IC's:

    y'(0) = 1hs

    y(0) = 0

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

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


    How about if the DE is:

    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.

     \lambda^2 + 1 = 0

    Clearly this has the imaginary roots  -i and  i

    So,

     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 y''(t) + y = \sin(2t) the general solution is the solution from question 1 plus the particular solution.

    For the particular solution,

    Let  y = Asin(2t) + Bcos(2t)

    So,

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

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

    Subbing into the equation we get,

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

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

     A = 1

     -4 -3B = 0

     B = - \frac{4}{3}

    And  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
    10,969
    Thanks
    1009
    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.

     \lambda^2 + 1 = 0

    Clearly this has the imaginary roots  -i and  i

    So,

     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...

     y = c_1 e^{ -ix} + c_2 e^{ix}

     = c_1 [ cosx - isinx ] + c_2 [cosx + isinx]

     = [c_1 + c_2]cosx + [ i c_2 - i c_1 ] sinx

    Let  A = c_1 + c_2 and  B = i c_2 - i c_2

     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
    14,973
    Thanks
    1121
    That's very clever, guys, but it doesn't actually answer the question asked, does it?

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

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

    This can also be written as the "matrix" equation:
    \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 \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 \frac{dy_1}{dt}= y_2 and \frac{dy_2}{dt}= -y_1+ sin(2t) with the same intial conditions.

    That also can be written as a "matrix" equation:
    \frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}=  \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 \begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}.

    Of course, the eigenvalues of the matrix \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 y_1= y and y_2= \frac{dy}{dt}, then we have immediately that \frac{dy_1}{dt}= y_2 and then \frac{d^2y}{dt^2}= \frac{d}{dt}\frac{dy_1}{dt}= \frac{dy_2}{dt} so that \frac{d^2y}{dt^2}+ y= \frac{dy_2}{dt}+ y_1= 0 so that \frac{dy_2}{dt}= -y_1

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

    This can also be written as the "matrix" equation:
    \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 \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 \frac{dy_1}{dt}= y_2 and \frac{dy_2}{dt}= -y_1+ sin(2t) with the same intial conditions.

    That also can be written as a "matrix" equation:
    \frac{d\begin{pmatrix}y_1 \\ y_2\end{pmatrix}}{dt}=  \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 \begin{pmatrix}y_1(0) \\ y_2(0)\end{pmatrix}= \begin{pmatrix}0 \\ 1\end{pmatrix}.

    Of course, the eigenvalues of the matrix \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: October 2nd 2011, 08:20 AM
  2. Modelling with second order ODEs
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: September 7th 2010, 10:14 PM
  3. second order odes
    Posted in the Differential Equations Forum
    Replies: 5
    Last Post: August 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: January 9th 2009, 07:31 PM

Search Tags


/mathhelpforum @mathhelpforum