Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Orekit
Orekit
Commits
5abf251a
Commit
5abf251a
authored
Jan 11, 2023
by
Jean-Baptiste Valet
Browse files
Added tests of infinite numerical propagation.
parent
b08b9537
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/orekit/propagation/numerical/FieldNumericalPropagatorTest.java
View file @
5abf251a
...
...
@@ -1726,6 +1726,30 @@ public class FieldNumericalPropagatorTest {
}
}
@Test
public
void
testInfinitePropagation
()
{
doTestInfinitePropagation
(
Decimal64Field
.
getInstance
());
}
private
<
T
extends
CalculusFieldElement
<
T
>>
void
doTestInfinitePropagation
(
Field
<
T
>
field
)
{
Utils
.
setDataRoot
(
"regular-data:atmosphere:potential/grgs-format"
);
GravityFieldFactory
.
addPotentialCoefficientsReader
(
new
GRGSFormatReader
(
"grim4s4_gr"
,
true
));
FieldNumericalPropagator
<
T
>
propagator
=
createPropagator
(
field
);
propagator
.
setResetAtEnd
(
false
);
// Stop condition
propagator
.
addEventDetector
(
new
FieldDateDetector
<
T
>(
propagator
.
getInitialState
().
getDate
().
shiftedBy
(
60
)));
// Propagate until the stop condition is reached
final
FieldSpacecraftState
<
T
>
finalState
=
propagator
.
propagate
(
FieldAbsoluteDate
.
getFutureInfinity
(
field
));
// Check that the expected final state was reached
Assertions
.
assertEquals
(
60
,
finalState
.
getDate
().
durationFrom
(
propagator
.
getInitialState
().
getDate
()).
getReal
());
}
private
static
<
T
extends
CalculusFieldElement
<
T
>>
void
doTestShift
(
final
FieldCartesianOrbit
<
T
>
orbit
,
final
OrbitType
orbitType
,
final
PositionAngle
angleType
,
final
boolean
withDerivatives
,
final
double
error60s
,
final
double
error120s
,
...
...
src/test/java/org/orekit/propagation/numerical/NumericalPropagatorTest.java
View file @
5abf251a
...
...
@@ -1591,6 +1591,25 @@ public class NumericalPropagatorTest {
}
}
@Test
public
void
testInfinitePropagation
()
{
Utils
.
setDataRoot
(
"regular-data:atmosphere:potential/grgs-format"
);
GravityFieldFactory
.
addPotentialCoefficientsReader
(
new
GRGSFormatReader
(
"grim4s4_gr"
,
true
));
final
NumericalPropagator
propag
=
createPropagator
(
initialState
,
OrbitType
.
KEPLERIAN
,
PositionAngle
.
TRUE
);
// Stop condition
propag
.
addEventDetector
(
new
DateDetector
(
initialState
.
getDate
().
shiftedBy
(
60
)));
// Propagate until the stop condition is reached
final
SpacecraftState
finalState
=
propag
.
propagate
(
AbsoluteDate
.
FUTURE_INFINITY
);
// Check that the expected final state was reached
Assertions
.
assertEquals
(
60
,
finalState
.
getDate
().
durationFrom
(
initialState
.
getDate
()));
}
/** Record the dates treated by the handler.
* If they are out of an interval defined by a start and final date.
*/
...
...
Write
Preview
Supports
Markdown
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