Estimating Pi Using a Pendulum

Application ID: 140811


A simple way to estimate the value of π is by using a pendulum, whose oscillation period can be measured and used to calculate an approximation.

This simulation app is based on a model that uses the Multibody Dynamics interface to describe the motion of a simple pendulum. The app allows users to vary several parameters, including the pendulum length, bob radius, initial angle, and density ratio.

The application computes an estimated value of π and displays the corresponding error relative to the true value. In addition, a built-in help section explains the underlying theory, describes how to use the app, and provides guidance on parameter settings that yield the most accurate estimates of π.

The example also demonstrates how easily simulation models can be transformed into interactive simulation apps using the Application Builder in the COMSOL Multiphysics® software.

To learn more about this model, see our accompanying blog post “Pi on a String: An Interactive App to Estimate Pi ”.

This application example illustrates applications of this type that would nominally be built using the following products: