WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
AsphericalGravityModel.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, INC.
15******************************************************************************/
16/*
17Aspherical gravity model header file
18
19Author: Alex Reynolds
20*/
21/*
22Metadata for MS GUI:
23imdata = {"displayname" : "Aspherical Gravity",
24 "exclude" : False,
25 "category" : "Dynamics"
26}
27aliases = {"mu" : "GM",
28 "J2" : "J2",
29 "J3" : "J3",
30 "r_planet" : "Planet Equatorial Radius",
31 "body_mass" : "Spacecraft Mass",
32 "pos_body__f" : "Position",
33 "grav_accel__f" : "EXCLUDE",
34 "grav_force__f" : "Gravity Force",
35 "grav_mu" : "EXCLUDE",
36 "grav_J2" : "EXCLUDE",
37 "grav_J3" : "EXCLUDE",
38}
39*/
40
41#ifndef MODELS_ENVIRONMENT_ASPHERICAL_GRAVITY_MODEL_H
42#define MODELS_ENVIRONMENT_ASPHERICAL_GRAVITY_MODEL_H
43
44#include "simulation/Model.h"
45#include "frames/Frame.h"
46#include "frames/Node.h"
47#include "frames/frameutils.h"
49
50namespace warptwin {
51
52 // Precalculated constants for internal gravity model use
53 const double PC_15_2 = 0.5*15.0; // Precalc of 15/2
54 const double PC_3_2 = 0.5*3.0; // Precalc of 3/2
55 const double PC_35_2 = 0.5*35; // Precalc of 35/2
56
63 MODEL(AsphericalGravityModel)
64 public:
65 // TODO: Replace need for mass with direct acceleration calculation when
66 // body accel methods are implemented
67 // Model params
68 // NAME TYPE DEFAULT VALUE
72 SIGNAL(mu, double, warpos::earth_wgs84.mu)
75 SIGNAL(J2, double, warpos::earth_wgs84.J2)
78 SIGNAL(J3, double, warpos::earth_wgs84.J3)
80 SIGNAL(r_planet, double, warpos::earth_wgs84.eq_radius)
83 SIGNAL(body_mass, double, 1.0)
85
86 // Model inputs
87 // NAME TYPE DEFAULT VALUE
90 SIGNAL(pos_body__f, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
92
93 // Model outputs
94 // NAME TYPE DEFAULT VALUE
97 SIGNAL(grav_accel__f, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
99 SIGNAL(grav_force__f, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
101 SIGNAL(grav_mu, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
103 SIGNAL(grav_J2, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
105 SIGNAL(grav_J3, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
107
108 protected:
109 int16 start() override;
110 int16 execute() override;
111
112 // Temporary vectors and variables to carry out our calculations
113 double r;
117 };
118
119}
120
121#endif
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition appmacros.h:27
#define START_PARAMS
Definition appmacros.h:42
#define END_OUTPUTS
Definition appmacros.h:33
#define END_PARAMS
Definition appmacros.h:47
#define START_OUTPUTS
Definition appmacros.h:28
#define END_INPUTS
Definition appmacros.h:40
#define START_INPUTS
Definition appmacros.h:35
#define CartesianVector3
Definition mathmacros.h:43
PlanetDefaults earth_wgs84
Definition planetdefaults.cpp:22
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
int16 start() override
Class to execute logging.
CartesianVector3 grav_force__planet
Definition AsphericalGravityModel.h:116
SIGNAL(_mu, double, warpos::earth_wgs84.mu)
const double PC_35_2
Definition AsphericalGravityModel.h:55
double precalc_j3
Definition AsphericalGravityModel.h:115
const double PC_15_2
Definition AsphericalGravityModel.h:53
double r
Definition AsphericalGravityModel.h:113
@ MODEL
Simplified dynamics model representing motion in the circular restricted 3 body problem.
Definition ImNode.h:31
double precalc_j2
Definition AsphericalGravityModel.h:114
int16 execute() override
Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in...
const double PC_3_2
Definition AsphericalGravityModel.h:54