mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 05:07:54 +00:00
.. | ||
images | ||
Modified_data | ||
RUN_graphics | ||
RUN_test | ||
README.md | ||
S_define | ||
S_overrides.mk |
#SIM_cannon_analytic
This is first of eight Trick-based simulations that one builds in the Trick Tutorial (Section 3). It's purpose is to introduce some of the fundamentals of building a Trick simulation.
Here we simulate the flight of a cannon ball. We want to know the position and velocity of the cannon ball over time, given an initial position, and velocity, and subject to the following assumptions and limitations:
- The only force acting on the cannon ball is gravity.
- The acceleration of gravity (g) is constant and equal to -9.81 meters per second squared.
- The surface of the ground is defined as where y=0.
Solution
This problem has a closed-form solution, so that's what is used.
The cannon ball will impact the ground, when y(t)=0 at: