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

  • Context: Graduate 
  • Thread starter Thread starter peterbone
  • Start date Start date
  • Tags Tags
    Second order Systems
Click For Summary

Discussion Overview

The discussion revolves around solving a system of second order ordinary differential equations (ODEs) numerically, specifically in the context of simulating a double inverted pendulum. Participants explore methods for reducing second order equations to first order systems suitable for numerical integration using techniques like Runge-Kutta.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant seeks guidance on numerically solving a system of three second order ODEs related to a double inverted pendulum simulation.
  • Another participant suggests that each second order differential equation can be converted into two first order equations, leading to a total of six first order equations for the system.
  • A participant expresses uncertainty about how to reduce the order of the coupled differential equations due to the interdependence of the three unknown variables.
  • A further contribution provides a general framework for transforming a second order differential equation system into a first order system, detailing how to define new variables to facilitate this conversion.
  • One participant finds additional resources that explain the simulation process for a single inverted pendulum, indicating that similar methods could apply to the double inverted pendulum case.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to reduce the order of the coupled differential equations, and uncertainty remains regarding the specifics of the transformation process.

Contextual Notes

Participants express limitations in finding resources specifically addressing systems of second order ODEs and the challenges posed by the coupling of variables in the equations.

Who May Find This Useful

Individuals interested in numerical methods for solving differential equations, particularly in the context of mechanical systems and simulations, may find this discussion relevant.

peterbone
Messages
13
Reaction score
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
Each second order differential equation is equivalent to two first order equations so you could write this system as six first order equations.
 
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.
 
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:
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:

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K