trick/trick_sims/Cannon/SIM_cannon_analytic
2016-10-19 17:39:47 -05:00
..
images Consolidate all of the Cannon sims into one directory. refs #191 2016-02-23 11:44:18 -06:00
Modified_data Consolidate all of the Cannon sims into one directory. refs #191 2016-02-23 11:44:18 -06:00
RUN_graphics Update SIM_cannon_analytic and add ability to launch new graphics client. Ref #320 2016-10-19 17:39:47 -05:00
RUN_test Update SIM_cannon_analytic and add ability to launch new graphics client. Ref #320 2016-10-19 17:39:47 -05:00
README.md Consolidate all of the Cannon sims into one directory. refs #191 2016-02-23 11:44:18 -06:00
S_define Consolidate all of the Cannon sims into one directory. refs #191 2016-02-23 11:44:18 -06:00
S_overrides.mk Consolidate all of the Cannon sims into one directory. refs #191 2016-02-23 11:44:18 -06:00

#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.

v_{y}(t) = gt +v_{y0}

The cannon ball will impact the ground, when y(t)=0 at:

CANNON Object

Model Variable Simulation Variable Type Units
, CANNON.pos0[2] double[2] m
, CANNON.vel0[2] double[2] m/s
\theta CANNON.init_angle double r
speed CANNON.init_speed double m/s
\vec{x} CANNON.pos[2] double[2] m
\vec{v} CANNON.vel[2] double[2] m/s