1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.propagation.semianalytical.dsst.forces;
18
19 import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
20 import org.apache.commons.math3.util.FastMath;
21 import org.orekit.errors.OrekitException;
22 import org.orekit.forces.drag.Atmosphere;
23 import org.orekit.frames.Frame;
24 import org.orekit.propagation.SpacecraftState;
25 import org.orekit.propagation.events.EventDetector;
26 import org.orekit.time.AbsoluteDate;
27 import org.orekit.utils.Constants;
28
29
30
31
32
33
34
35
36
37
38
39 public class DSSTAtmosphericDrag extends AbstractGaussianContribution {
40
41
42 private static final double GAUSS_THRESHOLD = 6.0e-10;
43
44
45 private static final double ATMOSPHERE_ALTITUDE_MAX = 1000000.;
46
47
48 private final Atmosphere atmosphere;
49
50
51 private final double area;
52
53
54 private final double kRef;
55
56
57 private final double rbar;
58
59
60
61
62
63
64 public DSSTAtmosphericDrag(final Atmosphere atmosphere, final double cd, final double area) {
65 super(GAUSS_THRESHOLD);
66 this.atmosphere = atmosphere;
67 this.area = area;
68 this.kRef = 0.5 * cd * area;
69 this.rbar = ATMOSPHERE_ALTITUDE_MAX + Constants.WGS84_EARTH_EQUATORIAL_RADIUS;
70 }
71
72
73
74
75 public Atmosphere getAtmosphere() {
76 return atmosphere;
77 }
78
79
80
81
82 public double getArea() {
83 return area;
84 }
85
86
87
88
89 public double getCd() {
90 return 2 * kRef / area;
91 }
92
93
94
95
96
97
98
99
100 public double getRbar() {
101 return rbar;
102 }
103
104
105 public double[] getShortPeriodicVariations(final AbsoluteDate date, final double[] meanElements)
106 throws OrekitException {
107
108 return new double[] {0., 0., 0., 0., 0., 0.};
109 }
110
111
112 public EventDetector[] getEventsDetectors() {
113 return null;
114 }
115
116
117 protected Vector3D getAcceleration(final SpacecraftState state,
118 final Vector3D position, final Vector3D velocity)
119 throws OrekitException {
120 final AbsoluteDate date = state.getDate();
121 final Frame frame = state.getFrame();
122
123 final double rho = atmosphere.getDensity(date, position, frame);
124
125 final Vector3D vAtm = atmosphere.getVelocity(date, position, frame);
126
127 final Vector3D vRel = vAtm.subtract(velocity);
128
129 final double bc = kRef / state.getMass();
130
131 return new Vector3D(bc * rho * vRel.getNorm(), vRel);
132 }
133
134
135 protected double[] getLLimits(final SpacecraftState state) throws OrekitException {
136 final double perigee = a * (1. - ecc);
137
138 if (perigee > rbar) {
139 return new double[2];
140 }
141 final double apogee = a * (1. + ecc);
142
143 if (apogee < rbar) {
144 return new double[] {-FastMath.PI, FastMath.PI};
145 }
146
147 final double fb = FastMath.acos(((a * (1. - ecc * ecc) / rbar) - 1.) / ecc);
148 final double wW = FastMath.atan2(h, k);
149 return new double[] {wW - fb, wW + fb};
150 }
151
152 }