Skip to main content
Engineering LibreTexts

7.1: Understand the Problem

  • Page ID
    54267
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Before attempting to create a solution, it is important to understand the problem. Ensuring a complete understanding of the problem can help reduce errors. The first step is to understand what input is required and what information the program is expected to produce. In this example, the formula for the period of a pendulum is:

    Pendulum diagram.

    \[ \textit{Period} = 2 \pi \sqrt{\dfrac{L}{g}} \left( 1 + \frac{1}{4}\sin^{2}\left( \frac{\alpha}{2} \right) \right) \nonumber \]

    Where:

    \[ \begin{align*} g &= \text{980 cm/sec}^2 \\ \pi &= 3.14159 \\ L &= \text{Pendulum length (cm)} \\ \alpha &= \text{Angle of displacement (degree)} \end{align*} \nonumber \]

    Both \(g\) (gravity) and \(\pi\) should be declared as a constants. The formula is a simplified version of the more general case. As such, for very large, very small, or zero angle values the formula will not provide accurate results. For this example, that is acceptable.

    As shown, the pendulum is attached to a fixed point, and set into motion by displacing the pendulum by an angle, \(\alpha\), as shown in the diagram. The program must define the constants for \(g\) and \(\pi\), declare the variables, display appropriate prompts, read the values for \(L\) and \(\alpha\), then calculate and display the original input and the period of the pendulum with the given length and angle of displacement.


    This page titled 7.1: Understand the Problem is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Ed Jorgensen via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?