Warning: This simulation requires ten integrators, 15 summers, 16 multipliers, and 17 coefficient potentiometers (-> eight THATs).*

Simulating a double pendulum

../../../../_images/double_pendulum.jpg

Figure 1: Double pendulum

This application note describes the simulation of a double pendulum as shown in figure 1 on an analog computer. 1

Equations of motion

The equations of motion will be derived by determining the Lagrangian L=TV with the two generalized coordinates φ1 and φ2 where T represents the total kinetic energy while V is the potential energy of the system. This potential energy is just

(1)V=g((m1+m2)l1cos(φ1)+m2l2cos(φ2))

with m1 and m2 representing the masses of the two bobs mounted on the tips of the two pendulum rods (which are assumed as being weightless). As always, g represents the gravitational acceleration.

To derive the total kinetic energy the positions of the pendulum arm tips (x1,y1) and (x2,y2) are required:

x1=l1sin(φ1)y1=l1cos(φ1)x2=l1sin(φ1)+l2sin(φ2)y2=l1cos(φ1)+l2cos(φ2)

The first derivatives of these with respect to time are

˙x1=˙φ1l1cos(φ1),˙y1=˙φ1l1sin(φ1),˙x2=˙φ1l1cos(φ1)+˙φ2l2cos(φ2)~and˙y2=˙φ1l1sin(φ1)˙φ2l2sinφ2.

The kinetic energy of the system is then

(2)T=12(m1(˙x21+˙y21)+ms(˙x22+˙y22))

with

˙x21=˙φ21l21cos2(φ1)˙y21=˙φ21l21sin2(φ1)˙x22=˙φ21l21cos2(φ1)+2˙φ1˙φ2l1l2cos(φ1)cos(φ2)+˙φ22l22cos2(φ2)˙y22=˙φ21l21sin2(φ1)+2˙φ1˙φ2l1l2sin(φ1)sin(φ2)+˙φ22l22sin2(φ2)

and thus

(3)˙x21+˙y21=˙φ21l21cos2(φ1)+φ21l21sin2(φ1)=˙φ21l21(cos2(φ1)+sin2(φ1))=˙φ21l21
(4)˙x22+˙y22=˙φ21l21(cos2(φ1)+sin2(φ1))+˙φ22l22(cos2(φ2)+sin2(φ2))+    2˙φ1˙φ2l1l2(cos(φ1)cos(φ2)+sin(φ1)sin(φ2))=˙φ21l21+˙φ22l22+2˙φ1˙φ2l1l2cos(φ1φ2)

The Lagrangian L results from equations (1) and (2) with (3) and (4) as

(5)L=12l21˙φ21(m1+m2)+12m2˙φ22l22+m2˙φ1˙φ2l1l2cos(φ1φ2)+    g(m1+m2)l1cos(φ1)+gm2l2cos(φ2).

Now the Euler-Lagrange-equations

(6)ddtL˙φ1Lφ1=0

and

(7)ddtL˙φ2Lφ2=0

have to be solved. The required (partial) derivatives are

Lφ1=m2˙φ1˙φ2l1l2sin(φ1φ2)g(m1+m2)l1sin(φ1)L˙φ1=l21˙φ1(m1+m2)+m2˙φ2l1l2cos(φ1φ2)ddtL˙φ1=l21¨φ1(m1+m2)+m2l1l2[¨φ2cos(φ1φ2)˙φ2sin(φ1φ2)(˙φ1˙φ2)]Lφ2=m2˙φ1˙φ2l1l2sin(φ1φ2)gm2l2sin(φ2)L˙φ2=m2˙φ2l22+m2˙φ1l1l2cos(φ1φ2)ddtL˙φ2=m2¨φ2l22+m2l1l2[¨φ1cos(φ1φ2)˙φ1sin(φ1φ2)(˙φ1˙φ2)].

based on (5). Substituting these into (6) yields

0=l21¨φ1(m1+m2)m2l1l2¨φ2cos(φ1φ2)m2l1l2˙φ2sin(φ1φ2)(˙φ1˙φ2)+    m2˙φ1˙φ2l1l2sin(φ1φ2)+gl1(m1+m2)sin(φ1).

Expanding (˙φ1˙φ2) yields

0=l21¨φ1(m1+m2)+m2l1l2¨φ2cos(φ1φ2)+    m2l1l2˙φ22sin(φ1φ2)+gl1(m1+m2)sin(φ1).

Dividing by l21(m1+m2) results in

0=¨φ1+m2m1+m2l2l1¨φ2cos(φ1φ2)+m2m1+m2l2l1˙φ22sin(φ1φ2)+gl1sin(φ1)

which can be further simplified as

(8)0=¨φ1+m2m1+m2l2l1[¨φ2cos(φ1φ2)+˙φ22sin(φ1φ2)]+gl1sin(φ1).

Proceeding analogously, (7) yields

(9)0=¨φ2+l1l2[¨φ1cos(φ1φ2)˙φ21sin(φ1φ2)]+gl2sin(φ2)

after some rearrangements.

To simplify things further it will be assumed that m1=m2=1 and l1=l2=1 in arbitrary units yielding the following two equations of motion of the double pendulum based on (8) and (9):

¨φ1=12[¨φ2cos(φ1φ2)+˙φ22sin(φ1φ2)+2gsin(φ1)]¨φ2=[¨φ1cos(φ1φ2)˙φ21sin(φ1φ2)+gsin(φ2)]

Implementation

The implementation of equations (10) and (11) is straightforward as shown in figures 2 and 3. Both circuits require the functions sin(φ1φ2), cos(φ1φ2), sin(φ1), and sin(φ2), which are generated by three distinct sub-circuits such as the one shown in figure 4. These circuits yield sine and cosine of an angle based on the first time-derivative of this angle, so the simulation is not limited to a finite range for the two angles φ1 and φ2.

It should be noted that each of the two integrators of each of these three harmonic function generators has a potentiometer connected to its respective initial value input. When a simulation run with given initial values for φ1(0) and φ2(0) is to be started, these potentiometers have to be set to cos(φ1(0)), sin(φ1(0)) and cos(φ2(0)), sin(φ2(0)), respectively.

../../../../_images/circuit01.jpg
../../../../_images/circuit02.jpg

Figure 2: Implementation of equation (10)

Figure 3: Implementation of equation (11)

Since ˙φ1 and ˙φ2 are readily available from the circuits shown in figures 2 and 3, two of these harmonic function generators can be directly fed with these values. The input for the third function generator is generated by a two-input summer as shown in figure 5.

../../../../_images/circuit03.jpg
../../../../_images/circuit04.png

Figure 4: Generating sin(φ) and cos(φ)

Figure 5: Computing ˙φ1 - ˙φ2

../../../../_images/circuit05.jpg

Figure 6: Display circuit for the double pendulum

With ˙φ1 and ˙φ2 and thus sin(φ1), cos(φ1), and sin(φ2), cos(φ2) readily available, the double pendulum can be displayed on an oscilloscope featuring two separate x,y-inputs by means of the circuit shown in figure 6. To yield a flicker-free display, this circuit requires a high-frequency input sin(ωt) which can be obtained by two integrators in series with a summer, the output of which is fed back into the first integrators. This circuit is not shown here but can be found in [ULMANN 2017, p.67].

Results

Figure 7 shows a long-term exposure of the movements of the double pendulum starting as an inverted pendulum with its first pendulum rod pointing upwards while the second one points downwards.

../../../../_images/double_pendulum_long_exposure.jpg

Figure 7: Long-term exposure of a double pendulum simulation run

This simulation requires ten integrators, 15 summers, 16 multipliers, and 17 coefficient potentiometers.

References

[MAHRENHOLTZ, 1968] Oskar Mahrenholtz, Analogrechnen in Maschinenbau und Mechanik, BI Hochschultaschenbücher, 1968

[Ulmann 2017] Bernd Ulmann, Analog Computer Programming, Create Space, 2017

1

This has also been done by [MAHRENHOLTZ, 1968, pp. 159–165] which served as an inspiration for this application note, especially the display circuit.