trick/trick_sims/Cannon/SIM_cannon_analytic
jmpenn 8c97db25f4
Cleanup the Cannon Readme's and Sim Tweaks of Clarity (#659)
* Delete a bunch of old png's.

* Make g (acceleration of gravity at sea-level) a parameter rather to make doc cleaner.

* Update Cannon READMEs to be more informative.
2018-08-17 17:07:06 -05:00
..
images Cleanup the Cannon Readme's and Sim Tweaks of Clarity (#659) 2018-08-17 17:07:06 -05: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 Cleanup the Cannon Readme's and Sim Tweaks of Clarity (#659) 2018-08-17 17:07:06 -05:00
S_define Organize model functions and prototypes. Refs #338 2016-11-17 16:04:07 -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 4). 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.

Parameterization

The following parameters are given default values in a "default_data" job called cannon_default_data. Their values can be changed in the input.py file.

Name Sim Variable Type Units Symbol default
Barrel Angle dyn.cannon.init_angle double radians theta 30*(π/180)
Speed dyn.cannon.init_speed double m/s speed 50.0
Gravity dyn.cannon.g double m/s g 9.81
Initial Position dyn.cannon.pos0 double[2] m x_0

Initialization

The initial velocity is calculated in an "initialization" job.

Name Sim Variable Type Units Calculation
Initial Velocity dyn.cannon.vel0 double[2] m/s

State Propagation

For each time-step, the following are calculated in a "scheduled" job. Though acceleration is constant in this simulation, it usually isn't for "F=ma" type simulations.

Name Sim Variable Type Units Calculation
Acceleration dyn.cannon.acc double[2] m/s²
Velocity(t) dyn.cannon.vel double[2] m/s
Position(t) dyn.cannon.pos double[2] m

Calculating When the Ball Impacts the Ground.

The cannon ball will impact the ground, when y-element of the position vector is zero.

Name Sim Variable Type Units Calculation
Time of Impact dyn.cannon.impactTime double s