NetLogo banner

NetLogo Publications
Contact Us

Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Farsi / Persian


NetLogo Models Library:
Curricular Models/CT-STEM

(back to the library)


[screen shot]

If you download the NetLogo application, this model is included. You can also Try running it in NetLogo Web


This model is meant to help learners understand simple harmonic motion by exploring the motion of a simple pendulum and observing changes in motion-related parameters like displacement, velocity acceleration. In addition, users can observe changes in the mechanical–kinetic and potential–energy of the pendulum and how the total energy is conserved throughout the motion of the pendulum.

Simple harmonic motion is a periodic motion where the restoring force on the oscillating body is directly proportional to the degree of disturbance. A good approximation of simple harmonic motion that we see around us is the motion of a simple pendulum when the angle of disturbance is small. This model shows a simple pendulum with a small release angle in simple harmonic motion. The user can change the angle of release and the length of the pendulum to observe the changes in the motion of the bob (the part at the end of the string).


The model represents a simple pendulum. It consists of a mass (m - also called a bob) hanging from a massless string of length (l) which is fixed at a point. The bob will be shown in simple harmonic motion where each second maps into one tick in NetLogo. When released from an initial angle the bob will swing back and forth in a periodic motion. The motion of the pendulum follows the following equations:

θ(t) = θ<sub>0</sub> cos(ω * t) ω = sqrt(g / l) g = acceleration due to gravity l = length of the pendulum


  1. Set the RELEASE-ANGLE, LENGTH-OF-PENDULUM, and MASS-OF-BOB sliders and press the SETUP button.
  2. Press the GO or GO-SLOWLY buttons to let the model run. You can also choose to press the GO-ONCE or GO-10-TICKS button to run and stop after 1 second or 10 seconds; this allows you to observe the bob's motion more closely.
  3. Observe the monitor on the right side of the VIEW to see the distance the bob is from the resting (mean) position. Observe the plot on the right side of the VIEW to see the distance graphed over time.
  4. Observe the velocity and acceleration monitors next to the distance monitor and then the velocity and acceleration plots below the distance plot.
  5. Observe the KE and PE plot below the GO ONCE and GO-10-TICKS buttons. Look at the KE, PE, and total-energy monitors below this plot.

The motion of the simple pendulum is dependent on three different slider parameters.

  1. RELEASE-ANGLE: is the angle from which you release the bob. The angle is measured from the resting position which is a vertical axis. For approximation purposes, the angles are kept between (-18, 18)
  2. LENGTH-OF-PENDULUM: is the length of the string attached to the bob (from the center of the bob to the fixed pivot point).
  3. MASS-OF-BOB: is the mass of the bob attached to the string.


Notice the plot to the right of the VIEW, what is the maximum and minimum of it? When does it start to repeat? The time it takes to repeat is called the period of the pendulum.

Look at the distance from the mean position monitor, how does it change throughout the pendulum's motion. Do you notice any patterns?

Notice how the velocity peaks when the distance is 0 and the acceleration peaks when the velocity is 0. Why does this happen?

Does the total energy monitor ever change? If so, when does it change?

Why does the pendulum never stop swinging?


Try keeping the MASS-OF-BOB and the RELEASE-ANGLE constant and change the LENGTH-OF-PENDULUM. What changes do you see in the pendulum's motion?

Try other combinations. What patterns do you notice?


This model was incorporated into the CT-STEM Simple Harmonic Motion - Simple Pendulum unit, a lesson plan designed for a high school physics class. In the lesson, students experiment with a progression of three pendulum models that gradually introduce more monitored variables:

  1. The base model with only distance monitored Students can observe the pendulum and its distance from the mean position over time.

  2. Velocity and acceleration added Students can now observe velocity and acceleration over time, in addition to the variables from the first model. They are asked to think about how one might use this model to conduct a computational experiment to find g, the acceleration due to gravity. They are also asked to compare their observations with a physical pendulum and the computational experimental setup in this model.

  3. This model with KE and PE added This final model includes all the features from the first two versions while adding monitors for kinetic energy, potential energy, and total energy. Students can study how the kinetic and the potential energy of a pendulum changes throughout its motion.


This is a very simple model that has a limited scope. Here are some more ideas to get you to think more and further your understanding of harmonic motion.

Do we observe the same motion of a simple pendulum in the real world?

What are our assumptions while designing a model of a simple pendulum?

What would happen if the release angle was larger? Would there be any large changes?

What would happen if the gravitational constant was changed?

How will you incorporate the other factors that affect the motion of the pendulum in the real world? How about adding air friction in this model?

What would happen if we attach [another pendulum at the end of the original pendulum?] (


This model uses the pen tool to trace the pendulum's motion in the VIEW. The change in location of the pendulum's bob is traced with the pen tool.

This model also uses a link between two turtles to show the string of the pendulum. There is a hidden turtle at a fixed location and a second turtle which shows up as the pendulum's bob. A link is created between these two turtles to represent the pendulum's string.


To learn about more advanced features of oscillatory motion, look at the Kicked Rotator and Kicked Rotators models in the Models Library.


If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

Please cite the NetLogo software as:

This model was developed as part of the CT-STEM Project at Northwestern University and was made possible through generous support from the National Science Foundation (grants CNS-1138461, CNS-1441041, DRL-1020101, DRL-1640201 and DRL-1842374) and the Spencer Foundation (Award #201600069). Any opinions, findings, or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the funding organizations. For more information visit

Special thanks to the CT-STEM models team for preparing these models for inclusion in the Models Library including: Kelvin Lao, Jamie Lee, Sugat Dabholkar, Sally Wu, and Connor Bain.


Copyright 2020 Uri Wilensky.


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at

(back to the NetLogo Models Library)