\hypertarget{class_system}{\section{System Class Reference}
\label{class_system}\index{System@{System}}
}


A physical system in Lagrangian Mechanics, which uses generalized coordinates.  




{\ttfamily \#include $<$System.\-hpp$>$}

Inheritance diagram for System\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_system}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_system_a529efa4e15e9494ff4da5711e1d090d8}{System} (int num\-Generalized\-Coordinates)
\begin{DoxyCompactList}\small\item\em Sets the number of generalized coordinates for the system. \end{DoxyCompactList}\item 
virtual \hyperlink{struct_matrix1_vector1}{Matrix1\-Vector1} \hyperlink{class_system_adecf99535be960c23a8bb44de97cbb21}{compute\-A\-B} (const \hyperlink{class_vector_n_d}{Vector\-N\-D} \&generalized\-Position, const \hyperlink{class_vector_n_d}{Vector\-N\-D} \&generalized\-Velocity)=0
\begin{DoxyCompactList}\small\item\em Computes the matrix $A$ and the vector $\overrightarrow{b}$ such that the matrix form of the \hyperlink{namespace_lagrange}{Lagrange} equations can be written $ A \ddot{\overrightarrow{x}} + \overrightarrow{b} = \overrightarrow{Q} $. \end{DoxyCompactList}\item 
\hyperlink{class_vector_n_d}{Vector\-N\-D} \hyperlink{class_system_a785142b18417fc36453c4e72695a4f81}{compute\-Generalized\-Acceleration} (const \hyperlink{class_vector_n_d}{Vector\-N\-D} \&generalized\-Position, const \hyperlink{class_vector_n_d}{Vector\-N\-D} \&generalized\-Velocity, const \hyperlink{class_vector_n_d}{Vector\-N\-D} \&generalized\-Force)
\begin{DoxyCompactList}\small\item\em Computes the generalized acceleration as a function of the generalized position, velocity, and force. \end{DoxyCompactList}\item 
\hyperlink{class_vector_n_d}{Vector\-N\-D} \hyperlink{class_system_a61e4343973cce9211e65217379dcb1d1}{compute\-Generalized\-Acceleration} (const \hyperlink{class_vector_n_d}{Vector\-N\-D} \&generalized\-Position, const \hyperlink{class_vector_n_d}{Vector\-N\-D} \&generalized\-Velocity)
\begin{DoxyCompactList}\small\item\em Computes the generalized acceleration as a function of the generalized position and velocity. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{class_system_aa06fade2f21b3282921a86a926f0ba1f}{m\-Num\-Generalized\-Coordinates}
\begin{DoxyCompactList}\small\item\em The number of generalized coordinates in the system. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
A physical system in Lagrangian Mechanics, which uses generalized coordinates. 

This class handles the computation of $ \ddot{\overrightarrow{x}} $ given the generalized position vector $ \overrightarrow{x} $, the generalized velocity vector $ \dot{\overrightarrow{x}} $, and the generalized applied force vector $ \overrightarrow{Q} $. In order to use this class you need to implement the {\itshape compute\-A\-B} method, which computes the matrix $A$ and the vector $\overrightarrow{b}$ given $ \overrightarrow{x} $ and $ \dot{\overrightarrow{x}} $, such that the matrix form of the \hyperlink{namespace_lagrange}{Lagrange} equations can be written $ A \ddot{\overrightarrow{x}} + \overrightarrow{b} = \overrightarrow{Q} $. \begin{DoxyAuthor}{Author}
<NAME> 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}
0.\-1 
\end{DoxyVersion}
\begin{DoxyDate}{Date}
2012 
\end{DoxyDate}
\begin{DoxyWarning}{Warning}
If the matrix $A$ that you compute in {\itshape compute\-A\-B} is not invertible for some values of $ \overrightarrow{x} $ and $ \dot{\overrightarrow{x}} $, then the program might crash when you call {\itshape compute\-Generalized\-Acceleration}. It is best to make sure that $A$ is invertible for all possible generalized position. 
\end{DoxyWarning}
\begin{DoxyInvariant}{Invariant}
The number of generalized coordinates $n$ in the system never changes. 
\end{DoxyInvariant}

\begin{DoxyExceptions}{Exceptions}
{\em Whenever} & you pass a vector of generalized position or velocity, it needs to have length $n$, otherwise this will throw an error. \\
\hline
\end{DoxyExceptions}
\begin{DoxyRefDesc}{Todo}
\item[\hyperlink{todo__todo000009}{Todo}]Write and implement this class. \end{DoxyRefDesc}


\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_system_a529efa4e15e9494ff4da5711e1d090d8}{\index{System@{System}!System@{System}}
\index{System@{System}!System@{System}}
\subsubsection[{System}]{\setlength{\rightskip}{0pt plus 5cm}System\-::\-System (
\begin{DoxyParamCaption}
\item[{int}]{num\-Generalized\-Coordinates}
\end{DoxyParamCaption}
)}}\label{class_system_a529efa4e15e9494ff4da5711e1d090d8}


Sets the number of generalized coordinates for the system. 

This class's only piece of data stored is the number of generalized coordinates. \begin{DoxyPostcond}{Postcondition}
The object will have the number of generalized coordinates set. 
\end{DoxyPostcond}

\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em num\-Generalized\-Coordinates} & The number of generalized coordinates. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em An} & error when {\itshape num\-Generalized\-Coordinates} $<$= 0. \\
\hline
\end{DoxyExceptions}


\subsection{Member Function Documentation}
\hypertarget{class_system_adecf99535be960c23a8bb44de97cbb21}{\index{System@{System}!compute\-A\-B@{compute\-A\-B}}
\index{compute\-A\-B@{compute\-A\-B}!System@{System}}
\subsubsection[{compute\-A\-B}]{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf Matrix1\-Vector1} System\-::compute\-A\-B (
\begin{DoxyParamCaption}
\item[{const {\bf Vector\-N\-D} \&}]{generalized\-Position, }
\item[{const {\bf Vector\-N\-D} \&}]{generalized\-Velocity}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_system_adecf99535be960c23a8bb44de97cbb21}


Computes the matrix $A$ and the vector $\overrightarrow{b}$ such that the matrix form of the \hyperlink{namespace_lagrange}{Lagrange} equations can be written $ A \ddot{\overrightarrow{x}} + \overrightarrow{b} = \overrightarrow{Q} $. 

This function is used in the {\itshape get\-Generalized\-Acceleration} method. \begin{DoxyPrecond}{Precondition}
Both arguments must have length equal to $n$, the number of generalized coordinates. 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em generalized\-Position} & The generalized position vector. \\
\hline
{\em generalized\-Velocity} & The generalized velocity vector. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A struct containing $A(\overrightarrow{x},\dot{\overrightarrow{x}})$ and $\overrightarrow{b}(\overrightarrow{x},\dot{\overrightarrow{x}})$ such that the matrix form of the \hyperlink{namespace_lagrange}{Lagrange} equations can be written $ A \ddot{\overrightarrow{x}} + \overrightarrow{b} = \overrightarrow{Q} $, where $\overrightarrow{Q}$ is the generalized applied force on the system. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em An} & error if the length of either generalized\-Position or generalized\-Velocity is not equal to $n$, the number of generalized coordinates. \\
\hline
\end{DoxyExceptions}
\hypertarget{class_system_a785142b18417fc36453c4e72695a4f81}{\index{System@{System}!compute\-Generalized\-Acceleration@{compute\-Generalized\-Acceleration}}
\index{compute\-Generalized\-Acceleration@{compute\-Generalized\-Acceleration}!System@{System}}
\subsubsection[{compute\-Generalized\-Acceleration}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Vector\-N\-D} System\-::compute\-Generalized\-Acceleration (
\begin{DoxyParamCaption}
\item[{const {\bf Vector\-N\-D} \&}]{generalized\-Position, }
\item[{const {\bf Vector\-N\-D} \&}]{generalized\-Velocity, }
\item[{const {\bf Vector\-N\-D} \&}]{generalized\-Force}
\end{DoxyParamCaption}
)}}\label{class_system_a785142b18417fc36453c4e72695a4f81}


Computes the generalized acceleration as a function of the generalized position, velocity, and force. 

\begin{DoxyPrecond}{Precondition}
All parameters must have length $n$, the number of generalized coordinates. 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em generalized\-Position} & The generalized position vector. \\
\hline
{\em generalized\-Velocity} & The generalized velocity vector. \\
\hline
{\em generalized\-Force} & The generalized force vector. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The generalized acceleration when the position, velocity, and force are equal to the arguments. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em An} & error when either of the arguments does not have length $n$, the number of generalized coordinates. \\
\hline
\end{DoxyExceptions}
\begin{DoxyRefDesc}{Todo}
\item[\hyperlink{todo__todo000010}{Todo}]Implement this method. \end{DoxyRefDesc}
\hypertarget{class_system_a61e4343973cce9211e65217379dcb1d1}{\index{System@{System}!compute\-Generalized\-Acceleration@{compute\-Generalized\-Acceleration}}
\index{compute\-Generalized\-Acceleration@{compute\-Generalized\-Acceleration}!System@{System}}
\subsubsection[{compute\-Generalized\-Acceleration}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Vector\-N\-D} System\-::compute\-Generalized\-Acceleration (
\begin{DoxyParamCaption}
\item[{const {\bf Vector\-N\-D} \&}]{generalized\-Position, }
\item[{const {\bf Vector\-N\-D} \&}]{generalized\-Velocity}
\end{DoxyParamCaption}
)}}\label{class_system_a61e4343973cce9211e65217379dcb1d1}


Computes the generalized acceleration as a function of the generalized position and velocity. 

The applied force is assumed to be zero. \begin{DoxyPrecond}{Precondition}
All parameters must have length $n$, the number of generalized coordinates. 
\end{DoxyPrecond}

\begin{DoxyParams}{Parameters}
{\em generalized\-Position} & The generalized position vector. \\
\hline
{\em generalized\-Velocity} & The generalized velocity vector. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The generalized acceleration when the position and velocity are equal to the arguments and the force is zero. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em An} & error when either of the arguments does not have length $n$, the number of generalized coordinates. \\
\hline
\end{DoxyExceptions}
\begin{DoxyRefDesc}{Todo}
\item[\hyperlink{todo__todo000011}{Todo}]Implement this method. \end{DoxyRefDesc}


\subsection{Member Data Documentation}
\hypertarget{class_system_aa06fade2f21b3282921a86a926f0ba1f}{\index{System@{System}!m\-Num\-Generalized\-Coordinates@{m\-Num\-Generalized\-Coordinates}}
\index{m\-Num\-Generalized\-Coordinates@{m\-Num\-Generalized\-Coordinates}!System@{System}}
\subsubsection[{m\-Num\-Generalized\-Coordinates}]{\setlength{\rightskip}{0pt plus 5cm}int System\-::m\-Num\-Generalized\-Coordinates\hspace{0.3cm}{\ttfamily [protected]}}}\label{class_system_aa06fade2f21b3282921a86a926f0ba1f}


The number of generalized coordinates in the system. 



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
C\-:/\-Users/\-Owner/\-My Programming/\-Personal Projects/\-Video\-Games/\-Optimist Racing/src/\hyperlink{_system_8hpp}{System.\-hpp}\item 
C\-:/\-Users/\-Owner/\-My Programming/\-Personal Projects/\-Video\-Games/\-Optimist Racing/src/\hyperlink{_system_8cpp}{System.\-cpp}\end{DoxyCompactItemize}
