mirror of
https://github.com/nasa/trick.git
synced 2025-02-04 18:13:36 +00:00
48 lines
1.0 KiB
C
48 lines
1.0 KiB
C
|
/*****************************************************************************
|
||
|
PURPOSE: ( Try Trick integration )
|
||
|
*****************************************************************************/
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include "sim_services/Integrator/include/integrator_c_intf.h"
|
||
|
#include "../include/cannon.h"
|
||
|
|
||
|
int cannon_integ2(
|
||
|
CANNON* C )
|
||
|
{
|
||
|
|
||
|
int ipass;
|
||
|
//printf("Running cannon_integ2\n");
|
||
|
/* LOAD THE POSITION AND VELOCITY STATES */
|
||
|
load_state(
|
||
|
&C->pos[0] ,
|
||
|
&C->pos[1] ,
|
||
|
&C->vel[0] ,
|
||
|
&C->vel[1] ,
|
||
|
NULL
|
||
|
);
|
||
|
|
||
|
/* LOAD THE POSITION AND VELOCITY STATE DERIVATIVES */
|
||
|
load_deriv(
|
||
|
&C->vel[0] ,
|
||
|
&C->vel[1] ,
|
||
|
&C->acc[0] ,
|
||
|
&C->acc[1] ,
|
||
|
NULL
|
||
|
);
|
||
|
|
||
|
/* CALL THE TRICK INTEGRATION SERVICE */
|
||
|
ipass = integrate();
|
||
|
|
||
|
/* UNLOAD THE NEW POSITION AND VELOCITY STATES */
|
||
|
unload_state(
|
||
|
&C->pos[0] ,
|
||
|
&C->pos[1] ,
|
||
|
&C->vel[0] ,
|
||
|
&C->vel[1] ,
|
||
|
NULL
|
||
|
);
|
||
|
|
||
|
/* RETURN */
|
||
|
return( ipass );
|
||
|
}
|