trick/trick_source/trick_utils/SAIntegrator/examples/CannonBall
Alex Lin 496de8c7a9
Disambiguate python use #1250 (#1251)
* 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
2022-03-22 15:15:40 -05:00
..
images Update the CannonBall example for the Tutorial. #1097 2021-01-27 12:22:16 -06:00
.gitignore SAIntegrator: Add gitignore files. 2021-02-25 22:58:39 -06:00
CannonBall.cpp Update the CannonBall example for the Tutorial. #1097 2021-01-27 12:22:16 -06:00
makefile Add new stand alone numerical integration library SAIntegrator #1056 #936 2020-09-27 18:36:49 -05:00
plot_trajectory.py Disambiguate python use #1250 (#1251) 2022-03-22 15:15:40 -05:00
README.md Update the CannonBall example for the Tutorial. #1097 2021-01-27 12:22:16 -06:00

CannonBall

The CannonBall program is an example of using the SA::RK2Integrator to create a simple cannon ball simulation.

For each numerical integration time-step, the simulation program prints:

  1. time (s)
  2. 2D position vector (m)
  3. 2D velocity vector (m/s)

to stdout, in Comma Separated Values (CSV) format.

Building & Running the Simulation Program

Generate the results as follows:

$ make
$ ./CannonBall > 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

Cannon