Software Requirements Specification for Projectile

Samuel J. Crawford, Brooks MacLachlan, and W. Spencer Smith

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
m length metre
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
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 --

Table of Symbols

Abbreviations and Acronyms

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

Abbreviations and Acronyms

Introduction

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 program documented here is called 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.

Purpose of 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.

Scope of Requirements

The scope of the requirements includes the analysis of a two-dimensional (2D) projectile motion problem with constant acceleration.

Characteristics of Intended Reader

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.

Organization of Document

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.

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 (Projectile). 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 Projectile, 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.
  • Projectile 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.

User Characteristics

The end user of Projectile should have an understanding of high school physics and high school calculus.

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 predict whether a launched projectile hits its target.

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.

  • Launcher: Where the projectile is launched from and the device that does the launching.
  • Projectile: The object to be launched at the target.
  • Target: Where the projectile should be launched to.
  • 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).
  • Rectilinear: Occurring in one dimension.

Physical System Description

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.

The physical system
The physical system

Goal Statements

Given the initial velocity vector of the projectile and the geometric layout of the launcher and target, the goal statement is:

targetHit: Determine if the projectile hits the target.

Solution Characteristics Specification

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.

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 projectile motion is two-dimensional (2D). (RefBy: GD:velVec and GD:posVec.)

cartSyst: A Cartesian coordinate system is used (from A:neglectCurv). (RefBy: GD:velVec and GD:posVec.)

yAxisGravity: The direction of the y-axis is directed opposite to gravity. (RefBy: IM:calOfLandingDist, IM:calOfLandingTime, and A:accelYGravity.)

launchOrigin: The launcher is coincident with the origin. (RefBy: IM:calOfLandingDist and IM:calOfLandingTime.)

targetXAxis: The target lies on the x-axis (from A:neglectCurv). (RefBy: IM:calOfLandingTime.)

posXDirection: The positive x-direction is from the launcher to the target. (RefBy: IM:offsetIM, IM:messageIM, IM:calOfLandingDist, and IM:calOfLandingTime.)

constAccel: The acceleration is constant (from A:accelXZero, A:accelYGravity, A:neglectDrag, and A:freeFlight). (RefBy: GD:velVec and GD:posVec.)

accelXZero: The acceleration in the x-direction is zero. (RefBy: IM:calOfLandingDist and A:constAccel.)

accelYGravity: The acceleration in the y-direction is the acceleration due to gravity (from A:yAxisGravity). (RefBy: IM:calOfLandingTime and A:constAccel.)

neglectDrag: Air drag is neglected. (RefBy: A:constAccel.)

pointMass: The size and shape of the projectile are negligible, so that it can be modelled as a point mass. (RefBy: GD:rectVel and GD:rectPos.)

freeFlight: The flight is free; there are no collisions during the trajectory of the projectile. (RefBy: A:constAccel.)

neglectCurv: The distance is small enough that the curvature of the celestial body can be neglected. (RefBy: A:targetXAxis and A:cartSyst.)

timeStartZero: Time starts at zero. (RefBy: GD:velVec, GD:rectVel, GD:rectPos, GD:posVec, and IM:calOfLandingTime.)

gravAccelValue: The acceleration due to gravity is assumed to have the value provided in the section for Values of Auxiliary Constants. (RefBy: IM:calOfLandingDist and IM:calOfLandingTime.)

Theoretical Models

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
  • a(t) is the acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • t is the time (s)
  • v(t) is the velocity (\(\frac{\text{m}}{\text{s}}\))
Source

accelerationWiki

RefBy

GD:rectVel

Refname TM:velocity
Label

Velocity

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

velocityWiki

RefBy

GD:rectPos

General Definitions

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
  • v(t) is the 1D speed (\(\frac{\text{m}}{\text{s}}\))
  • vi is the initial speed (\(\frac{\text{m}}{\text{s}}\))
  • ac is the constant acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • t is the time (s)
Source

hibbeler2004 (pg. 8)

RefBy

GD:velVec and GD:rectPos

Detailed derivation of rectilinear velocity:

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
  • p(t) is the 1D position (m)
  • pi is the initial position (m)
  • vi is the initial speed (\(\frac{\text{m}}{\text{s}}\))
  • t is the time (s)
  • ac is the constant acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
Source

hibbeler2004 (pg. 8)

RefBy

GD:posVec

Detailed derivation of rectilinear position:

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
  • v(t) is the velocity (\(\frac{\text{m}}{\text{s}}\))
  • vxi is the x-component of initial velocity (\(\frac{\text{m}}{\text{s}}\))
  • axc is the x-component of constant acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • t is the time (s)
  • vyi is the y-component of initial velocity (\(\frac{\text{m}}{\text{s}}\))
  • ayc is the y-component of constant acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
Source

--

RefBy

Detailed derivation of velocity vector:

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
  • p(t) is the position (m)
  • pxi is the x-component of initial position (m)
  • vxi is the x-component of initial velocity (\(\frac{\text{m}}{\text{s}}\))
  • t is the time (s)
  • axc is the x-component of constant acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
  • pyi is the y-component of initial position (m)
  • vyi is the y-component of initial velocity (\(\frac{\text{m}}{\text{s}}\))
  • ayc is the y-component of constant acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
Source

--

RefBy

IM:calOfLandingDist and IM:calOfLandingTime

Detailed derivation of position vector:

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}\]

Data Definitions

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
  • v is the speed (\(\frac{\text{m}}{\text{s}}\))
  • v(t) is the velocity (\(\frac{\text{m}}{\text{s}}\))
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
  • vxi is the x-component of initial velocity (\(\frac{\text{m}}{\text{s}}\))
  • vi is the initial speed (\(\frac{\text{m}}{\text{s}}\))
  • θ is the launch angle (rad)
Notes

vi is from DD:vecMag.

θ is shown in Fig:Launch.

Source

--

RefBy

IM:calOfLandingDist

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
  • vyi is the y-component of initial velocity (\(\frac{\text{m}}{\text{s}}\))
  • vi is the initial speed (\(\frac{\text{m}}{\text{s}}\))
  • θ is the launch angle (rad)
Notes

vi is from DD:vecMag.

θ is shown in Fig:Launch.

Source

--

RefBy

IM:calOfLandingTime

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: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
  • tflight is the flight duration (s)
  • vlaunch is the launch speed (\(\frac{\text{m}}{\text{s}}\))
  • θ is the launch angle (rad)
  • g is the magnitude of gravitational acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
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

Detailed derivation of flight duration:

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
  • pland is the landing position (m)
  • vlaunch is the launch speed (\(\frac{\text{m}}{\text{s}}\))
  • θ is the launch angle (rad)
  • g is the magnitude of gravitational acceleration (\(\frac{\text{m}}{\text{s}^{2}}\))
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

IM:offsetIM and FR:Calculate-Values

Detailed derivation of landing position:

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
  • doffset is the distance between the target position and the landing position (m)
  • pland is the landing position (m)
  • ptarget is the target position (m)
Notes

pland is from IM:calOfLandingDist.

The constraints pland > 0 and ptarget > 0 are from A:posXDirection.

Source

--

RefBy

IM:messageIM, FR:Output-Values, and FR:Calculate-Values

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
  • s is the output message as a string (Unitless)
  • doffset is the distance between the target position and the landing position (m)
  • ptarget is the target position (m)
  • ε is the hit tolerance (Unitless)
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

FR:Output-Values and FR:Calculate-Values

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.
ptarget ptarget > 0 1000 m 10%
vlaunch vlaunch > 0 100 \(\frac{\text{m}}{\text{s}}\) 10%
θ 0 < θ < \(\frac{π}{2}\) \(\frac{π}{4}\) rad 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
pland pland > 0
doffset doffset > −ptarget
tflight tflight > 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-Values: Calculate the following values: tflight (from IM:calOfLandingTime), pland (from IM:calOfLandingDist), doffset (from IM:offsetIM), and s (from IM:messageIM).

Output-Values: Output tflight (from IM:calOfLandingTime), s (from IM:messageIM), and doffset (from IM:offsetIM).

Symbol Description Units
ptarget Target position m
vlaunch Launch speed \(\frac{\text{m}}{\text{s}}\)
θ Launch angle rad

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 described in Properties of a Correct Solution.

Verifiable: The code is tested with complete verification and validation plan.

Understandable: The code is modularized with complete module guide and module interface specification.

Reusable: The code is modularized.

Maintainable: If a likely change is made to the finished software, it will take at most 10% of the original development time, assuming the same development resources are available.

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 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.

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

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 --

Auxiliary Constants

References