mirror of
https://github.com/nasa/trick.git
synced 2025-01-18 02:40:08 +00:00
delete SIM_integ. Doesn't actually seem to test anything.
This commit is contained in:
parent
4b1b1d451b
commit
54a4b57dbe
@ -1,45 +0,0 @@
|
||||
|
||||
/*************************************************************************
|
||||
PURPOSE: (Cannonball Structure)
|
||||
LIBRARY DEPENDENCIES:
|
||||
(
|
||||
(cannon/gravity/src/cannon_default_data.o)
|
||||
(cannon/gravity/src/cannon_init.o)
|
||||
(cannon/gravity/src/cannon_integ.o)
|
||||
(cannon/integ/src/cannon_integ2.o)
|
||||
(cannon/gravity/src/cannon_deriv.o)
|
||||
(cannon/integ/src/cannon_deriv2.o)
|
||||
)
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef CANNON_H
|
||||
#define CANNON_H
|
||||
#include <stdio.h>
|
||||
#include "sim_services/Integrator/include/regula_falsi.h"
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
double pos0[2] ; /* *i M Init position of cannonball */
|
||||
double vel0[2] ; /* *i M Init velocity of cannonball */
|
||||
double acc0[2] ; /* *i M Init acceleration of cannonball */
|
||||
|
||||
double pos[2] ; /* M xy-position */
|
||||
double vel[2] ; /* M/s xy-velocity */
|
||||
double acc[2] ; /* M/s2 xy-acceleration */
|
||||
double init_speed ; /* *i M/s Init barrel speed */
|
||||
double init_angle ; /* *i r Angle of cannon */
|
||||
|
||||
/* Impact */
|
||||
REGULA_FALSI rf ; /* -- Dynamic event params for impact */
|
||||
int impact ; /* -- Has impact occured? */
|
||||
|
||||
FILE *fp ; /* -- file pointer */
|
||||
|
||||
/* Communication Connection */
|
||||
TCDevice connection ; /* -- Socket connection for sending position */
|
||||
} CANNON ;
|
||||
|
||||
#endif
|
@ -1,25 +0,0 @@
|
||||
/*************************************************************************
|
||||
PURPOSE: (Cannonball Prototypes)
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef CANNON_INTEG_PROTO_H
|
||||
#define CANNON_INTEG_PROTO_H
|
||||
#include <stdio.h>
|
||||
#include "cannon.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int cannon_integ(CANNON*) ;
|
||||
int cannon_integ2(CANNON*) ;
|
||||
int cannon_deriv(CANNON*) ;
|
||||
int cannon_deriv2(CANNON*) ;
|
||||
int cannon_init(CANNON*) ;
|
||||
int cannon_default_data(CANNON*) ;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,13 +0,0 @@
|
||||
/*****************************************************************************
|
||||
PURPOSE: ( Try Trick integration )
|
||||
*****************************************************************************/
|
||||
#include "../include/cannon.h"
|
||||
|
||||
int cannon_deriv2(
|
||||
CANNON* C )
|
||||
{
|
||||
C->acc[0] = 0.0 ;
|
||||
C->acc[1] = -9.81 ;
|
||||
|
||||
return 0 ;
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
/*****************************************************************************
|
||||
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 );
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
|
||||
# new setIntegrator function to set the Integrator.
|
||||
dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 4)
|
||||
dyn1_integloop.getIntegrator(trick.Runge_Kutta_4, 4)
|
||||
|
||||
# Setting first_step_deriv and last_step_deriv is now a
|
||||
# part of IntegLoopScheduler instead of the Integrator
|
||||
#dyn_integloop.integ_sched.set_last_step_deriv(True)
|
||||
#dyn1_integloop.integ_sched.set_first_step_deriv(False)
|
||||
|
||||
# Moving a sim_object to another IntegLoop
|
||||
trick.add_read(3, """
|
||||
dyn_integloop.integ_sched.add_sim_object(dyn1)
|
||||
""")
|
||||
|
||||
trick.echo_jobs_on()
|
||||
trick.stop(5)
|
@ -1,17 +0,0 @@
|
||||
|
||||
# new setIntegrator function to set the Integrator.
|
||||
dyn_integloop.getIntegrator(trick.Runge_Kutta_4, 4)
|
||||
dyn1_integloop.getIntegrator(trick.Runge_Kutta_4, 4)
|
||||
|
||||
# Setting first_step_deriv and last_step_deriv is now a
|
||||
# part of IntegLoopScheduler instead of the Integrator
|
||||
#dyn_integloop.integ_sched.set_last_step_deriv(True)
|
||||
#dyn1_integloop.integ_sched.set_first_step_deriv(False)
|
||||
|
||||
# Moving a sim_object to another IntegLoop
|
||||
trick.add_read(3, """
|
||||
dyn_integloop.integ_sched.add_sim_object(dyn1)
|
||||
""")
|
||||
|
||||
trick.stop(5)
|
||||
|
@ -1,54 +0,0 @@
|
||||
|
||||
#include "sim_objects/default_trick_sys.sm"
|
||||
##include "cannon/integ/include/cannon.h"
|
||||
##include "cannon/integ/include/cannon_integ_proto.h"
|
||||
|
||||
class CannonSimObject : public Trick::SimObject {
|
||||
|
||||
public:
|
||||
CANNON cannon ;
|
||||
|
||||
CannonSimObject() {
|
||||
("default_data") cannon_default_data( &cannon ) ;
|
||||
|
||||
("initialization") cannon_init( &cannon ) ;
|
||||
|
||||
("derivative") cannon_deriv( &cannon ) ;
|
||||
("integration") trick_ret = cannon_integ( &cannon ) ;
|
||||
}
|
||||
} ;
|
||||
|
||||
class Cannon1SimObject : public Trick::SimObject {
|
||||
|
||||
public:
|
||||
CANNON cannon1 ;
|
||||
Trick::JobData *dyn_ptr;
|
||||
|
||||
Cannon1SimObject() {
|
||||
("derivative") cannon_deriv2( &cannon1 ) ;
|
||||
|
||||
}
|
||||
} ;
|
||||
|
||||
class Cannon2SimObject : public Trick::SimObject {
|
||||
|
||||
public:
|
||||
CANNON cannon2 ;
|
||||
|
||||
Cannon2SimObject() {
|
||||
("default_data") cannon_default_data( &cannon2 ) ;
|
||||
|
||||
("initialization") cannon_init( &cannon2 ) ;
|
||||
|
||||
("integration") trick_ret = cannon_integ2( &cannon2 ) ;
|
||||
|
||||
}
|
||||
} ;
|
||||
|
||||
// Instantiations
|
||||
CannonSimObject dyn ;
|
||||
Cannon1SimObject dyn1 ;
|
||||
Cannon2SimObject dyn2 ;
|
||||
IntegLoop dyn_integloop (0.5) dyn;
|
||||
IntegLoop dyn1_integloop (2.0) dyn1, dyn2;
|
||||
|
@ -1,4 +0,0 @@
|
||||
|
||||
TRICK_CFLAGS += -I${TRICK_HOME}/trick_models
|
||||
TRICK_CXXFLAGS += -I${TRICK_HOME}/trick_models
|
||||
|
Loading…
Reference in New Issue
Block a user