An outline of all sections included in this SRS is recorded here for easy reference.
This section records information for easy reference.
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 |
---|---|---|
Hz | frequency | hertz |
kg | mass | kilogram |
m | length | metre |
N | force | newton |
rad | angle | radian |
s | time | second |
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 |
---|---|---|
ax | x-component of acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
ay | y-component of acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
a(t) | Acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
F | Force | N |
f | Frequency | Hz |
g | Gravitational acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
I | Moment of inertia | kgm2 |
î | Unit vector | -- |
Lrod | Length of the rod | m |
m | Mass | kg |
px | x-component of position | m |
pxi | x-component of initial position | m |
py | y-component of position | m |
pyi | y-component of initial position | m |
p(t) | Position | m |
T | Period | s |
T | Tension | N |
t | Time | s |
vx | x-component of velocity | \(\frac{\text{m}}{\text{s}}\) |
vy | y-component of velocity | \(\frac{\text{m}}{\text{s}}\) |
v(t) | Velocity | \(\frac{\text{m}}{\text{s}}\) |
α | Angular acceleration | \(\frac{\text{rad}}{\text{s}^{2}}\) |
θ | Angular displacement | rad |
θi | Initial pendulum angle | rad |
θp | Displacement angle of the pendulum | rad |
π | Ratio of circumference to diameter for any circle | -- |
τ | Torque | Nm |
Ω | Angular frequency | s |
ω | Angular velocity | \(\frac{\text{rad}}{\text{s}}\) |
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 |
RefBy | Referenced by |
Refname | Reference Name |
SRS | Software Requirements Specification |
SglPend | Single Pendulum |
TM | Theoretical Model |
Uncert. | Typical Uncertainty |
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 document describes the program called Single Pendulum , which is based on the original, manually created version of Double Pendulum.
The following section provides an overview of the Software Requirements Specification (SRS) for Single 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.
The primary purpose of this document is to record the requirements of SglPend. 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 SglPend. 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.
The scope of the requirements includes the analysis of a two-dimensional (2D) pendulum motion problem with various initial conditions.
Reviewers of this documentation should have an understanding of undergraduate level 2 physics, undergraduate level 1 calculus, and ordinary differential equations. The users of SglPend can have a lower level of expertise, as explained in Sec:User Characteristics.
The organization of this document follows the template for an SRS for scientific computing software proposed by koothoor2013, smithLai2005, smithEtAl2007, and smithKoothoor2016. 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.
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.
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 (SglPend). Arrows are used to show the data flow between the system and its environment.
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:
The end user of SglPend should have an understanding of high school physics, high school calculus and ordinary differential equations.
There are no system constraints.
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.
A system is needed to predict the motion of a single pendulum.
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.
The physical system of SglPend, as shown in Fig:sglpend, includes the following elements:
PS1: The rod.
PS2: The mass.
Given the mass and length of the rod, initial angle of the mass and the gravitational constant, the goal statement is:
The instance models that govern SglPend 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.
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.
This section focuses on the general equations and laws that SglPend is based on.
Refname | TM:acceleration |
---|---|
Label | Acceleration |
Equation | \[\symbf{a}\text{(}t\text{)}=\frac{\,d\symbf{v}\text{(}t\text{)}}{\,dt}\] |
Description | |
Source | |
RefBy |
Refname | TM:velocity |
---|---|
Label | Velocity |
Equation | \[\symbf{v}\text{(}t\text{)}=\frac{\,d\symbf{p}\text{(}t\text{)}}{\,dt}\] |
Description | |
Source | |
RefBy |
Refname | TM:NewtonSecLawMot |
---|---|
Label | Newton's second law of motion |
Equation | \[\symbf{F}=m\,\symbf{a}\text{(}t\text{)}\] |
Description | |
Notes |
The net force F on a body is proportional to the acceleration a(t) of the body, where m denotes the mass of the body as the constant of proportionality. |
Source | -- |
RefBy |
Refname | TM:NewtonSecLawRotMot |
---|---|
Label |
Newton's second law for rotational motion |
Equation | \[\symbf{τ}=\symbf{I}\,α\] |
Description | |
Notes |
The net torque τ on a rigid body is proportional to its angular acceleration α, where I denotes the moment of inertia of the rigid body as the constant of proportionality. |
Source | -- |
RefBy |
This section collects the laws and equations that will be used to build the instance models.
Refname | GD:velocityIX |
---|---|
Label |
The x-component of velocity of the pendulum |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[{v_{\text{x}}}=ω\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)\] |
Description | |
Source | -- |
RefBy |
At a given point in time, velocity may be defined as
\[\symbf{v}\text{(}t\text{)}=\frac{\,d\symbf{p}\text{(}t\text{)}}{\,dt}\]We also know the horizontal position
\[{p_{\text{x}}}={L_{\text{rod}}}\,\sin\left({θ_{p}}\right)\]Applying this,
\[{v_{\text{x}}}=\frac{\,d{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)}{\,dt}\]Lrod is constant with respect to time, so
\[{v_{\text{x}}}={L_{\text{rod}}}\,\frac{\,d\sin\left({θ_{p}}\right)}{\,dt}\]Therefore, using the chain rule,
\[{v_{\text{x}}}=ω\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)\]Refname | GD:velocityIY |
---|---|
Label |
The y-component of velocity of the pendulum |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[{v_{\text{y}}}=ω\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)\] |
Description | |
Source | -- |
RefBy |
At a given point in time, velocity may be defined as
\[\symbf{v}\text{(}t\text{)}=\frac{\,d\symbf{p}\text{(}t\text{)}}{\,dt}\]We also know the vertical position
\[{p_{\text{y}}}=-{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)\]Applying this,
\[{v_{\text{y}}}=-\left(\frac{\,d{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)}{\,dt}\right)\]Lrod is constant with respect to time, so
\[{v_{\text{y}}}=-{L_{\text{rod}}}\,\frac{\,d\cos\left({θ_{p}}\right)}{\,dt}\]Therefore, using the chain rule,
\[{v_{\text{y}}}=ω\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)\]Refname | GD:accelerationIX |
---|---|
Label |
The x-component of acceleration of the pendulum |
Units |
\(\frac{\text{m}}{\text{s}^{2}}\) |
Equation | \[{a_{\text{x}}}=-ω^{2}\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)+α\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)\] |
Description | |
Source | -- |
RefBy |
Our acceleration is:
\[\symbf{a}\text{(}t\text{)}=\frac{\,d\symbf{v}\text{(}t\text{)}}{\,dt}\]Earlier, we found the horizontal velocity to be
\[{v_{\text{x}}}=ω\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)\]Applying this to our equation for acceleration
\[{a_{\text{x}}}=\frac{\,dω\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)}{\,dt}\]By the product and chain rules, we find
\[{a_{\text{x}}}=\frac{\,dω}{\,dt}\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)-ω\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)\,\frac{\,d{θ_{p}}}{\,dt}\]Simplifying,
\[{a_{\text{x}}}=-ω^{2}\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)+α\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)\]Refname | GD:accelerationIY |
---|---|
Label |
The y-component of acceleration of the pendulum |
Units |
\(\frac{\text{m}}{\text{s}^{2}}\) |
Equation | \[{a_{\text{y}}}=ω^{2}\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)+α\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)\] |
Description | |
Source | -- |
RefBy |
Our acceleration is:
\[\symbf{a}\text{(}t\text{)}=\frac{\,d\symbf{v}\text{(}t\text{)}}{\,dt}\]Earlier, we found the vertical velocity to be
\[{v_{\text{y}}}=ω\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)\]Applying this to our equation for acceleration
\[{a_{\text{y}}}=\frac{\,dω\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)}{\,dt}\]By the product and chain rules, we find
\[{a_{\text{y}}}=\frac{\,dω}{\,dt}\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)+ω\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)\,\frac{\,d{θ_{p}}}{\,dt}\]Simplifying,
\[{a_{\text{y}}}=ω^{2}\,{L_{\text{rod}}}\,\cos\left({θ_{p}}\right)+α\,{L_{\text{rod}}}\,\sin\left({θ_{p}}\right)\]Refname | GD:hForceOnPendulum |
---|---|
Label | Horizontal force on the pendulum |
Units | N |
Equation | \[\symbf{F}=m\,{a_{\text{x}}}=-\symbf{T}\,\sin\left({θ_{p}}\right)\] |
Description | |
Source | -- |
RefBy |
Refname | GD:vForceOnPendulum |
---|---|
Label | Vertical force on the pendulum |
Units | N |
Equation | \[\symbf{F}=m\,{a_{\text{y}}}=\symbf{T}\,\cos\left({θ_{p}}\right)-m\,\symbf{g}\] |
Description | |
Source | -- |
RefBy |
Refname | GD:angFrequencyGD |
---|---|
Label |
The angular frequency of the pendulum |
Units | s |
Equation | \[Ω=\sqrt{\frac{\symbf{g}}{{L_{\text{rod}}}}}\] |
Description | |
Notes |
The torque is defined in TM:NewtonSecLawRotMot and frequency is f is defined in DD:frequencyDD. |
Source | -- |
RefBy |
Consider the torque on a pendulum defined in TM:NewtonSecLawRotMot. The force providing the restoring torque is the component of weight of the pendulum bob that acts along the arc length. The torque is the length of the string Lrod multiplied by the component of the net force that is perpendicular to the radius of the arc. The minus sign indicates the torque acts in the opposite direction of the angular displacement:
\[\symbf{τ}=-{L_{\text{rod}}}\,m\,\symbf{g}\,\sin\left({θ_{p}}\right)\]So then
\[\symbf{I}\,α=-{L_{\text{rod}}}\,m\,\symbf{g}\,\sin\left({θ_{p}}\right)\]Therefore,
\[\symbf{I}\,\frac{\,d\frac{\,d{θ_{p}}}{\,dt}}{\,dt}=-{L_{\text{rod}}}\,m\,\symbf{g}\,\sin\left({θ_{p}}\right)\]Substituting for I
\[m\,{L_{\text{rod}}}^{2}\,\frac{\,d\frac{\,d{θ_{p}}}{\,dt}}{\,dt}=-{L_{\text{rod}}}\,m\,\symbf{g}\,\sin\left({θ_{p}}\right)\]Crossing out m and Lrod we have
\[\frac{\,d\frac{\,d{θ_{p}}}{\,dt}}{\,dt}=-\left(\frac{\symbf{g}}{{L_{\text{rod}}}}\right)\,\sin\left({θ_{p}}\right)\]For small angles, we approximate sin θp to θp
\[\frac{\,d\frac{\,d{θ_{p}}}{\,dt}}{\,dt}=-\left(\frac{\symbf{g}}{{L_{\text{rod}}}}\right)\,{θ_{p}}\]Because this equation, has the same form as the equation for simple harmonic motion the solution is easy to find. The angular frequency
\[Ω=\sqrt{\frac{\symbf{g}}{{L_{\text{rod}}}}}\]Refname | GD:periodPend |
---|---|
Label | The period of the pendulum |
Units | s |
Equation | \[T=2\,π\,\sqrt{\frac{{L_{\text{rod}}}}{\symbf{g}}}\] |
Description | |
Notes |
The frequency and period are defined in the data definitions for frequency and period respectively |
Source | -- |
RefBy |
The period of the pendulum can be defined from the general definition for the equation of angular frequency
\[Ω=\sqrt{\frac{\symbf{g}}{{L_{\text{rod}}}}}\]Therefore from the data definition of the equation for angular frequency, we have
\[T=2\,π\,\sqrt{\frac{{L_{\text{rod}}}}{\symbf{g}}}\]This section collects and defines all the data needed to build the instance models.
Refname | DD:positionIX |
---|---|
Label |
x-component of initial position |
Symbol |
pxi |
Units | m |
Equation | \[{{p_{\text{x}}}^{\text{i}}}={L_{\text{rod}}}\,\sin\left({θ_{i}}\right)\] |
Description | |
Notes |
pxi is the horizontal position pxi is shown in Fig:sglpend. |
Source | -- |
RefBy |
Refname | DD:positionIY |
---|---|
Label |
y-component of initial position |
Symbol |
pyi |
Units | m |
Equation | \[{{p_{\text{y}}}^{\text{i}}}=-{L_{\text{rod}}}\,\cos\left({θ_{i}}\right)\] |
Description | |
Notes |
pyi is the vertical position pyi is shown in Fig:sglpend. |
Source | -- |
RefBy |
Refname | DD:frequencyDD |
---|---|
Label | Frequency |
Symbol | f |
Units | Hz |
Equation | \[f=\frac{1}{T}\] |
Description | |
Notes |
f is the number of back and forth swings in one second |
Source | -- |
RefBy |
Refname | DD:angFrequencyDD |
---|---|
Label | Angular frequency |
Symbol | Ω |
Units | s |
Equation | \[Ω=\frac{2\,π}{T}\] |
Description | |
Notes |
T is from DD:periodSHMDD |
Source | -- |
RefBy |
Refname | DD:periodSHMDD |
---|---|
Label | Period |
Symbol | T |
Units | s |
Equation | \[T=\frac{1}{f}\] |
Description | |
Notes |
T is from DD:frequencyDD |
Source | -- |
RefBy |
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:calOfAngularDisplacement |
---|---|
Label |
Calculation of angular displacement |
Input |
Lrod, θi, g |
Output | θp |
Input Constraints | \[{L_{\text{rod}}}\gt{}0\] \[{θ_{i}}\gt{}0\] \[\symbf{g}\gt{}0\] |
Output Constraints | \[{θ_{p}}\gt{}0\] |
Equation | \[{θ_{p}}\left(t\right)={θ_{i}}\,\cos\left(Ω\,t\right)\] |
Description | |
Notes |
The constraint θi > 0 is required. The angular frequency is defined in GD:angFrequencyGD. |
Source | -- |
RefBy |
When the pendulum is displaced to an initial angle and released, the pendulum swings back and forth with periodic motion. By applying Newton's second law for rotational motion, the equation of motion for the pendulum may be obtained:
\[\symbf{τ}=\symbf{I}\,α\]Where τ denotes the torque, I denotes the moment of inertia and α denotes the angular acceleration. This implies:
\[-m\,\symbf{g}\,\sin\left({θ_{p}}\right)\,{L_{\text{rod}}}=m\,{L_{\text{rod}}}^{2}\,\frac{\,d\frac{\,d{θ_{p}}}{\,dt}}{\,dt}\]And rearranged as:
\[\frac{\,d\frac{\,d{θ_{p}}}{\,dt}}{\,dt}+\frac{\symbf{g}}{{L_{\text{rod}}}}\,\sin\left({θ_{p}}\right)=0\]If the amplitude of angular displacement is small enough, we can approximate sin(θp) = θp for the purpose of a simple pendulum at very small angles. Then the equation of motion reduces to the equation of simple harmonic motion:
\[\frac{\,d\frac{\,d{θ_{p}}}{\,dt}}{\,dt}+\frac{\symbf{g}}{{L_{\text{rod}}}}\,{θ_{p}}=0\]Thus the simple harmonic motion is:
\[{θ_{p}}\left(t\right)={θ_{i}}\,\cos\left(Ω\,t\right)\]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. |
---|---|---|---|
Lrod | Lrod > 0 | 44.2 m | 10% |
θi | θi > 0 | 2.1 rad | 10% |
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 |
---|---|
α | α > 0 |
θp | θp > 0 |
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.
This section provides the functional requirements, the tasks and behaviours that the software is expected to complete.
Symbol | Description | Units |
---|---|---|
Lrod | Length of the rod | m |
m | Mass | kg |
α | Angular acceleration | \(\frac{\text{rad}}{\text{s}^{2}}\) |
θi | Initial pendulum angle | rad |
θp | Displacement angle of the pendulum | rad |
This section provides the non-functional requirements, the qualities that the software is expected to exhibit.
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 the assumptions on each other. Tab:TraceMatAvsAll shows the dependencies of the data definitions, theoretical models, general definitions, instance models, requirements, likely changes, and unlikely changes on the assumptions. Tab:TraceMatRefvsRef shows the dependencies of the data definitions, theoretical models, general definitions, and instance models on each other. Tab:TraceMatAllvsR shows the dependencies of the requirements and goal statements on the data definitions, theoretical models, general definitions, and instance models.
A:twoDMotion | A:cartSys | A:cartSysR | A:yAxisDir | A:startOrigin | |
---|---|---|---|---|---|
A:twoDMotion | |||||
A:cartSys | |||||
A:cartSysR | |||||
A:yAxisDir | |||||
A:startOrigin |
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 each other. 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 on each other. Fig:TraceGraphAllvsR shows the dependencies of requirements and 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.
For convenience, the following graphs can be found at the links below:
There are no auxiliary constants.