Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JacquesCarette committed Feb 6, 2018
2 parents 7393c1b + cc955d0 commit 6c0a823
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 127 deletions.
5 changes: 1 addition & 4 deletions code/log_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ if [ -s $SWHS_PREF$log ]; then
echo "- BETWEEN GENERATED AND STABLE OUTPUT FOUND"
echo "-------------------------------------------"
errors="yes"
exitval=1
fi

if [ -s $TINY_PREF$log ]; then
Expand All @@ -25,7 +24,6 @@ if [ -s $TINY_PREF$log ]; then
echo "- BETWEEN GENERATED AND STABLE OUTPUT FOUND"
echo "-------------------------------------------"
errors="yes"
exitval=1
fi

if [ -s $SSP_PREF$log ]; then
Expand All @@ -34,7 +32,6 @@ if [ -s $SSP_PREF$log ]; then
echo "- BETWEEN GENERATED AND STABLE OUTPUT FOUND"
echo "-------------------------------------------"
errors="yes"
exitval=1
fi

if [ -s $GLASS_PREF$log ]; then
Expand All @@ -59,7 +56,6 @@ if [ -s $NoPCM_PREF$log ]; then
echo "- BETWEEN GENERATED AND STABLE OUTPUT FOUND"
echo "-------------------------------------------"
errors="yes"
exitval=1
fi

if [ "$errors" = "no" ]; then
Expand All @@ -71,6 +67,7 @@ else
echo "- ERROR IN GENERATED OUTPUT SEE ABOVE FOR -"
echo "- MORE DETAILS -"
echo "-------------------------------------------"
exitval=1
fi

exit $exitval
36 changes: 22 additions & 14 deletions code/stable/gamephys/Chipmunk_SRS.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ <h3>
<em><b>I</b><sub>A</sub></em>
</td>
<td>
Moment of Inertia Of Rigid Body A
Moment of Inertia Of Rigid Body a
</td>
<td>
kg&sdot;m<sup>2</sup>
Expand Down Expand Up @@ -356,7 +356,7 @@ <h3>
<em>m<sub>A</sub></em>
</td>
<td>
Mass Of Rigid Body A
Mass Of Rigid Body a
</td>
<td>
kg
Expand Down Expand Up @@ -620,7 +620,7 @@ <h3>
<em><b>v</b><sub>i</sub><sup>AB</sup></em>
</td>
<td>
Relative Velocity Between Rigid Bodies of A and B
Relative Velocity Between Rigid Bodies of a and B
</td>
<td>
m/s
Expand All @@ -631,7 +631,7 @@ <h3>
<em><b>v</b><sub>A</sub></em>
</td>
<td>
Velocity At Point A
Velocity At Point a
</td>
<td>
m/s
Expand Down Expand Up @@ -708,7 +708,7 @@ <h3>
<em>||<b>r</b><sub>AP</sub>*<b>n</b>||</em>
</td>
<td>
Length of the Perpendicular Vector To the Contact Displacement Vector of Rigid Body A
Length of the Perpendicular Vector To the Contact Displacement Vector of Rigid Body a
</td>
<td>
m
Expand Down Expand Up @@ -807,7 +807,7 @@ <h3>
<em>&omega;<sub>A</sub></em>
</td>
<td>
Is the A Body's Angular Velocity
Is the a Body's Angular Velocity
</td>
<td>
rad/s
Expand Down Expand Up @@ -856,6 +856,14 @@ <h3>
</tr>
<tr>
<td>
2D
</td>
<td>
Two-Dimensional
</td>
</tr>
<tr>
<td>
A
</td>
<td>
Expand All @@ -872,6 +880,14 @@ <h3>
</tr>
<tr>
<td>
Chipmunk2D
</td>
<td>
Chipmunk2D game physics library
</td>
</tr>
<tr>
<td>
DD
</td>
<td>
Expand Down Expand Up @@ -942,14 +958,6 @@ <h3>
Theoretical Model
</td>
</tr>
<tr>
<td>
2D
</td>
<td>
Two-Dimensional
</td>
</tr>
</table>
</a>
</div>
Expand Down
48 changes: 25 additions & 23 deletions code/stable/gamephys/Chipmunk_SRS.tex
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ \subsection{Table of Symbols}
\\
$\mathbf{\hat{i}}$ & Horizontal Unit Vector & m
\\
${\mathbf{I}_{A}}$ & Moment of Inertia Of Rigid Body A & kg$\text{m}^{2}$
${\mathbf{I}_{A}}$ & Moment of Inertia Of Rigid Body a & kg$\text{m}^{2}$
\\
${\mathbf{I}_{B}}$ & Moment of Inertia Of Rigid Body B & kg$\text{m}^{2}$
\\
Expand All @@ -96,7 +96,7 @@ \subsection{Table of Symbols}
\\
${m_{2}}$ & Mass of the second body & kg
\\
${m_{A}}$ & Mass Of Rigid Body A & kg
${m_{A}}$ & Mass Of Rigid Body a & kg
\\
${m_{B}}$ & Mass Of Rigid Body B & kg
\\
Expand Down Expand Up @@ -144,9 +144,9 @@ \subsection{Table of Symbols}
\\
${t_{0}}$ & Denotes the initial time & s
\\
${{\mathbf{v}_{i}}^{AB}}$ & Relative Velocity Between Rigid Bodies of A and B & $\frac{\text{m}}{\text{s}}$
${{\mathbf{v}_{i}}^{AB}}$ & Relative Velocity Between Rigid Bodies of a and B & $\frac{\text{m}}{\text{s}}$
\\
${\mathbf{v}_{A}}$ & Velocity At Point A & $\frac{\text{m}}{\text{s}}$
${\mathbf{v}_{A}}$ & Velocity At Point a & $\frac{\text{m}}{\text{s}}$
\\
${\mathbf{v}_{B}}$ & Velocity At Point B & $\frac{\text{m}}{\text{s}}$
\\
Expand All @@ -160,7 +160,7 @@ \subsection{Table of Symbols}
\\
$||\mathbf{n}||$ & Length of the Normal Vector & m
\\
$||{\mathbf{r}_{AP}}*\mathbf{n}||$ & Length of the Perpendicular Vector To the Contact Displacement Vector of Rigid Body A & m
$||{\mathbf{r}_{AP}}*\mathbf{n}||$ & Length of the Perpendicular Vector To the Contact Displacement Vector of Rigid Body a & m
\\
$||{\mathbf{r}_{BP}}*\mathbf{n}||$ & Length of the Perpendicular Vector To the Contact Displacement Vector of Rigid Body B & m
\\
Expand All @@ -178,7 +178,7 @@ \subsection{Table of Symbols}
\\
$\phi{}$ & Orientation & rad
\\
${\omega{}_{A}}$ & Is the A Body's Angular Velocity & $\frac{\text{rad}}{\text{s}}$
${\omega{}_{A}}$ & Is the a Body's Angular Velocity & $\frac{\text{rad}}{\text{s}}$
\\
${\omega{}_{B}}$ & Is the B Body's Angular Velocity & $\frac{\text{rad}}{\text{s}}$
\\
Expand All @@ -194,10 +194,14 @@ \subsection{Abbreviations and Acronyms}
Symbol & Description
\\
\midrule
2D & Two-Dimensional
\\
A & Assumption
\\
CM & Centre of Mass
\\
Chipmunk2D & Chipmunk2D game physics library
\\
DD & Data Definition
\\
GD & General Definition
Expand All @@ -216,8 +220,6 @@ \subsection{Abbreviations and Acronyms}
\\
T & Theoretical Model
\\
2D & Two-Dimensional
\\
\bottomrule
\label{Table:AbbrandAcro}
\end{longtable*}
Expand Down Expand Up @@ -300,7 +302,7 @@ \subsubsection{Theoretical Models}
\\ \midrule \\
Label & Newton's Second Law of Motion
\\ \midrule \\
Equation & $\mathbf{F}=m\mathbf{a}$
Equation & $\mathbf{F}=m \mathbf{a}$
\\ \midrule \\
Description & The net force $\mathbf{F}$ (N) on a rigid body is proportional to the acceleration $\mathbf{a}$ ($\frac{\text{m}}{\text{s}^{2}}$) of the rigid body, where $m$ (kg) denotes the mass of the rigid body as the constant of proportionality.
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -328,7 +330,7 @@ \subsubsection{Theoretical Models}
\\ \midrule \\
Label & Newton's Law of Universal Gravitation
\\ \midrule \\
Equation & $\mathbf{F}=G\frac{{m_{1}}{m_{2}}}{||\mathbf{r}||^{2}}\mathbf{\hat{r}}=G\frac{{m_{1}}{m_{2}}}{||\mathbf{r}||^{2}}\frac{\mathbf{r}}{||\mathbf{r}||}$
Equation & $\mathbf{F}=G \frac{{m_{1}} {m_{2}}}{||\mathbf{r}||^{2}} \mathbf{\hat{r}}=G \frac{{m_{1}} {m_{2}}}{||\mathbf{r}||^{2}} \frac{\mathbf{r}}{||\mathbf{r}||}$
\\ \midrule \\
Description & Two rigid bodies in the universe attract each other with a force $\mathbf{F}$ (N) that is directly proportional to the product of their masses, ${m_{1}}$ and ${m_{2}}$ (kg), and inversely proportional to the squared distance ${||\mathbf{r}||^{2}}$ ($\text{m}^{2}$) between them. The vector $\mathbf{r}$ (m) is the displacement between the centres of the rigid bodies and $||\mathbf{r}||$ (m) represents the Euclidean norm of the displacement, or absolute distance between the two. $\mathbf{\hat{r}}$ denotes the displacement unit vector, equivalent to the displacement divided by the Euclidean norm of the displacement, as shown above. Finally, $G$ is the gravitational constant (6.673 * 10E-11) ($\frac{\text{m}^{3}}{(\text{kg}\text{s}^{2})}$).
\\ \bottomrule \end{tabular}
Expand Down Expand Up @@ -356,7 +358,7 @@ \subsubsection{Theoretical Models}
\\ \midrule \\
Label & Newton's Second Law for Rotational Motion
\\ \midrule \\
Equation & $\tau{}=\mathbf{I}\alpha{}$
Equation & $\tau{}=\mathbf{I} \alpha{}$
\\ \midrule \\
Description & The net torque $\tau{}$ (Nm) on a rigid body is proportional to its angular acceleration $\alpha{}$ ($\frac{\text{rad}}{\text{s}^{2}}$). Here, $\mathbf{I}$ (kg$\text{m}^{2}$) denotes the moment of inertia of the rigid body. We also assume that all rigid bodies involved are two-dimensional (A2).
\\ \bottomrule \end{tabular}
Expand All @@ -376,7 +378,7 @@ \subsubsection{Instance Models}
\\ \midrule \\
Label & Force on the Translational Motion of a Set of 2d Rigid Bodies
\\ \midrule \\
Equation & ${\mathbf{a}_{i}}=\frac{d{\mathbf{v}_{i}}\left(t\right)}{dt}=g+\frac{\mathbf{F}\left(t\right)}{{m_{j}}}$
Equation & ${\mathbf{a}_{i}}=\frac{d {\mathbf{v}_{i}}\left(t\right)}{d t}=g+\frac{\mathbf{F}\left(t\right)}{{m_{j}}}$
\\ \midrule \\
Description & The above equation expresses the total acceleration of the rigid body (A1, A2) i as the sum of gravitational acceleration (GD3) and acceleration due to applied force Fi(t) (T1). The resultant outputs are then obtained from this equation using DD2, DD3 and DD4. It is currently assumed that there is no damping (A6) or constraints (A7) involved. ${m_{i}}$ is the mass of the i-th rigid body (kg). $g$ is the gravitational acceleration ($\frac{\text{m}}{\text{s}^{2}}$). $t$ is the point in time (s). ${t_{0}}$ is the denotes the initial time (s). ${\mathbf{p}_{CM}}$ is the the mass-weighted average position of a rigid body's particles (m). $\mathbf{a}$ is the acceleration ($\frac{\text{m}}{\text{s}^{2}}$). $\mathbf{v}$ is the velocity ($\frac{\text{m}}{\text{s}}$). $\mathbf{F}$ is the force applied to the i-th body at time t (N).
\\ \bottomrule \end{tabular}
Expand All @@ -390,7 +392,7 @@ \subsubsection{Instance Models}
\\ \midrule \\
Label & Force on the Rotational Motion of a Set of 2D Rigid Body
\\ \midrule \\
Equation & $\alpha{}=\frac{d\omega{}\left(t\right)}{dt}=\frac{{\tau{}_{i}}\left(t\right)}{\mathbf{I}}$
Equation & $\alpha{}=\frac{d \omega{}\left(t\right)}{d t}=\frac{{\tau{}_{i}}\left(t\right)}{\mathbf{I}}$
\\ \midrule \\
Description & The above equation for the total angular acceleration of the rigid body (A1, A2) i is derived from T5, and the resultant outputs are then obtained from this equation using DD5, DD6 and DD7. It is currently assumed that there is no damping (A6) or constraints (A7) involved. ${m_{i}}$ is the mass of the i-th rigid body (kg). $g$ is the gravitational acceleration ($\frac{\text{m}}{\text{s}^{2}}$). $t$ is the point in time (s). ${t_{0}}$ is the denotes the initial time (s). $\phi{}$ is the orientation (rad). $\omega{}$ is the angular velocity ($\frac{\text{rad}}{\text{s}}$). $\alpha{}$ is the angular acceleration ($\frac{\text{rad}}{\text{s}^{2}}$). ${\tau{}_{i}}$ is the is the torque applied to the i-th body (Nm). ${\mathbf{I}_{k}}$ is the moment of inertia of the k-th rigid body (kg$\text{m}^{2}$).
\\ \bottomrule \end{tabular}
Expand All @@ -404,7 +406,7 @@ \subsubsection{Instance Models}
\\ \midrule \\
Label & Collisions on 2D Rigid Bodies
\\ \midrule \\
Equation & ${\mathbf{v}_{A}}\left({t_{c}}\right)={\mathbf{v}_{A}}\left(t\right)+\frac{j}{{m_{A}}}\mathbf{n}$
Equation & ${\mathbf{v}_{A}}\left({t_{c}}\right)={\mathbf{v}_{A}}\left(t\right)+\frac{j}{{m_{A}}} \mathbf{n}$
\\ \midrule \\
Description & This instance model is based on our assumptions regarding rigid body (A1, A2) collisions (A5). Again, this does not take damping (A6) or constraints (A7) into account. ${m_{i}}$ is the mass of the i-th rigid body (kg). ${\mathbf{I}_{k}}$ is the moment of inertia of the k-th rigid body (kg$\text{m}^{2}$). $t$ is the point in time (s). ${t_{0}}$ is the denotes the initial time (s). ${t_{c}}$ is the denotes the time at collision (s). ${\mathbf{p}_{CM}}$ is the the mass-weighted average position of a rigid body's particles (m). $\mathbf{v}$ is the velocity ($\frac{\text{m}}{\text{s}}$). $\phi{}$ is the orientation (rad). $\omega{}$ is the angular velocity ($\frac{\text{rad}}{\text{s}}$). $\mathbf{n}$ is the collision normal vector (m). $j$ is the collision impulse (scalar) (Ns). $P$ is the point of collision (m). ${\mathbf{r}_{kP}}$ is the displacement vector between the centre of mass of rigid body k and contact point P (m).
\\ \bottomrule \end{tabular}
Expand All @@ -423,7 +425,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Units & m
\\ \midrule \\
Equation & ${\mathbf{p}_{CM}}$ = $\frac{\displaystyle\sum{\left[{m_{j}}{\mathbf{p}_{j}}\right]}}{M}$
Equation & ${\mathbf{p}_{CM}}$ = $\frac{\displaystyle\sum{\left[{m_{j}} {\mathbf{p}_{j}}\right]}}{M}$
\\ \midrule \\
Description & ${\mathbf{p}_{CM}}$ is the the mass-weighted average position of a rigid body's particles (m)\newline${m_{j}}$ is the mass of the j-th particle (kg)\newline${\mathbf{p}_{j}}$ is the position vector of the j-th particle (m)\newline$M$ is the total mass of the rigid body (kg)
\\ \bottomrule \end{tabular}
Expand All @@ -439,7 +441,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Units & m
\\ \midrule \\
Equation & $\mathbf{r}(t)$ = $\frac{d\mathbf{p}\left(t\right)}{dt}$
Equation & $\mathbf{r}(t)$ = $\frac{d \mathbf{p}\left(t\right)}{d t}$
\\ \midrule \\
Description & $\mathbf{r}(t)$ is the linear displacement (m)\newline$\mathbf{p}$ is the position (m)\newline$t$ is the time (s)
\\ \bottomrule \end{tabular}
Expand All @@ -455,7 +457,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Units & $\frac{\text{m}}{\text{s}}$
\\ \midrule \\
Equation & $\mathbf{v}(t)$ = $\frac{d\mathbf{r}\left(t\right)}{dt}$
Equation & $\mathbf{v}(t)$ = $\frac{d \mathbf{r}\left(t\right)}{d t}$
\\ \midrule \\
Description & $\mathbf{v}(t)$ is the linear velocity ($\frac{\text{m}}{\text{s}}$)\newline$\mathbf{r}$ is the displacement (m)\newline$t$ is the time (s)
\\ \bottomrule \end{tabular}
Expand All @@ -471,7 +473,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Units & $\frac{\text{m}}{\text{s}^{2}}$
\\ \midrule \\
Equation & $\mathbf{a}(t)$ = $\frac{d\mathbf{v}\left(t\right)}{dt}$
Equation & $\mathbf{a}(t)$ = $\frac{d \mathbf{v}\left(t\right)}{d t}$
\\ \midrule \\
Description & $\mathbf{a}(t)$ is the linear acceleration ($\frac{\text{m}}{\text{s}^{2}}$)\newline$\mathbf{v}$ is the velocity ($\frac{\text{m}}{\text{s}}$)\newline$t$ is the time (s)
\\ \bottomrule \end{tabular}
Expand All @@ -487,7 +489,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Units & rad
\\ \midrule \\
Equation & $\theta{}$ = $\frac{d\phi{}\left(t\right)}{dt}$
Equation & $\theta{}$ = $\frac{d \phi{}\left(t\right)}{d t}$
\\ \midrule \\
Description & $\theta{}$ is the angular displacement (rad)\newline$\phi{}$ is the orientation (rad)\newline$t$ is the time (s)
\\ \bottomrule \end{tabular}
Expand All @@ -503,7 +505,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Units & $\frac{\text{rad}}{\text{s}}$
\\ \midrule \\
Equation & $\omega{}$ = $\frac{d\theta{}\left(t\right)}{dt}$
Equation & $\omega{}$ = $\frac{d \theta{}\left(t\right)}{d t}$
\\ \midrule \\
Description & $\omega{}$ is the angular velocity ($\frac{\text{rad}}{\text{s}}$)\newline$\theta{}$ is the angular displacement (rad)\newline$t$ is the time (s)
\\ \bottomrule \end{tabular}
Expand All @@ -519,7 +521,7 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Units & $\frac{\text{rad}}{\text{s}^{2}}$
\\ \midrule \\
Equation & $\alpha{}$ = $\frac{d\omega{}\left(t\right)}{dt}$
Equation & $\alpha{}$ = $\frac{d \omega{}\left(t\right)}{d t}$
\\ \midrule \\
Description & $\alpha{}$ is the angular acceleration ($\frac{\text{rad}}{\text{s}^{2}}$)\newline$\omega{}$ is the angular velocity ($\frac{\text{rad}}{\text{s}}$)\newline$t$ is the time (s)
\\ \bottomrule \end{tabular}
Expand All @@ -535,8 +537,8 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Units & Ns
\\ \midrule \\
Equation & $j$ = $\frac{\left(-1+{C_{R}}\right){{\mathbf{v}_{i}}^{AB}}\cdot{}\mathbf{n}}{\begin{multlined}
\left(1/{m_{A}}+1/{m_{B}}\right)||\mathbf{n}||^{2}
Equation & $j$ = $\frac{\left(-1+{C_{R}}\right) {{\mathbf{v}_{i}}^{AB}}\cdot{}\mathbf{n}}{\begin{multlined}
\left(1/{m_{A}}+1/{m_{B}}\right) ||\mathbf{n}||^{2}
\\+
||{\mathbf{r}_{AP}}*\mathbf{n}||^{2}/{\mathbf{I}_{A}}+||{\mathbf{r}_{BP}}*\mathbf{n}||^{2}/{\mathbf{I}_{B}}
\end{multlined}
Expand Down
Loading

0 comments on commit 6c0a823

Please sign in to comment.