We shall work with a sample application that takes a few variables as input and produces numbers and/or graphs as result. Specifically, our application, later referred to as a simulation program or simply a simulator, concerns the simulation of a ball thrown through air. Given the initial velocity of the ball, and some other data like mass and radius, we can compute the trajectory of the ball until it hits the ground. The details of the calculations are not of interest here as our focus is on software for assigning input data and for displaying the results. However, the interested reader can consult the box below for the inner workings of the simulation program.
We can simplify the model for a two-dimensional motion in an \( xy \) plane with unit vectors \( \boldsymbol{i} \) and \( \boldsymbol{j} \) in the \( x \) and \( y \) directions, respectively. Then we skip the sidewind force (\( C_S=0 \)). We also let gravity point downwards, \( \boldsymbol{g}=-g\boldsymbol{j} \), and let the wind velocity be horizontal: \( \boldsymbol{w}=-w\boldsymbol{i} \). Furthermore, we have that $$ \begin{align} \boldsymbol{i}_t &= \frac{\boldsymbol{v}}{\left|\boldsymbol{v}\right|} \equiv a\boldsymbol{i} + b\boldsymbol{j}, \quad \boldsymbol{v} = \frac{d\boldsymbol{r}}{dt}, \tag{2}\\ \boldsymbol{i}_n &= -b\boldsymbol{i} + a\boldsymbol{j}\hbox{ if }a>0\hbox{ else }b\boldsymbol{i}-a\boldsymbol{j} \tag{3} \end{align} $$ The initial conditions associated with (1) express that the body starts at the origin with an initial velocity \( v_0 \) making an angle \( \theta \) with the horizontal. In the two-dimensional case the conditions become $$ \boldsymbol{r}(0) = 0\boldsymbol{i} + 0\boldsymbol{j},\quad \frac{d\boldsymbol{r}}{dt}(0)=\boldsymbol{v}(0)= v_0\cos\theta\boldsymbol{i} + v_0\sin\theta\boldsymbol{j}.$$