trick/trick_sims/SIM_msd/models/msd/include/msd.hh
Scott Fennell aa36c31231 added new mass-spring-damper sim and graphics client (#555)
* added new mass-spring-damper sim and graphics client

* changed math model image for README.md

* updated math model image for README.md
2018-01-31 13:37:14 -06:00

48 lines
1.1 KiB
C++

/************************TRICK HEADER*************************
PURPOSE: Mass-Spring-Damper class header file .
PROGRAMMERS:
(((Scott P. Fennell) (CACI International Inc.) (January 2018) (Trick Learning Project)))
*************************************************************/
#ifndef MSD_H
#define MSD_H
class MSD {
public:
double a; /* m/s2 acceleration */
double v; /* m/s velocity */
double x; /* m position */
double m; /* kg mass */;
double v_0; /* *i m/s initial velocity of the mass (at t = 0) */
double x_0; /* *i m initial position of the mass (at t = 0) */
double b; /* N.s/m damping constant */
double k; /* N/m spring constant */
double F; /* N force constant */
MSD(void); /* not used */
MSD(double _m, double _k, double _b, double _F,
double _v_0, double _x_0);
int state_deriv(void);
int state_integ(void);
};
#ifdef __cplusplus
extern "C" {
#endif
int msd_default_data(MSD &);
int msd_init(MSD &);
int msd_shutdown(const MSD &);
#ifdef __cplusplus
}
#endif
#endif /* MSD_H */