
#1
May2405, 07:25 AM

P: 13

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 modelled 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 rewriting them here): http://www.tf.unikiel.de/etech/ART/...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 



#2
May2405, 07:35 AM

Math
Emeritus
Sci Advisor
Thanks
PF Gold
P: 38,894

Each second order differential equation is equivalent to two first order equations so you could write this system as six first order equations.




#3
May2405, 08:59 AM

P: 13

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
May2405, 10:35 AM

Sci Advisor
HW Helper
PF Gold
P: 12,016

Systems of second order ODE's
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 1order 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_{in}(\vec{X},t), n<i\leq{2n}[/tex] 



#5
May2505, 06:06 AM

P: 13

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. 


Register to reply 
Related Discussions  
Solving Systems of ODE's  Calculus & Beyond Homework  4  
Differential Equations  First Order Systems  Calculus & Beyond Homework  6  
system of ODE's  Linear & Abstract Algebra  1  
dirst order ODE's with x & expontials  Differential Equations  3  
ebook on ODE's?  Science & Math Textbook Listings  0 