trick/trick_models/test/sched/include/sched_integ.d
Alex Lin 14a75508a3 Cleaning up once include variables and copyright cleanup.
Changed all header file once include variables to follow the same naming
convention and not start with any underscores.  Also deleted old
incorrect copyright notices.  Also removed $Id: tags from all files.

Fixes #14.  Fixes #22.
2015-03-23 16:03:14 -05:00

35 lines
1.2 KiB
D

/********************************* TRICK HEADER *******************************
PURPOSE:
(Ball model state integrator default initialization data.)
REFERENCE:
(((Bailey, R.W, and Paddock, E.J.)
(Trick Simulation Environment) (NASA:JSC #37943)
(JSC/Engineering Directorate/Automation, Robotics and Simulation Division)
(March 1997)))
ASSUMPTIONS AND LIMITATIONS:
((2 dimensional space))
PROGRAMMERS:
(((Your Name) (Company Name) (Date) (Trick tutorial)))
*******************************************************************************/
#define NUM_STEP 12 /* use up to 12 intermediate steps:
8th order RK Fehlberg */
#define NUM_VARIABLES 4 /* x,y position state and x,y velocity state */
INTEGRATOR.state = alloc(NUM_VARIABLES) ;
INTEGRATOR.deriv = alloc(NUM_STEP) ;
INTEGRATOR.state_ws = alloc(NUM_STEP) ;
for (int kk = 0 ; kk < NUM_STEP ; kk++ ) {
INTEGRATOR.deriv[kk] = alloc(NUM_VARIABLES) ;
INTEGRATOR.state_ws[kk] = alloc(NUM_VARIABLES) ;
}
INTEGRATOR.num_state = NUM_VARIABLES ;
INTEGRATOR.option = Runge_Kutta_4 ; /* 4rth order Runge Kutta */
INTEGRATOR.init = True ;
INTEGRATOR.first_step_deriv = Yes ;
#undef NUM_STEP
#undef NUM_VARIABLES