WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
CR3BPDynamicsModel.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/*
17Circular restricted three body dynamics header file
18
19Author: Alex Reynolds
20*/
21/*
22Metadata for MS GUI:
23imdata = {"displayname" : "Three Body Dynamics",
24 "exclude" : False,
25 "category" : "Dynamics"
26}
27aliases = {"mu_primary" : "GM Primary",
28 "mu_secondary" : "GM Secondary",
29 "orbit_radius" : "Orbit Radius",
30 "use_canonical" : "EXCLUDE",
31 "pos_synodic" : "Position",
32 "vel_synodic" : "Velocity",
33 "accel_synodic" : "Acceleration"
34}
35*/
36
37#ifndef MODELS_ACTUATORS_CR3BP_DYNAMICS_MODEL_H
38#define MODELS_ACTUATORS_CR3BP_DYNAMICS_MODEL_H
39
40#include "core/mathmacros.h"
41#include "simulation/Model.h"
44
45namespace warptwin {
46
65 MODEL(CR3BPDynamicsModel)
66 public:
67 // Model params
68 // NAME TYPE DEFAULT VALUE
72 SIGNAL(mu_primary, double, warpos::earth_wgs84.mu)
75 SIGNAL(mu_secondary, double, warpos::moon_nasa.mu)
77 SIGNAL(orbit_radius, double, 384800000)
79 SIGNAL(use_canonical, int, true)
81
82 // Model inputs
83 // NAME TYPE DEFAULT VALUE
87 SIGNAL(pos_synodic, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
90 SIGNAL(vel_synodic, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
92
93 // Model outputs
94 // NAME TYPE DEFAULT VALUE
98 SIGNAL(accel_synodic, CartesianVector3, CartesianVector3({0.0, 0.0, 0.0}))
100
101 protected:
102 int16 start();
103 int16 execute();
104
105 // CR3BP conversions
106 double _mu_star;
107 double _l_star;
108 double _t_star;
109
112
113 std::array<double, 6> _input_states;
114 std::array<double, 6> _rates;
117 };
118}
119
120#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
Definition CR3BPDynamics.h:43
#define CartesianVector3
Definition mathmacros.h:43
PlanetDefaults earth_wgs84
Definition planetdefaults.cpp:22
PlanetDefaults moon_nasa
Definition planetdefaults.cpp:34
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
int16 start() override
Class to execute logging.
SIGNAL(_mu, double, warpos::earth_wgs84.mu)
double _mu_star
Definition CR3BPDynamicsModel.h:106
clockwerk::CartesianVector< 3 > _tmp
Definition CR3BPDynamicsModel.h:116
double _t_star
Definition CR3BPDynamicsModel.h:108
std::array< double, 6 > _input_states
Definition CR3BPDynamicsModel.h:113
double _l_star
Definition CR3BPDynamicsModel.h:107
@ MODEL
Simplified dynamics model representing motion in the circular restricted 3 body problem.
Definition ImNode.h:31
clockwerk::CartesianVector< 3 > _internal_vel
Definition CR3BPDynamicsModel.h:111
clockwerk::CartesianVector< 3 > _internal_pos
Definition CR3BPDynamicsModel.h:110
int16 execute() override
Function to check monitor input conditions and set trigger flag accordingly. Should be implemented in...
CR3BPDynamics _dynamics
Definition CR3BPDynamicsModel.h:115
std::array< double, 6 > _rates
Definition CR3BPDynamicsModel.h:114