For double and triple pendulum, the phase portrait is applied to the inner most bob.
The equations of motion of the pendulum were derived using the Lagrangian energy method. For the -bob pendulum, there are -second order nonlinear differential equations and degrees of freedom. The equations are kept in their non-linear form since NDSolve was used for the solving them.
Mathematica was used to do the analytical derivation due to the high complexity of algebra for the case.
Initial position conditions can be changed by dragging the bob using the mouse. When the mouse is clicked on the display, it will pause and then the mouse can be used to drag the bob to a new location. Logic inside the Demonstration will detect which bob to drag based on the proximity of the mouse current location to known bob positions.
Below is description of each control variable shown on the Demonstration: The top buttons Labeled run, pause, step, reset are self explanatory and used to control the simulation. The control labeled duration is used to set the maximum simulation time. When this time is reached, the simulation will restart again from automatically.
The control labeled is used to change the time step for the display. The smaller the time step, the more accurate the simulation will be, but it will take longer to complete.
The control labeled number of bobs is used to change the pendulum type to either simple, double or triple. The controls below that are used to adjust the mass of the bobs, units are in kg. All units in this simulation are in SI units. The controls below that are used to change the length of each pendulum bar.
The controls below that are used to set the initial conditions. Units are in radians for the angles and in radians per second for the angular velocities. Initial angle positions can also be set using the mouse as mentioned above, however, using the controls might provide more accurate settings if needed. For convenience, small buttons next to the control variables can be used to quickly set the value to zero.
The g control is used to select the gravitational constant . The control labeled show phase is used to turn on and off the phase portrait plot. The red point in the phase portrait plot indicates the initial conditions, and the black point is the position at the end of the duration. The moving blue point is the position in phase space at the current time.
The control labeled c is used to change the damping coefficient. At the bottom is a display of the energy plot, it shows the current kinetic energy (KE), potential energy (PE) and the total energy in Joules.
The angles are all measured from the vertical line. When the pendulum is hanging vertically at rest, then all angles will have zero values at this position.
The angles and velocities are taken to be positive in anticlockwise direction.
Dare A. Wells, Schaum's Lagrangian Dynamics, McGraw-Hill, 1967