Write the differential equation as a first order ode on the form $\frac{d}{dt}\mathbf{y}(t)=\mathbf{f}(\mathbf{y}).$

154 Views Asked by At

The motion of a harmonic ocilator $x(t)$ is described by the differential equation

$$\frac{d^2x}{dt^2}=-\frac{k}{m}x-\frac{c}{m}\frac{dx}{dt}$$

Write the differential equation as a first order ode on the form $\frac{d}{dt}\mathbf{y}(t)=\mathbf{f}(\mathbf{y}).$

I'm confused by the notation $\frac{d}{dt}\mathbf{y}(t)=\mathbf{f}(\mathbf{y}).$ The function $\mathbf{f},$ is it the same as a transofmrationmatrix, say $A$ so that the form is equivalent to $\mathbf{y}'=A\mathbf{y}?$ If this is ineed the case, then here is my try:

Let $\mathbf y=(y_1,y_2)^T$. Then we have that

$$\frac{d}{dt}\begin{bmatrix}y_1 \\ y_2\end{bmatrix}=\begin{bmatrix}0 & 1 \\ -\frac{k}{m} & -\frac{c}{m}\end{bmatrix}\begin{bmatrix}y_1 \\ y_2\end{bmatrix}.$$

The exam solutions just say

$$\frac{d}{dt}\begin{bmatrix}x \\ v \end{bmatrix}=\begin{bmatrix}v \\ -\frac{k}{m}x-\frac{c}{m}v\end{bmatrix}.$$

Questions:

  1. What are they doing?
  2. Is my answer wrong?
  3. What is a good step-by-step algorithm to do this?
2

There are 2 best solutions below

4
On BEST ANSWER

Your solution is equivalent to the second one. If you rename your variables $y_1=x$ and $y_2=v$ and carry out the matrix vector multiplication you arrive at their solution, i.e. $$\frac{d}{dt}\begin{bmatrix}x \\ v\end{bmatrix}=\begin{bmatrix}0 & 1 \\ -\frac{k}{m} & -\frac{c}{m}\end{bmatrix}\begin{bmatrix}x \\ v\end{bmatrix} = \begin{bmatrix}0 & v \\ -\frac{k}{m} x & -\frac{c}{m} v\end{bmatrix}.$$

A general difference is, that there exists always a first order equation of the form $\frac{d\mathbf{y}}{dt}(t)=\mathbf{f}(\mathbf{y}(t))$, but maybe not a linear one.

For example the nonlinear second order ode $$ \frac{d^2}{dt^2} x = x^2,$$ can be reduced to a nonlinear first order system using $\mathbf{y} = \begin{bmatrix}x\\v\end{bmatrix}$, $$ \frac{d}{dt} \begin{bmatrix}x\\v\end{bmatrix} = \frac{d \mathbf{y}}{dt}(t) = \mathbf{f}(\mathbf{y}(t)) = \begin{bmatrix}v\\x^2\end{bmatrix}.$$

But since $\mathbf{f}$ is nonlinear, there is no matrix $A$ independent of $x,v$ which allows a reduction to a linear first order ode of the form $\frac{d \mathbf{y}}{dt}(t) = A \cdot \mathbf{y}(t).$

The general formula for higher order differential equations can be found on wikipedia (Reduction to first order) The idea is the same: Shift the last $n-1$ on entry towards the top and replace the last line of $\mathbf{f}$ by the original right hand side.

2
On

your answer is correct too.

Consider $$ \begin{cases} \dot x =v \\ \dot v = -\frac kmx-\frac cm v \end {cases} $$ With matrix notation $$ \begin{cases} \pmatrix {\dot x \\ \dot v} =\pmatrix {0 & 1\\ -\frac km & -\frac cm } \pmatrix {x \\ v} \end {cases} $$ $$ \implies \pmatrix {\dot x \\ \dot v} =\pmatrix {v\\ -\frac kmx -\frac cmv } $$