Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Orekit
Orekit
Commits
2088712c
Commit
2088712c
authored
Dec 21, 2020
by
Bryan Cazabonne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added unit tests to fix issue 736.
parent
b2d64a8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
0 deletions
+89
-0
src/test/java/org/orekit/propagation/semianalytical/dsst/DSSTTesseralTest.java
...kit/propagation/semianalytical/dsst/DSSTTesseralTest.java
+42
-0
src/test/java/org/orekit/propagation/semianalytical/dsst/FieldDSSTTesseralTest.java
...ropagation/semianalytical/dsst/FieldDSSTTesseralTest.java
+47
-0
No files found.
src/test/java/org/orekit/propagation/semianalytical/dsst/DSSTTesseralTest.java
View file @
2088712c
...
...
@@ -215,6 +215,48 @@ public class DSSTTesseralTest {
}
@Test
public
void
testIssue736
()
{
// Central Body geopotential 4x4
final
UnnormalizedSphericalHarmonicsProvider
provider
=
GravityFieldFactory
.
getUnnormalizedProvider
(
4
,
4
);
// Frames and epoch
final
Frame
frame
=
FramesFactory
.
getEME2000
();
final
Frame
earthFrame
=
CelestialBodyFactory
.
getEarth
().
getBodyOrientedFrame
();
final
AbsoluteDate
initDate
=
new
AbsoluteDate
(
2007
,
4
,
16
,
0
,
46
,
42.400
,
TimeScalesFactory
.
getUTC
());
// Initial orbit
final
Orbit
orbit
=
new
EquinoctialOrbit
(
2.655989E7
,
2.719455286199036
E
-
4
,
0.0041543085910249414
,
-
0.3412974060023717
,
0.3960084733107685
,
8.566537840341699
,
PositionAngle
.
TRUE
,
frame
,
initDate
,
provider
.
getMu
());
// Force model
final
DSSTForceModel
tesseral
=
new
DSSTTesseral
(
earthFrame
,
Constants
.
WGS84_EARTH_ANGULAR_VELOCITY
,
provider
);
final
double
[]
parameters
=
tesseral
.
getParameters
();
// Initialize force model
tesseral
.
initialize
(
new
AuxiliaryElements
(
orbit
,
1
),
PropagationType
.
MEAN
,
parameters
);
// Eccentricity shift
final
Orbit
shfitedOrbit
=
new
EquinoctialOrbit
(
2.655989E7
,
0.02
,
0.0041543085910249414
,
-
0.3412974060023717
,
0.3960084733107685
,
8.566537840341699
,
PositionAngle
.
TRUE
,
frame
,
initDate
,
provider
.
getMu
());
final
double
[]
elements
=
tesseral
.
getMeanElementRate
(
new
SpacecraftState
(
shfitedOrbit
),
new
AuxiliaryElements
(
shfitedOrbit
,
1
),
parameters
);
// The purpose of this test is not to verify a specific value.
// Its purpose is to verify that a NullPointerException does not
// occur when calculating initial values of Hansen Coefficients
for
(
int
i
=
0
;
i
<
elements
.
length
;
i
++)
{
Assert
.
assertTrue
(
elements
[
i
]
!=
0
);
}
}
@Test
public
void
testOutOfRangeException
()
{
// Central Body geopotential 1x0
...
...
src/test/java/org/orekit/propagation/semianalytical/dsst/FieldDSSTTesseralTest.java
View file @
2088712c
...
...
@@ -257,6 +257,53 @@ public class FieldDSSTTesseralTest {
}
@Test
public
void
testIssue736
()
{
doTestIssue736
(
Decimal64Field
.
getInstance
());
}
private
<
T
extends
RealFieldElement
<
T
>>
void
doTestIssue736
(
final
Field
<
T
>
field
)
{
// Central Body geopotential 4x4
final
UnnormalizedSphericalHarmonicsProvider
provider
=
GravityFieldFactory
.
getUnnormalizedProvider
(
4
,
4
);
// Frames and epoch
final
Frame
frame
=
FramesFactory
.
getEME2000
();
final
Frame
earthFrame
=
CelestialBodyFactory
.
getEarth
().
getBodyOrientedFrame
();
final
FieldAbsoluteDate
<
T
>
initDate
=
new
FieldAbsoluteDate
<>(
field
,
2007
,
04
,
16
,
0
,
46
,
42.400
,
TimeScalesFactory
.
getUTC
());
// Orbit
final
T
zero
=
field
.
getZero
();
final
FieldOrbit
<
T
>
orbit
=
new
FieldEquinoctialOrbit
<>(
zero
.
add
(
2.655989E7
),
zero
.
add
(
2.719455286199036
E
-
4
),
zero
.
add
(
0.0041543085910249414
),
zero
.
add
(-
0.3412974060023717
),
zero
.
add
(
0.3960084733107685
),
zero
.
add
(
8.566537840341699
),
PositionAngle
.
TRUE
,
frame
,
initDate
,
zero
.
add
(
3.986004415E14
));
// Force model
final
DSSTForceModel
tesseral
=
new
DSSTTesseral
(
earthFrame
,
Constants
.
WGS84_EARTH_ANGULAR_VELOCITY
,
provider
);
final
T
[]
parameters
=
tesseral
.
getParameters
(
field
);
// Initialize force model
tesseral
.
initialize
(
new
FieldAuxiliaryElements
<>(
orbit
,
1
),
PropagationType
.
MEAN
,
parameters
);
// Eccentricity shift
final
FieldOrbit
<
T
>
shfitedOrbit
=
new
FieldEquinoctialOrbit
<>(
zero
.
add
(
2.655989E7
),
zero
.
add
(
0.02
),
zero
.
add
(
0.0041543085910249414
),
zero
.
add
(-
0.3412974060023717
),
zero
.
add
(
0.3960084733107685
),
zero
.
add
(
8.566537840341699
),
PositionAngle
.
TRUE
,
frame
,
initDate
,
zero
.
add
(
3.986004415E14
));
final
T
[]
elements
=
tesseral
.
getMeanElementRate
(
new
FieldSpacecraftState
<>(
shfitedOrbit
),
new
FieldAuxiliaryElements
<>(
shfitedOrbit
,
1
),
parameters
);
// The purpose of this test is not to verify a specific value.
// Its purpose is to verify that a NullPointerException does not
// occur when calculating initial values of Hansen Coefficients
for
(
int
i
=
0
;
i
<
elements
.
length
;
i
++)
{
Assert
.
assertTrue
(
elements
[
i
].
getReal
()
!=
0
);
}
}
@Test
@SuppressWarnings
(
"unchecked"
)
public
void
testShortPeriodTermsStateDerivatives
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment