COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
physicslib.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
30 #ifndef _ORBITLIB_H
31 #define _ORBITLIB_H 1
32 
37 
83 #include "support/configCosmos.h"
84 
85 #include "support/cosmos-defs.h"
86 #include "math/mathlib.h"
87 #include "physics/nrlmsise-00.h"
88 #include "support/convertlib.h"
89 #include "support/demlib.h"
90 #include "physics/physicsdef.h"
91 #include "support/jsondef.h"
92 
93 #include <fcntl.h>
94 #include <cmath>
95 #include <time.h>
96 #include <errno.h>
97 
101 
102 
103 void pleph_(double [], long *, long *, double []);
104 void dpleph_(double [], long *, long *, double []);
105 
106 rvector gravity_vector(svector pos,int model,uint32_t degree);
107 double gravity_potential(double lon, double lat, double r,int model,uint32_t degree);
109 rvector gravity_accel(posstruc pos, int model, uint32_t degree);
111 rvector gravity_accel2(posstruc pos, int model, uint32_t degree);
113 double gravity(double radius, double colat, double elon, int model, uint32_t degree);
115 int32_t gravity_params(int model);
117 double nplgndr(uint32_t l, uint32_t m, double x);
121 void simulate_hardware(cosmosstruc *cinfo, locstruc &loc);
122 void simulate_hardware(cosmosstruc *cinfo, vector <locstruc> &locvec);
124 void initialize_imu(uint16_t index, devspecstruc &devspec, locstruc &loc);
126 void simulate_imu(int index, cosmosstruc *root, locstruc &loc);
128 int32_t pos_accel(physicsstruc &physics, locstruc &loc);
130 void att_accel(physicsstruc &physics, locstruc &loc);
132 void geod2icrf(posstruc *pos);
133 double msis86_density(posstruc pos,float f107avg,float f107,float magidx);
134 double msis00_density(posstruc pos,float f107avg,float f107,float magidx);
135 void orbit_init_tle(int32_t mode, double dt, double mjd, cosmosstruc *root);
136 void orbit_init_eci(int32_t mode, double dt, double mjd, cartpos ipos, cosmosstruc *root);
137 void orbit_init_shape(int32_t mode, double dt, double mjd, double altitude, double angle, double hour, cosmosstruc *root);
138 void propagate(cosmosstruc *root, double mjd);
139 double rearth(double lat);
140 int update_eci(cosmosstruc *root, double utc, cartpos pos);
141 
142 void hardware_init_eci(cosmosstruc *cinfo, locstruc &loc);
143 void gauss_jackson_setup(gj_handle &gjh, uint32_t order, double utc, double &dt);
144 void gauss_jackson_init_tle(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double mjd, cosmosstruc *cinfo);
145 void gauss_jackson_init_eci(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double mjd, cartpos ipos, qatt iatt, physicsstruc &physics, locstruc &loc);
146 void gauss_jackson_init_stk(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double mjd, stkstruc &stk, physicsstruc &physics, locstruc &loc);
147 void gauss_jackson_init(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double mjd, double altitude, double angle, double hour, locstruc &iloc, physicsstruc &physics, locstruc &loc);
150 vector<locstruc> gauss_jackson_propagate(gj_handle &gjh, physicsstruc &physics, locstruc &loc, double mjd);
152 int orbit_propagate(cosmosstruc *root, double mjd);
153 int orbit_init(int32_t mode, double dt, double mjd, string ofile, cosmosstruc *root);
154 //void SolidTide(posstruc pos, double dc[5][4], double ds[5][4]);
155 
157 
158 #endif
svector groundstation(locstruc &satellite, locstruc &groundstation)
Ground station values.
Definition: physicslib.cpp:855
void orbit_init_shape(int32_t mode, double dt, double mjd, double altitude, double angle, double hour, cosmosstruc *root)
Definition: physicslib.cpp:1897
DEM Support header file.
int update_eci(cosmosstruc *root, double utc, cartpos pos)
Definition: physicslib.cpp:3297
void propagate(cosmosstruc *root, double mjd)
Definition: physicslib.cpp:2044
Gauss-Jackson integration handle.
Definition: physicsdef.h:98
void orbit_init_eci(int32_t mode, double dt, double mjd, cartpos ipos, cosmosstruc *root)
Definition: physicslib.cpp:1797
ElapsedTime dt
Definition: agent_file3.cpp:183
Quaternion Attitude.
Definition: convertdef.h:475
3 element generic row vector
Definition: vector.h:53
double nplgndr(uint32_t l, uint32_t m, double x)
Legendre polynomial.
Definition: physicsclass.cpp:1820
Cartesian full position structure.
Definition: convertdef.h:158
int orbit_init(int32_t mode, double dt, double mjd, string ofile, cosmosstruc *root)
Initialize orbit from orbital data.
Definition: physicslib.cpp:3150
rvector gravity_accel2(posstruc pos, int model, uint32_t degree)
Calculates geocentric acceleration vector from chosen model.
Definition: physicslib.cpp:645
COSMOS definitions Definitions specific to the COSMOS environement.
void gauss_jackson_init_eci(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double mjd, cartpos ipos, qatt iatt, physicsstruc &physics, locstruc &loc)
Initialize Gauss-Jackson orbit using ECI state vector.
Definition: physicslib.cpp:2479
void initialize_imu(uint16_t index, devspecstruc &devspec, locstruc &loc)
Initialize IMU simulation.
Definition: physicslib.cpp:1452
rvector gravity_vector(svector pos, int model, uint32_t degree)
Definition: physicslib.cpp:556
void gauss_jackson_init(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double mjd, double altitude, double angle, double hour, locstruc &iloc, physicsstruc &physics, locstruc &loc)
Definition: physicslib.cpp:2721
rvector gravity_accel(posstruc pos, int model, uint32_t degree)
Calculates geocentric acceleration vector from chosen model.
Definition: physicslib.cpp:65
Physics Simulation Structure.
Definition: jsondef.h:3411
Definition: convertdef.h:733
STK positions structure.
Definition: convertdef.h:999
int orbit_propagate(cosmosstruc *root, double mjd)
Load TLE&#39;s from file.
Definition: physicslib.cpp:3259
void dpleph_(double[], long *, long *, double[])
static uint16_t model
Definition: add_radio.cpp:19
3 element spherical vector
Definition: vector.h:167
void geod2icrf(posstruc *pos)
Geodetic to Heliocentric.
locstruc gauss_jackson_converge_orbit(gj_handle &gjh, physicsstruc &physics)
Definition: physicslib.cpp:2761
void att_accel(physicsstruc &physics, locstruc &loc)
Torque.
Definition: physicslib.cpp:1493
Headers and definitions common to all COSMOS.
convertlib include file A library providing functions for conversion between the various position and...
double gravity_potential(double lon, double lat, double r, int model, uint32_t degree)
Definition: physicslib.cpp:605
stkstruc stk
Definition: testengine.cpp:46
vector< locstruc > gauss_jackson_propagate(gj_handle &gjh, physicsstruc &physics, locstruc &loc, double mjd)
Definition: physicslib.cpp:2871
x
Definition: inputfile.py:6
double mjd
Definition: udp_send.cpp:41
gj_handle gjh
Definition: agent_node.cpp:80
void gauss_jackson_init_stk(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double mjd, stkstruc &stk, physicsstruc &physics, locstruc &loc)
Definition: physicslib.cpp:2619
mathlib include file
void hardware_init_eci(cosmosstruc *cinfo, locstruc &loc)
Initialize Hardware.
Definition: physicslib.cpp:877
double msis00_density(posstruc pos, float f107avg, float f107, float magidx)
Calculate atmospheric density.
Definition: physicslib.cpp:1664
void gauss_jackson_converge_hardware(gj_handle &gjh, physicsstruc &physics)
Definition: physicslib.cpp:2862
double msis86_density(posstruc pos, float f107avg, float f107, float magidx)
void simulate_hardware(cosmosstruc *cinfo, locstruc &loc)
Simulate all devices.
Definition: physicslib.cpp:951
Specific Device structure.
Definition: jsondef.h:3860
void simulate_imu(int index, cosmosstruc *root, locstruc &loc)
Simulated IMU values.
Definition: physicslib.cpp:1467
void gauss_jackson_init_tle(gj_handle &gjh, uint32_t order, int32_t mode, double dt, double mjd, cosmosstruc *cinfo)
Definition: jsondef.h:4199
NRLMSISE-00 Extended Support header file.
double gravity(double radius, double colat, double elon, int model, uint32_t degree)
Calculates geocentric acceleration magnitude from chosen model.
int32_t gravity_params(int model)
Gravitational model parameters.
Definition: physicslib.cpp:699
Definition: convertdef.h:876
Orbit library support definitions.
double rearth(double lat)
Definition: convertlib.cpp:1556
void orbit_init_tle(int32_t mode, double dt, double mjd, cosmosstruc *root)
Definition: physicslib.cpp:1705
void gauss_jackson_setup(gj_handle &gjh, uint32_t order, double utc, double &dt)
Prepare for Gauss-Jackson integration.
Definition: physicslib.cpp:2219
void pleph_(double[], long *, long *, double[])
int32_t pos_accel(physicsstruc &physics, locstruc &loc)
Acceleration.
Definition: physicslib.cpp:1553