Commit 38b0b48f authored by Bryan Cazabonne's avatar Bryan Cazabonne
Browse files

Merge branch 'maneuvers-dates-derivatives' into 'develop'

Add derivatives with respect to maneuvers start and stop dates.

Closes #856, #853, and #848

See merge request !218
parents 987b04f6 1cb1d086
Pipeline #1557 canceled with stages
in 14 minutes and 8 seconds
......@@ -227,24 +227,6 @@
<!-- The following internal representation exposure are intentional,
They are used to pass data back and forth between classes
-->
<Match>
<Class name="org.orekit.propagation.integration.AdditionalStateData"/>
<Method name ="getAdditionalState" params="" returns="double[]" />
<Bug pattern="EI_EXPOSE_REP" />
</Match>
<Match>
<Class name="org.orekit.propagation.integration.AdditionalStateData"/>
<Method name ="getAdditionalStateDot" params="" returns="double[]" />
<Bug pattern="EI_EXPOSE_REP" />
</Match>
<Match>
<Class name="org.orekit.estimation.measurements.gnss.AbstractLambdaReducer"/>
<Or>
<Method name ="getDiagReference" params="" returns="double[]" />
<Method name ="getLowReference" params="" returns="double[]" />
</Or>
<Bug pattern="EI_EXPOSE_REP" />
</Match>
<Match>
<Class name="org.orekit.forces.gravity.HolmesFeatherstoneAttractionModel$GradientHessian"/>
<Or>
......
......@@ -21,6 +21,56 @@
</properties>
<body>
<release version="11.1" date="TBD" description="TBD">
<action dev="luc" type="add" issue="865">
Added derivatives with respect to maneuvers start and stop dates.
</action>
<action dev="luc" type="add" >
Added observers for maneuvers triggers.
</action>
<action dev="luc" type="fix" issue="853">
Added field-based init method in ForceModel and DSSTForceModel.
</action>
<action dev="luc" type="fix" >
Added ParameterDrivenDateIntervalDetector and FieldParameterDrivenDateIntervalDetector.
</action>
<action dev="luc" type="add" >
Added DateDriver to drive dates using a ParameterDriver.
</action>
<action dev="luc" type="fix" issue="848">
Allow backward propagation in EventBasedManeuverTriggers.
</action>
<action dev="luc" type="add" >
Added IntervalEventTrigger and StartStopEventsTrigger to streamline
several ways to trigger maneuvers.
</action>
<action dev="luc" type="add" >
When propagating with integrated additional equations, the generated
spacecraft states now also contain both state and derivatives
managed by the equations.
</action>
<action dev="luc" type="add" >
Replaced AdditionalEquations by AdditionalDerivativesProvider with
support for dimension retrieval and yield feature between providers.
</action>
<action dev="luc" type="add" issue="856">
Added a new and simpler API for State Transition Matrix and Jacobian
matrix computation. This new API is for now only used with NumericalPropagator
(both in batch least squares and in Kalman filter), but it is expected to be
generalized to semi-analytical and analytical propagators as well when it is
stabilized.
</action>
<action dev="luc" type="add" >
Added DoubleArrayDictionary and FieldArrayDictionary as replacements
for HashMap when the number of keys is very small (such as in spacecraft
states).
</action>
<action dev="luc" type="add">
Manage dependencies between additional states in propagators using a yield
feature between providers.
</action>
<action dev="luc" type="add" >
SpacecraftState now handle derivatives of additional states.
</action>
<action dev="luc" type="add" issue="862">
PropagatorParallelizer now preserves existing step handlers in the propagators it runs.
</action>
......
......@@ -94,7 +94,7 @@
abstract class AbstractIntegratedPropagator {
+void setIntegrator(FirstOrderIntegrator integrator)
+void addAdditionalEquations(AdditionalEquations addEqu)
+void addAdditionalDerivativesProvider(AdditionalDerivativesProvider provider)
+void setInitialAdditionalState(String name, double[] addState)
}
......
' Copyright 2002-2021 CS GROUP
' Licensed to CS GROUP (CS) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' CS licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB/CCC9C5
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
skinparam PackageFontSize 12
skinparam linetype ortho
package org.orekit #ECEBD8 {
package attitude #DDEBD8 {
interface AttitudeProvider
}
package forces #DDEBD8 {
interface ForceModel
abstract class AbstractForceModel
ForceModel <|.. AbstractForceModel
package maneuvers #CBDBC8 {
package propulsion #CCCCC7 {
interface PropulsionModel
}
package trigger #CCCCC7 {
interface ManeuverTriggers
}
interface Maneuver
AbstractForceModel <|-- Maneuver
AttitudeProvider <--o Maneuver : "optional attitude override"
Maneuver o--> PropulsionModel
Maneuver o--> ManeuverTriggers
}
}
}
@enduml
......@@ -39,15 +39,16 @@
Propagator <|.. AbstractPropagator
package integration #CBDBC8 {
interface AdditionalEquations {
interface AdditionalDerivativesProvider {
+String getName()
+void computeDerivatives()
+boolean yield()
+void derivatives()
}
class AbstractIntegratedPropagator {
+void addAdditionalEquations(AdditionalEquations addEqu)
+void addAdditionalDerivativesProvider(AdditionalDerivativesProvider provider)
}
AbstractPropagator <|-- AbstractIntegratedPropagator
AdditionalEquations <---o AbstractIntegratedPropagator : additional
AdditionalDerivativesProvider <---o AbstractIntegratedPropagator : provider
}
package semianalytical.dsst #CBDBC8 {
......@@ -81,7 +82,7 @@
+void getParametersJacobian(SpacecraftState state, double[][] dYdP)
}
AdditionalEquations <|.. DSSTPartialDerivativesEquations
AdditionalDerivativesProvider <|.. DSSTPartialDerivativesEquations
DSSTPartialDerivativesEquations *--> DSSTForceModel
AbstractIntegratedPropagator <|-- DSSTPropagator
DSSTPropagator *--> DSSTForceModel
......
' Copyright 2002-2021 CS GROUP
' Licensed to CS GROUP (CS) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' CS licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB/CCC9C5
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
skinparam PackageFontSize 12
skinparam linetype ortho
package org.orekit #ECEBD8 {
package propagation.events #DDEBD8 {
interface EventDetector
interface FieldEventDetector
}
package forces.maneuvers.propulsion.triggers #DDEBD8 {
interface ManeuverTriggers {
+getName()
+init()
+getEventsDetectors()
+getFieldEventsDetectors()
+isFiring()
+getParametersDrivers()
}
abstract class AbstractManeuverTriggers
abstract class "IntervalEventTrigger<T>" as IntervalEventTrigger_T {
-firingIntervalDetector
#convertIntervalDetector()
}
abstract class "StartStopEventsTrigger<A, O>" as StartStopEventsTrigger_A_O {
-startDetector
-stopDetector
#convertStartDetector()
#convertStopDetector()
}
class DateBasedManeuverTriggers
EventDetector <--o ManeuverTriggers
FieldEventDetector <--o ManeuverTriggers
ManeuverTriggers <|.. AbstractManeuverTriggers
AbstractManeuverTriggers <|-- IntervalEventTrigger_T
AbstractManeuverTriggers <|-- StartStopEventsTrigger_A_O
IntervalEventTrigger_T <|-- DateBasedManeuverTriggers
}
}
@enduml
......@@ -50,18 +50,24 @@
+ SpacecraftState propagate(AbsoluteDate target)
}
interface MatrixHarvester {
+RealMatrix getStateTransitionMatrix(SpacecraftState state)
+RealMatrix getParametersJacobian(SpacecraftState state)
}
Propagator <|.. AbstractPropagator
package integration #CBDBC8 {
interface AdditionalEquations {
interface AdditionalDerivativesProvider {
+String getName()
+void computeDerivatives()
+yield()
+void derivatives()
}
class AbstractIntegratedPropagator {
+void addAdditionalEquations(AdditionalEquations addEqu)
+void addAdditionalDerivativesProvider(AdditionalDerivativesProvider provider)
}
AbstractPropagator <|-- AbstractIntegratedPropagator
AdditionalEquations <---o AbstractIntegratedPropagator : additional
AdditionalDerivativesProvider <---o AbstractIntegratedPropagator : provider
}
package numerical #CBDBC8 {
......@@ -74,20 +80,13 @@
class NumericalPropagator {
+void addForceModel(ForceModel model)
+MatrixHarvester setupMatricesComputation(name, initialSTM, initialJacobian)
}
class PartialDerivativesEquations {
+void freezeParametersSelection()
+void setInitialJacobians(SpacecraftState s0)
+JacobiansMapper getMapper()
}
class Jacobianizer
TimeDerivativesEquations <-- ForceModel : contributes
AdditionalEquations <|.. PartialDerivativesEquations
PartialDerivativesEquations *--> ForceModel
AbstractIntegratedPropagator <|-- NumericalPropagator
NumericalPropagator "1..*" *--> ForceModel
MatrixHarvester <-- NumericalPropagator
NumericalPropagator "1" *--> TimeDerivativesEquations : main
}
......@@ -98,7 +97,6 @@
package user.application #F3EDF7 {
class ComplexForceModel #EAE6F7/B9B3D2
ComplexForceModel ..|> ForceModel
Jacobianizer "1" <--> "1" ComplexForceModel
}
@enduml
......@@ -48,7 +48,7 @@
+SpacecraftState addAdditionalState(final String name, final double ... value)
+boolean hasAdditionalState(final String name)
+double[] getAdditionalState(final String name)
+Map<String, double[]> getAdditionalStates()
+DoubleArrayDictionary getAdditionalStates()
}
note bottom
always immutable
......
' Copyright 2002-2021 CS GROUP
' Licensed to CS GROUP (CS) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' CS licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB/CCC9C5
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
skinparam PackageFontSize 12
skinparam linetype ortho
package org.orekit #ECEBD8 {
package attitude #DDEBD8 {
interface AttitudeProvider
}
package forces.maneuvers.propulsion #DDEBD8 {
interface PropulsionModel {
+getName()
+init()
+getAcceleration()
+getMassDerivatives()
+getParametersDrivers()
}
interface ThrustPropulsionModel {
+getIsp()
+getDirection()
+getThrust()
+getThrustVector()
+getFlowRate()
}
interface ThrustDirectionProvider {
+computeThrustDirection()
}
abstract class AbstractConstantThrustPropulsionModel
class BasicConstantThrustPropulsionModel
class ScaledConstantThrustPropulsionModel
class ThrustDirectionAndAttitudeProvider
PropulsionModel <|.. ThrustPropulsionModel
ThrustPropulsionModel <|-- AbstractConstantThrustPropulsionModel
AbstractConstantThrustPropulsionModel <|-- BasicConstantThrustPropulsionModel
AbstractConstantThrustPropulsionModel <|-- ScaledConstantThrustPropulsionModel
AttitudeProvider <|.. ThrustDirectionAndAttitudeProvider
ThrustDirectionAndAttitudeProvider <-- "1" ThrustDirectionProvider
}
}
@enduml
' Copyright 2002-2021 CS GROUP
' Licensed to CS GROUP (CS) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' CS licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam ClassBackgroundColor #F3EFEB/CCC9C5
skinparam ClassArrowColor #691616
skinparam ClassBorderColor #691616
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam ClassFontSize 11
skinparam PackageFontSize 12
skinparam linetype ortho
package org.orekit #ECEBD8 {
package forces.maneuvers #DDEBD8 {
class SmallManeuverAnalyticalModel
}
package propagation #DDEBD8 {
package analytical #CBDBC8 {
interface "AdapterPropagator.DifferentialEffect" as AdapterPropagator_DifferentialEffect {
+SpacecraftState apply(SpacecraftState original);
}
class AdapterPropagator
class J2DifferentialEffect
AdapterPropagator_DifferentialEffect "*" <--o "1" AdapterPropagator
J2DifferentialEffect ..|> AdapterPropagator_DifferentialEffect
J2DifferentialEffect o--> AdapterPropagator_DifferentialEffect : "direct effect"
}
interface Propagator
AdapterPropagator ..|> Propagator
AdapterPropagator *--> Propagator : reference
}
SmallManeuverAnalyticalModel ..|> AdapterPropagator_DifferentialEffect
}
@enduml
' Copyright 2002-2021 CS GROUP
' Licensed to CS GROUP (CS) under one or more
' contributor license agreements. See the NOTICE file distributed with
' this work for additional information regarding copyright ownership.
' CS licenses this file to You under the Apache License, Version 2.0
' (the "License"); you may not use this file except in compliance with
' the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS,
' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' See the License for the specific language governing permissions and
' limitations under the License.
@startuml
skinparam svek true
skinparam NoteBackgroundColor #F3EFEB
skinparam NoteBorderColor #691616
skinparam NoteFontColor #691616
skinparam SequenceActorBorderColor #6A584B
skinparam SequenceParticipantBackgroundColor #F3EFEB/CCC9C5
skinparam SequenceParticipantBorderColor #6A584B
skinparam SequenceLifeLineBackgroundColor #CCC9C5/F3EFEB
skinparam SequenceLifeLineBorderColor #6A584B
skinparam SequenceArrowColor #6A584B
skinparam SequenceBorderColor #6A584B
skinparam SequenceFontSize 11
hide footbox
box "User application" #F3EDF7
actor "Main" as M
participant StationKeepingMonitorHandler
end box
participant Propagator
participant EphemerisGenerator
participant BoundedPropagator
participant AdapterPropagator
participant "Small maneuver" as m
participant "J₂ due to maneuver" as j
activate M
M -> Propagator : getEphemerisGenerator
activate Propagator
create EphemerisGenerator
Propagator --> EphemerisGenerator : create
deactivate Propagator
M -> Propagator : propagate
activate Propagator
Propagator -> EphemerisGenerator : feed
activate EphemerisGenerator
deactivate EphemerisGenerator
deactivate Propagator
M -> EphemerisGenerator : getGeneratedEphemeris
activate EphemerisGenerator
create BoundedPropagator
EphemerisGenerator --> BoundedPropagator : create
EphemerisGenerator --> M : generated ephemeris
deactivate EphemerisGenerator
loop #CBDBC8 for p optimization attempts
create AdapterPropagator
M -> AdapterPropagator : create
activate AdapterPropagator
AdapterPropagator -> BoundedPropagator : grab
activate BoundedPropagator
deactivate BoundedPropagator
deactivate AdapterPropagator
loop #DDEBD8 for n maneuvers
create m
M -> m : create
M -> AdapterPropagator : addEffect(direct maneuver effect)
activate AdapterPropagator
deactivate AdapterPropagator
create j
M -> j : create
M -> AdapterPropagator : addEffect(indirect J₂ effect)
activate AdapterPropagator
deactivate AdapterPropagator
end
M -> AdapterPropagator : register SK monitor
M -> AdapterPropagator : propagate
activate AdapterPropagator
AdapterPropagator -> BoundedPropagator : propagate reference
activate BoundedPropagator
deactivate BoundedPropagator
loop #DDEBD8 for q steps
loop #ECEBD8 for n maneuvers
AdapterPropagator -> m : apply
activate m
deactivate m
AdapterPropagator -> j : apply
activate j
deactivate j
end
AdapterPropagator -> StationKeepingMonitorHandler : handleStep
activate StationKeepingMonitorHandler
deactivate StationKeepingMonitorHandler
end
AdapterPropagator --> M : final state
deactivate AdapterPropagator
M -> StationKeepingMonitorHandler : check Station Keeping goals
activate StationKeepingMonitorHandler
deactivate StationKeepingMonitorHandler
end
deactivate M
@enduml
......@@ -19,10 +19,9 @@ package org.orekit.attitudes;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.hipparchus.Field;
import org.hipparchus.CalculusFieldElement;
import org.hipparchus.Field;
import org.hipparchus.ode.events.Action;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitMessages;
......@@ -37,6 +36,7 @@ import org.orekit.propagation.events.FieldEventDetector;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.FieldAbsoluteDate;
import org.orekit.utils.AngularDerivativesFilter;
import org.orekit.utils.DoubleArrayDictionary;
import org.orekit.utils.FieldPVCoordinatesProvider;
import org.orekit.utils.PVCoordinatesProvider;
import org.orekit.utils.TimeSpanMap;
......@@ -431,7 +431,7 @@ public class AttitudesSequence implements AttitudeProvider {
final Orbit sOrbit = s.getOrbit().shiftedBy(-transitionTime);
final Attitude sAttitude = past.getAttitude(sOrbit, sOrbit.getDate(), sOrbit.getFrame());
SpacecraftState sState = new SpacecraftState(sOrbit, sAttitude, s.getMass());
for (final Map.Entry<String, double[]> entry : s.getAdditionalStates().entrySet()) {
for (final DoubleArrayDictionary.Entry entry : s.getAdditionalStatesValues().getData()) {
sState = sState.addAdditionalState(entry.getKey(), entry.getValue());
}
......