55 double dt, dp, maxr, minr, mjdnow, mjdbase, mjdlast, tp, cp;
57 double deltas, deltav;
59 double ralp=0., mtrx=0., mtry=0., mtrz=0.;
61 rvector torque, mtorque, rtorque1, rtorque2, bearth, mmoment, ftorque;
63 char stkname[50], tstring[100];
68 printf(
"Usage: testengine node mode deltat deltap totalp\n");
94 strcpy(stkname,
"stk_cdr_j2000.txt");
102 printf(
"Error: stk2eci()\n");
106 sqrt(
GM/(radius*radius*radius));
195 mjdlast = mjdnow + tp/86400.;
202 strcpy(tstring,
"(\"info_powuse\">10.)");
212 localtime = kep.
raan +
DPI - localtime;
263 printf(
"%.10g\t%.10g\t%.10g\t",torque.
col[0],torque.
col[1],torque.
col[2]);
265 printf(
"%.10g\t%.10g\t%.10g\t",mtorque.
col[0],mtorque.
col[1],mtorque.
col[2]);
266 printf(
"%.10g\t%.10g\t",rwomg,ralp);
267 printf(
"%.10g\t%.10g\t%.10g\t",mtrx,mtry,mtrz);
268 printf(
"%.10g\t%.10g\t",deltas,deltav);
277 }
while (mjdnow < mjdlast && cosmos_data->
node.loc.pos.geod.s.h > 8600.);
rvector bearth
Earth magnetic vector in ITRS for this time and location.
Definition: convertdef.h:754
double y
Y value.
Definition: vector.h:114
Vector moi
Definition: jsondef.h:3448
svector s
Position vector.
Definition: convertdef.h:318
Gauss-Jackson integration handle.
Definition: physicsdef.h:98
int32_t eci2kep(cartpos &eci, kepstruc &kep)
Definition: convertlib.cpp:2934
rvector rv_add(rvector a, rvector b)
Add two row vectors.
Definition: vector.cpp:299
cposstruc * pos
Array of positions.
Definition: convertdef.h:1006
ElapsedTime dt
Definition: agent_file3.cpp:183
3 element generic row vector
Definition: vector.h:53
spherpos geos
Definition: convertdef.h:743
double utc
UTC of Position.
Definition: convertdef.h:161
rvector a
2nd derivative: Alpha - acceleration
Definition: convertdef.h:483
cvector d
Orientation.
Definition: vector.h:405
Cartesian full position structure.
Definition: convertdef.h:158
double length_rv(rvector v)
Length of row vector.
Definition: vector.cpp:748
quaternion q_conjugate(quaternion q)
Definition: vector.cpp:1010
int iretn
Definition: rw_test.cpp:37
void gauss_jackson_init_eci(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double utc, cartpos ipos, qatt iatt, physicsstruc &physics, locstruc &loc)
Initialize Gauss-Jackson orbit using ECI state vector.
Definition: physicslib.cpp:2479
cartpos geoc
Definition: convertdef.h:739
Vector ftorque
Definition: jsondef.h:3437
double utc
Master time for location, in Modified Julian Day.
Definition: convertdef.h:879
double utc
Overall Node time.
Definition: jsondef.h:3592
double x
X value.
Definition: vector.h:112
int32_t att_lvlh2icrf(locstruc *loc)
Convert LVLH attitude to ICRF attitude.
Definition: convertlib.cpp:2035
vector< uint16_t > rw
Definition: jsondef.h:3913
qatt lvlh
Definition: convertdef.h:827
#define GM
SI Mass * Gravitational Constant for Earth.
Definition: convertdef.h:79
rvector v
1st derivative: Omega - angular velocity
Definition: convertdef.h:481
rvector rv_smult(double a, rvector b)
Multiply row vector by scalar.
Definition: vector.cpp:266
#define JPL_MOON
Definition: convertdef.h:119
quaternion q_fmult(rvector r1, quaternion q2)
rvector quaternion multiply
Definition: vector.cpp:1079
double json_equation(const char *&ptr, cosmosstruc *cinfo)
Return the results of a JSON equation.
Definition: jsonlib.cpp:4294
vector< devicestruc > device
Vector of all general (common) information for devices (components) in node.
Definition: jsondef.h:4238
nodestruc node
Structure for summary information in node.
Definition: jsondef.h:4220
int32_t node_init(string node, cosmosstruc *cinfo)
Initialize Node configuration.
Definition: jsonlib.cpp:10832
int32_t pos_clear(locstruc *loc)
Initialize posstruc.
Definition: convertlib.cpp:77
quaternion q_smult(double a, quaternion b)
Multiply quaternion by scalar.
Definition: vector.cpp:1151
rvector s
Location.
Definition: convertdef.h:163
double period
Orbital Period in seconds.
Definition: convertdef.h:536
attstruc att
attstruc for this time.
Definition: convertdef.h:883
cosmosstruc * cosmos_data
Definition: testengine.cpp:45
rvector rv_normal(rvector v)
Normalize row order vector.
Definition: vector.cpp:212
double utc
UTC as Modified Julian Day.
Definition: convertdef.h:218
qatt icrf
Definition: convertdef.h:830
rvector rv_quaternion2axis(quaternion q)
Quaternion to row vector axis and angle.
Definition: mathlib.cpp:194
locstruc loc
Location structure.
Definition: jsondef.h:3596
int32_t pos_geoc(locstruc *loc)
Set Geocentric position.
Definition: convertlib.cpp:366
#define DEGOF(rad)
Degrees of a Radian value.
Definition: math/constants.h:33
int32_t pos_eci(locstruc *loc)
Set ECI position.
Definition: convertlib.cpp:258
double h
Height in meters.
Definition: vector.h:229
stkstruc stk
Definition: testengine.cpp:46
vector< locstruc > gauss_jackson_propagate(gj_handle &gjh, physicsstruc &physics, locstruc &loc, double tomjd)
Definition: physicslib.cpp:2871
double raan
Right Ascension of the Ascending Node in radians.
Definition: convertdef.h:549
rvector rv_unitz(double scale)
Scaled z row vector.
Definition: vector.cpp:140
gj_handle gjh
Definition: agent_node.cpp:80
double lon
Longitude in radians.
Definition: vector.h:227
double w
Rotation.
Definition: vector.h:407
rvector rv_zero()
Zero row order vector.
Definition: vector.cpp:107
Classical elements structure.
Definition: convertdef.h:529
#define JPL_EARTH
Definition: convertdef.h:112
posstruc pos
posstruc for this time.
Definition: convertdef.h:881
double z
Z value.
Definition: vector.h:116
gvector s
Position vector.
Definition: convertdef.h:263
double lat
Latitude in radians.
Definition: vector.h:225
const double D2PI
Double precision 2*PI.
Definition: math/constants.h:16
quaternion s
0th derivative: Quaternion
Definition: convertdef.h:479
int32_t att_icrf2lvlh(locstruc *loc)
Definition: convertlib.cpp:1822
double col[3]
Definition: vector.h:55
cartpos eci
Definition: convertdef.h:737
quaternion q_eye()
Identity quaternion.
Definition: vector.cpp:1310
geoidpos geod
Definition: convertdef.h:741
double r
Radius in meters.
Definition: vector.h:174
int32_t jplpos(long from, long to, double utc, cartpos *pos)
Position from JPL Ephemeris.
Definition: ephemlib.cpp:128
devspecstruc devspec
Structure for devices (components) special data in node, by type.
Definition: jsondef.h:4241
int32_t att_lvlh2planec(locstruc *loc)
Convert LVLH attitude to ITRS attitude.
Definition: convertlib.cpp:1943
static string node
Definition: agent_monitor.cpp:126
const double DPI
Double precision PI.
Definition: math/constants.h:14
cartpos icrf
Definition: convertdef.h:736
rvector rv_sub(rvector a, rvector b)
Subtract two vectors.
Definition: vector.cpp:315
rvector rv_cross(rvector a, rvector b)
Take cross product of two row vectors.
Definition: vector.cpp:363
Definition: convertdef.h:876
int32_t load_stk(string filename, stkstruc &stkdata)
Load STK elements.
Definition: convertlib.cpp:3792
physicsstruc phys
Definition: jsondef.h:3597
rvector drotate(quaternion q, rvector v)
Rotate a row vector using a quaternion.
Definition: mathlib.cpp:2261
double utc2tt(double mjd)
Convert UTC to TT.
Definition: timelib.cpp:884
int stk2eci(double utc, stkstruc &stk, cartpos &eci)
ECI from STK data.
Definition: convertlib.cpp:3842