[pstricks] Searching for a numeric solution for coupled differential equation systems of order 2

Alexander Grahn A.Grahn at hzdr.de
Fri May 25 11:15:11 CEST 2012

On Thu, May 24, 2012 at 10:21:06PM +0200, Juergen Gilg wrote:
>Dear PSTricks list,
>is there anybody out there, knowing about how to generate a PS code for 
>"Runge-Kutta 4" to solve a "coupled differential equation system of 
>order 2"?
>There is the need for such a code to animate a double-pendulum in real 
>time, following the coupled differential equations with the variables 
>(\varphi_1, \varphi_2) and their derivatives like:

I'd first transform this set of DEs of second order into a set of four
DEs of first order, since Runge-Kutta only works on first order DE sets,
as far as I know.

However, it may still not be amenable to Runge-Kutta, because the right
hand sides of the resulting four equation set of DEs, put into normal
form, still contain derivatives:

\dot\varphi_{11}& = \varphi_{12}\\
\dot\varphi_{12}& = f(\varphi_{11}, \varphi_{21}, \varphi_{22}, \dot\varphi_{22})\\
\dot\varphi_{21}& = \varphi_{22}\\
\dot\varphi_{22}& = f(\varphi_{11}, \varphi_{12}, \dot\varphi_{12}, \varphi_{21})

Perhaps, an iteration procedure is required to determine $\dot\varphi_{12}$
and $\dot\varphi_{22}$ on the right hand sides of the equations above?

An implementation of the Runge-Kutta 4 method is given in the animate
package documentation (Lorenz attractor example). It writes the solution
vector into a file, that can be read out for plotting by other PSTricks
utilities. The DE system for calculating the right hand sides must be
written in PS syntax.


More information about the PSTricks mailing list