Main pendulum clock example. Clock has one hand that takes one step each second. The movement is controlled by a counterweight.


Wolfram Language




Pendulum Clock



This model shows the mechanics of a pendulum clock.



A pendulum clock works by having a pendulum swinging back and forth with a constant period of one second. The pendulum period can be directly determined by the length of the pendulum rod and the gravity affecting the pendulum. The swinging motion pushes on a fork (see graphic), which releases an escapement wheel that is attached to a weight. When the gear is released, gravity pulls the weight down and the gear starts to turn. When the pendulum swings back, the gear is locked once again. The angled cogs and the torque applied to the escapement wheel give the pendulum a small push that returns energy to the pendulum that was lost due to friction.




To simulate the model, perform this step:

  • Click the Simulate button in the top toolbar simulate.

Plot the Results

Explore how the hand is rotated during one minute. The secondGear.phi_b variable describes the change in degrees, counting from the start of the simulation. After 60 seconds of simulation, the hand will have rotated 360 degrees.

A plot will automatically be displayed when the simulation has finished. You should see the plot below:


Automatic 3D Animation

Multibody systems have visualizers to show what a real-world system would look like.


To show a 3D animation of the model, follow the steps below:

  • Click the Simulate button simulate in the top-right corner.
  • When the build has finished and simulation has completed, click the Animation button animate in the toolbar.
  • Use your mouse or trackpad to drag the animation to a good angle and zoom in with your scroll wheel or by using the trackpad. Then click the Play button play to play the animation.

Expand the Model

Using SystemModeler's drag-and-drop functionality, you can expand the model to include a minute hand. First you need to create a new hand. This is done by duplicating the second hand:

  • Select the five components shown in the graphic, either by applying Shift+Click to each one individually or selecting them using click-and-drag.


  • Press Ctrl+D to duplicate the components.
  • Drag the new components toward the bottom of the diagram layer and release them by clicking anywhere on the diagram layer.

Next you need to make the connections to the new hand:

  • If before duplicating you selected the connection between the weight and the gear, you will now see a connection between the weight and your duplicated gear. Click it and press Delete to remove it.
  • Select the Connection Line Tool button connection from the toolbar or press C.
  • Click the white circle (flange_b) and then click the gray circle on the duplicated gear (flange_a). You can click anywhere in the diagram layer to draw your connection line through that point. Try clicking around the first gear component to get a clean model diagram.

Your diagram should now look something like this:


Now the new hand can be made distinct from the old one:

  • Click the duplicated gear. You want the minute hand to turn 1/60 degrees every time the second hand turns one degree. In the General tab, next to the ratio parameter, write 60.
  • The duplicated components are now named secondGear1, secondRevolute1, etc. If you want, you can rename them to something more appropriate, like minuteGear, minuteRevolute, and so on. Select each of the duplicated components and press F2. A Component Properties window will show up; in the box next to "Name:", enter your desired component name and click OK.
  • To make the hand visually distinct, click the duplicated arrow. In the General tab, next to the length parameter, write 0.35 to make the new arrow a bit shorter than the old one. To change the color, navigate to the color parameter, and write, for example, {155, 155, 155} in the box beside it to make the new arrow gray. If you are using SystemModeler 4.2, you can use the color selection palette to select a color.

Repeat the steps in the Simulation section to see the effects of your changes.


Components (17)


Type: World


Type: Body


Type: FixedTranslation


Type: Revolute


Type: Fixed


Type: EscapementFork


Type: Damper


Type: EscapementWheel


Type: Body


Type: Prismatic


Type: Fixed


Type: IdealGear


Type: Fixed


Type: Revolute


Type: FixedArrow


Type: FixedRotation


Type: PeriodCounter