ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
stateinit.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/*
17Orbit Utilities header file
18---------------------------
19This file contains orbit utilities for converting between "classical"
20keplerian orbital elements and xyz cartesian position and velocity.
21
22TODO: Protect edge cases in these files. Right now they only work for
23elliptical orbits
24
25The converters in this file are based on those found in Vallado's
26Fundamentals of Astrodynamics and Applications, fourth edition, Chapter
272.5. The test cases are drawn from that text as well.
28
29Author: Alex Reynolds
30*/
31#ifndef STATE_INIT_H
32#define STATE_INIT_H
33
34#include "core/macros.h"
35#include "core/CartesianVector.hpp"
36#include "six_dof_dynamics/Frame.hpp"
37
38namespace modelspace {
39
40 /// @brief Function to initialize frame target relative to freame reference inertially
41 /// @param target The target frame whose state we want to set
42 /// @param reference The frame we are setting state relative to
43 /// @param pos_tgt_ref__ref The position of target relative to reference, in ref frame coordinates
44 /// @param vel_tgt_ref__ref The inertial velocity of target origin relative to reference origin, in ref frame coords
45 /// @return Error code corresponding to success/failure
46 int frameRelativeInit(FrameD &target, FrameD &reference,
47 const CartesianVector3D &pos_tgt_ref__ref, const CartesianVector3D &vel_tgt_ref__ref);
48
49 /// @brief Function to initialize a body's position and velocity from an orbit
50 /// @param target The target frame to initialize
51 /// @param planet The planet frame our orbit is relative to
52 /// @param mu Gravitational parameter of the planet
53 /// @param a Orbit semimajor axis, in meters
54 /// @param e Orbit eccentricity
55 /// @param i Orbit inclination, radians
56 /// @param RAAN Orbit Right Ascention of the Ascending Node, radians
57 /// @param w Orbit argument of periapsis, radians
58 /// @param f Orbit true anomaly, radians
59 /// @return Error code corresponding to success/failure
60 int orbitInit(FrameD &target, FrameD &planet, double mu, double a, double e, double i, double RAAN, double w, double f);
61
62}
63
64#endif
#define CartesianVector3D
Definition macros.h:54
#define FrameD
Definition macros.h:64
Class to propagate CR3BP dynamics in characteristic units.
Definition ConfigurationWriter.cpp:18
int orbitInit(clockwerk::Frame< double > &target, clockwerk::Frame< double > &planet, double mu, double a, double e, double i, double RAAN, double w, double f)
Function to initialize a body's position and velocity from an orbit.
Definition stateinit.cpp:46
int frameRelativeInit(clockwerk::Frame< double > &target, clockwerk::Frame< double > &reference, const clockwerk::CartesianVector< double, 3 > &pos_tgt_ref__ref, const clockwerk::CartesianVector< double, 3 > &vel_tgt_ref__ref)
Function to initialize frame target relative to freame reference inertially.
Definition stateinit.cpp:22