trick/trick_sims/Cannon/SIM_cannon_numeric
Scott Fennell 0d5aa45c20
Python3 exec open (#907)
* update .gitignore

* #906 change all python execfile() to exec(open().read())
2019-11-14 13:35:57 -06:00
..
images Cleanup the Cannon Readme's and Sim Tweaks of Clarity (#659) 2018-08-17 17:07:06 -05:00
Modified_data Get rid of SIM_cannon_dt and combine Sim_cannon_contact and SIM_cannon_integ 2016-10-20 17:35:27 -05:00
RUN_graphics Python3 exec open (#907) 2019-11-14 13:35:57 -06:00
RUN_test Python3 exec open (#907) 2019-11-14 13:35:57 -06:00
www Efficiently handle time-consistent and non-time consistent message modes in web server, plus lots of refactoring. ref #883 2019-10-08 14:14:18 -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 Incorporate Webserver into Trick, so one only has to include HttpServ… (#886) 2019-10-23 11:58:19 -05:00
S_overrides.mk Incorporate Webserver into Trick, so one only has to include HttpServ… (#886) 2019-10-23 11:58:19 -05:00

SIM_cannon_numeric


This is the second in a series example cannon ball simulations that one builds in the Trick Tutorial (Sections 9, 10). It's purpose is to introduce Trick supported numerical methods.

Rather than using the analytic solutions of SIM_cannon_analytic, this simulation uses Trick's numerical integration, and root-finding methods to:

  • Determine the cannon ball state (velocity, position) at each time step, and
  • Determine when and where the cannon ball impacts the ground.

The simulation is otherwise the same as SIM_cannon_analytic.

CannonPicture

Parameterization

Same as in SIM_cannon_analytic.

Initialization

Same as in SIM_cannon_analytic.

State Propagation

This Trick simulation calculates the cannonball state by numerical integration. Acceleration is calculated in the "derivative" job cannon_deriv. It is then used in "integration" job cannon_integ to calculate the cannonball's velocity and position, using the Trick integrate function.

When and Where the Ball Impacts the Ground

The time and position of impact is determined by the "dynamic_event" event job cannon_impact, using the Trick regula_falsi function.