1   /* Copyright 2002-2025 CS GROUP
2    * Licensed to CS GROUP (CS) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * CS licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.orekit.files.ccsds.ndm.odm.ocm;
19  
20  import org.hipparchus.geometry.euclidean.threed.Vector3D;
21  import org.orekit.files.ccsds.definitions.OnOff;
22  import org.orekit.time.AbsoluteDate;
23  import org.orekit.time.TimeStamped;
24  
25  /** Maneuver entry.
26   * @author Luc Maisonobe
27   * @since 11.0
28   */
29  public class OrbitManeuver implements TimeStamped {
30  
31      /** Maneuver date. */
32      private AbsoluteDate date;
33  
34      /** Duration. */
35      private double duration;
36  
37      /** Mass change. */
38      private double deltaMass;
39  
40      /** Acceleration. */
41      private double[] acceleration;
42  
43      /** Interpolation mode between current and next acceleration line. */
44      private OnOff accelerationInterpolation;
45  
46      /** One σ percent error on acceleration magnitude. */
47      private double accelerationMagnitudeSigma;
48  
49      /** One σ angular off-nominal acceleration direction. */
50      private double accelerationDirectionSigma;
51  
52      /** Velocity increment. */
53      private double[] dV;
54  
55      /** One σ percent error on ΔV magnitude. */
56      private double dvMagSigma;
57  
58      /** One σ angular off-nominal ΔV direction. */
59      private double dvDirSigma;
60  
61      /** Thrust. */
62      private double[] thrust;
63  
64      /** Thrust efficiency η typically between 0.0 and 1.0. */
65      private double thrustEfficiency;
66  
67      /** Interpolation mode between current and next acceleration line. */
68      private OnOff thrustInterpolation;
69  
70      /** Thrust specific impulse. */
71      private double thrustIsp;
72  
73      /** One σ percent error on thrust magnitude. */
74      private double thrustMagnitudeSigma;
75  
76      /** One σ angular off-nominal thrust direction. */
77      private double thrustDirectionSigma;
78  
79      /** Identifier of resulting "child" object deployed from this host. */
80      private String deployId;
81  
82      /** Velocity increment of deployed "child" object. */
83      private double[] deployDv;
84  
85      /** Decrement in host mass as a result of deployment (shall be ≤ 0). */
86      private double deployMass;
87  
88      /** One σ percent error on deployment ΔV magnitude. */
89      private double deployDvSigma;
90  
91      /** One σ angular off-nominal deployment vector direction. */
92      private double deployDirSigma;
93  
94      /** Ratio of child-to-host ΔV vectors. */
95      private double deployDvRatio;
96  
97      /** Typical (50th percentile) product of drag coefficient times cross-sectional area of deployed "child" object. */
98      private double deployDvCda;
99  
100     /** Build an uninitialized maneuver.
101      */
102     public OrbitManeuver() {
103         acceleration = new double[3];
104         dV           = new double[3];
105         thrust       = new double[3];
106         deployDv     = new double[3];
107     }
108 
109     /** {@inheritDoc} */
110     @Override
111     public AbsoluteDate getDate() {
112         return date;
113     }
114 
115     /** Set date.
116      * @param date maneuver date
117      */
118     public void setDate(final AbsoluteDate date) {
119         this.date = date;
120     }
121 
122     /** Get duration.
123      * @return duration
124      */
125     public double getDuration() {
126         return duration;
127     }
128 
129     /** Set duration.
130      * @param duration duration
131      */
132     public void setDuration(final double duration) {
133         this.duration = duration;
134     }
135 
136     /** Get mass change.
137      * @return mass change
138      */
139     public double getDeltaMass() {
140         return deltaMass;
141     }
142 
143     /** Set mass change.
144      * @param deltaMass mass change
145      */
146     public void setDeltaMass(final double deltaMass) {
147         this.deltaMass = deltaMass;
148     }
149 
150     /** Get acceleration.
151      * @return acceleration
152      */
153     public Vector3D getAcceleration() {
154         return new Vector3D(acceleration);
155     }
156 
157     /** Set acceleration component.
158      * @param i component index
159      * @param ai i<sup>th</sup> component of acceleration
160      */
161     public void setAcceleration(final int i, final double ai) {
162         acceleration[i] = ai;
163     }
164 
165     /** Get interpolation mode between current and next acceleration line.
166      * @return interpolation mode between current and next acceleration line
167      */
168     public OnOff getAccelerationInterpolation() {
169         return accelerationInterpolation;
170     }
171 
172     /** Set interpolation mode between current and next acceleration line.
173      * @param accelerationInterpolation interpolation mode between current and next acceleration line
174      */
175     public void setAccelerationInterpolation(final OnOff accelerationInterpolation) {
176         this.accelerationInterpolation = accelerationInterpolation;
177     }
178 
179     /** Get one σ percent error on acceleration magnitude.
180      * @return one σ percent error on acceleration magnitude
181      */
182     public double getAccelerationMagnitudeSigma() {
183         return accelerationMagnitudeSigma;
184     }
185 
186     /** Set one σ percent error on acceleration magnitude.
187      * @param accelerationMagnitudeSigma one σ percent error on acceleration magnitude
188      */
189     public void setAccelerationMagnitudeSigma(final double accelerationMagnitudeSigma) {
190         this.accelerationMagnitudeSigma = accelerationMagnitudeSigma;
191     }
192 
193     /** Get one σ angular off-nominal acceleration direction.
194      * @return one σ angular off-nominal acceleration direction
195      */
196     public double getAccelerationDirectionSigma() {
197         return accelerationDirectionSigma;
198     }
199 
200     /** Set one σ angular off-nominal acceleration direction.
201      * @param accelerationDirectionSigma one σ angular off-nominal acceleration direction
202      */
203     public void setAccelerationDirectionSigma(final double accelerationDirectionSigma) {
204         this.accelerationDirectionSigma = accelerationDirectionSigma;
205     }
206 
207     /** Get velocity increment.
208      * @return velocity increment
209      */
210     public Vector3D getDv() {
211         return new Vector3D(dV);
212     }
213 
214     /** Set velocity increment component.
215      * @param i component index
216      * @param dVi i<sup>th</sup> component of velocity increment
217      */
218     public void setDv(final int i, final double dVi) {
219         dV[i] = dVi;
220     }
221 
222     /** Get one σ percent error on ΔV  magnitude.
223      * @return one σ percent error on ΔV  magnitude
224      */
225     public double getDvMagSigma() {
226         return dvMagSigma;
227     }
228 
229     /** Set one σ percent error on ΔV  magnitude.
230      * @param dvMagSigma one σ percent error on ΔV  magnitude
231      */
232     public void setDvMagSigma(final double dvMagSigma) {
233         this.dvMagSigma = dvMagSigma;
234     }
235 
236     /** Get one σ angular off-nominal ΔV direction.
237      * @return one σ angular off-nominal ΔV direction
238      */
239     public double getDvDirSigma() {
240         return dvDirSigma;
241     }
242 
243     /** Set one σ angular off-nominal ΔV direction.
244      * @param dvDirSigma one σ angular off-nominal ΔV direction
245      */
246     public void setDvDirSigma(final double dvDirSigma) {
247         this.dvDirSigma = dvDirSigma;
248     }
249 
250     /** Get thrust.
251      * @return thrust
252      */
253     public Vector3D getThrust() {
254         return new Vector3D(thrust);
255     }
256 
257     /** Set thrust component.
258      * @param i component index
259      * @param ti i<sup>th</sup> component of thrust
260      */
261     public void setThrust(final int i, final double ti) {
262         thrust[i] = ti;
263     }
264 
265     /** Get thrust efficiency η.
266      * @return thrust efficiency η (typically between 0.0 and 1.0)
267      */
268     public double getThrustEfficiency() {
269         return thrustEfficiency;
270     }
271 
272     /** Set thrust efficiency η.
273      * @param thrustEfficiency thrust efficiency η (typically between 0.0 and 1.0)
274      */
275     public void setThrustEfficiency(final double thrustEfficiency) {
276         this.thrustEfficiency = thrustEfficiency;
277     }
278 
279     /** Get interpolation mode between current and next thrust line.
280      * @return interpolation mode between current and next thrust line
281      */
282     public OnOff getThrustInterpolation() {
283         return thrustInterpolation;
284     }
285 
286     /** Set interpolation mode between current and next thrust line.
287      * @param thrustInterpolation interpolation mode between current and next thrust line
288      */
289     public void setThrustInterpolation(final OnOff thrustInterpolation) {
290         this.thrustInterpolation = thrustInterpolation;
291     }
292 
293     /** Get thrust specific impulse.
294      * @return thrust specific impulse
295      */
296     public double getThrustIsp() {
297         return thrustIsp;
298     }
299 
300     /** Set thrust specific impulse.
301      * @param thrustIsp thrust specific impulse
302      */
303     public void setThrustIsp(final double thrustIsp) {
304         this.thrustIsp = thrustIsp;
305     }
306 
307     /** Get one σ percent error on thrust magnitude.
308      * @return one σ percent error on thrust magnitude
309      */
310     public double getThrustMagnitudeSigma() {
311         return thrustMagnitudeSigma;
312     }
313 
314     /** Set one σ percent error on thrust magnitude.
315      * @param thrustMagnitudeSigma one σ percent error on thrust magnitude
316      */
317     public void setThrustMagnitudeSigma(final double thrustMagnitudeSigma) {
318         this.thrustMagnitudeSigma = thrustMagnitudeSigma;
319     }
320 
321     /** Get one σ angular off-nominal thrust direction.
322      * @return one σ angular off-nominal thrust direction
323      */
324     public double getThrustDirectionSigma() {
325         return thrustDirectionSigma;
326     }
327 
328     /** Set one σ angular off-nominal thrust direction.
329      * @param thrustDirectionSigma one σ angular off-nominal thrust direction
330      */
331     public void setThrustDirectionSigma(final double thrustDirectionSigma) {
332         this.thrustDirectionSigma = thrustDirectionSigma;
333     }
334 
335     /** Get identifier of resulting "child" object deployed from this host.
336      * @return identifier of resulting "child" object deployed from this host
337      */
338     public String getDeployId() {
339         return deployId;
340     }
341 
342     /** Set identifier of resulting "child" object deployed from this host.
343      * @param deployId identifier of resulting "child" object deployed from this host
344      */
345     public void setDeployId(final String deployId) {
346         this.deployId = deployId;
347     }
348 
349     /** Get velocity increment of deployed "child" object.
350      * @return velocity increment of deployed "child" object
351      */
352     public Vector3D getDeployDv() {
353         return new Vector3D(deployDv);
354     }
355 
356     /** Set velocity increment component of deployed "child" object.
357      * @param i component index
358      * @param deployDvi i<sup>th</sup> component of velocity increment of deployed "child" object
359      */
360     public void setDeployDv(final int i, final double deployDvi) {
361         deployDv[i] = deployDvi;
362     }
363 
364     /** Get decrement in host mass as a result of deployment.
365      * @return decrement in host mass as a result of deployment (shall be ≤ 0)
366      */
367     public double getDeployMass() {
368         return deployMass;
369     }
370 
371     /** Set decrement in host mass as a result of deployment.
372      * @param deployMass decrement in host mass as a result of deployment (shall be ≤ 0)
373      */
374     public void setDeployMass(final double deployMass) {
375         this.deployMass = deployMass;
376     }
377 
378     /** Get one σ percent error on deployment ΔV magnitude.
379      * @return one σ percent error on deployment ΔV magnitude
380      */
381     public double getDeployDvSigma() {
382         return deployDvSigma;
383     }
384 
385     /** Set one σ percent error on deployment ΔV magnitude.
386      * @param deployDvSigma one σ percent error on deployment ΔV magnitude
387      */
388     public void setDeployDvSigma(final double deployDvSigma) {
389         this.deployDvSigma = deployDvSigma;
390     }
391 
392     /** Get one σ angular off-nominal deployment vector direction.
393      * @return one σ angular off-nominal deployment vector direction
394      */
395     public double getDeployDirSigma() {
396         return deployDirSigma;
397     }
398 
399     /** Set one σ angular off-nominal deployment vector direction.
400      * @param deployDirSigma one σ angular off-nominal deployment vector direction
401      */
402     public void setDeployDirSigma(final double deployDirSigma) {
403         this.deployDirSigma = deployDirSigma;
404     }
405 
406     /** Get ratio of child-to-host ΔV vectors.
407      * @return ratio of child-to-host ΔV vectors
408      */
409     public double getDeployDvRatio() {
410         return deployDvRatio;
411     }
412 
413     /** Set ratio of child-to-host ΔV vectors.
414      * @param deployDvRatio ratio of child-to-host ΔV vectors
415      */
416     public void setDeployDvRatio(final double deployDvRatio) {
417         this.deployDvRatio = deployDvRatio;
418     }
419 
420     /** Get typical (50th percentile) product of drag coefficient times cross-sectional area of deployed "child" object.
421      * @return typical (50th percentile) product of drag coefficient times cross-sectional area of deployed "child" object
422      */
423     public double getDeployDvCda() {
424         return deployDvCda;
425     }
426 
427     /** Set typical (50th percentile) product of drag coefficient times cross-sectional area of deployed "child" object.
428      * @param deployDvCda typical (50th percentile) product of drag coefficient times cross-sectional area of deployed "child" object
429      */
430     public void setDeployDvCda(final double deployDvCda) {
431         this.deployDvCda = deployDvCda;
432     }
433 
434 }