Software Requirements Specification for Pendulum

Dong Chen

Table of Contents

An outline of all sections included in this SRS is recorded here for easy reference.

Reference Material

This section records information for easy reference.

Table of Units

The unit system used throughout is SI (Système International d'Unités). In addition to the basic units, several derived units are also used. For each unit, the Table of Units lists the symbol, a description and the SI name.

Symbol Description SI Name
° angle degree
kg mass kilogram
m length metre
N force newton
rad angle radian
s time second

Table of Units

Table of Symbols

The symbols used in this document are summarized in the Table of Symbols along with their units. Throughout the document, symbols in bold will represent vectors, and scalars otherwise. The symbols are listed in alphabetical order. For vector quantities, the units shown are for each component of the vector.

Symbol Description Units
ax1 The horizontal acceleration of the first object \(\frac{\text{m}}{\text{s}^{2}}\)
ax2 The horizontal acceleration of the second object \(\frac{\text{m}}{\text{s}^{2}}\)
ay1 The vertical acceleration of the first object \(\frac{\text{m}}{\text{s}^{2}}\)
ay2 The vertical acceleration of the second object \(\frac{\text{m}}{\text{s}^{2}}\)
a Acceleration \(\frac{\text{m}}{\text{s}^{2}}\)
F Force N
g Gravitational acceleration \(\frac{\text{m}}{\text{s}^{2}}\)
Unit vector --
L1 The length of the first rod m
L2 The length of the second rod m
m Mass kg
m1 The mass of the first object kg
m2 The mass of the second object kg
px1 The horizontal position of the first object m
px2 The horizontal position of the second object m
py1 The vertical position of the first object m
py2 The vertical position of the second object m
p Position m
T Tension N
T1 The tension of the first object N
T2 The tension of the second object N
t Time s
vx1 The horizontal velocity of the first object \(\frac{\text{m}}{\text{s}}\)
vx2 The horizontal velocity of the second object \(\frac{\text{m}}{\text{s}}\)
vy1 The vertical velocity of the first object \(\frac{\text{m}}{\text{s}}\)
vy2 The vertical velocity of the second object \(\frac{\text{m}}{\text{s}}\)
v Velocity \(\frac{\text{m}}{\text{s}}\)
w1 The angular velocity of the first object \(\frac{\text{rad}}{\text{s}}\)
w2 The angular velocity of the second object \(\frac{\text{rad}}{\text{s}}\)
α1 The angular acceleration of the first object \(\frac{\text{rad}}{\text{s}^{2}}\)
α2 The angular acceleration of the second object \(\frac{\text{rad}}{\text{s}^{2}}\)
θ1 The angle of the first rod °
θ2 The angle of the second rod °
π Ratio of circumference to diameter for any circle --

Table of Symbols

Abbreviations and Acronyms

Abbreviation Full Form
2D Two-Dimensional
A Assumption
DD Data Definition
GD General Definition
GS Goal Statement
IM Instance Model
PS Physical System Description
R Requirement
SRS Software Requirements Specification
TM Theoretical Model
Uncert. Typical Uncertainty

Abbreviations and Acronyms

Introduction

A pendulum consists of mass attached to the end of a rod and its moving curve is highly sensitive to initial conditions. Therefore, it is useful to have a program to simulate the motion of the pendulum to exhibit its chaotic characteristics. The program documented here is called Pendulum.

The following section provides an overview of the Software Requirements Specification (SRS) for Pendulum. This section explains the purpose of this document, the scope of the requirements, the characteristics of the intended reader, and the organization of the document.

Purpose of Document

The primary purpose of this document is to record the requirements of the Pendulum. Goals, assumptions, theoretical models, definitions, and other model derivation information are specified, allowing the reader to fully understand and verify the purpose and scientific basis of DblPendulum. With the exception of system constraints, this SRS will remain abstract, describing what problem is being solved, but not how to solve it.

This document will be used as a starting point for subsequent development phases, including writing the design specification and the software verification and validation plan. The design document will show how the requirements are to be realized, including decisions on the numerical algorithms and programming environment. The verification and validation plan will show the steps that will be used to increase confidence in the software documentation and the implementation. Although the SRS fits in a series of documents that follow the so-called waterfall model, the actual development process is not constrained in any way. Even when the waterfall model is not followed, as Parnas and Clements point out parnasClements1986, the most logical way to present the documentation is still to "fake" a rational design process.

Scope of Requirements

The scope of the requirements includes the analysis of a two-dimensional (2D) pendulum motion problem with various initial conditions.

Characteristics of Intended Reader

Reviewers of this documentation should have an understanding of undergraduate level 2 physics, undergraduate level 1 calculus, and ordinary differential equations. The users of DblPendulum can have a lower level of expertise, as explained in Sec:User Characteristics.

Organization of Document

The organization of this document follows the template for an SRS for scientific computing software proposed by koothoor2013 and smithLai2005. The presentation follows the standard pattern of presenting goals, theories, definitions, and assumptions. For readers that would like a more bottom up approach, they can start reading the instance models and trace back to find any additional information they require.

The goal statements are refined to the theoretical models and the theoretical models to the instance models.

General System Description

This section provides general information about the system. It identifies the interfaces between the system and its environment, describes the user characteristics, and lists the system constraints.

System Context

Fig:sysCtxDiag shows the system context. A circle represents an entity external to the software, the user in this case. A rectangle represents the software system itself (DblPendulum). Arrows are used to show the data flow between the system and its environment.

System Context
System Context

The interaction between the product and the user is through an application programming interface. The responsibilities of the user and the system are as follows:

  • User Responsibilities
    • Provide initial conditions of the physical state of the motion and the input data related to the Pendulum, ensuring no errors in the data entry.
    • Ensure that consistent units are used for input variables.
    • Ensure required software assumptions are appropriate for any particular problem input to the software.
  • DblPendulum Responsibilities
    • Detect data type mismatch, such as a string of characters input instead of a floating point number.
    • Determine if the inputs satisfy the required physical and software constraints.
    • Calculate the required outputs.
    • Generate the required graphs.

User Characteristics

The end user of DblPendulum should have an understanding of high school physics, high school calculus and ordinary differential equations.

System Constraints

There are no system constraints.

Specific System Description

This section first presents the problem description, which gives a high-level view of the problem to be solved. This is followed by the solution characteristics specification, which presents the assumptions, theories, and definitions that are used.

Problem Description

A system is needed to efficiently and correctly to predict the motion of a pendulum.

Terminology and Definitions

This subsection provides a list of terms that are used in the subsequent sections and their meaning, with the purpose of reducing ambiguity and making it easier to correctly understand the requirements.

  • Gravity: The force that attracts one physical body with mass to another.
  • Cartesian coordinate system: A coordinate system that specifies each point uniquely in a plane by a set of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in the same unit of length (from cartesianWiki).

Physical System Description

The physical system of DblPendulum, as shown in Fig:dblpendulum, includes the following elements:

PS1: The first rod (with the length of the first rod L1).

PS2: The second rod (with the length of the second rod L2).

PS3: The first object.

PS4: The second object.

The physical system
The physical system

Goal Statements

Given the masses, length of the rods, initial angle of the masses and the gravitational constant, the goal statements are:

motionMass: Calculate the motion of the masses.

Solution Characteristics Specification

The instance models that govern DblPendulum are presented in the Instance Model Section. The information to understand the meaning of the instance models and their derivation is also presented, so that the instance models can be verified.

Assumptions

This section simplifies the original problem and helps in developing the theoretical models by filling in the missing information for the physical system. The assumptions refine the scope by providing more detail.

twoDMotion: The pendulum motion is two-dimensional (2D).

cartSys: A Cartesian coordinate system is used.

cartSysR: The Cartesian coordinate system is right-handed where positive x-axis and y-axis point right up.

yAxisDir: The direction of the y-axis is directed opposite to gravity.

startOrigin: The first rod is attached to the origin.

firstPend: The first rod has two sides. One side attaches to the origin. Another side attaches to the first object.

secondPend: The second rod has two sides. One side attaches to the first object. Another side attaches to the second object.

Theoretical Models

This section focuses on the general equations and laws that DblPendulum is based on.

Refname TM:acceleration
Label

Acceleration

Equation \[\symbf{a}=\frac{\,d\symbf{v}}{\,dt}\]
Description
  • a is the acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • t is the time (s)
  • v is the velocity (\(\frac{\text{m}}{\text{s}}\))
Source

accelerationWiki

RefBy

Refname TM:velocity
Label

Velocity

Equation \[\symbf{v}=\frac{\,d\symbf{p}}{\,dt}\]
Description
  • v is the velocity (\(\frac{\text{m}}{\text{s}}\))
  • t is the time (s)
  • p is the position (m)
Source

velocityWiki

RefBy

Refname TM:NewtonSecLawMot
Label

Newton's second law of motion

Equation \[\symbf{F}=m \symbf{a}\]
Description
  • F is the force (N)
  • m is the mass (kg)
  • a is the acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
Notes

The net force F on a body is proportional to the acceleration a of the body, where m denotes the mass of the body as the constant of proportionality.

Source

--

RefBy

General Definitions

This section collects the laws and equations that will be used to build the instance models.

Refname GD:velocityX1
Label

The x-component of velocity of the first object

Units

\(\frac{\text{m}}{\text{s}}\)

Equation \[{v_{\text{x}1}}={w_{1}} {L_{1}} \cos\left({θ_{1}}\right)\]
Description
  • vx1 is the the horizontal velocity of the first object (\(\frac{\text{m}}{\text{s}}\))
  • w1 is the the angular velocity of the first object (\(\frac{\text{rad}}{\text{s}}\))
  • L1 is the the length of the first rod (m)
  • θ1 is the the angle of the first rod (°)
Source

--

RefBy

Detailed derivation of the x-component of velocity:

At a given point in time, velocity is defined in DD:positionGDD

\[\symbf{v}=\frac{\,d\symbf{p}}{\,dt}\]

We also know the horizontal position that is defined in DD:positionXDD1

\[{p_{\text{x}1}}={L_{1}} \sin\left({θ_{1}}\right)\]

Applying this,

\[{v_{\text{x}1}}=\frac{\,d{L_{1}} \sin\left({θ_{1}}\right)}{\,dt}\]

L1 is constant with respect to time, so

\[{v_{\text{x}1}}={L_{1}} \frac{\,d\sin\left({θ_{1}}\right)}{\,dt}\]

Therefore, using the chain rule,

\[{v_{\text{x}1}}={w_{1}} {L_{1}} \cos\left({θ_{1}}\right)\]
Refname GD:velocityY1
Label

The y-component of velocity of the first object

Units

\(\frac{\text{m}}{\text{s}}\)

Equation \[{v_{\text{y}1}}={w_{1}} {L_{1}} \sin\left({θ_{1}}\right)\]
Description
  • vy1 is the the vertical velocity of the first object (\(\frac{\text{m}}{\text{s}}\))
  • w1 is the the angular velocity of the first object (\(\frac{\text{rad}}{\text{s}}\))
  • L1 is the the length of the first rod (m)
  • θ1 is the the angle of the first rod (°)
Source

--

RefBy

Detailed derivation of the y-component of velocity:

At a given point in time, velocity is defined in DD:positionGDD

\[\symbf{v}=\frac{\,d\symbf{p}}{\,dt}\]

We also know the vertical position that is defined in DD:positionYDD1

\[{p_{\text{y}1}}=-{L_{1}} \cos\left({θ_{1}}\right)\]

Applying this,

\[{v_{\text{y}1}}=-\left(\frac{\,d{L_{1}} \cos\left({θ_{1}}\right)}{\,dt}\right)\]

L1 is constant with respect to time, so

\[{v_{\text{y}1}}=-{L_{1}} \frac{\,d\cos\left({θ_{1}}\right)}{\,dt}\]

Therefore, using the chain rule,

\[{v_{\text{y}1}}={w_{1}} {L_{1}} \sin\left({θ_{1}}\right)\]
Refname GD:velocityX2
Label

The x-component of velocity of the second object

Units

\(\frac{\text{m}}{\text{s}}\)

Equation \[{v_{\text{x}2}}={v_{\text{x}1}}+{w_{2}} {L_{2}} \cos\left({θ_{2}}\right)\]
Description
  • vx2 is the the horizontal velocity of the second object (\(\frac{\text{m}}{\text{s}}\))
  • vx1 is the the horizontal velocity of the first object (\(\frac{\text{m}}{\text{s}}\))
  • w2 is the the angular velocity of the second object (\(\frac{\text{rad}}{\text{s}}\))
  • L2 is the the length of the second rod (m)
  • θ2 is the the angle of the second rod (°)
Source

--

RefBy

Detailed derivation of the x-component of velocity:

At a given point in time, velocity is defined in DD:positionGDD

\[\symbf{v}=\frac{\,d\symbf{p}}{\,dt}\]

We also know the horizontal position that is defined in DD:positionXDD2

\[{p_{\text{x}2}}={p_{\text{x}1}}+{L_{2}} \sin\left({θ_{2}}\right)\]

Applying this,

\[{v_{\text{x}2}}=\frac{\,d{p_{\text{x}1}}+{L_{2}} \sin\left({θ_{2}}\right)}{\,dt}\]

L1 is constant with respect to time, so

\[{v_{\text{x}2}}={v_{\text{x}1}}+{w_{2}} {L_{2}} \cos\left({θ_{2}}\right)\]
Refname GD:velocityY2
Label

The y-component of velocity of the second object

Units

\(\frac{\text{m}}{\text{s}}\)

Equation \[{v_{\text{y}2}}={v_{\text{y}1}}+{w_{2}} {L_{2}} \sin\left({θ_{2}}\right)\]
Description
  • vy2 is the the vertical velocity of the second object (\(\frac{\text{m}}{\text{s}}\))
  • vy1 is the the vertical velocity of the first object (\(\frac{\text{m}}{\text{s}}\))
  • w2 is the the angular velocity of the second object (\(\frac{\text{rad}}{\text{s}}\))
  • L2 is the the length of the second rod (m)
  • θ2 is the the angle of the second rod (°)
Source

--

RefBy

Detailed derivation of the y-component of velocity:

At a given point in time, velocity is defined in DD:positionGDD

\[\symbf{v}=\frac{\,d\symbf{p}}{\,dt}\]

We also know the vertical position that is defined in DD:positionYDD2

\[{p_{\text{y}2}}={p_{\text{y}1}}-{L_{2}} \cos\left({θ_{2}}\right)\]

Applying this,

\[{v_{\text{y}2}}=-\left(\frac{\,d{p_{\text{y}1}}-{L_{2}} \cos\left({θ_{2}}\right)}{\,dt}\right)\]

Therefore, using the chain rule,

\[{v_{\text{y}2}}={v_{\text{y}1}}+{w_{2}} {L_{2}} \sin\left({θ_{2}}\right)\]
Refname GD:accelerationX1
Label

The x-component of acceleration of the first object

Units

\(\frac{\text{m}}{\text{s}^{2}}\)

Equation \[{a_{\text{x}1}}=-{w_{1}}^{2} {L_{1}} \sin\left({θ_{1}}\right)+{α_{1}} {L_{1}} \cos\left({θ_{1}}\right)\]
Description
  • ax1 is the the horizontal acceleration of the first object (\(\frac{\text{m}}{\text{s}^{2}}\))
  • w1 is the the angular velocity of the first object (\(\frac{\text{rad}}{\text{s}}\))
  • L1 is the the length of the first rod (m)
  • θ1 is the the angle of the first rod (°)
  • α1 is the the angular acceleration of the first object (\(\frac{\text{rad}}{\text{s}^{2}}\))
Source

--

RefBy

IM:calOfAngularAcceleration2

Detailed derivation of the x-component of acceleration:

Our acceleration is:

\[\symbf{a}=\frac{\,d\symbf{v}}{\,dt}\]

Earlier, we found the horizontal velocity to be

\[{v_{\text{x}1}}={w_{1}} {L_{1}} \cos\left({θ_{1}}\right)\]

Applying this to our equation for acceleration

\[{a_{\text{x}1}}=\frac{\,d{w_{1}} {L_{1}} \cos\left({θ_{1}}\right)}{\,dt}\]

By the product and chain rules, we find

\[{a_{\text{x}1}}=\frac{\,d{w_{1}}}{\,dt} {L_{1}} \cos\left({θ_{1}}\right)-{w_{1}} {L_{1}} \sin\left({θ_{1}}\right) \frac{\,d{θ_{1}}}{\,dt}\]

Simplifying,

\[{a_{\text{x}1}}=-{w_{1}}^{2} {L_{1}} \sin\left({θ_{1}}\right)+{α_{1}} {L_{1}} \cos\left({θ_{1}}\right)\]
Refname GD:accelerationY1
Label

The y-component of acceleration of the first object

Units

\(\frac{\text{m}}{\text{s}^{2}}\)

Equation \[{a_{\text{y}1}}={w_{1}}^{2} {L_{1}} \cos\left({θ_{1}}\right)+{α_{1}} {L_{1}} \sin\left({θ_{1}}\right)\]
Description
  • ay1 is the the vertical acceleration of the first object (\(\frac{\text{m}}{\text{s}^{2}}\))
  • w1 is the the angular velocity of the first object (\(\frac{\text{rad}}{\text{s}}\))
  • L1 is the the length of the first rod (m)
  • θ1 is the the angle of the first rod (°)
  • α1 is the the angular acceleration of the first object (\(\frac{\text{rad}}{\text{s}^{2}}\))
Source

--

RefBy

IM:calOfAngularAcceleration2

Detailed derivation of the y-component of acceleration:

Our acceleration is:

\[\symbf{a}=\frac{\,d\symbf{v}}{\,dt}\]

Earlier, we found the vertical velocity to be

\[{v_{\text{y}1}}={w_{1}} {L_{1}} \sin\left({θ_{1}}\right)\]

Applying this to our equation for acceleration

\[{a_{\text{y}1}}=\frac{\,d{w_{1}} {L_{1}} \sin\left({θ_{1}}\right)}{\,dt}\]

By the product and chain rules, we find

\[{a_{\text{y}1}}=\frac{\,d{w_{1}}}{\,dt} {L_{1}} \sin\left({θ_{1}}\right)+{w_{1}} {L_{1}} \cos\left({θ_{1}}\right) \frac{\,d{θ_{1}}}{\,dt}\]

Simplifying,

\[{a_{\text{y}1}}={w_{1}}^{2} {L_{1}} \cos\left({θ_{1}}\right)+{α_{1}} {L_{1}} \sin\left({θ_{1}}\right)\]
Refname GD:accelerationX2
Label

The x-component of acceleration of the second object

Units

\(\frac{\text{m}}{\text{s}^{2}}\)

Equation \[{a_{\text{x}2}}={a_{\text{x}1}}-{w_{2}}^{2} {L_{2}} \sin\left({θ_{2}}\right)+{α_{2}} {L_{2}} \cos\left({θ_{2}}\right)\]
Description
  • ax2 is the the horizontal acceleration of the second object (\(\frac{\text{m}}{\text{s}^{2}}\))
  • ax1 is the the horizontal acceleration of the first object (\(\frac{\text{m}}{\text{s}^{2}}\))
  • w2 is the the angular velocity of the second object (\(\frac{\text{rad}}{\text{s}}\))
  • L2 is the the length of the second rod (m)
  • θ2 is the the angle of the second rod (°)
  • α2 is the the angular acceleration of the second object (\(\frac{\text{rad}}{\text{s}^{2}}\))
Source

--

RefBy

IM:calOfAngularAcceleration2

Detailed derivation of the x-component of acceleration:

Our acceleration is:

\[\symbf{a}=\frac{\,d\symbf{v}}{\,dt}\]

Earlier, we found the horizontal velocity to be

\[{v_{\text{x}2}}={v_{\text{x}1}}+{w_{2}} {L_{2}} \cos\left({θ_{2}}\right)\]

Applying this to our equation for acceleration

\[{a_{\text{x}2}}=\frac{\,d{v_{\text{x}1}}+{w_{2}} {L_{2}} \cos\left({θ_{2}}\right)}{\,dt}\]

By the product and chain rules, we find

\[{a_{\text{x}2}}={a_{\text{x}1}}-{w_{2}}^{2} {L_{2}} \sin\left({θ_{2}}\right)+{α_{2}} {L_{2}} \cos\left({θ_{2}}\right)\]
Refname GD:accelerationY2
Label

The y-component of acceleration of the second object

Units

\(\frac{\text{m}}{\text{s}^{2}}\)

Equation \[{a_{\text{y}2}}={a_{\text{y}1}}+{w_{2}}^{2} {L_{2}} \cos\left({θ_{2}}\right)+{α_{2}} {L_{2}} \sin\left({θ_{2}}\right)\]
Description
  • ay2 is the the vertical acceleration of the second object (\(\frac{\text{m}}{\text{s}^{2}}\))
  • ay1 is the the vertical acceleration of the first object (\(\frac{\text{m}}{\text{s}^{2}}\))
  • w2 is the the angular velocity of the second object (\(\frac{\text{rad}}{\text{s}}\))
  • L2 is the the length of the second rod (m)
  • θ2 is the the angle of the second rod (°)
  • α2 is the the angular acceleration of the second object (\(\frac{\text{rad}}{\text{s}^{2}}\))
Source

--

RefBy

IM:calOfAngularAcceleration2

Detailed derivation of the y-component of acceleration:

Our acceleration is:

\[\symbf{a}=\frac{\,d\symbf{v}}{\,dt}\]

Earlier, we found the horizontal velocity to be

\[{v_{\text{y}2}}={v_{\text{y}1}}+{w_{2}} {L_{2}} \sin\left({θ_{2}}\right)\]

Applying this to our equation for acceleration

\[{a_{\text{y}2}}=\frac{\,d{v_{\text{y}1}}+{w_{2}} {L_{2}} \sin\left({θ_{2}}\right)}{\,dt}\]

By the product and chain rules, we find

\[{a_{\text{y}2}}={a_{\text{y}1}}+{w_{2}}^{2} {L_{2}} \cos\left({θ_{2}}\right)+{α_{2}} {L_{2}} \sin\left({θ_{2}}\right)\]
Refname GD:xForce1
Label

Horizontal force on the first object

Units

N

Equation \[\symbf{F}=m \symbf{a}=-{\symbf{T}_{1}} \sin\left({θ_{1}}\right)+{\symbf{T}_{2}} \sin\left({θ_{2}}\right)\]
Description
  • F is the force (N)
  • m is the mass (kg)
  • a is the acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • T1 is the the tension of the first object (N)
  • θ1 is the the angle of the first rod (°)
  • T2 is the the tension of the second object (N)
  • θ2 is the the angle of the second rod (°)
Source

--

RefBy

IM:calOfAngularAcceleration2

Detailed derivation of force on the first object:

\[\symbf{F}=m \symbf{a}=-{\symbf{T}_{1}} \sin\left({θ_{1}}\right)+{\symbf{T}_{2}} \sin\left({θ_{2}}\right)\]
Refname GD:yForce1
Label

Vertical force on the first object

Units

N

Equation \[\symbf{F}=m \symbf{a}={\symbf{T}_{1}} \cos\left({θ_{1}}\right)-{\symbf{T}_{2}} \cos\left({θ_{2}}\right)-{m_{1}} \symbf{g}\]
Description
  • F is the force (N)
  • m is the mass (kg)
  • a is the acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • T1 is the the tension of the first object (N)
  • θ1 is the the angle of the first rod (°)
  • T2 is the the tension of the second object (N)
  • θ2 is the the angle of the second rod (°)
  • m1 is the the mass of the first object (kg)
  • g is the gravitational acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
Source

--

RefBy

IM:calOfAngularAcceleration2

Detailed derivation of force on the first object:

\[\symbf{F}=m \symbf{a}={\symbf{T}_{1}} \cos\left({θ_{1}}\right)-{\symbf{T}_{2}} \cos\left({θ_{2}}\right)-{m_{1}} \symbf{g}\]
Refname GD:xForce2
Label

Horizontal force on the second object

Units

N

Equation \[\symbf{F}=m \symbf{a}=-{\symbf{T}_{2}} \sin\left({θ_{2}}\right)\]
Description
  • F is the force (N)
  • m is the mass (kg)
  • a is the acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • T2 is the the tension of the second object (N)
  • θ2 is the the angle of the second rod (°)
Source

--

RefBy

IM:calOfAngularAcceleration2

Detailed derivation of force on the second object:

\[\symbf{F}=m \symbf{a}=-{\symbf{T}_{2}} \sin\left({θ_{2}}\right)\]
Refname GD:yForce2
Label

Vertical force on the second object

Units

N

Equation \[\symbf{F}=m \symbf{a}={\symbf{T}_{2}} \cos\left({θ_{2}}\right)-{m_{2}} \symbf{g}\]
Description
  • F is the force (N)
  • m is the mass (kg)
  • a is the acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • T2 is the the tension of the second object (N)
  • θ2 is the the angle of the second rod (°)
  • m2 is the the mass of the second object (kg)
  • g is the gravitational acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
Source

--

RefBy

IM:calOfAngularAcceleration2

Detailed derivation of force on the second object:

\[\symbf{F}=m \symbf{a}={\symbf{T}_{2}} \cos\left({θ_{2}}\right)-{m_{2}} \symbf{g}\]

Data Definitions

This section collects and defines all the data needed to build the instance models.

Refname DD:positionGDD
Label

Velocity

Symbol

v

Units

\(\frac{\text{m}}{\text{s}}\)

Equation \[\symbf{v}=\frac{\,d\symbf{p}}{\,dt}\]
Description
  • v is the velocity (\(\frac{\text{m}}{\text{s}}\))
  • t is the time (s)
  • p is the position (m)
Source

--

RefBy

GD:velocityY2, GD:velocityY1, GD:velocityX2, and GD:velocityX1

Refname DD:positionXDD1
Label

The horizontal position of the first object

Symbol

px1

Units

m

Equation \[{p_{\text{x}1}}={L_{1}} \sin\left({θ_{1}}\right)\]
Description
  • px1 is the the horizontal position of the first object (m)
  • L1 is the the length of the first rod (m)
  • θ1 is the the angle of the first rod (°)
Notes

px1 is the horizontal position

px1 is shown in Fig:dblpendulum.

Source

--

RefBy

GD:velocityX1

Refname DD:positionYDD1
Label

The vertical position of the first object

Symbol

py1

Units

m

Equation \[{p_{\text{y}1}}=-{L_{1}} \cos\left({θ_{1}}\right)\]
Description
  • py1 is the the vertical position of the first object (m)
  • L1 is the the length of the first rod (m)
  • θ1 is the the angle of the first rod (°)
Notes

py1 is the vertical position

py1 is shown in Fig:dblpendulum.

Source

--

RefBy

GD:velocityY1

Refname DD:positionXDD2
Label

The horizontal position of the second object

Symbol

px2

Units

m

Equation \[{p_{\text{x}2}}={p_{\text{x}1}}+{L_{2}} \sin\left({θ_{2}}\right)\]
Description
  • px2 is the the horizontal position of the second object (m)
  • px1 is the the horizontal position of the first object (m)
  • L2 is the the length of the second rod (m)
  • θ2 is the the angle of the second rod (°)
Notes

px2 is the horizontal position

px2 is shown in Fig:dblpendulum.

Source

--

RefBy

GD:velocityX2

Refname DD:positionYDD2
Label

The vertical position of the second object

Symbol

py2

Units

m

Equation \[{p_{\text{y}2}}={p_{\text{y}1}}-{L_{2}} \cos\left({θ_{2}}\right)\]
Description
  • py2 is the the vertical position of the second object (m)
  • py1 is the the vertical position of the first object (m)
  • L2 is the the length of the second rod (m)
  • θ2 is the the angle of the second rod (°)
Notes

py2 is the vertical position

py2 is shown in Fig:dblpendulum.

Source

--

RefBy

GD:velocityY2

Refname DD:accelerationGDD
Label

Acceleration

Symbol

a

Units

\(\frac{\text{m}}{\text{s}^{2}}\)

Equation \[\symbf{a}=\frac{\,d\symbf{v}}{\,dt}\]
Description
  • a is the acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • t is the time (s)
  • v is the velocity (\(\frac{\text{m}}{\text{s}}\))
Source

--

RefBy

Refname DD:forceGDD
Label

Force

Symbol

F

Units

N

Equation \[\symbf{F}=m \symbf{a}\]
Description
  • F is the force (N)
  • m is the mass (kg)
  • a is the acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
Source

--

RefBy

Instance Models

This section transforms the problem defined in the problem description into one which is expressed in mathematical terms. It uses concrete symbols defined in the data definitions to replace the abstract symbols in the models identified in theoretical models and general definitions.

Refname IM:calOfAngularAcceleration1
Label

Calculation of angular acceleration

Input

L1, L2, m1, m2, θ1, θ2

Output

α1

Input Constraints \[{L_{1}}\gt{}0\] \[{L_{2}}\gt{}0\] \[{m_{1}}\gt{}0\] \[{m_{2}}\gt{}0\]
Output Constraints \[{α_{1}}\gt{}0\]
Equation \[{α_{1}}\left({θ_{1}},{θ_{2}},{w_{1}},{w_{2}}\right)=\frac{-\symbf{g} \left(2 {m_{1}}+{m_{2}}\right) \sin\left({θ_{1}}\right)-{m_{2}} \symbf{g} \sin\left({θ_{1}}-2 {θ_{2}}\right)-2 \sin\left({θ_{1}}-{θ_{2}}\right) {m_{2}} \left({w_{2}}^{2} {L_{2}}+{w_{1}}^{2} {L_{1}} \cos\left({θ_{1}}-{θ_{2}}\right)\right)}{{L_{1}} \left(2 {m_{1}}+{m_{2}}-{m_{2}} \cos\left(2 {θ_{1}}-2 {θ_{2}}\right)\right)}\]
Description
  • α1 is the the angular acceleration of the first object (\(\frac{\text{rad}}{\text{s}^{2}}\))
  • θ1 is the the angle of the first rod (°)
  • θ2 is the the angle of the second rod (°)
  • w1 is the the angular velocity of the first object (\(\frac{\text{rad}}{\text{s}}\))
  • w2 is the the angular velocity of the second object (\(\frac{\text{rad}}{\text{s}}\))
  • g is the gravitational acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • m1 is the the mass of the first object (kg)
  • m2 is the the mass of the second object (kg)
  • L2 is the the length of the second rod (m)
  • L1 is the the length of the first rod (m)
Source

--

RefBy

FR:Output-Values, FR:Calculate-Angular-Position-Of-Mass, and IM:calOfAngularAcceleration2

Refname IM:calOfAngularAcceleration2
Label

Calculation of angular acceleration

Input

L1, L2, m1, m2, θ1, θ2

Output

α2

Input Constraints \[{L_{1}}\gt{}0\] \[{L_{2}}\gt{}0\] \[{m_{1}}\gt{}0\] \[{m_{2}}\gt{}0\]
Output Constraints \[{α_{2}}\gt{}0\]
Equation \[{α_{2}}\left({θ_{1}},{θ_{2}},{w_{1}},{w_{2}}\right)=\frac{2 \sin\left({θ_{1}}-{θ_{2}}\right) \left({w_{1}}^{2} {L_{1}} \left({m_{1}}+{m_{2}}\right)+\symbf{g} \left({m_{1}}+{m_{2}}\right) \cos\left({θ_{1}}\right)+{w_{2}}^{2} {L_{2}} {m_{2}} \cos\left({θ_{1}}-{θ_{2}}\right)\right)}{{L_{2}} \left(2 {m_{1}}+{m_{2}}-{m_{2}} \cos\left(2 {θ_{1}}-2 {θ_{2}}\right)\right)}\]
Description
  • α2 is the the angular acceleration of the second object (\(\frac{\text{rad}}{\text{s}^{2}}\))
  • θ1 is the the angle of the first rod (°)
  • θ2 is the the angle of the second rod (°)
  • w1 is the the angular velocity of the first object (\(\frac{\text{rad}}{\text{s}}\))
  • w2 is the the angular velocity of the second object (\(\frac{\text{rad}}{\text{s}}\))
  • L1 is the the length of the first rod (m)
  • m1 is the the mass of the first object (kg)
  • m2 is the the mass of the second object (kg)
  • g is the gravitational acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • L2 is the the length of the second rod (m)
Source

--

RefBy

FR:Output-Values, FR:Calculate-Angular-Position-Of-Mass, and IM:calOfAngularAcceleration2

Detailed derivation of the angle of the second rod:

By solving equations GD:xForce2 and GD:yForce2 for T2 sin(θ2) and T2 cos(θ2) and then substituting into eqaution GD:xForce1 and GD:yForce1 , We can get equations 1 and 2:

\[{m_{1}} {a_{\text{x}1}}=-{\symbf{T}_{1}} \sin\left({θ_{1}}\right)-{m_{2}} {a_{\text{x}2}}\]

\[{m_{1}} {a_{\text{y}1}}={\symbf{T}_{1}} \cos\left({θ_{1}}\right)-{m_{2}} {a_{\text{y}2}}-{m_{2}} \symbf{g}-{m_{1}} \symbf{g}\]

Multiply the equation 1 by cos(θ1) and the equation 2 by sin(θ1) and rearrange to get:

\[{\symbf{T}_{1}} \sin\left({θ_{1}}\right) \cos\left({θ_{1}}\right)=-\cos\left({θ_{1}}\right) \left({m_{1}} {a_{\text{x}1}}+{m_{2}} {a_{\text{x}2}}\right)\]

\[{\symbf{T}_{1}} \sin\left({θ_{1}}\right) \cos\left({θ_{1}}\right)=\sin\left({θ_{1}}\right) \left({m_{1}} {a_{\text{y}1}}+{m_{2}} {a_{\text{y}2}}+{m_{2}} \symbf{g}+{m_{1}} \symbf{g}\right)\]

This leads to the equation 3

\[\sin\left({θ_{1}}\right) \left({m_{1}} {a_{\text{y}1}}+{m_{2}} {a_{\text{y}2}}+{m_{2}} \symbf{g}+{m_{1}} \symbf{g}\right)=-\cos\left({θ_{1}}\right) \left({m_{1}} {a_{\text{x}1}}+{m_{2}} {a_{\text{x}2}}\right)\]

Next, multiply equation GD:xForce2 by cos(θ2) and equation GD:yForce2 by sin(θ2) and rearrange to get:

\[{\symbf{T}_{2}} \sin\left({θ_{2}}\right) \cos\left({θ_{2}}\right)=-\cos\left({θ_{2}}\right) {m_{2}} {a_{\text{x}2}}\]

\[{\symbf{T}_{1}} \sin\left({θ_{2}}\right) \cos\left({θ_{2}}\right)=\sin\left({θ_{2}}\right) \left({m_{2}} {a_{\text{y}2}}+{m_{2}} \symbf{g}\right)\]

which leads to equation 4

\[\sin\left({θ_{2}}\right) \left({m_{2}} {a_{\text{y}2}}+{m_{2}} \symbf{g}\right)=-\cos\left({θ_{2}}\right) {m_{2}} {a_{\text{x}2}}\]

By giving equations GD:accelerationX1 and GD:accelerationX2 and GD:accelerationY1 and GD:accelerationY2 plus additional two equations, 3 and 4, we can get IM:calOfAngularAcceleration1 and IM:calOfAngularAcceleration2 via a computer algebra program:

Data Constraints

The Data Constraints Table shows the data constraints on the input variables. The column for physical constraints gives the physical limitations on the range of values that can be taken by the variable. The uncertainty column provides an estimate of the confidence with which the physical quantities can be measured. This information would be part of the input if one were performing an uncertainty quantification exercise. The constraints are conservative, to give the user of the model the flexibility to experiment with unusual situations. The column of typical values is intended to provide a feel for a common scenario.

Var Physical Constraints Typical Value Uncert.
L1 L1 > 0 1.0 m 10%
L2 L2 > 0 1.0 m 10%
m1 m1 > 0 0.5 kg 10%
m2 m2 > 0 0.5 kg 10%
θ1 θ1 > 0 30.0 ° 10%
θ2 θ2 > 0 30.0 ° 10%

Input Data Constraints

Properties of a Correct Solution

The Data Constraints Table shows the data constraints on the output variables. The column for physical constraints gives the physical limitations on the range of values that can be taken by the variable.

Var Physical Constraints
α1 α1 > 0
α2 α2 > 0

Output Data Constraints

Requirements

This section provides the functional requirements, the tasks and behaviours that the software is expected to complete, and the non-functional requirements, the qualities that the software is expected to exhibit.

Functional Requirements

This section provides the functional requirements, the tasks and behaviours that the software is expected to complete.

Input-Values: Input the values from Tab:ReqInputs.

Verify-Input-Values: Check the entered input values to ensure that they do not exceed the data constraints. If any of the input values are out of bounds, an error message is displayed and the calculations stop.

Calculate-Angular-Position-Of-Mass: Calculate the following values: α1 and α2 (from IM:calOfAngularAcceleration1) (from IM:calOfAngularAcceleration2).

Output-Values: Output α1 and α2 (from IM:calOfAngularAcceleration1 and IM:calOfAngularAcceleration2).

Symbol Description Units
L1 The length of the first rod m
L2 The length of the second rod m
m1 The mass of the first object kg
m2 The mass of the second object kg
θ1 The angle of the first rod °
θ2 The angle of the second rod °

Required Inputs following FR:Input-Values

Non-Functional Requirements

This section provides the non-functional requirements, the qualities that the software is expected to exhibit.

Correct: The outputs of the code have the properties of a correct solution.

Portable: The code is able to be run in different environments.

Traceability Matrices and Graphs

The purpose of the traceability matrices is to provide easy references on what has to be additionally modified if a certain component is changed. Every time a component is changed, the items in the column of that component that are marked with an "X" should be modified as well. Tab:TraceMatAvsA shows the dependencies of assumptions on the assumptions. Tab:TraceMatAvsAll shows the dependencies of data definitions, theoretical models, general definitions, instance models, requirements, likely changes, and unlikely changes on the assumptions. Tab:TraceMatRefvsRef shows the dependencies of data definitions, theoretical models, general definitions, and instance models with each other. Tab:TraceMatAllvsR shows the dependencies of requirements, goal statements on the data definitions, theoretical models, general definitions, and instance models.

The purpose of the traceability graphs is also to provide easy references on what has to be additionally modified if a certain component is changed. The arrows in the graphs represent dependencies. The component at the tail of an arrow is depended on by the component at the head of that arrow. Therefore, if a component is changed, the components that it points to should also be changed. Fig:TraceGraphAvsA shows the dependencies of assumptions on the assumptions. Fig:TraceGraphAvsAll shows the dependencies of data definitions, theoretical models, general definitions, instance models, requirements, likely changes, and unlikely changes on the assumptions. Fig:TraceGraphRefvsRef shows the dependencies of data definitions, theoretical models, general definitions, and instance models with each other. Fig:TraceGraphAllvsR shows the dependencies of requirements, goal statements on the data definitions, theoretical models, general definitions, and instance models. Fig:TraceGraphAllvsAll shows the dependencies of dependencies of assumptions, models, definitions, requirements, goals, and changes with each other.

TraceGraphAvsA
TraceGraphAvsA
TraceGraphAvsAll
TraceGraphAvsAll
TraceGraphRefvsRef
TraceGraphRefvsRef
TraceGraphAllvsR
TraceGraphAllvsR
TraceGraphAllvsAll
TraceGraphAllvsAll

For convenience, the following graphs can be found at the links below:

Values of Auxiliary Constants

There are no auxiliary constants.

References