Skip to main content
Mathematics LibreTexts

8.05: On Solving Higher-Order and Coupled Ordinary Differential Equations

  • Page ID
    126431

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Lesson 1: Solving Higher-Order Ordinary Differential Equations

    Learning Objectives

    After successful completion of this lesson, you should be able to:

    1) write higher-order ordinary differential equations as simultaneous first-order ordinary differential equations,

    2) solve higher-order ordinary differential equations numerically

    Description

    In the earlier lessons, we have learned Euler’s and Runge-Kutta methods to solve first-order ordinary differential equations of the form

    \[\frac{dy}{dx} = f\left( x,y \right),y\left( x_{0} \right) = y_{0}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.1}) \nonumber\]

    What do we do to solve simultaneous (coupled) differential equations or differential equations higher than first order? For example, an \(n^{th}\)order differential equation of the form

    \[a_{n}\frac{d^{n}y}{dx^{n}} + a_{n - 1}\frac{d^{n - 1}y}{dx^{n - 1}} + \ldots + a_{1}\frac{dy}{dx} + a_{o}y = f\left( x \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.2}) \nonumber\]

    with \(n\) initial conditions can be solved by assuming

    \[y = z_{1}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.3.1}) \nonumber\]

    \[\frac{dy}{dx} = \frac{dz_{1}}{dx} = z_{2}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.3.2}) \nonumber\]

    \[\frac{d^{2}y}{dx^{2}} = \frac{dz_{2}}{dx} = z_{3}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.3.3}) \nonumber\]

    \[\vdots \nonumber\]

    \[\frac{d^{n - 1}y}{dx^{n - 1}} = \frac{dz_{n - 1}}{dx} = z_{n}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.3.}n) \nonumber\]

    \[\begin{split} \frac{d^{n}y}{dx^{n}} &= \frac{dz_{n}}{dx}\\ &= \frac{1}{a_{n}}\left( - a_{n - 1}\frac{d^{n - 1}y}{dx^{n - 1}}\ldots - a_{1}\frac{dy}{dx} - a_{0}y + f\left( x \right) \right)\\ &= \frac{1}{a_{n}}\left( - a_{n - 1}z_{n}\ldots - a_{1}z_{2} - a_{0}z_{1} + f\left( x \right) \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.3.}n+1) \end{split}\]

    The above Equations from \((\PageIndex{1.3.2})\) to \((\PageIndex{1.3.}n+1)\) represent \(n\) first-order differential equations as follows

    \[\frac{dz_{1}}{dx} = z_{2} = f_{1}\left( z_{1},z_{2},\ldots,x \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.4.1}) \nonumber\]

    \[\frac{dz_{2}}{dx} = z_{3} = f_{2}\left( z_{1},z_{2},\ldots,x \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.4.2}) \nonumber\]

    \[\vdots \nonumber\]

    \[\frac{dz_{n}}{dx} = \frac{1}{a_{n}}\left( - a_{n - 1}z_{n}\ldots - a_{1}z_{2} - a_{0}z_{1} + f\left( x \right) \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.4.n}) \nonumber\]

    Each of the \(n\) first-order ordinary differential equations should be accompanied by one initial condition. The initial condition should be on the corresponding dependent variable on the left-hand side of the ordinary differential equation. For example, Equation \((\PageIndex{1.4.1})\) would need an initial condition on \(z_{1}\), Equation \((\PageIndex{1.4.}n)\) would need an initial condition on \(z_{n}\), etc. These first-order ordinary differential equations (Equations \((\PageIndex{1.4.1})\) through \((\PageIndex{1.4.}n)\)) are simultaneous. Still, they can be solved by the methods used for solving first-order ordinary differential equations that we have already learned in the previous lessons.

    Example \(\PageIndex{1.1}\)

    Rewrite the following differential equation as a set of simultaneous first-order differential equations.

    \[3\frac{d^{2}y}{dx^{2}} + 2\frac{dy}{dx} + 5y = e^{- x},y\left( 0 \right) = 5,\ y^{\prime}\left( 0 \right) = 7 \nonumber\]

    Solution

    The ordinary differential equation

    \[3\frac{d^{2}y}{dx^{2}} + 2\frac{dy}{dx} + 5y = e^{- x},y\left( 0 \right) = 5,\ y^{\prime}\left( 0 \right) = 7 \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E1.1}) \nonumber\]

    would be rewritten as follows. Assume

    \[\frac{dy}{dx} = z, \;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{1.E1.2}) \nonumber\]

    Then

    \[\frac{d^{2}y}{dx^{2}} = \frac{dz}{dx}\;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{1.E1.3}) \nonumber\]

    Substituting Equations \((\PageIndex{1.E1.2})\) and \((\PageIndex{1.E1.3})\) in the given second-order ordinary differential equation gives

    \[3\frac{dz}{dx} + 2z + 5y = e^{- x} \nonumber\]

    and rewritten as

    \[\frac{dz}{dx} = \frac{1}{3}\left( e^{- x} - 2z - 5y \right) \;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{1.E1.4}) \nonumber\]

    The set of two simultaneous first-order ordinary differential equations complete with the initial conditions then is

    \[\frac{dy}{dx} = z,y\left( 0 \right) = 5 \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E1.5}\text{a}) \nonumber\]

    \[\frac{dz}{dx} = \frac{1}{3}\left( e^{- x} - 2z - 5y \right), \ z\left( 0 \right) = 7. \;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{1.E1.5}\text{b}) \nonumber\]

    Now one can apply any of the numerical methods used for solving first-order ordinary differential equations.

    We write such equations in a subscripted format in a later lesson to make them suitable for matrix and vector representation. In the above example, we would introduce subscripted dependent variables, say \(w_1\) and \(w_2\), as

    \[w_1=y \;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{1.E1.6}) \nonumber\]

    and

    \[w_2=\displaystyle \frac{dy}{dx}\;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{1.E1.7}) \nonumber\]

    Using Equations \((\PageIndex{1.E1.6})\) and \((\PageIndex{1.E1.7})\), Equations \((\PageIndex{1.E1.5}\text{a})\) and \((\PageIndex{1.E1.5}\text{b})\) can be rewritten in subscripted form as

    \[\frac{dw_{1}}{dx} = w_{2}, \ w_{1}\left( 0 \right) = 5 \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E1.8}\text{a}) \nonumber\] \[\frac{dw_{2}}{dx} = \frac{1}{3}\left( e^{- x} - 2w_{2} - 5w_{1} \right), \ w_{2}\left( 0 \right) = 7. \;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{1.E1.8}\text{b}) \nonumber\]

    Rewriting Equations \((\PageIndex{1.E1.8}\text{a})\) and \((\PageIndex{1.E1.8}\text{b})\) now as

    \[\frac{dw_{1}}{dx} = 0w_{1}+1w_{2}, \ w_{1}\left( 0 \right) = 5 \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E1.9}\text{a}) \nonumber\] \[\frac{dw_{2}}{dx} = -\frac{5}{3}w_{1} - \frac{2}{3}w_{2} + \frac{1}{3}e^{- x}, \ w_{2}\left( 0 \right) = 7. \;\;\;\;\;\;\;\;\;\;\;\;(\PageIndex{1.E1.9}\text{b}) \nonumber\]

    makes it ready to be written in a matrix form and is called the state-space model.

    In the matrix form, the Equations \((\PageIndex{1.E1.9}\text{a})\) and \((\PageIndex{1.E1.9}\text{b})\) are given as

    \[\begin{bmatrix} \displaystyle \frac{dw_{1}}{dx} \\ \displaystyle\frac{dw_{2}}{dx} \\ \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ -\displaystyle \frac{5}{3} & -\displaystyle \frac{2}{3} \\ \end{bmatrix}\begin{bmatrix} w_{1} \\ w_{2} \\ \end{bmatrix} + \begin{bmatrix} 0 \\ \displaystyle\frac{1}{3}e^{-x} \\ \end{bmatrix} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E1.10}) \nonumber\]

    where the initial conditions are given by

    \[\begin{bmatrix} w_{1}(0) \\ w_{2}(0) \\ \end{bmatrix} = \begin{bmatrix} 5 \\ 7 \\ \end{bmatrix}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E1.11}) \nonumber\]

    The motivation and description of the state-space model are described in detail in the next lesson for higher-order and coupled ordinary differential equations.

    Example \(\PageIndex{1.2}\)

    Given

    \[\frac{d^{2}y}{dt^{2}} + 2\frac{dy}{dt} + y = e^{- t}, \ y\left( 0 \right) = 1,\frac{dy}{dt}\left( 0 \right) = 2, \nonumber\]

    estimate the following by Euler’s method

    a) \(y\left( 0.75 \right)\)

    b) the absolute relative true error for part(a), if \(\left. \ y\left( 0.75 \right) \right|_{exact} = 1.668\)

    c) \(\displaystyle \frac{dy}{dt}\left( 0.75 \right)\)

    Use a step size of \(h = 0.25\).

    Solution

    First, the second-order differential equation is written as two simultaneous first-order differential equations as follows. Assume

    \[\frac{dy}{dt} = z \nonumber\]

    then

    \[\frac{dz}{dt} + 2z + y = e^{- t} \nonumber\]

    \[\frac{dz}{dt} = e^{- t} - 2z - y \nonumber\]

    So the two simultaneous first-order differential equations are

    \[\frac{dy}{dt} = z = f_{1}\left( t,y,z \right), \ y(0) = 1\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E2.1}) \nonumber\]

    \[\frac{dz}{dt} = e^{- t} - 2z - y = f_{2}\left( t,y,z \right),\ z(0) = 2\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E2.2}) \nonumber\]

    Using Euler’s method on Equations \((\PageIndex{1.E2.1})\) and \((\PageIndex{1.E2.2})\), we get

    \[y_{i + 1} = y_{i} + f_{1}\left( t_{i},y_{i},z_{i} \right)h\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E2.3}) \nonumber\]

    \[z_{i + 1} = z_{i} + f_{2}\left( t_{i},y_{i},z_{i} \right)h\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E2.4}) \nonumber\]

    a) To find the value of \(y\left( 0.75 \right)\) and since we are using a step size of \(0.25\) and starting at \(t = 0\), we need to take three steps to find the value of \(y\left( 0.75 \right)\).

    For \(i = 0, \ t_{0} = 0, \ y_{0} = 1, \ z_{0} = 2\):

    From Equation \((\PageIndex{1.E2.3})\)

    \[\begin{split} y_{1} &= y_{0} + f_{1}\left( t_{0},y_{0},z_{0} \right)h\\ &= 1 + f_{1}\left( 0,1,2 \right)\left( 0.25 \right)\\ &=1+2\left(0.25\right)\\ &= 1.5 \end{split}\]

    \(y_{1}\) is the approximate value of \(y\) at

    \[t = t_{1} = t_{0} + h = 0 + 0.25 = 0.25 \nonumber\]

    \[y_{1} = y\left( 0.25 \right) \approx 1.5 \nonumber\]

    From Equation \((\PageIndex{1.E2.4})\)

    \[\begin{split} z_{1} &= z_{0} + f_{2}\left( t_{0},y_{0},z_{0} \right)h\\ &= 2 + f_{2}\left( 0,1,2 \right)\left( 0.25 \right)\\ &= 2 + \left( e^{- 0} - 2\left( 2 \right) - 1 \right)\left( 0.25 \right)\\ &= 1 \end{split}\]

    \(z_{1}\) is the approximate value of \(z\) (same as \(\frac{dy}{dt}\)) at \(t = 0.25\)

    \[z_{1} = z\left( 0.25 \right) \approx 1 \nonumber\]

    For \(i = 1, \ t_{1} = 0.25, \ y_{1} = 1.5, \ z_{1} = 1\):

    From Equation \((\PageIndex{1.E2.3})\)

    \[\begin{split} y_{2}\ &= y_{1} + f_{1}\left( t_{1},y_{1},z_{1} \right)h\\ &= 1.5 + f_{1}\left( 0.25,1.5,1 \right)\left( 0.25 \right)\\ &= 1.5 + \left( 1 \right)\left( 0.25 \right)\\ &= 1.75 \end{split}\]

    \(y_{2}\) is the approximate value of \(y\) at

    \[t = t_{2} = t_{1} + h = 0.25 + 0.25 = 0.50 \nonumber\]

    \[y_{2} = y\left( 0.5 \right) \approx 1.75 \nonumber\]

    From Equation \((\PageIndex{1.E2.4})\)

    \[\begin{split} z_{2} &= z_{1} + f_{2}\left( t_{1},y_{1},z_{1} \right)h\\ &= 1 + f_{2}\left( 0.25,1.5,1 \right)\left( 0.25 \right)\\ &= 1 + \left( e^{- 0.25} - 2\left( 1 \right) - 1.5 \right)\left( 0.25 \right)\\ &= 1 + \left( - 2.7211 \right)\left( 0.25 \right)\\ &= 0.31970 \end{split}\]

    \(z_{2}\) is the approximate value of \(z\) at

    \[t = t_{2} = 0.5 \nonumber\]

    \[z_{2} = z\left( 0.5 \right) \approx 0.31970 \nonumber\]

    For \(i = 2, \ t_{2} = 0.5, \ y_{2} = 1.75, \ z_{2} = 0.31970\):

    From Equation \((\PageIndex{1.E2.3})\)

    \[\begin{split} y_{3} &= y_{2} + f_{1}\left( t_{2},y_{2},z_{2} \right)h\\ &= 1.75 + f_{1}\left( 0.50,1.75,0.31970 \right)\left( 0.25 \right)\\ &= 1.75 + \left( 0.31970 \right)\left( 0.25 \right)\\ &= 1.8299 \end{split}\]

    \(y_{3}\) is the approximate value of \(y\) at

    \[t = t_{3} = t_{2} + h = 0.5 + 0.25 = 0.75 \nonumber\]

    \[y_{3} = y\left( 0.75 \right) \approx 1.8299 \nonumber\]

    From Equation \((\PageIndex{1.E2.4})\)

    \[\begin{split} z_{3} &= z_{2} + f_{2}\left( t_{2},y_{2},z_{2} \right)h\\ &= 0.31972 + f_{2}\left( 0.50,1.75,0.31970 \right)\left( 0.25 \right)\\ &= 0.31972 + \left( e^{- 0.50} - 2\left( 0.31970 \right) - 1.75 \right)\left( 0.25 \right)\\ &= 0.31972 + \left( - 1.7829 \right)\left( 0.25 \right)\\ &= - 0.1260 \end{split}\]

    \(z_{3}\) is the approximate value of \(z\) at

    \[t = t_{3} = 0.75 \nonumber\]

    \[z_{3} = z\left( 0.75 \right) \approx - 0.12601 \nonumber\]

    \[y\left( 0.75 \right) \approx y_{3} = 1.8299 \nonumber\]

    b) The exact value of \(y\left( 0.75 \right)\) is

    \[\left. \ y\left( 0.75 \right) \right|_{exact} = 1.668 \nonumber\]

    The absolute relative true error in the result from part (a) is

    \[\begin{split} \left| \epsilon_{t} \right| &= \left| \frac{1.668 - 1.8299}{1.668} \right| \times 100\\ &= 9.7062\% \end{split}\]

    c)

    \[\begin{split} \frac{dy}{dx}\left(0.75\right) &=z_3\\ &\approx - 0.12601 \end{split}\]

    Example \(\PageIndex{1.3}\)

    Given

    \[\frac{d^{2}y}{dt^{2}} + 2\frac{dy}{dt} + y = e^{- t},\ y(0) = 1,\ \frac{dy}{dt}(0) = 2, \nonumber\]

    estimate the following by Heun’s method.

    a) \(y\left( 0.75 \right)\)

    b) \(\displaystyle \frac{dy}{dx}\left( 0.75 \right)\).

    Use a step size of \(h = 0.25\).

    Solution

    First, the second-order differential equation is rewritten as two simultaneous first-order differential equations as follows. Assume

    \[\frac{dy}{dt} = z \nonumber\]

    then

    \[\frac{dz}{dt} + 2z + y = e^{- t} \nonumber\]

    \[\frac{dz}{dt} = e^{- t} - 2z - y \nonumber\]

    So the two simultaneous first-order differential equations with the corresponding initial conditions are

    \[\frac{dy}{dt} = z = f_{1}\left( t,y,z \right), \ y(0) = 1\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E3.1}) \nonumber\]

    \[\frac{dz}{dt} = e^{- t} - 2z - y = f_{2}\left( t,y,z \right),\ z(0) = 2\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E3.2}) \nonumber\]

    Using Heun’s method on Equations \((\PageIndex{1.E3.1})\) and \((\PageIndex{1.E3.2})\), we get

    \[y_{i + 1} = y_{i}\ + \ \frac{1}{2}\left( k_{1}^{y} + k_{2}^{y} \right)h\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E3.3}) \nonumber\]

    \[k_{1}^{y} = f_{1}\ \left( t_{i},\ y_{i},\ z_{i} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E3.4}\text{a}) \nonumber\]

    \[k_{2}^{y} = f_{1}\ \left( t_{i}\ + \ h,\ y_{i}\ + \ hk_{1}^{y},\ z_{i}\ + \ hk_{1}^{z} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E3.4}\text{b}) \nonumber\]

    \[z_{i + 1} = z_{i}\ + \frac{1}{2}\ \left( k_{1}^{z} + k_{2}^{z} \right)h\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E3.5}) \nonumber\]

    \[k_{1}^{z} = \ f_{2}\ \left( t_{i},\ y_{i},\ z_{i} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E3.6}\text{a}) \nonumber\]

    \[k_{2}^{z} = f_{2}\ \left( t_{i}\ + \ h,\ y_{i}\ + \ hk_{1}^{y},\ z_{i}\ + \ hk_{1}^{z} \right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{1.E3.6}\text{b}) \nonumber\]

    For \(i = 0, \ t_{o} = 0, \ y_{o} = 1, \ z_{o} = 2\)

    From Equation \((\PageIndex{1.E3.4}\text{a})\)

    \[\begin{split} k_{1}^{y} &= f_{1}\left( t_{0},y_{0},z_{0} \right)\\ &= f_{1}\left( 0,1,2 \right)\\ &= 2 \end{split}\]

    From Equation \((\PageIndex{1.E3.6}\text{a})\)

    \[\begin{split} k_{1}^{z} &= f_{2}\left( t_{0},y_{0},z_{0} \right)\\ &= f_{2}\left( 0,1,2 \right)\\ &= e^{- 0} - 2\left( 2 \right) - 1\\ &= -4 \end{split}\]

    From Equation \((\PageIndex{1.E3.4}\text{b})\)

    \[\begin{split} k_{2}^{y} &= f_{1}\left( t_{0} + h,y_{0} + hk_{1}^{y},z_{0} + hk_{1}^{z} \right)\\ &= f_{1}\left( 0 + 0.25,1 + \left( 0.25 \right)\left( 2 \right),2 + \left( 0.25 \right)\left( - 4 \right) \right)\\ &= f_{1}\left( 0.25,1.5,1 \right)\\ &= 1 \end{split}\]

    From Equation \((\PageIndex{1.E3.6}\text{b})\)

    \[\begin{split} k_{2}^{z} &= f_{2}\left( t_{0} + h,y_{0} + hk_{1}^{y},z_{0} + hk_{1}^{z} \right)\\ &= f_{2}\left( 0 + 0.25,1 + \left( 0.25 \right)\left( 2 \right),2 + \left( 0.25 \right)\left( - 4 \right) \right)\\ &= f_{2}\left( 0.25,1.5,1 \right)\\ &= e^{- 0.25} - 2\left( 1 \right) - 1.5\\ &= - 2.7212 \end{split}\]

    From Equation \((\PageIndex{1.E3.3})\)

    \[\begin{split} y_{1} &= y_{0} + \frac{1}{2}\left( k_{1}^{y} + k_{2}^{y} \right)h\\ &= 1 + \frac{1}{2}\left( 2 + 1 \right)\left( 0.25 \right)\\ &= 1.375 \end{split}\]

    \(y_{1}\) is the approximate value of \(y\) at

    \[t = t_{1} = t_{0} + h = 0 + 0.25 = 0.25 \nonumber\]

    \[y_{1} = y\left( 0.25 \right) \cong 1.375 \nonumber\]

    From Equation \((\PageIndex{1.E3.5})\)

    \[\begin{split} z_{1} &= z_{0} + \frac{1}{2}\left( k_{1}^{z} + k_{2}^{z} \right)h\\ &= 2 + \frac{1}{2}( - 4 + ( - 2.7212))(0.25)\\ &= 1.1598 \end{split}\]

    \(z_{1}\) is the approximate value of \(z\) at

    \[t = t_{1} = 0.25 \nonumber\]

    \[z_{1} = z\left( 0.25 \right) \approx 1.1598 \nonumber\]

    For \(i = 1, \ t_{1} = 0.25, \ y_{1} = 1.375, \ z_{1} = 1.1598\)

    From Equation \((\PageIndex{1.E3.4}\text{a})\)

    \[\begin{split} k_{1}^{y} &= f_{1}\left( t_{1},y_{1},z_{1} \right)\\ &= f_{1}\left( 0.25,1.375,1.1598 \right)\\ &= 1.1598 \end{split}\]

    From Equation \((\PageIndex{1.E3.6}\text{a})\)

    \[\begin{split} k_{1}^{z} &= f_{2}\left( t_{1},y_{1},z_{1} \right)\\ &= f_{2}\left( 0.25,1.375,1.1598 \right)\\ &= e^{- 0.25} - 2\left( 1.1598 \right) - 1.375\\ &= - 2.9158 \end{split}\]

    From Equation \((\PageIndex{1.E3.4}\text{b})\)

    \[\begin{split} k_{2}^{y} &= f_{1}\left( t_{1} + h,y_{1} + hk_{1}^{y},z_{1} + hk_{1}^{z} \right)\\ &= f_{1}\left( 0.25 + 0.25,1.375 + \left( 0.25 \right)(1.1598),1.1598 + \left( 0.25 \right)\left( - 2.9158 \right) \right)\\ &= f_{1}\left( 0.50,1.6649,0.43087 \right)\\ &= 0.43087 \end{split}\]

    From Equation \((\PageIndex{1.E3.6}\text{b})\)

    \[\begin{split} k_{2}^{z} &= f_{2}\left( t_{1} + h,y_{1} + hk_{1}^{y},z_{1} + hk_{1}^{z} \right)\\ &= f_{2}\left( 0.25 + 0.25,1.375 + \left( 0.25 \right)(1.1598),1.1598 + \left( 0.25 \right)\left( - 2.9158 \right) \right)\\ &= f_{2}\left( 0.50,1.6649,0.43087 \right)\\ &= e^{- 0.50} - 2\left( 0.43087 \right) - 1.6649\\ &= - 1.9201 \end{split}\]

    From Equation \((\PageIndex{1.E3.3})\)

    \[\begin{split} y_{2}\ &= y_{1} + \frac{1}{2}\left( k_{1}^{y} + k_{2}^{y} \right)h\\ &= 1.375 + \frac{1}{2}\left( 1.1598 + 0.43087 \right)\left( 0.25 \right)\\ &= 1.5738 \end{split}\]

    \(y_{2}\) is the approximate value of \(y\) at

    \[t = t_{2} = t_{1} + h = 0.25 + 0.25 = 0.50 \nonumber\]

    \[y_{2} = y\left( 0.50 \right) \approx 1.5738 \nonumber\]

    From Equation \((\PageIndex{1.E3.5})\)

    \[\begin{split} z_{2} &= z_{1} + \frac{1}{2}\left( k_{1}^{z} + k_{2}^{z} \right)h\\ &= 1.1598 + \frac{1}{2}( - 2.9158 + ( - 1.9201))(0.25)\\ &= 0.55533 \end{split}\]

    \(z_{2}\) is the approximate value of \(z\) at

    \[t = t_{2} = 0.50 \nonumber\]

    \[z_{2} = z\left( 0.50 \right) \approx 0.55533 \nonumber\]

    For \(i = 2, \ t_{2} = 0.50, \ y_{2} = 1.57384, \ z_{2} = 0.55533\)

    From Equation \((\PageIndex{1.E3.4}\text{a})\)

    \[\begin{split} k_{1}^{y} &= f_{1}\left( t_{2},y_{2},z_{2} \right)\\ &= f_{1}\left( 0.50,1.5738,0.55533 \right)\\ &= 0.55533 \end{split}\]

    From Equation \((\PageIndex{1.E3.6}\text{a})\)

    \[\begin{split} k_{1}^{z} &= f_{2}\left( t_{2},y_{2},z_{2} \right)\\ &= f_{2}\left( 0.50,1.5738,0.55533 \right)\\ &= e^{- 0.50} - 2\left( 0.55533 \right) - 1.5738\\ &= - 2.0779 \end{split}\]

    From Equation \((\PageIndex{1.E3.4}\text{b})\)

    \[\begin{split} k_{2}^{y} &= f_{2}\left( t_{2} + h,y_{2} + hk_{1}^{y},z_{2} + hk_{1}^{z} \right)\\ &= f_{1}\left( 0.50 + 0.25,1.5738 + \left( 0.25 \right)(0.55533),0.55533 + \left( 0.25 \right)\left( - 2.0779 \right) \right)\\ &= f_{1}\left( 0.75,1.7126,0.035836 \right)\\ &= 0.035836 \end{split}\]

    From Equation \((\PageIndex{1.E3.6}\text{b})\)

    \[\begin{split} k_{2}^{z} &= f_{2}\left( t_{2} + h,y_{2} + hk_{1}^{y},z_{2} + hk_{1}^{z} \right)\\ &= f_{2}\left( 0.50 + 0.25,1.5738 + \left( 0.25 \right)(0.55533),0.55533 + \left( 0.25 \right)\left( - 2.0779 \right) \right)\\ &= f_{2}\left( 0.75,1.7126,0.035836 \right)\\ &= e^{- 0.75} - 2\left( 0.035836 \right) - 1.7126\\ &= - 1.3119 \end{split}\]

    From Equation \((\PageIndex{1.E3.3})\)

    \[\begin{split} y_{3} &= y_{2} + \frac{1}{2}\left( k_{1}^{y} + k_{2}^{y} \right)h\\ &= 1.5738 + \frac{1}{2}\left( 0.55533 + 0.035836 \right)\left( 0.25 \right)\\ &= 1.6477 \end{split}\]

    \(y_{3}\) is the approximate value of \(y\) at

    \[t = t_{3} = t_{2} + h = 0.50 + 0.25 = 0.75 \nonumber\]

    \[y_{3} = y\left( 0.75 \right) \approx 1.6477 \nonumber\]

    b) From Equation \((\PageIndex{1.E3.5})\)

    \[\begin{split} z_{3} &= z_{2} + \frac{1}{2}\left( k_{1}^{z} + k_{2}^{z} \right)h\\ &= 0.55533 + \frac{1}{2}( - 2.0779 + ( - 1.3119))(0.25)\\ &= 0.13158 \end{split}\]

    \(z_{3}\) is the approximate value of \(z\) at

    \[t = t_{3} = 0.75 \nonumber\]

    \[z_{3} = z\left( 0.75 \right) \cong 0.13158 \nonumber\]

    The intermediate and the final results are shown in Table \(\PageIndex{1.1}\).

    Table \(\PageIndex{1.1}\). Intermediate results of Heun’s method.
    \(i\) \(0\) \(1\) \(2\)
    \(t_i\) \(0\) \(0.25\) \(0.50\)
    \(y_i\) \(1\) \(1.3750\) \(1.5738\)
    \(z_i\) \(2\) \(1.1598\) \(0.55533\)
    \(k_1^y\) \(2\) \(1.1598\) \(0.55533\)
    \(k_1^z\) \(-4\) \(-2.9158\) \(-2.0779\)
    \(k_2^y\) \(1\) \(0.43087\) \(0.035836\)
    \(k_2^z\) \(-2.7211\) \(-1.9201\) \(-1.3119\)
    \(y_{i+1}\) \(1.3750\) \(1.5738\) \(1.6477\)
    \(z_{i+1}\) \(1.1598\) \(0.55533\) \(0.13158\)

    Lesson 2: State-Space Modeling and Higher-Order and Coupled Ordinary Differential Equations

    Learning Objectives

    After successful completion of this lesson, you should be able to:

    1) set up higher-order and coupled ordinary differential equations as simultaneous first-order ordinary differential equations

    2) write higher-order and coupled ordinary differential equations in a state-space model form

    3) solve higher-order and coupled ordinary differential equations numerically using software programs

    Introduction

    In the previous lesson, we showed how to write a higher-order ordinary differential equation as a set of first-order differential equations along with the corresponding initial conditions. In this lesson, we show how we rewrite the set of first-order differential equations in matrix form called as the state-space model. We illustrate this through an example. We show the concept through higher-order and coupled ordinary differential equations.

    Example \(\PageIndex{2.1}\)

    Write the following ordinary differentiation equation as a state model

    \[17\frac{d^{3}y}{dt^{3}} + 3\frac{d^{2}y}{dt^{2}} + 7\frac{dy}{dt} + 5y = 11e^{- t}, \nonumber\]

    \[y\left( 0 \right) = 13,\ \frac{dy}{dt}\left( 0 \right) = 19,\ \frac{d^{2}y}{dt^{2}} = 23 \nonumber\]

    Solution

    The differential equation is of the third order, and we have three state variables. Let these be named as

    \[x_{1} = y\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E1.1}) \nonumber\]

    \[x_{2} = \dot{y}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E1.2}) \nonumber\]

    \[x_{3} = \ddot{y}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E1.3}) \nonumber\]

    Note the symbols. The symbol \(\dot{y}\) stands for \(\frac{dy}{dt}\) and \(\ddot{y}\) stands for \(\frac{d^{2}y}{dt^{2}}\). We are using these symbols as they are the norm in most textbooks.

    We also have

    \[\dot{x_{3}} = \dddot{y}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E1.4}) \nonumber\]

    So the given ordinary differential equation

    \[17\frac{d^{3}y}{dt^{3}} + 3\frac{d^{2}y}{dt^{2}} + 7\frac{dy}{dt} + 5y = 11e^{- t}, \nonumber\]

    can be written as

    \[17\dot{x_{3}} + 3x_{3} + 7x_{2} + 5x_{1} = 11e^{- t}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E1.5}) \nonumber\]

    Writing equations \((\PageIndex{2.E1.2})\), \((\PageIndex{2.E1.3})\), and \((\PageIndex{2.E1.5})\) with the first derivatives on the left side, we get

    \[\dot{x_{1}} = \dot{y} = x_{2} \nonumber\]

    \[\dot{x_{2}} = \ddot{y} = x_{3} \nonumber\]

    \[\dot{x_{3}} = \frac{11e^{- t} - 3x_{3} - 7x_{2} - 5x_{1}}{17}\nonumber\]

    Rewriting the above three equations with coefficients for all the state variables, we get

    \[\dot{x_{1}} = 0x_{1} + 1x_{2} + 0x_{3} + 0 \nonumber\]

    \[\dot{x_{2}} = 0x_{1} + 0x_{2} + 1x_{3} + 0 \nonumber\]

    \[\dot{x_{3}} = - \frac{5}{17}x_{1} - \frac{7}{17}x_{2} - \frac{3}{17}x_{3} + \frac{11e^{- t}}{17} \nonumber\]

    In the matrix form, the state-space model is given as

    \[\begin{bmatrix} \dot{x_{1}} \\ \dot{x_{2}} \\ \dot{x_{3}} \\ \end{bmatrix} = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ - \displaystyle\frac{5}{17} & - \displaystyle\frac{7}{17} & - \displaystyle\frac{3}{17} \\ \end{bmatrix}\begin{bmatrix} x_{1} \\ x_{2} \\ x_{3} \\ \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ \displaystyle\frac{11e^{- t}}{17} \\ \end{bmatrix} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E1.6}) \nonumber\]

    where the conditions are given by

    \[\begin{bmatrix} x_{1}(0) \\ x_{2}(0) \\ x_{3}(0) \\ \end{bmatrix} = \begin{bmatrix} y(0) \\ \dot{y}(0) \\ \ddot{y}(0) \\ \end{bmatrix} = \begin{bmatrix}\displaystyle y(0) \\\displaystyle \frac{dy}{dt}\left( 0 \right) \\\displaystyle \frac{d^{2}y}{dt^{2}}(0) \\ \end{bmatrix} = \begin{bmatrix} 13 \\ 19 \\ 23 \\ \end{bmatrix} \nonumber\]

    and

    \[y = \begin{bmatrix} 1 & 0 & 0 \\ \end{bmatrix}\begin{bmatrix} x_{1} \\ x_{2} \\ x_{3} \\ \end{bmatrix} \nonumber\]

    In Equation \((\PageIndex{2.E1.6})\), the \(3 \times 3\) matrix below

    \[[A] = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ - \displaystyle\frac{5}{17} & - \displaystyle\frac{7}{17} & - \displaystyle\frac{3}{17} \\ \end{bmatrix} \nonumber\]

    is the state matrix.

    The 3-element column vector in Equation \((\PageIndex{1.E1.6})\)

    \[[X]=\begin{bmatrix} x_{1} \\ x_{2} \\ x_{3} \\ \end{bmatrix} \nonumber\]

    is called the state vector.

    The 3-element column vector in Equation \((\PageIndex{1.E1.6})\)

    \[[u] = \begin{bmatrix} 0 \\ 0 \\ \displaystyle\frac{11e^{- t}}{17} \\ \end{bmatrix} \nonumber\]

    is called the input vector or forcing function vector. The left side of the equation consists of the first derivatives of the state vector.

    The general form of the state-space model is

    \[[\dot{X}] = [A][X]+[u] \nonumber\]

    Example \(\PageIndex{2.2}\)

    Reduce the following coupled ordinary differential equations to a set of first-order differential equations complete with initial conditions and in the matrix form required to solve them numerically.

    \[10\frac{d^2x_1}{dt^2} - 15\left(-2x_1 + x_2 \right) = 0 \nonumber\]

    \[20 \frac{d^2x_2}{dt^2} - 15\left(x_1-2x_2 \right) = 0 \nonumber\]

    \[\frac{dx_1}{dt}\left(0\right) = 4,\ \frac{dx_2}{dt}\left(0\right) = 5,\ x_1\left(0\right) = 2,\ x_2\left(0\right) = 3 \nonumber\]

    Solution

    The differential equations given are second-order ordinary differential equations

    \[10\frac{d^2x_1}{dt^2} - 15\left(-2x_1 + x_2 \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.1}) \nonumber\]

    \[20 \frac{d^2x_2}{dt^2} - 15\left(x_1-2x_2 \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.2}) \nonumber\]

    The coupled ordinary differential equations \((\PageIndex{2.E2.1})\) and \((\PageIndex{2.E2.2})\) would be rewritten as first-order ordinary differential equations.

    Assuming

    \[\frac{dx_1}{dt} = x_{3}, \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.3}) \nonumber\]

    \[\frac{dx_2}{dt} = x_{4} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.4}) \nonumber\]

    then

    \[\frac{d^{2}x_{1}}{dt^2} = \frac{dx_{3}}{dt},\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.5}) \nonumber\]

    \[\frac{d^{2}x_{2}}{dt^2} = \frac{dx_{4}}{dt}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.6}) \nonumber\]

    Substituting Equations \((\PageIndex{2.E2.3})\), \((\PageIndex{2.E2.4})\), \((\PageIndex{2.E2.5})\), and \((\PageIndex{2.E2.6})\) with the two new variables \(x_{3}\) and \(x_{4}\) in the given second-order ordinary differential equation \((\PageIndex{2.E2.1})\) gives

    \[10\frac{dx_{3}}{dt} - 15\left(-2x_{1} + x_{2}\right) = 0 \nonumber\]

    and then rewriting it gives

    \[\frac{dx_{3}}{dt} = 1.5\left(-2x_1+x_2\right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.7}) \nonumber\]

    Substituting equations \((\PageIndex{2.E2.3})\), \((\PageIndex{2.E2.4})\), \((\PageIndex{2.E2.5})\), \((\PageIndex{2.E2.6})\) with the two new variables \(x_{3}\) and \(x_{4}\) in the given second-order ordinary differential equation \((\PageIndex{2.E2.2})\) gives

    \[20\frac{dx_4}{dt} - 15\left(x_{1} - 2x_{2}\right) = 0 \nonumber\]

    and then rewriting it gives

    \[\frac{dx_4}{dt} = 0.75\left(x_{1} - 2x_{2}\right)\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.8}) \nonumber\]

    Now, writing the equations \((\PageIndex{2.E2.3})\), \((\PageIndex{2.E2.4})\), \((\PageIndex{2.E2.7})\), and \((\PageIndex{2.E2.8})\) along with the initial conditions \[\frac{dx_{1}}{dt} = x_3,\ x_1(0) = 4,\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.9}\text{a}) \nonumber\]

    \[\frac{dx_2}{dt} = x_4,\ x_2(0) = 5,\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.9}\text{b}) \nonumber\]

    \[\frac{dx_3}{dt} = 1.5(-2x_1+x_2),\ x_3(0) = 2,\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.9}\text{c}) \nonumber\]

    \[\frac{dx_4}{dt} = 0.75(x_1-2x_2),\ x_4(0) = 3,\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.9}\text{d}) \nonumber\]

    Preparing for the state-space model form, Equations \((\PageIndex{2.E2.9}\text{a})\) through \((\PageIndex{2.E2.9}\text{d})\) gives

    \[\frac{dx_1}{dt} = 0x_1+0x_2+ 1x_3+0x_4,\ x_1(0) = 4,\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.10}\text{a}) \nonumber\]

    \[\frac{dx_2}{dt} = 0x_1 + 0x_2+ 0x_3+ 1x_4,\ x_2(0) = 5,\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.10}\text{b}) \nonumber\]

    \[\frac{dx_3}{dt} = -3x_1 +1.5x_2 + 0x_3 +0x_4,\ x_3(0) = 2,\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.10}\text{c}) \nonumber\]

    \[\frac{dx_4}{dt} = 0.75x_1 -1.5x_2 +0x_3+0x_4,\ x_4(0) = 3,\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E2.10}\text{d}) \nonumber\]

    Equations \((\PageIndex{2.E2.10}\text{a})\) through \((\PageIndex{2.E2.10}\text{d})\) can now be written in state-space model form as

    \[\left[\begin{array}{l} \dot{x}_{1} \\ \dot{x}_{2} \\ \dot{x}_{3} \\ \dot{x}_{4} \end{array}\right]=\left[\begin{array}{cccc} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ -3 & 1.5 & 0 & 0 \\ 0.75 & -1.5 & 0 & 0 \end{array}\right]\left[\begin{array}{l} x_{1} \\ x_{2} \\ x_{3} \\ x_{4} \end{array}\right] \nonumber\]

    with the initial conditions as

    \[\left[\begin{array}{l} x_{1}(0) \\ x_{2}(0) \\ x_{3}(0) \\ x_{4}(0) \end{array}\right]=\left[\begin{array}{l} 2 \\ 3 \\ 4 \\ 5 \end{array}\right] \nonumber\]

    Can you identify the state vector, state matrix, input vector, and the initial conditions on the state vector?

    Example \(\PageIndex{2.3}\)

    A suspension system of a bus can be modeled as below.

    A bus in motion.
    A model of the suspension system for a quarter of a bus,, with the input profile of the road modeled as W, a suspension mass above the road connected to the road by a spring-and-dampener system with spring and dampener constants of k2 and B2 respectively, and a body mass above the suspension connected to the suspension by a spring-and-dampener system with spring and dampener constants k1 and B1 respectively. Displacement of the body is given as x1 and displacement of the suspension is given as x2, with the positive directions being upwards.
    Figure \(\PageIndex{2.1}\). a) A bus in motion b) A model of 1/4th of suspension system of a bus (Credit: Model and numbers from <http://www.monografias.com/trabajos-pdf/modeling-bus-suspension-transfer-function/modeling-bus-suspension-transfer-function.pdf>)

    Only 1/4th of the bus is modeled. The differential equations that govern the above system can be derived (this is something you will do in your vibrations course) as

    \[M_{1}\frac{d^{2}x_{1}}{dt^{2}} + B_{1}\left( \frac{dx_{1}}{dt} - \frac{dx_{2}}{dt} \right) + K_{1}\left( x_{1} - x_{2} \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.1}) \nonumber\]

    \[\begin{split} M_{2}\frac{d^{2}x_{2}}{dt^{2}} + B_{1}\left( \frac{dx_{2}}{dt} - \frac{dx_{1}}{dt} \right) &+ K_{1}\left( x_{2} - x_{1} \right) + B_{2}\left( \frac{dx_{2}}{dt} - \frac{dw}{dt} \right)\\ & \ \ \ \ \ \ + K_{2}\left( x_{2} - w \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.2}) \end{split}\]

    \[x_{1}(0) = 0, \ x_{3}(0) = 0, \ x_{2}(0) = 0, \ x_{4}(0) = 0 \nonumber\]

    where

    \[M_{1} =\text{body mass} \nonumber\]

    \[M_{2} =\text{suspension mass} \nonumber\]

    \[K_{1} =\text{spring constant of the suspension system} \nonumber\]

    \[K_{2} =\text{spring constant of wheel and tire} \nonumber\]

    \[B_{1} =\text{damping constant of the suspension system} \nonumber\]

    \[B_{2} =\text{damping constant of wheel and tire} \nonumber\]

    \[x_{1} =\text{displacement of the body mass as a function of time} \nonumber\]

    \[x_{2} =\text{displacement of the suspension mass as a function of time} \nonumber\]

    \[w =\text{input profile of the road as a function of time} \nonumber\]

    The constants are given as

    \[m_{1} = 2500\ \text{kg} \nonumber\]

    \[m_{2} = 320\ \text{kg} \nonumber\]

    \[k_{1} = 80000\ \text{N/m}, \nonumber\]

    \[k_{2} = 500000\ \text{N/m}, \nonumber\]

    \[B_{1} = 350\ \text{N-s/m}, \nonumber\]

    \[B_{2} = 15020\ \text{N} \cdot \text{s/m} \nonumber\]

    Reduce the simultaneous differential equations \((\PageIndex{2.E3.1})\) and \((\PageIndex{2.E3.2})\) to simultaneous first-order differential equations and put those in the state variable form complete with corresponding initial conditions.

    Solution

    Substituting the values of the constants in the two differential equations \((\PageIndex{2.E3.1})\) and \((\PageIndex{2.E3.2})\) gives the differential equations \((\PageIndex{2.E3.3})\) and \((\PageIndex{2.E3.4})\), respectively.

    \[2500\frac{d^{2}x_{1}}{dt^{2}} + 350\left( \frac{dx_{1}}{dt} - \frac{dx_{2}}{dt} \right) + 80000\left( x_{1} - x_{2} \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.3}) \nonumber\]

    \[\begin{split} &320\frac{d^{2}x_{2}}{dt^{2}} + 350\left( \frac{dx_{2}}{dt} - \frac{dx_{1}}{dt} \right) + 80000\left( x_{2} - x_{1} \right) + 15020\left( \frac{dx_{2}}{dt} - \frac{dw}{dt} \right) +\\ & 500000(x_{2} - w) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.4}) \end{split}\]

    Since \(w\) is an input, we take it to the right-hand side to show it as a forcing function and rewrite Equations \((\PageIndex{2.E3.4})\) as

    \[\begin{split} &320\frac{d^{2}x_{2}}{dt^{2}} + 350\left( \frac{dx_{2}}{dt} - \frac{dx_{1}}{dt} \right) + 80000\left( x_{2} - x_{1} \right) + 15020\left( \frac{dx_{2}}{dt} \right) + 500000x_{2}\\ &=15020\frac{dw}{dt}+500000w\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.5}) \end{split}\]

    Now let us start the process of reducing the 2 simultaneous differential equations (Equations \((\PageIndex{2.E3.3})\) and \((\PageIndex{2.E3.5})\)) to 4 simultaneous first-order ordinary differential equations.

    Choose

    \[\frac{dx_{1}}{dt} = x_{3},\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.6}) \nonumber\]

    \[\frac{dx_{2}}{dt} = x_{4},\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.7}) \nonumber\]

    then Equation \((\PageIndex{2.E3.3})\)

    \[2500\frac{d^{2}x_{1}}{dt^{2}} + 350\left( \frac{dx_{1}}{dt} - \frac{dx_{2}}{dt} \right) + 80000\left( x_{1} - x_{2} \right) = 0 \nonumber\]

    can be written as

    \[2500\frac{dx_{3}}{dt} + 350\left( x_{3} - x_{4} \right) + 80000\left( x_{1} - x_{2} \right) = 0 \nonumber\]

    \[2500\frac{dx_{3}}{dt} = - 350\left(x_{3} - x_{4}\right) - 80000\left(x_{1} - x_{2}\right) \nonumber\]

    \[\begin{split} \frac{dx_{3}}{dt} &= - 0.14\left( x_{3} - x_{4} \right) - 32\left( x_{1} - x_{2} \right)\\ &= - 32x_{1} - 0.14x_{3} + 32x_{2} + 0.14x_{4}\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.8})\end{split}\]

    and Equation \((\PageIndex{2.E3.5})\)

    \[\begin{split} &320\frac{d^{2}x_{2}}{dt^{2}} + 350\left( \frac{dx_{2}}{dt} - \frac{dx_{1}}{dt} \right) + 80000\left( x_{2} - x_{1} \right) + 15020\left( \frac{dx_{2}}{dt} \right) + 500000x_{2} \\ &= 15020\frac{dw}{dt} + 500000w \end{split}\]

    can be written as

    \[\begin{split} &320\frac{dx_{4}}{dt} + 350\left( x_{4} - x_{3} \right) + 80000\left( x_{2} - x_{1} \right) + 15020x_{4} + 500000x_{2}\\ &= 15020\frac{dw}{dt} + 500000w \end{split}\]

    \[\begin{split} 320\frac{dx_{4}}{dt} = &- 350(x_{4} - x_{3}) - 80000(x_{2} - x_{1}) - 15020x_{4} - \\ & 500000x_{2} + 15020\frac{dw}{dt} + 500000w \end{split}\]

    \[\begin{split} \frac{dx_{4}}{dt} &= - 1.09375\left( x_{4} - x_{3} \right) - 250\left( x_{2} - x_{1} \right) - 46.9375x_{4} - 1562.5x_{2}\\& \ \ \ \ \ \ \ \ \ \ + 46.9375\frac{dw}{dt} + 1562.5w\\ &= 250x_{1} + 1.09375x_{3} - 1812.5x_{2} - 48.03125x_{4}\\ &\ \ \ \ \ \ \ \ \ \ + 1562.5w + 46.9375\frac{dw}{dt}\ \ \ \ \ \ \ \ \ (\PageIndex{2.E3.9}) \end{split}\]

    The 4 simultaneous first-order differential equations given by Equations \((\PageIndex{2.E3.6})\) through \((\PageIndex{2.E3.9})\), complete with the corresponding initial condition, are

    \[\begin{split} \frac{dx_{1}}{dt} &= x_{3}\\ &=f_1\left(t,x_1,x_2,x_3,x_4\right)\ \text{with } x_1\left(0\right)=0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.10}) \end{split}\]

    \[\begin{split} \frac{dx_{2}}{dt} &= x_{4}\\ &=f_2\left(t,x_1,x_2,x_3,x_4\right)\text{with }x_2\left(0\right)=0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.11}) \end{split}\]

    \[\begin{split} \frac{dx_{3}}{dt} &= - 32x_{1} + 32x_{2} - 0.14x_{3} + 0.14x_{4}\\ &=f_3\left(t,x_1,x_2,x_3,x_4\right)\text{with }x_3\left(0\right)=0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.12}) \end{split}\]

    \[\begin{split} \frac{dx_{4}}{dt} &= 250x_{1} - 1812.5x_{2} + 1.09375x_{3} - 48.03125x_{4} + 1562.5w + 46.9375\frac{dw}{dt}\\ &=f_4\left(t,x_1,x_2,x_3,x_4\right)\text{with }x_4\left(0\right)=0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.13}) \end{split}\]

    The profile of the road is given below.

    Assuming that the bus is going at \(60 \ \text{mph}\), that is, approximately \(27 \ \text{m/s}\), it takes

    \[\frac{6 \ \text{m}}{27 \ \text{m/s}} = 0.22\ \text{s} \nonumber\]

    to go through one period. So the frequency

    \[\begin{split} f &= \frac{1}{0.22}\\ &= 4.545\ \text{Hz}\end{split}\]

    The angular frequency then is

    \[\begin{split} \omega &=2 \times \pi \times 4.545\\ &= 28.6\ \text{rad/s} \end{split}\]

    giving

    \[\begin{split} w &= 0.01\sin\left( {\omega t} \right)\\ &= 0.01\sin\left( 28.6t \right)\end{split}\]

    and

    \[\frac{dw}{dt} = 0.286\cos\left( 28.6t \right) \nonumber\]

    Graph of the periodic road profile as a sine wave of amplitude 0.01 meters and period 6 meters.
    Figure \(\PageIndex{2.2}\). Periodic road profile.

    To put the differential equations given by Equations \((\PageIndex{2.E3.10})\) through \((\PageIndex{2.E3.13})\) in matrix form, we rewrite them as

    \[\frac{dx_{1}}{dt} = x_{3} = 0x_{1} + 0x_{2} + 1x_{3} + 0x_{4},\ {x}_{1}\left( 0 \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.14}) \nonumber\]

    \[\frac{dx_{2}}{dt} = x_{4} = 0x_{1} + 0x_{2} + 0x_{3} + 1x_{4},\ {x}_{2}\left( 0 \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.15}) \nonumber\]

    \[\frac{dx_{3}}{dt} = - 32x_{1} + 32x_{2} - 0.14x_{3} + 0.14x_{4},\ x_{3}\left( 0 \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.16}) \nonumber\]

    \[\begin{split} \frac{dx_{4}}{dt} = &250x_{1} - 1812.5x_{2} + 1.09375x_{3} - 48.03125x_{4} + \\ &1562.5w + 46.9375\frac{dw}{dt},\ x_{4}\left( 0 \right) = 0\;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.17}) \end{split}\]

    In state variable matrix form, the differential equations are given by

    \[\begin{split} \begin{bmatrix} \displaystyle \frac{dx_{1}}{dt} \\ \displaystyle \frac{dx_{2}}{dt} \\ \displaystyle \frac{dx_{3}}{dt} \\ \displaystyle \frac{dx_{4}}{dt} \\ \end{bmatrix} &= \begin{bmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ - 32 & 32 & - 0.14 & 0.14 \\ 250 & - 1812.5 & 1.09375 & - 48.03125 \\ \end{bmatrix}\begin{bmatrix} x_{1} \\ x_{2} \\ x_{3} \\ x_{4} \\ \end{bmatrix} \\ & \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ + \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1562.5w + 46.9375\displaystyle \frac{dw}{dt} \\ \end{bmatrix} \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.18})\end{split}\]

    where

    \[w = 0.01\sin(28.6t) \;\;\;\;\;\;\;\;\;\;\;\; (\PageIndex{2.E3.19}) \nonumber\]

    and the corresponding initial conditions are

    \[\begin{bmatrix} x_{1}(0) \\ x_{2}(0) \\ x_{3}(0) \\ x_{4}(0) \\ \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \\ \end{bmatrix} \nonumber\]

    Can you identify the state vector, the state matrix, the input vector, and the initial conditions on the state vector?

    State-space models is how numerical solvers expect you to enter the data. For example, the above state-space model would be entered as the following on MATLAB.

    First, a function is defined where t is the independent variable, and x is the state-space vector. The names diffx and sysofeqn are the choice of the user. The arguments of the function are the independent variable t and the state vector x. Inside the function, \([A]\) is the state-space matrix from Equation \((\PageIndex{2.E3.18})\), \(w\) is the forcing function from Equation \((\PageIndex{2.E3.19})\), and \([B]\) is the input vector.

    function diffx=sysofeqn(t,x)

    A=[0 0 1 0; …

    0 0 0 1; …

    -32 32 -0.14 0.14; …

    250 -1812.5 1.09375 -48.03125];

    w=0.01*sin(28.6*t);

    dw=0.286*cos(28.6*t);

    B=[0; 0; 0; 1652.5*w+46.9375*dw];

    diffx=A*x+B;

    end

    How is the function used? Assume that you want the output between \(t=0\) and \(t=10\). You can use that time span shown as the variable tspan. Then the initial conditions of the state vector are entered. The ode45 routine is a combination of the Runge-Kutta 4th and 5th order methods to solve a system of first-order ordinary differential equations. The inputs of the ode45 routine are the system of equations, the span in which the output is requested, and the initial conditions.

    tspan=[0 10];

    initial_cond=[0;0;0;0];

    [t,x]=ode45('sysofeqn',tspan,initial_cond);

    figure (1)

    plot(t,x(:,1))

    A sample of the outputs is shown below with the values of the independent variable \(t\), the state vector \(x\), and the output of \(x(1)\) vs \(t\).

    \[\begin{split} t &= \\ &\begin{array}{c} 0 \\ 0.000003742346606 \\ 0.000007484693212 \\ 0.000011227039818 \\ 0.000014969386423 \\ 0.000033681119453 \\ 0.000052392852482 \end{array} \end{split}\]

    \[\begin{split} x &= \\ &\begin{array}{c} 0 \\ 0.000000000000000 \\ 0.000000000000000 \\ 0.000000000000000 \\ 0.000000000000001 \\ 0.000000000000012 \\ 0.000000000000045 \end{array} \quad \begin{array}{c} 0 \\ 0.000000000094002 \\ 0.000000000376002 \\ 0.000000000845991 \\ 0.000000001503960 \\ 0.000000007613185 \\ 0.000000018420550 \end{array} \quad \begin{array}{c} 0 \\ 0.000000000013164 \\ 0.000000000052670 \\ 0.000000000118540 \\ 0.000000000210794 \\ 0.000000001068580 \\ 0.000000002589166 \end{array} \quad \begin{array}{c} 0 \\ 0.000050236522812 \\ 0.000100470633045 \\ 0.000150702329280 \\ 0.000200931610101 \\ 0.000452041733437 \\ 0.000703091259071 \end{array} \end{split}\]

    Plot of x1 vs t for the bus-suspension problem.
    Figure \(\PageIndex{2.3}\). Plot of\(x_1\) vs. \(t\) for the bus-suspension problem

    Multiple Choice Test

    (1). To solve, the ordinary differential equation

    \[2\frac{d^{2}y}{dx^{2}} + 5\frac{dy}{dx} + 6y = 11e^{- x}, \ y(0) = 5, \ \frac{dy}{dx}(0) = 7 \nonumber\]

    can be reduced to a net of how many first order differential equations?

    (A) 1

    (B) 2

    (C) 3

    (D) 4

    (2). Find the state variable form of the following linear dynamic system

    \[2\frac{d^{2}x_{1}}{dt^{2}} + 3x_{1} - 5\left( x_{2} - x_{1} \right) - 7\left( \frac{dx_{2}}{dt} - \frac{dx_{1}}{dt} \right) = 0 \nonumber\]

    \[11\frac{d^{2}x_{2}}{dt^{2}} + 5\left( x_{2} - x_{1} \right) + 7\left( \frac{dx_{2}}{dt} - \frac{dx_{1}}{dt} \right) = \sin(2t) \nonumber\]

    \[\frac{dx_{1}}{dt}(0) = 13,\ \ \frac{dx_{2}}{dt}(0) = 17,\ \ x_{1}(0) = 23,\ \ x_{2}(0) = 29\nonumber\]

    where \(x_{1}\) and \(x_{2}\) are dependent variables and one can choose \(v_{1} = \dfrac{dx_{1}}{dt}\) and \(v_{2} = \dfrac{dx_{2}}{dt}\) as newly introduced dependent variables for the state variable form.

    (A) \(\ \ \ \ \begin{bmatrix} \dot{x_{1}} \\ \dot{v_{1}} \\ \begin{matrix} \dot{x_{2}} \\ \dot{v_{2}} \\ \end{matrix} \\ \end{bmatrix} = \left\lbrack \begin{matrix} 0 & - 1 & 0 \\ 4 & \frac{7}{2} & - \frac{5}{2} \\ \begin{matrix} 0 \\ - \frac{5}{11} \\ \end{matrix} & \begin{matrix} 0 \\ - \frac{7}{11} \\ \end{matrix} & \begin{matrix} 0 \\ \frac{5}{11} \\ \end{matrix} \\ \end{matrix}\ \ \ \ \begin{matrix} 0 \\ - \frac{7}{2} \\ \begin{matrix} - 1 \\ \frac{7}{11} \\ \end{matrix} \\ \end{matrix} \right\rbrack\begin{bmatrix} x_{1} \\ v_{1} \\ \begin{matrix} x_{2} \\ v_{2} \\ \end{matrix} \\ \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ \begin{matrix} 0 \\ \sin(2t) \\ \end{matrix} \\ \end{bmatrix}\)

    with \(\begin{bmatrix} x_{1}(0) \\ v_{1}(0) \\ \begin{matrix} x_{2}(0) \\ v_{2}(0) \\ \end{matrix} \\ \end{bmatrix} = \begin{bmatrix} 23 \\ 13 \\ \begin{matrix} 29 \\ 17 \\ \end{matrix} \\ \end{bmatrix}\)

    (B) \(\ \ \ \ \begin{bmatrix} \dot{x_{1}} \\ \dot{v_{1}} \\ \begin{matrix} \dot{x_{2}} \\ \dot{v_{2}} \\ \end{matrix} \\ \end{bmatrix} = \left\lbrack \begin{matrix} 0 & 1 & 0 \\ - 4 & - \frac{7}{2} & \frac{5}{2} \\ \begin{matrix} 0 \\ \frac{5}{11} \\ \end{matrix} & \begin{matrix} 0 \\ \frac{7}{11} \\ \end{matrix} & \begin{matrix} 0 \\ - \frac{5}{11} \\ \end{matrix} \\ \end{matrix}\ \ \ \ \begin{matrix} 0 \\ \frac{7}{2} \\ \begin{matrix} 1 \\ - \frac{7}{11} \\ \end{matrix} \\ \end{matrix} \right\rbrack\begin{bmatrix} x_{1} \\ v_{1} \\ \begin{matrix} x_{2} \\ v_{2} \\ \end{matrix} \\ \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ \begin{matrix} 0 \\ \sin(2t) \\ \end{matrix} \\ \end{bmatrix}\)

    with \(\begin{bmatrix} x_{1}(0) \\ v_{1}(0) \\ \begin{matrix} x_{2}(0) \\ v_{2}(0) \\ \end{matrix} \\ \end{bmatrix} = \begin{bmatrix} 23 \\ 13 \\ \begin{matrix} 29 \\ 17 \\ \end{matrix} \\ \end{bmatrix}\)

    (C) \(\ \ \ \ \begin{bmatrix} \dot{x_{1}} \\ \dot{v_{1}} \\ \begin{matrix} \dot{x_{2}} \\ \dot{v_{2}} \\ \end{matrix} \\ \end{bmatrix} = \left\lbrack \begin{matrix} 0 & 1 & 0 \\ - 4 & - \frac{7}{2} & \frac{5}{2} \\ \begin{matrix} 0 \\ \frac{5}{11} \\ \end{matrix} & \begin{matrix} 0 \\ \frac{7}{11} \\ \end{matrix} & \begin{matrix} 0 \\ - \frac{5}{11} \\ \end{matrix} \\ \end{matrix}\ \ \ \ \begin{matrix} 0 \\ \frac{7}{2} \\ \begin{matrix} 1 \\ - \frac{7}{11} \\ \end{matrix} \\ \end{matrix} \right\rbrack\begin{bmatrix} x_{1} \\ v_{1} \\ \begin{matrix} x_{2} \\ v_{2} \\ \end{matrix} \\ \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ \begin{matrix} 0 \\ \frac{\sin(2t)}{11} \\ \end{matrix} \\ \end{bmatrix}\)

    with \(\begin{bmatrix} x_{1}(0) \\ v_{1}(0) \\ \begin{matrix} x_{2}(0) \\ v_{2}(0) \\ \end{matrix} \\ \end{bmatrix} = \begin{bmatrix} 23 \\ 13 \\ \begin{matrix} 29 \\ 17 \\ \end{matrix} \\ \end{bmatrix}\)

    (D) \(\begin{bmatrix} \dot{v_{1}} \\ \dot{v_{2}} \\ \end{bmatrix} = \left\lbrack \begin{matrix} - 4 & - \frac{7}{2} & \frac{5}{2} \\ \frac{5}{11} & \frac{7}{11} & - \frac{5}{11} \\ \end{matrix}\ \ \ \ \begin{matrix} \frac{7}{2} \\ - \frac{7}{11} \\ \end{matrix} \right\rbrack\begin{bmatrix} v_{1} \\ v_{2} \\ \end{bmatrix} + \begin{bmatrix} 0 \\ \frac{\sin(2t)}{11} \\ \end{bmatrix}\)

    with \(\begin{bmatrix} v_{1} \\ v_{2} \\ \end{bmatrix} = \begin{bmatrix} 13 \\ 17 \\ \end{bmatrix}\)

    (3). Given

    \[2\frac{d^{2}y}{dx^{2}} + 5\frac{dy}{dx} + 7y = 6x^{2}, \ y(0) = 9, \ \frac{dy}{dx}(0) = 11 \nonumber,\]

    what is the estimated value of \(y(4)\) using Euler’s method? Step size used is \(h=2\).

    (A) \(-205.0\)

    (B) \(192.0\)

    (C) \(9.181\)

    (D) \(31\)

    (4). Given

    \[2\frac{d^{2}y}{dx^{2}} + 5\frac{dy}{dx} + 7y = 6x^{2}, \ y(0) = 9, \ \frac{dy}{dx}(0) = 11 \nonumber,\]

    what is the estimated true error of \(y(4)\) using Heun’s method? Step size used is \(h=2\).

    (A) \(-205.0\)

    (B) \(192.0\)

    (C) \(9.181\)

    (D) \(-77\)

    (5). The differential equation

    \[2\frac{d^{2}y}{dx^{2}} + 5\frac{dy}{dx} + 7y = 6x^{2}, \ y(0) = 9, \ \frac{dy}{dx}(0) = 11 \nonumber\]

    is solved by using Euler’s method. A step size of \(h=2\) is used and the following output variables are tabled.

    \(X\) \(Y\) \(Z\)
    \(0\) \(9\) \(11\)
    \(2\) \(31\) \(-107\)
    \(4\) \(-205\) \(235\)

    What is the best estimate of \(\dfrac{dy}{dx}(4)\) and \(\dfrac{d^{2}y}{dx^{2}}(4)\)?

    (A) \(\dfrac{dy}{dx}(4) = 235\ ;\ \dfrac{d^{2}y}{dx^{2}}(4) = 178\)

    (B) \(\dfrac{dy}{dx}(4) = - 122.5\ ;\ \dfrac{d^{2}y}{dx^{2}}(4) = 178\)

    (C) \(\dfrac{dy}{dx}(4) = 235\ ;\ \dfrac{d^{2}y}{dx^{2}}(4) = 171\)

    (D) \(\dfrac{dy}{dx}(4) = - 122.5\ ;\ \dfrac{d^{2}y}{dx^{2}}(4) = 171\)

    (6). Given the state variable form of a second order ordinary differential equation as

    \(\begin{bmatrix} \dot{y} \\ \dot{z} \\ \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ - 3 & - 6 \\ \end{bmatrix}\begin{bmatrix} y \\ z \\ \end{bmatrix} + \begin{bmatrix} 0 \\ 5x^{2} \\ \end{bmatrix}\)

    where \(\begin{bmatrix} y(0) \\ z(0) \\ \end{bmatrix} = \begin{bmatrix} 9 \\ 11 \\ \end{bmatrix}\),

    then the second order ODE in question is

    (A) \(\dfrac{d^{2}y}{dx^{2}} - 6\dfrac{dy}{dx} - 3y = 5x^{2}, \ y(0) = 9, \ \dfrac{dy}{dx}(0) = 11\)

    (B) \(\dfrac{d^{2}y}{dx^{2}} + 6\dfrac{dy}{dx} + 3y = 5x^{2}, \ y(0) = 9, \ \dfrac{dy}{dx}(0) = 11\)

    (C) \(\dfrac{d^{2}y}{dx^{2}} + 6\dfrac{dy}{dx} + 3y = 5x^{2}, \ y(0) = 11, \ \dfrac{dy}{dx}(0) = 9\)

    (D) \(\dfrac{d^{2}y}{dx^{2}} + 6\dfrac{dy}{dx} - 3y = 5x^{2}, \ y(0) = 9, \ \dfrac{dy}{dx}(0) = 11\)

    Problem Set

    (1). Reduce the following 2nd order ordinary differential equation to a set of first-order ordinary differential equations complete with initial conditions and in the form required to solve them numerically.

    \[5\frac{d^{2}y}{dt^{2}} + 3\frac{dy}{dt} + 7y = e^{- t} + t^{2},\ y(0) = 6,\ \frac{dy}{dt}(0) = 11. \nonumber\]

    (2). Reduce the following coupled ordinary differential equations to a set of first-order ordinary differential equations complete with initial conditions and in the form required for solving them numerically.

    \[10\frac{d^{2}x_{1}}{dt^{2}} - 15( - 2x_{1} + x_{2}) = 0, \nonumber\]

    \[20\frac{d^{2}x_{2}}{dt^{2}} - 15(x_{1} - 2x_{2}) = 0, \nonumber\]

    \[x_{1}(0) = 2,\ x_{2}(0) = 3,\ \frac{dx_{1}}{dt}(0) = 4,\ \frac{dx_{2}}{dt}(0) = 5. \nonumber\]

    (3). The acceleration of a spring-mass system is given by

    \[\frac{d^{2}x}{dt^{2}} + x = e^{- t}, \ t > 0 \nonumber\]

    where \(x\) is the displacement of the mass given in meters and \(t\) is the time given in seconds. The initial conditions are given as \(x(0) = 3\), \(\displaystyle \frac{dx}{dt}(0) = 2\).

    a) What is the value of displacement, velocity, and acceleration at \(t = 0^{+}\) seconds?

    b) Use Euler’s method to find the value of displacement, velocity, and acceleration at \(t = 0.5\) seconds. Use a step size of \(0.25\) seconds.

    c) What is the exact value of displacement, velocity and acceleration at \(t = 0.5\) seconds.

    Answer

    \(a)\ 3,\ 2 ,\ -2\)
    \(b)\ 3.8750,\ 0.81970,\ -3.2685\)
    \(c)\ 3.6958,\ 0.69213,\ -3.0893\)

    (4). The acceleration of a spring-mass system is given by

    \[\frac{d^{2}x}{dt^{2}}\ + x = \ e^{- t} \nonumber\]

    where \(x\) is the displacement of the mass given in meters and \(t\) is the time given in seconds. The initial conditions are given as \(x(0) = 3\), \(\displaystyle \frac{dx}{dt}(0) = 2\). Use the Runge-Kutta 2nd order Ralston’s method to find the value of displacement, velocity, and acceleration at \(t = 0.5\) seconds. Use a step size of \(0.25\) seconds.

    Answer

    \(3.7067\ \text{m},\ 0.67811\ \text{m/s},\ -3.1001\ \text{m/s}^2\)

    (5). Reduce the following ordinary differential equation to the state-space model form. Include the initial conditions in proper form as well.

    \[4\frac{d^{2}y}{dt^{2}} + 9\frac{dy}{dt} + 12y = 3 \sin(7x),\ y(0) = 13,\ \frac{dy}{dt}(0) = 19. \nonumber\]

    (6). Reduce the following coupled ordinary differential equations to the state space model form. Include the initial conditions in proper form as well.

    \[25\frac{d^{2}x_{1}}{dt^{2}} - 40( - 3x_{1} + x_{2}) = 3 \cos(3t), \nonumber\]

    \[32\frac{d^{2}x_{2}}{dt^{2}} - 12x_{1} - 24x_{2} = 7e^{-3t}, \nonumber\]

    \[x_{1}(0) = 23,\ x_{2}(0) = 17,\ \frac{dx_{1}}{dt}(0) = 37,\ \frac{dx_{2}}{dt}(0) = 29. \nonumber\]


    This page titled 8.05: On Solving Higher-Order and Coupled Ordinary Differential Equations is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Autar Kaw via source content that was edited to the style and standards of the LibreTexts platform.