How can I solve a system of second order ODE's numerically?

In summary, you need to solve six first order differential equations to model a double inverted pendulum.
  • #1
peterbone
13
0
Hello. First post here.

I'm trying to write a program (from scratch) to simulate a double inverted pendulum (a cart with 2 pendulums one on top of the other). The system is modeled with a system of 3 second order ODE's, which I need to solve numerically using Runge Kutta. I know how to solve a system of first order ODE's numerically but not a system of second order ODE's. The equations are shown in this paper (there's no point in me re-writing them here):

http://www.tf.uni-kiel.de/etech/ART/paper/2001/ieee_cca_isic_zhong.pdf
(equations 4 to 6)

So can anyone tell me how to go about solving this initial value problem numerically? I have looked in many books but can only find examples of systems of first order equations and single second order equations.

Thanks

Peter Bone
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Each second order differential equation is equivalent to two first order equations so you could write this system as six first order equations.
 
  • #3
Thanks, but I don't know how to go about reducing the order of coupled differential equations because the 3 unkown variables x, theta1 and theta2 all appear in the same equations.
 
  • #4
Suppose you've got a second order diff.eq system:
[tex]\frac{d^{2}\vec{Y}}{dt^{2}}=\vec{F}(y_{1},..y_{n},\dot{y}_{1},...,\dot{y}_{n},t), \vec{Y}(t)=(y_{1}(t),...,y_{n}(t)),\dot{y}_{m}\equiv\frac{dy_{m}}{dt},1\leq{m}\leq{n}; m,n\in\mathbb{N}[/tex]

Now, define:
[tex]\vec{X}(t)=(x_{1}(t),...,x_{n}(t),...,x_{2n}(t))[/tex]
with:
[tex]x_{i}=y_{i}, x_{n+i}=\frac{dy_{i}}{dt}=\frac{dx_{i}}{dt}, 1\leq{i}\leq{n}[/tex]
Thus, we may form the 1-order differential system of 2n equations:
[tex]\frac{d\vec{X}}{dt}=\vec{G}(\vec{X},t)[/tex]
where:
[tex]G_{i}(\vec{X},t)=x_{n+i}, 1\leq{i}\leq{n}[/tex]
[tex]G_{i}(\vec{X},t)=F_{i-n}(\vec{X},t), n<i\leq{2n}[/tex]
 
Last edited:
  • #5
Thankyou, that was helpful.
I also found this site which explains the whole process of simulating a single inverted pendulum and includes the reduction stage.
http://drewk.net/projects/ipendulum/ipendulum.html
I should be able to use the same method for the double inverted pendulum.
 
Last edited by a moderator:

1. What is a system of second order ODE's?

A system of second order ODE's (ordinary differential equations) is a set of equations that involve second derivatives of one or more variables. These equations are commonly used to model physical systems and their behavior over time.

2. How is a system of second order ODE's different from a single second order ODE?

A system of second order ODE's involves multiple equations, each with its own set of variables and parameters. This allows for a more complex model to be created and is useful for studying interconnected systems.

3. What are some real-world applications of systems of second order ODE's?

Systems of second order ODE's are used in various fields such as physics, engineering, and biology to model and predict the behavior of systems such as electrical circuits, chemical reactions, and population growth.

4. How do you solve a system of second order ODE's?

There are various methods for solving a system of second order ODE's, such as the substitution method, elimination method, and the use of matrix techniques. The choice of method depends on the specific equations and variables involved.

5. What are some common techniques for analyzing systems of second order ODE's?

Some common techniques for analyzing systems of second order ODE's include phase plane analysis, stability analysis, and numerical methods such as Euler's method or Runge-Kutta method. These techniques help to understand the behavior and stability of the system over time.

Similar threads

  • Differential Equations
Replies
2
Views
1K
Replies
1
Views
935
  • Differential Equations
Replies
3
Views
386
Replies
2
Views
2K
  • Differential Equations
Replies
9
Views
2K
Replies
7
Views
3K
Replies
2
Views
2K
  • Differential Equations
Replies
6
Views
2K
Replies
3
Views
791
Replies
3
Views
2K
Back
Top