mirror of
https://github.com/nasa/trick.git
synced 2024-12-25 07:41:08 +00:00
496de8c7a9
* Disambiguate python use #1250 Changed all calls to /usr/bin/python to /usr/bin/env python3. Removed execute permissions on a lot of files that are not executable. closes #1250 |
||
---|---|---|
.. | ||
images | ||
.gitignore | ||
BouncyCannonBall.cpp | ||
makefile | ||
plot_trajectory.py | ||
README.md |
BouncyCannonBall
The BouncyCannonBall program adds dynamic events to the Cannonball simulation. using a rootfinder with our integrator to detect contact with the ground, and bounce the cannonball.
For each numerical integration time-step, the simulation program prints:
- time (s)
- 2D position vector (m)
- 2D velocity vector (m/s)
to stdout
, in Comma Separated Values (CSV) format.
Building & Running the Simulation Program
Generate the results as follows:
$ make
$ ./BouncyCannonBall > cannon.csv
Plotting the Results
The Python script, plot_trajectory.py
is provided to plot the results
in cannon.csv
using (Python) matplotlib.
Plot the cannon ball trajectory as follows:
$ python plot_trajectory.py