ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
CR3BPDynamicsModel.h
1/******************************************************************************
2* Copyright (c) ATTX LLC 2024. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, LLC. 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, LLC.
15******************************************************************************/
16/*
17Circular restricted three body dynamics header file
18
19Author: Alex Reynolds
20*/
21
22#ifndef MODELS_ACTUATORS_CR3BP_DYNAMICS_MODEL_H
23#define MODELS_ACTUATORS_CR3BP_DYNAMICS_MODEL_H
24
25#include "core/macros.h"
26#include "simulation/Model.h"
27#include "cr3bputils/CR3BPDynamics.hpp"
28
29namespace modelspace {
30
31 /**
32 * @brief Circular Restricted Three Body Problem Dynamics Model
33 *
34 * This model calculates the expected acceleration experienced by a
35 * body acting under three-body dynamics using the circular restricted
36 * three body assumptions.
37 *
38 * Note the synodic frame definition is consistent with the definitions
39 * in this same directory, which is as follows:
40 * - Frame centered at the system barycenter
41 * - Frame +x directed from the major body to the minor body
42 * - Frame +z aligned to the minor body's angular momentum vector
43 * - Frame +y completes the RH frame along the definition of minor planet travel
44 *
45 * Key assumptions:
46 * - The model outputs acceleration, not force, and so to apply it to a
47 * ModelSpace frame requires conversion or a body with unit mass
48 */
49 class CR3BPDynamicsModel : public modelspace::Model {
50 public:
51 // Model params
52 // NAME TYPE DEFAULT VALUE
54 /** The non-dimensional ratio of the mass of the primary body to the mass
55 * of the secondary body in the three body system. */
56 SIGNAL(mu_star, double, 0.0)
58
59 // Model inputs
60 // NAME TYPE DEFAULT VALUE
62 /** The position of the spacecraft in the rotating three body "synodic" frame */
64 /** The velocity of the spacecraft in the rotating three body "synodic" frame */
67
68 // Model outputs
69 // NAME TYPE DEFAULT VALUE
71 /** The acceleration of the spacecraft in the rotating three body "synodic" frame */
74
75 // Model-specific implementations of startup and derivative
76 CR3BPDynamicsModel() : modelspace::Model() { }
77 CR3BPDynamicsModel(modelspace::Model &pnt, int schedule_slot=0, const std::string &m_name="cr3bp_dynamics")
78 : modelspace::Model(pnt, schedule_slot, m_name) { }
79 CR3BPDynamicsModel(modelspace::SimulationExecutive &e, int schedule_slot=0, const std::string &m_name="cr3bp_dynamics")
80 : modelspace::Model(e, schedule_slot, m_name) { }
81 virtual ~CR3BPDynamicsModel() {}
82
83
84 protected:
85 int start();
86 int execute();
87
88 std::array<double, 6> _input_states;
89 std::array<double, 6> _rates;
90 CR3BPDynamics _dynamics;
92 };
93}
94
95#endif
Circular Restricted Three Body Problem Dynamics Model.
Definition CR3BPDynamicsModel.h:49
int execute()
Function to execute the task. All math and calculations should be here.
Definition CR3BPDynamicsModel.cpp:28
int start()
Function to perform task startup activities (step once after creation)
Definition CR3BPDynamicsModel.cpp:22
Definition CR3BPDynamics.hpp:39
Base model class for derived implementation.
Definition Model.h:56
Model(SimulationExecutive &executive, int schedule_slot, const std::string &m_name="Unnamed")
Executive-based constructor for the task.
Definition Model.cpp:35
Model(Model &pnt, int schedule_slot, const std::string &m_name="Unnamed")
Task-based constructor for the task. Auto-assigns executive.
Definition Model.cpp:31
Model()
Default constructor for the task object for simplicity. Note: Masks some functionality and should not...
Definition Model.cpp:21
Implementation of the executive class for simulation.
Definition SimulationExecutive.h:63
#define SIGNAL(NAME, TYPE, INITIAL_VALUE)
Definition macros.h:87
#define START_PARAMS
Definition macros.h:96
#define CartesianVector3D
Definition macros.h:54
#define END_OUTPUTS
Definition macros.h:90
#define END_PARAMS
Definition macros.h:98
#define START_OUTPUTS
Definition macros.h:88
#define END_INPUTS
Definition macros.h:94
#define START_INPUTS
Definition macros.h:92
Class to propagate CR3BP dynamics in characteristic units.
Definition ConfigurationWriter.cpp:18
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > vel_synodic
Definition CR3BPDynamicsModel.h:65
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > pos_synodic
Definition CR3BPDynamicsModel.h:63
clockwerk::DataIO< clockwerk::CartesianVector< double, 3 > > accel_synodic
Definition CR3BPDynamicsModel.h:72
clockwerk::DataIO< double > mu_star
Definition CR3BPDynamicsModel.h:56