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 |
---|---|---|
m | length | metre |
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 |
---|---|---|
a | Scalar acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
ac | Constant acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
ax | x-component of acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
axc | x-component of constant acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
ay | y-component of acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
ayc | y-component of constant acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
a(t) | Acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
ac | Constant acceleration vector | \(\frac{\text{m}}{\text{s}^{2}}\) |
doffset | Distance between the target position and the landing position | m |
g | Magnitude of gravitational acceleration | \(\frac{\text{m}}{\text{s}^{2}}\) |
p | Scalar position | m |
p(t) | 1D position | m |
pi | Initial position | m |
pland | Landing position | m |
ptarget | Target position | m |
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 |
s | Output message as a string | -- |
t | Time | s |
tflight | Flight duration | s |
v | Speed | \(\frac{\text{m}}{\text{s}}\) |
v(t) | 1D speed | \(\frac{\text{m}}{\text{s}}\) |
vi | Initial speed | \(\frac{\text{m}}{\text{s}}\) |
vlaunch | Launch speed | \(\frac{\text{m}}{\text{s}}\) |
vx | x-component of velocity | \(\frac{\text{m}}{\text{s}}\) |
vxi | x-component of initial velocity | \(\frac{\text{m}}{\text{s}}\) |
vy | y-component of velocity | \(\frac{\text{m}}{\text{s}}\) |
vyi | y-component of initial velocity | \(\frac{\text{m}}{\text{s}}\) |
v(t) | Velocity | \(\frac{\text{m}}{\text{s}}\) |
vi | Initial velocity | \(\frac{\text{m}}{\text{s}}\) |
ε | Hit tolerance | -- |
θ | Launch angle | rad |
π | Ratio of circumference to diameter for any circle | -- |
Abbreviation | Full Form |
---|---|
1D | One-Dimensional |
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 |
TM | Theoretical Model |
Uncert. | Typical Uncertainty |
Projectile motion is a common problem in physics. Therefore, it is useful to have a program to solve and model these types of problems. Common examples of projectile motion include ballistics problems (missiles, bullets, etc.) and the flight of balls in various sports (baseball, golf, football, etc.). The document describes the program called Projectile , which is based on the original, manually created version of Projectile.
The following section provides an overview of the Software Requirements Specification (SRS) for Projectile. 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 Projectile. 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 Projectile. 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) projectile motion problem with constant acceleration.
Reviewers of this documentation should have an understanding of undergraduate level 1 physics and undergraduate level 1 calculus. The users of Projectile 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 (Projectile). 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 Projectile should have an understanding of high school physics and high school calculus.
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 whether a launched projectile hits its target.
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 Projectile, as shown in Fig:Launch, includes the following elements:
PS1: The launcher.
PS2: The projectile (with initial velocity vi and launch angle θ).
PS3: The target.
Given the initial velocity vector of the projectile and the geometric layout of the launcher and target, the goal statement is:
The instance models that govern Projectile 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 Projectile 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 |
This section collects the laws and equations that will be used to build the instance models.
Refname | GD:rectVel |
---|---|
Label |
Rectilinear (1D) velocity as a function of time for constant acceleration |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[v\text{(}t\text{)}={v^{\text{i}}}+{a^{c}}\,t\] |
Description | |
Source |
hibbeler2004 (pg. 8) |
RefBy |
GD:velVec and GD:rectPos |
Assume we have rectilinear motion of a particle (of negligible size and shape, from A:pointMass); that is, motion in a straight line. The velocity is v and the acceleration is a. The motion in TM:acceleration is now one-dimensional with a constant acceleration, represented by ac. The initial velocity (at t = 0, from A:timeStartZero) is represented by vi. From TM:acceleration in 1D, and using the above symbols we have:
\[{a^{c}}=\frac{\,dv}{\,dt}\]Rearranging and integrating, we have:
\[\int_{{v^{\text{i}}}}^{v}{1}\,dv=\int_{0}^{t}{{a^{c}}}\,dt\]Performing the integration, we have the required equation:
\[v\text{(}t\text{)}={v^{\text{i}}}+{a^{c}}\,t\]Refname | GD:rectPos |
---|---|
Label |
Rectilinear (1D) position as a function of time for constant acceleration |
Units | m |
Equation | \[p\text{(}t\text{)}={p^{\text{i}}}+{v^{\text{i}}}\,t+\frac{{a^{c}}\,t^{2}}{2}\] |
Description | |
Source |
hibbeler2004 (pg. 8) |
RefBy |
Assume we have rectilinear motion of a particle (of negligible size and shape, from A:pointMass); that is, motion in a straight line. The position is p and the velocity is v. The motion in TM:velocity is now one-dimensional. The initial position (at t = 0, from A:timeStartZero) is represented by pi. From TM:velocity in 1D, and using the above symbols we have:
\[v=\frac{\,dp}{\,dt}\]Rearranging and integrating, we have:
\[\int_{{p^{\text{i}}}}^{p}{1}\,dp=\int_{0}^{t}{v}\,dt\]From GD:rectVel, we can replace v:
\[\int_{{p^{\text{i}}}}^{p}{1}\,dp=\int_{0}^{t}{{v^{\text{i}}}+{a^{c}}\,t}\,dt\]Performing the integration, we have the required equation:
\[p\text{(}t\text{)}={p^{\text{i}}}+{v^{\text{i}}}\,t+\frac{{a^{c}}\,t^{2}}{2}\]Refname | GD:velVec |
---|---|
Label |
Velocity vector as a function of time for 2D motion under constant acceleration |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[\symbf{v}\text{(}t\text{)}=\begin{bmatrix} {{v_{\text{x}}}^{\text{i}}}+{{a_{\text{x}}}^{\text{c}}}\,t\\ {{v_{\text{y}}}^{\text{i}}}+{{a_{\text{y}}}^{\text{c}}}\,t \end{bmatrix}\] |
Description | |
Source | -- |
RefBy |
For a two-dimensional Cartesian coordinate system (A:twoDMotion and A:cartSyst), we can represent the velocity vector as v(t) = \(\begin{bmatrix} {v_{\text{x}}}\\ {v_{\text{y}}} \end{bmatrix}\) and the acceleration vector as a(t) = \(\begin{bmatrix} {a_{\text{x}}}\\ {a_{\text{y}}} \end{bmatrix}\). The acceleration is assumed to be constant (A:constAccel) and the constant acceleration vector is represented as ac = \(\begin{bmatrix} {{a_{\text{x}}}^{\text{c}}}\\ {{a_{\text{y}}}^{\text{c}}} \end{bmatrix}\). The initial velocity (at t = 0, from A:timeStartZero) is represented by vi = \(\begin{bmatrix} {{v_{\text{x}}}^{\text{i}}}\\ {{v_{\text{y}}}^{\text{i}}} \end{bmatrix}\). Since we have a Cartesian coordinate system, GD:rectVel can be applied to each coordinate of the velocity vector to yield the required equation:
\[\symbf{v}\text{(}t\text{)}=\begin{bmatrix} {{v_{\text{x}}}^{\text{i}}}+{{a_{\text{x}}}^{\text{c}}}\,t\\ {{v_{\text{y}}}^{\text{i}}}+{{a_{\text{y}}}^{\text{c}}}\,t \end{bmatrix}\]Refname | GD:posVec |
---|---|
Label |
Position vector as a function of time for 2D motion under constant acceleration |
Units | m |
Equation | \[\symbf{p}\text{(}t\text{)}=\begin{bmatrix} {{p_{\text{x}}}^{\text{i}}}+{{v_{\text{x}}}^{\text{i}}}\,t+\frac{{{a_{\text{x}}}^{\text{c}}}\,t^{2}}{2}\\ {{p_{\text{y}}}^{\text{i}}}+{{v_{\text{y}}}^{\text{i}}}\,t+\frac{{{a_{\text{y}}}^{\text{c}}}\,t^{2}}{2} \end{bmatrix}\] |
Description | |
Source | -- |
RefBy |
For a two-dimensional Cartesian coordinate system (A:twoDMotion and A:cartSyst), we can represent the position vector as p(t) = \(\begin{bmatrix} {p_{\text{x}}}\\ {p_{\text{y}}} \end{bmatrix}\), the velocity vector as v(t) = \(\begin{bmatrix} {v_{\text{x}}}\\ {v_{\text{y}}} \end{bmatrix}\), and the acceleration vector as a(t) = \(\begin{bmatrix} {a_{\text{x}}}\\ {a_{\text{y}}} \end{bmatrix}\). The acceleration is assumed to be constant (A:constAccel) and the constant acceleration vector is represented as ac = \(\begin{bmatrix} {{a_{\text{x}}}^{\text{c}}}\\ {{a_{\text{y}}}^{\text{c}}} \end{bmatrix}\). The initial velocity (at t = 0, from A:timeStartZero) is represented by vi = \(\begin{bmatrix} {{v_{\text{x}}}^{\text{i}}}\\ {{v_{\text{y}}}^{\text{i}}} \end{bmatrix}\). Since we have a Cartesian coordinate system, GD:rectPos can be applied to each coordinate of the position vector to yield the required equation:
\[\symbf{p}\text{(}t\text{)}=\begin{bmatrix} {{p_{\text{x}}}^{\text{i}}}+{{v_{\text{x}}}^{\text{i}}}\,t+\frac{{{a_{\text{x}}}^{\text{c}}}\,t^{2}}{2}\\ {{p_{\text{y}}}^{\text{i}}}+{{v_{\text{y}}}^{\text{i}}}\,t+\frac{{{a_{\text{y}}}^{\text{c}}}\,t^{2}}{2} \end{bmatrix}\]This section collects and defines all the data needed to build the instance models.
Refname | DD:vecMag |
---|---|
Label | Speed |
Symbol | v |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[v=\|\symbf{v}\text{(}t\text{)}\|\] |
Description | |
Notes |
For a given velocity vector v(t), the magnitude of the vector (||v(t)||) is the scalar called speed. |
Source | -- |
RefBy |
DD:speedIY and DD:speedIX |
Refname | DD:speedIX |
---|---|
Label |
x-component of initial velocity |
Symbol |
vxi |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[{{v_{\text{x}}}^{\text{i}}}={v^{\text{i}}}\,\cos\left(θ\right)\] |
Description | |
Notes |
vi is from DD:vecMag. θ is shown in Fig:Launch. |
Source | -- |
RefBy |
Refname | DD:speedIY |
---|---|
Label |
y-component of initial velocity |
Symbol |
vyi |
Units |
\(\frac{\text{m}}{\text{s}}\) |
Equation | \[{{v_{\text{y}}}^{\text{i}}}={v^{\text{i}}}\,\sin\left(θ\right)\] |
Description | |
Notes |
vi is from DD:vecMag. θ is shown in Fig:Launch. |
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:calOfLandingTime |
---|---|
Label | Calculation of landing time |
Input |
vlaunch, θ |
Output | tflight |
Input Constraints | \[{v_{\text{launch}}}\gt{}0\] \[0\lt{}θ\lt{}\frac{π}{2}\] |
Output Constraints | \[{t_{\text{flight}}}\gt{}0\] |
Equation | \[{t_{\text{flight}}}=\frac{2\,{v_{\text{launch}}}\,\sin\left(θ\right)}{g}\] |
Description | |
Notes |
The constraint 0 < θ < \(\frac{π}{2}\) is from A:posXDirection and A:yAxisGravity, and is shown in Fig:Launch. g is defined in A:gravAccelValue. The constraint tflight > 0 is from A:timeStartZero. |
Source | -- |
RefBy |
IM:calOfLandingDist, FR:Output-Values, and FR:Calculate-Values |
We know that pyi = 0 (A:launchOrigin) and ayc = −g (A:accelYGravity). Substituting these values into the y-direction of GD:posVec gives us:
\[{p_{\text{y}}}={{v_{\text{y}}}^{\text{i}}}\,t-\frac{g\,t^{2}}{2}\]To find the time that the projectile lands, we want to find the t value (tflight) where py = 0 (since the target is on the x-axis from A:targetXAxis). From the equation above we get:
\[{{v_{\text{y}}}^{\text{i}}}\,{t_{\text{flight}}}-\frac{g\,{t_{\text{flight}}}^{2}}{2}=0\]Dividing by tflight (with the constraint tflight > 0) gives us:
\[{{v_{\text{y}}}^{\text{i}}}-\frac{g\,{t_{\text{flight}}}}{2}=0\]Solving for tflight gives us:
\[{t_{\text{flight}}}=\frac{2\,{{v_{\text{y}}}^{\text{i}}}}{g}\]From DD:speedIY (with vi = vlaunch) we can replace vyi:
\[{t_{\text{flight}}}=\frac{2\,{v_{\text{launch}}}\,\sin\left(θ\right)}{g}\]Refname | IM:calOfLandingDist |
---|---|
Label | Calculation of landing position |
Input |
vlaunch, θ |
Output | pland |
Input Constraints | \[{v_{\text{launch}}}\gt{}0\] \[0\lt{}θ\lt{}\frac{π}{2}\] |
Output Constraints | \[{p_{\text{land}}}\gt{}0\] |
Equation | \[{p_{\text{land}}}=\frac{2\,{v_{\text{launch}}}^{2}\,\sin\left(θ\right)\,\cos\left(θ\right)}{g}\] |
Description | |
Notes |
The constraint 0 < θ < \(\frac{π}{2}\) is from A:posXDirection and A:yAxisGravity, and is shown in Fig:Launch. g is defined in A:gravAccelValue. The constraint pland > 0 is from A:posXDirection. |
Source | -- |
RefBy |
We know that pxi = 0 (A:launchOrigin) and axc = 0 (A:accelXZero). Substituting these values into the x-direction of GD:posVec gives us:
\[{p_{\text{x}}}={{v_{\text{x}}}^{\text{i}}}\,t\]To find the landing position, we want to find the px value (pland) at flight duration (from IM:calOfLandingTime):
\[{p_{\text{land}}}=\frac{{{v_{\text{x}}}^{\text{i}}}\cdot{}2\,{v_{\text{launch}}}\,\sin\left(θ\right)}{g}\]From DD:speedIX (with vi = vlaunch) we can replace vxi:
\[{p_{\text{land}}}=\frac{{v_{\text{launch}}}\,\cos\left(θ\right)\cdot{}2\,{v_{\text{launch}}}\,\sin\left(θ\right)}{g}\]Rearranging this gives us the required equation:
\[{p_{\text{land}}}=\frac{2\,{v_{\text{launch}}}^{2}\,\sin\left(θ\right)\,\cos\left(θ\right)}{g}\]Refname | IM:offsetIM |
---|---|
Label | Offset |
Input |
pland, ptarget |
Output | doffset |
Input Constraints | \[{p_{\text{land}}}\gt{}0\] \[{p_{\text{target}}}\gt{}0\] |
Output Constraints | |
Equation | \[{d_{\text{offset}}}={p_{\text{land}}}-{p_{\text{target}}}\] |
Description | |
Notes |
pland is from IM:calOfLandingDist. The constraints pland > 0 and ptarget > 0 are from A:posXDirection. |
Source | -- |
RefBy |
Refname | IM:messageIM |
---|---|
Label | Output message |
Input |
doffset, ptarget |
Output | s |
Input Constraints | \[{d_{\text{offset}}}\gt{}-{p_{\text{target}}}\] \[{p_{\text{target}}}\gt{}0\] |
Output Constraints | |
Equation | \[s=\begin{cases} \text{``The target was hit.''}, & |\frac{{d_{\text{offset}}}}{{p_{\text{target}}}}|\lt{}ε\\ \text{``The projectile fell short.''}, & {d_{\text{offset}}}\lt{}0\\ \text{``The projectile went long.''}, & {d_{\text{offset}}}\gt{}0 \end{cases}\] |
Description | |
Notes |
doffset is from IM:offsetIM. The constraint ptarget > 0 is from A:posXDirection. The constraint doffset > −ptarget is from the fact that pland > 0, from A:posXDirection. ε is defined in Sec:Values of Auxiliary Constants. |
Source | -- |
RefBy |
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. |
---|---|---|---|
ptarget | ptarget > 0 | 1000 m | 10% |
vlaunch | vlaunch > 0 | 100 \(\frac{\text{m}}{\text{s}}\) | 10% |
θ | 0 < θ < \(\frac{π}{2}\) | \(\frac{π}{4}\) 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 |
---|---|
pland | pland > 0 |
doffset | doffset > −ptarget |
tflight | tflight > 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 |
---|---|---|
ptarget | Target position | m |
vlaunch | Launch speed | \(\frac{\text{m}}{\text{s}}\) |
θ | Launch angle | 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.
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:
This section contains the standard values that are used for calculations in Projectile.
Symbol | Description | Value | Unit |
---|---|---|---|
g | magnitude of gravitational acceleration | 9.8 | \(\frac{\text{m}}{\text{s}^{2}}\) |
ε | hit tolerance | 2.0% | -- |
π | ratio of circumference to diameter for any circle | 3.14159265 | -- |