Coupled 2nd Order DE: Convert to system of 1st Order

In summary, the conversation discusses converting a system of two coupled nonlinear differential equations into a system of four first-order nonlinear differential equations. The initial attempt at using variable substitutions was not successful, but it was eventually determined that the conversion could be done using a matrix and the inverse of the matrix. The use of a solver such as ode45 or ode15i was also suggested to simplify the process.
  • #1
jstluise
58
0
It's been a while since I've played with systems of ODEs, and I seem to have forgotten some of the tricks. As an example, I have two coupled nonlinear DE that I want to convert to a system of four 1st order nonlinear DE. But, the normal way of making variable substitutions is not working of me.

Two 2nd order nonlinear DE:
##\ddot{\alpha} + \ddot{\beta}cos(\alpha-\beta)+\dot{\beta}^2sin(\alpha-\beta)=\tau_{1}##
##\ddot{\beta} + \ddot{\alpha}cos(\alpha-\beta)-\dot{\alpha}^2sin(\alpha-\beta)=\tau_{2}##

If I substitute variables ##x_1=\alpha##, ##x_2=\dot{\alpha}##,##x_3=\beta##,##x_4=\dot{\beta}##, like my initial reaction was, I get:

##\dot{x_1}=x_2##
##\dot{x_2}=-\dot{x_4}cos(x_1-x_3)-x_4^2sin(x_1-x_3)+\tau_1##
##\dot{x_3}=x_4##
##\dot{x_4}=-\dot{x_2}cos(x_1-x_3)+x_2^2sin(x_1-x_3)+\tau_2##

which isn't quite right, since it is not in the form ##\dot{\vec{\textbf{x}}}=\vec{\textbf{f}}(t,\vec{\textbf{x}})##

I'm trying to get it a form where I can run it through ODE45 or a similar solver.

Refresh my memory! :)EDIT! I believe I figured it out. I did do it right, just implementing it in Matlab had me confused. But, all I have to do in my function is use the old values for ##\dot{x_2}## and ##\dot{x_4}##. Seeing those derivatives in the rhs just threw me off. Is this the right way to go about it?
 
Last edited:
Physics news on Phys.org
  • #2
You can write your equations as
$$\begin{bmatrix} 1 & \cos(\alpha - \beta) \\ \cos(\alpha - \beta) & 1 \end{bmatrix}
\begin{bmatrix} \ddot\alpha \\ \ddot\beta \end{bmatrix}
= \begin{bmatrix} -\dot\beta^2 \sin(\alpha - \beta) + r_1 \\
\dot\alpha^2 \sin(\alpha - \beta) + r_2\end{bmatrix}$$
So
$$\begin{bmatrix} \ddot\alpha \\ \ddot\beta \end{bmatrix}
= \begin{bmatrix} 1 & \cos(\alpha - \beta) \\ \cos(\alpha - \beta) & 1 \end{bmatrix}^{-1}
\begin{bmatrix} -\dot\beta^2 \sin(\alpha - \beta) + r_1 \\
\dot\alpha^2 \sin(\alpha - \beta) + r_2\end{bmatrix}$$

The matrix is singular if ##\alpha = \beta##, but in that case you only have one differential equation not two.
 
  • #3
AlephZero said:
You can write your equations as
$$\begin{bmatrix} 1 & \cos(\alpha - \beta) \\ \cos(\alpha - \beta) & 1 \end{bmatrix}
\begin{bmatrix} \ddot\alpha \\ \ddot\beta \end{bmatrix}
= \begin{bmatrix} -\dot\beta^2 \sin(\alpha - \beta) + r_1 \\
\dot\alpha^2 \sin(\alpha - \beta) + r_2\end{bmatrix}$$
So
$$\begin{bmatrix} \ddot\alpha \\ \ddot\beta \end{bmatrix}
= \begin{bmatrix} 1 & \cos(\alpha - \beta) \\ \cos(\alpha - \beta) & 1 \end{bmatrix}^{-1}
\begin{bmatrix} -\dot\beta^2 \sin(\alpha - \beta) + r_1 \\
\dot\alpha^2 \sin(\alpha - \beta) + r_2\end{bmatrix}$$

The matrix is singular if ##\alpha = \beta##, but in that case you only have one differential equation not two.

That makes sense, but is that the only way to implement it into Matlab (ode45)? I thought I was onto something (see my edit in my original post), but now I'm thinking it won't work.
 
  • #4
Move everything with overdots to the left hand sides. Then re-express the left hand side as a matrix times the column vector of the dotted first derivatives. So the equation is

Mxdot=f(x,t)

In your subroutine for evaluating derivatives, first calculate the right hand side vector. Then premultiply it by the inverse of M. Some equation solvers accept the more general inputs as M and f(x,t), and do the inversion for you. I'm not sure whether the equation solver you are using will do this.

Chet
 
  • #5
Chestermiller said:
Move everything with overdots to the left hand sides. Then re-express the left hand side as a matrix times the column vector of the dotted first derivatives. So the equation is

Mxdot=f(x,t)

In your subroutine for evaluating derivatives, first calculate the right hand side vector. Then premultiply it by the inverse of M. Some equation solvers accept the more general inputs as M and f(x,t), and do the inversion for you. I'm not sure whether the equation solver you are using will do this.

Chet

Thanks, Chet. Turns out I was able to keep it in my original form (system of implicit DEs) and use Matlabs ode15i solver. I believe it does a similar operation by inverting the matrix...but it just saves me a lot of work! It wouldn't be too bad, but when the system I have has 8 state variables, it gets messy really fast.

Anyways, looks like ode15i was the solution I was looking for.
 

FAQ: Coupled 2nd Order DE: Convert to system of 1st Order

What is a coupled 2nd order differential equation?

A coupled 2nd order differential equation is a type of differential equation that involves two or more dependent variables and their derivatives with respect to the same independent variable. This means that the equations are interrelated and cannot be solved separately.

Why do we need to convert coupled 2nd order DEs to a system of 1st order DEs?

Converting coupled 2nd order differential equations to a system of 1st order differential equations allows us to break down the complex equation into smaller, more manageable equations. This makes it easier to solve and analyze the system and also allows us to use numerical methods for solving the equations.

How do you convert a coupled 2nd order DE to a system of 1st order DEs?

To convert a coupled 2nd order differential equation to a system of 1st order differential equations, we can introduce new variables and rewrite the equations in terms of these variables. This creates a system of equations that can be solved simultaneously.

What are the advantages of using a system of 1st order DEs instead of a coupled 2nd order DE?

Using a system of 1st order differential equations allows us to solve complex systems of equations more easily and accurately. It also allows us to use numerical methods for solving the equations, which can be more efficient for larger systems.

Can all coupled 2nd order DEs be converted to a system of 1st order DEs?

Yes, all coupled 2nd order differential equations can be converted to a system of 1st order differential equations. This can be done through various techniques such as substitution, introduction of new variables, or using matrix methods.

Back
Top