mirror of
https://github.com/nasa/trick.git
synced 2025-02-05 02:19:20 +00:00
CannonBall
This is an example of using the RK2Integrator to create a simple cannon ball simulation.
$ make
$ ./CannonBall > cannon.csv
$ python plot_trajectory.py
$ make
$ ./Cannonball
Next edit, and uncomment the indicated lines, recompile, and run. You should see:
5.070, 219.5374398594, 0.6674655000, 43.3012701892, -24.7367000000, 0.0000000000, -9.8100000000
5.080, 219.9704525612, 0.4196080000, 43.3012701892, -24.8348000000, 0.0000000000, -9.8100000000
5.090, 220.4034652631, 0.1707695000, 43.3012701892, -24.9329000000, 0.0000000000, -9.8100000000
---------------------------------------------------------------
Impact at t = 5.0968399592 x = 220.6996441856 y = 0.0000000000.
---------------------------------------------------------------
5.100, 220.6996441856, 0.0000000001, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000
5.110, 220.6996441856, 0.0000000001, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000
5.120, 220.6996441856, 0.0000000001, 0.0000000000, 0.0000000000, 0.0000000000, 0.0000000000