TimeSpanDragForce.java

  1. /* Copyright 2002-2023 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. package org.orekit.forces.drag;

  18. import java.lang.reflect.Array;
  19. import java.util.ArrayList;
  20. import java.util.List;
  21. import java.util.stream.Stream;

  22. import org.hipparchus.CalculusFieldElement;
  23. import org.hipparchus.Field;
  24. import org.hipparchus.analysis.differentiation.DerivativeStructure;
  25. import org.hipparchus.analysis.differentiation.Gradient;
  26. import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
  27. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  28. import org.hipparchus.ode.events.Action;
  29. import org.hipparchus.util.MathArrays;
  30. import org.orekit.annotation.DefaultDataContext;
  31. import org.orekit.frames.Frame;
  32. import org.orekit.models.earth.atmosphere.Atmosphere;
  33. import org.orekit.propagation.FieldSpacecraftState;
  34. import org.orekit.propagation.SpacecraftState;
  35. import org.orekit.propagation.events.DateDetector;
  36. import org.orekit.propagation.events.EventDetector;
  37. import org.orekit.propagation.events.FieldDateDetector;
  38. import org.orekit.propagation.events.FieldEventDetector;
  39. import org.orekit.time.AbsoluteDate;
  40. import org.orekit.time.FieldAbsoluteDate;
  41. import org.orekit.time.FieldTimeStamped;
  42. import org.orekit.time.TimeScale;
  43. import org.orekit.time.TimeScalesFactory;
  44. import org.orekit.utils.ParameterDriver;
  45. import org.orekit.utils.TimeSpanMap;
  46. import org.orekit.utils.TimeSpanMap.Span;
  47. import org.orekit.utils.TimeSpanMap.Transition;


  48. /** Time span atmospheric drag force model.
  49.  *  <p>
  50.  *  This class is closely related to {@link org.orekit.forces.drag.DragForce DragForce} class.<br>
  51.  *  The difference is that it has a {@link TimeSpanMap} of {@link DragSensitive} objects as attribute
  52.  *  instead of a single {@link DragSensitive} object. <br>
  53.  *  The idea behind this model is to allow the user to design a drag force model that can see its physical parameters
  54.  *  (drag coefficient and lift ratio) change with time, at dates chosen by the user. <br>
  55.  *  </p>
  56.  *  <p>
  57.  *  This is a behavior that can be sought in operational orbit determination.<br>
  58.  *  Indeed the solar activity has a strong influence on the local atmospheric density, and thus on the drag force effect.<br>
  59.  *  Solar activity is a physical phenomenon that is difficult to model and predict. <br>
  60.  *  The errors induced by this incomplete modeling can be estimated through the drag coefficients.<br>
  61.  *  Being able to define and estimate drag coefficients depending on user-chosen dates in a piecewise fashion allows for
  62.  *  a better  modeling of solar activity uncertainties.
  63.  *  </p>
  64.  *  <p>
  65.  *  A typical operational use case is to have a daily solar activity with three-hourly magnetic indexes provided by an
  66.  *  international organization (NOAA for example).<br>
  67.  *  Given this input, a user can define a piecewise drag force model with daily or three-hourly drag coefficients.<br>
  68.  *  Each timed coefficient will absorb a part of the uncertainties in the solar activity and will allow for a more accurate
  69.  *  orbit determination
  70.  *  </p>
  71.  *  <b>Usage</b>:<ul>
  72.  *  <li><u>Construction</u>: constructor takes an atmospheric model and a DragSensitive model.<br>
  73.  *  This last model will be your initial DragSensitive model and it will be initially valid for the whole time line.<br>
  74.  *  The real validity of this first entry will be truncated as other DragSensitive models are added.
  75.  *  <li><u>Time spans</u>: DragSensitive models are added using methods {@link #addDragSensitiveValidAfter(DragSensitive, AbsoluteDate)}
  76.  *   or {@link #addDragSensitiveValidBefore(DragSensitive, AbsoluteDate)}.<br>
  77.  *   Recommendations are the same than the ones in {@link TimeSpanMap}, meaning: <ul>
  78.  *   <li>As an entry is added, it truncates the validity of the neighboring entries already present in the map;
  79.  *   <li><b>The transition dates should be entered only once</b>. Repeating a transition date will lead to unexpected result and is not supported;
  80.  *   <li>It is advised to order your DragSensitive models chronologically when adding them to avoid any confusion.
  81.  *   </ul>
  82.  *   <li><u>Naming the parameter drivers</u>: It is strongly advised to give a custom name to the {@link ParameterDriver}(s)
  83.  *   of each DragSensitive model that is added to the object. This will allow you keeping track of the evolution of your models.<br>
  84.  *   Different names are mandatory to differentiate the different drivers.<br>
  85.  *   If you do not specify a name, a default name will be chosen. Example for the drag coefficient:<ul>
  86.  *   <li>Initial DragSensitive model: the driver's default name is "{@link DragSensitive#DRAG_COEFFICIENT}";
  87.  *   <li>Using {@link #addDragSensitiveValidAfter(DragSensitive, AbsoluteDate)}: the driver's default name is
  88.  *   "{@link DragSensitive#DRAG_COEFFICIENT} + {@link #DATE_AFTER} + date.toString()"
  89.  *   <li>Using {@link #addDragSensitiveValidBefore(DragSensitive, AbsoluteDate)}: the driver's default name is
  90.  *   "{@link DragSensitive#DRAG_COEFFICIENT} + {@link #DATE_BEFORE} + date.toString()"
  91.  *   </ul>
  92.  *   </ul>
  93.  *  <b>Example following previous recommendations</b>:<ul>
  94.  *  <li>Given:
  95.  *  <ul>
  96.  *  <li><code>atmosphere</code>: an {@link Atmosphere atmospheric model};
  97.  *  <li><code>isotropicDrag0, 1 and 2</code>: three {@link org.orekit.forces.drag.IsotropicDrag IsotropicDrag} models;
  98.  *  <li><code>date</code>: an {@link AbsoluteDate}.
  99.  *  </ul>
  100.  *  <li>Name the drivers:<br>
  101.  *  <code>isotropicDrag0.getDragParametersDrivers()[0].setName = "Cd0";</code><br>
  102.  *  <code>isotropicDrag1.getDragParametersDrivers()[0].setName = "Cd1";</code><br>
  103.  *  <code>isotropicDrag2.getDragParametersDrivers()[0].setName = "Cd2";</code><br>
  104.  *  <li>Initialize the model: <br>
  105.  *  <code>TimeSpanDragForce force = new TimeSpanDragForce(atmosphere, isotropicDrag0);</code>
  106.  *  <li>Set the second and third model one Julian day apart each:<br>
  107.  *  <code>force.addDragSensitiveValidAfter(isotropicDrag1, date.shiftedBy(Constants.JULIAN_DAY));</code><br>
  108.  *  <code>force.addDragSensitiveValidAfter(isotropicDrag2, date.shiftedBy(2 * Constants.JULIAN_DAY));</code><br>
  109.  *  <li>With this, your model will have the following properties:
  110.  *  <ul>
  111.  *  <li>t in ]-∞, date + 1 day [ / Cd = Cd0
  112.  *  <li>t in [date + 1 day, date + 2days [ / Cd = Cd1
  113.  *  <li>t in [date + 2 days, +∞ [ / Cd = Cd2
  114.  *  </ul>
  115.  *  </ul>
  116.  *  <p>
  117.  *  <b>Warning</b>:<br> The TimeSpanDragForce model is versatile and you could end up with non-physical modeling.<br>
  118.  *  For example you could add 2 {@link org.orekit.forces.drag.IsotropicDrag IsotropicDrag} models with different areas,
  119.  *  or one {@link org.orekit.forces.drag.IsotropicDrag IsotropicDrag} model and then one
  120.  *  {@link org.orekit.forces.BoxAndSolarArraySpacecraft BoxAndSolarArraySpacecraft} model.<br>
  121.  *  It is up to you to ensure that your models are consistent with each other, Orekit will not perform any check for that.
  122.  *  </p>
  123.  * @author Maxime Journot
  124.  * @since 10.2
  125.  */
  126. public class TimeSpanDragForce extends AbstractDragForceModel {

  127.     /** Prefix for dates before in the parameter drivers' name. */
  128.     public static final String DATE_BEFORE = " - Before ";

  129.     /** Prefix for dates after in the parameter drivers' name. */
  130.     public static final String DATE_AFTER = " - After ";

  131.     /** Atmospheric model. */
  132.     private final Atmosphere atmosphere;

  133.     /** TimeSpanMap of DragSensitive objects. */
  134.     private final TimeSpanMap<DragSensitive> dragSensitiveTimeSpanMap;

  135.     /** Time scale used for the default names of the drag parameter drivers. */
  136.     private final TimeScale timeScale;

  137.     /** Constructor with default UTC time scale for the default names of the drag parameter drivers.
  138.      * @param atmosphere atmospheric model
  139.      * @param spacecraft Time scale used for the default names of the drag parameter drivers
  140.      */
  141.     @DefaultDataContext
  142.     public TimeSpanDragForce(final Atmosphere atmosphere,
  143.                              final DragSensitive spacecraft) {
  144.         super(atmosphere);
  145.         this.atmosphere = atmosphere;
  146.         this.dragSensitiveTimeSpanMap = new TimeSpanMap<>(spacecraft);
  147.         this.timeScale = TimeScalesFactory.getUTC();
  148.     }

  149.     /** Constructor.
  150.      * @param atmosphere atmospheric model
  151.      * @param spacecraft the initial object physical and geometric information
  152.      * @param timeScale Time scale used for the default names of the drag parameter drivers
  153.      */
  154.     public TimeSpanDragForce(final Atmosphere atmosphere,
  155.                              final DragSensitive spacecraft,
  156.                              final TimeScale timeScale) {
  157.         super(atmosphere);
  158.         this.atmosphere = atmosphere;
  159.         this.dragSensitiveTimeSpanMap = new TimeSpanMap<>(spacecraft);
  160.         this.timeScale = timeScale;
  161.     }

  162.     /** Add a DragSensitive entry valid before a limit date.<br>
  163.      * Using <code>addDragSensitiveValidBefore(entry, t)</code> will make <code>entry</code>
  164.      * valid in ]-∞, t[ (note the open bracket).
  165.      * @param dragSensitive DragSensitive entry
  166.      * @param latestValidityDate date before which the entry is valid
  167.      * (must be different from <b>all</b> dates already used for transitions)
  168.      */
  169.     public void addDragSensitiveValidBefore(final DragSensitive dragSensitive, final AbsoluteDate latestValidityDate) {
  170.         dragSensitiveTimeSpanMap.addValidBefore(changeDragParameterDriversNames(dragSensitive,
  171.                                                                                 latestValidityDate,
  172.                                                                                 DATE_BEFORE),
  173.                                                 latestValidityDate, false);
  174.     }

  175.     /** Add a DragSensitive entry valid after a limit date.<br>
  176.      * Using <code>addDragSensitiveValidAfter(entry, t)</code> will make <code>entry</code>
  177.      * valid in [t, +∞[ (note the closed bracket).
  178.      * @param dragSensitive DragSensitive entry
  179.      * @param earliestValidityDate date after which the entry is valid
  180.      * (must be different from <b>all</b> dates already used for transitions)
  181.      */
  182.     public void addDragSensitiveValidAfter(final DragSensitive dragSensitive, final AbsoluteDate earliestValidityDate) {
  183.         dragSensitiveTimeSpanMap.addValidAfter(changeDragParameterDriversNames(dragSensitive,
  184.                                                                                earliestValidityDate,
  185.                                                                                DATE_AFTER),
  186.                                                earliestValidityDate, false);
  187.     }

  188.     /** Get the {@link DragSensitive} model valid at a date.
  189.      * @param date the date of validity
  190.      * @return the DragSensitive model valid at date
  191.      */
  192.     public DragSensitive getDragSensitive(final AbsoluteDate date) {
  193.         return dragSensitiveTimeSpanMap.get(date);
  194.     }

  195.     /** Get the {@link DragSensitive} {@link Span} containing a specified date.
  196.      * @param date date belonging to the desired time span
  197.      * @return the DragSensitive time span containing the specified date
  198.      */
  199.     public Span<DragSensitive> getDragSensitiveSpan(final AbsoluteDate date) {
  200.         return dragSensitiveTimeSpanMap.getSpan(date);
  201.     }

  202.     /** Extract a range of the {@link DragSensitive} map.
  203.      * <p>
  204.      * The object returned will be a new independent instance that will contain
  205.      * only the transitions that lie in the specified range.
  206.      * </p>
  207.      * See the {@link TimeSpanMap#extractRange TimeSpanMap.extractRange method} for more.
  208.      * @param start earliest date at which a transition is included in the range
  209.      * (may be set to {@link AbsoluteDate#PAST_INFINITY} to keep all early transitions)
  210.      * @param end latest date at which a transition is included in the r
  211.      * (may be set to {@link AbsoluteDate#FUTURE_INFINITY} to keep all late transitions)
  212.      * @return a new TimeSpanMap instance of DragSensitive with all transitions restricted to the specified range
  213.      */
  214.     public TimeSpanMap<DragSensitive> extractDragSensitiveRange(final AbsoluteDate start, final AbsoluteDate end) {
  215.         return dragSensitiveTimeSpanMap.extractRange(start, end);
  216.     }

  217.     /** Get the first {@link Span time span} of the drag sensitive time span map.
  218.      * @return the first {@link Span time span} of the drag sensitive time span map
  219.      * @since 11.1
  220.      */
  221.     public Span<DragSensitive> getFirstSpan() {
  222.         return dragSensitiveTimeSpanMap.getFirstSpan();
  223.     }

  224.     /** {@inheritDoc} */
  225.     @Override
  226.     public Vector3D acceleration(final SpacecraftState s, final double[] parameters) {

  227.         // Local atmospheric density
  228.         final AbsoluteDate date     = s.getDate();
  229.         final Frame        frame    = s.getFrame();
  230.         final Vector3D     position = s.getPosition();
  231.         final double rho    = atmosphere.getDensity(date, position, frame);

  232.         // Spacecraft relative velocity with respect to the atmosphere
  233.         final Vector3D vAtm = atmosphere.getVelocity(date, position, frame);
  234.         final Vector3D relativeVelocity = vAtm.subtract(s.getPVCoordinates().getVelocity());

  235.         // Extract the proper parameters valid at date from the input array
  236.         final double[] extractedParameters = extractParameters(parameters, date);

  237.         // Compute and return drag acceleration
  238.         return getDragSensitive(date).dragAcceleration(s, rho, relativeVelocity, extractedParameters);

  239.     }

  240.     /** {@inheritDoc} */
  241.     @SuppressWarnings("unchecked")
  242.     @Override
  243.     public <T extends CalculusFieldElement<T>> FieldVector3D<T> acceleration(final FieldSpacecraftState<T> s,
  244.                                                                          final T[] parameters) {
  245.         // Local atmospheric density
  246.         final FieldAbsoluteDate<T> date     = s.getDate();
  247.         final Frame                frame    = s.getFrame();
  248.         final FieldVector3D<T>     position = s.getPosition();

  249.         // Density and its derivatives
  250.         final T rho;

  251.         // Check for faster computation dedicated to derivatives with respect to state
  252.         // Using finite differences instead of automatic differentiation as it seems to be much
  253.         // faster for the drag's derivatives' computation
  254.         if (isGradientStateDerivative(s)) {
  255.             rho = (T) this.getGradientDensityWrtStateUsingFiniteDifferences(date.toAbsoluteDate(), frame, (FieldVector3D<Gradient>) position);
  256.         } else if (isDSStateDerivative(s)) {
  257.             rho = (T) this.getDSDensityWrtStateUsingFiniteDifferences(date.toAbsoluteDate(), frame, (FieldVector3D<DerivativeStructure>) position);
  258.         } else {
  259.             rho = atmosphere.getDensity(date, position, frame);
  260.         }

  261.         // Spacecraft relative velocity with respect to the atmosphere
  262.         final FieldVector3D<T> vAtm = atmosphere.getVelocity(date, position, frame);
  263.         final FieldVector3D<T> relativeVelocity = vAtm.subtract(s.getPVCoordinates().getVelocity());

  264.         // Extract the proper parameters valid at date from the input array
  265.         final T[] extractedParameters = extractParameters(parameters, date);

  266.         // Compute and return drag acceleration
  267.         return getDragSensitive(date.toAbsoluteDate()).dragAcceleration(s, rho, relativeVelocity, extractedParameters);
  268.     }

  269.     /**{@inheritDoc}
  270.      * <p>
  271.      * A date detector is used to cleanly stop the propagator and reset
  272.      * the state derivatives at transition dates.
  273.      * </p>
  274.      */
  275.     @Override
  276.     public Stream<EventDetector> getEventDetectors() {

  277.         // Get the transitions' dates from the TimeSpanMap
  278.         final AbsoluteDate[] transitionDates = getTransitionDates();

  279.         // Initialize the date detector
  280.         final DateDetector datesDetector = new DateDetector(transitionDates[0]).
  281.                         withMaxCheck(60.).
  282.                         withHandler((state, detector, increasing) -> Action.RESET_DERIVATIVES);
  283.         // Add all transitions' dates to the date detector
  284.         for (int i = 1; i < transitionDates.length; i++) {
  285.             datesDetector.addEventDate(transitionDates[i]);
  286.         }

  287.         // Return the detector
  288.         return Stream.of(datesDetector);
  289.     }

  290.     /** {@inheritDoc}
  291.      * <p>
  292.      * A date detector is used to cleanly stop the propagator and reset
  293.      * the state derivatives at transition dates.
  294.      * </p>
  295.      */
  296.     @Override
  297.     public <T extends CalculusFieldElement<T>> Stream<FieldEventDetector<T>> getFieldEventDetectors(final Field<T> field) {

  298.         // Get the transitions' dates from the TimeSpanMap
  299.         final AbsoluteDate[] transitionDates = getTransitionDates();

  300.         // Initialize the date detector
  301.         @SuppressWarnings("unchecked")
  302.         final FieldDateDetector<T> datesDetector =
  303.                         new FieldDateDetector<>(field, (FieldTimeStamped<T>[]) Array.newInstance(FieldTimeStamped.class, 0)).
  304.                         withMaxCheck(60.0).
  305.                         withHandler((FieldSpacecraftState<T> state, FieldEventDetector<T> detector, boolean increasing) ->
  306.                                     Action.RESET_DERIVATIVES);
  307.         // Add all transitions' dates to the date detector
  308.         for (int i = 0; i < transitionDates.length; i++) {
  309.             datesDetector.addEventDate(new FieldAbsoluteDate<>(field, transitionDates[i]));
  310.         }

  311.         // Return the detector
  312.         return Stream.of(datesDetector);
  313.     }

  314.     /** {@inheritDoc}
  315.      * <p>
  316.      * All the parameter drivers of all DragSensitive models are returned in an array.
  317.      * Models are ordered chronologically.
  318.      * </p>
  319.      */
  320.     @Override
  321.     public List<ParameterDriver> getParametersDrivers() {

  322.         // Get all transitions from the TimeSpanMap
  323.         final List<ParameterDriver> listParameterDrivers = new ArrayList<>();

  324.         // Loop on the spans
  325.         for (Span<DragSensitive> span = getFirstSpan(); span != null; span = span.next()) {
  326.             // Add all the parameter drivers of the span
  327.             for (ParameterDriver driver : span.getData().getDragParametersDrivers()) {
  328.                 // Add the driver only if the name does not exist already
  329.                 if (!findByName(listParameterDrivers, driver.getName())) {
  330.                     listParameterDrivers.add(driver);
  331.                 }
  332.             }
  333.         }

  334.         // Return an array of parameter drivers with no duplicated name
  335.         return listParameterDrivers;

  336.     }

  337.     /** Extract the proper parameter drivers' values from the array in input of the
  338.      * {@link #acceleration(SpacecraftState, double[]) acceleration} method.
  339.      *  Parameters are filtered given an input date.
  340.      * @param parameters the input parameters array
  341.      * @param date the date
  342.      * @return the parameters given the date
  343.      */
  344.     public double[] extractParameters(final double[] parameters, final AbsoluteDate date) {

  345.         // Get the drag parameter drivers of the date
  346.         final List<ParameterDriver> dragParameterDriver = getDragSensitive(date).getDragParametersDrivers();

  347.         // Find out the indexes of the parameters in the whole array of parameters
  348.         final List<ParameterDriver> allParameters = getParametersDrivers();
  349.         final double[] outParameters = new double[dragParameterDriver.size()];
  350.         int index = 0;
  351.         for (int i = 0; i < allParameters.size(); i++) {
  352.             final String driverName = allParameters.get(i).getName();
  353.             for (ParameterDriver dragDriver : dragParameterDriver) {
  354.                 if (dragDriver.getName().equals(driverName)) {
  355.                     outParameters[index++] = parameters[i];
  356.                 }
  357.             }
  358.         }
  359.         return outParameters;
  360.     }

  361.     /** Extract the proper parameter drivers' values from the array in input of the
  362.      * {@link #acceleration(FieldSpacecraftState, CalculusFieldElement[]) acceleration} method.
  363.      *  Parameters are filtered given an input date.
  364.      * @param parameters the input parameters array
  365.      * @param date the date
  366.      * @param <T> extends CalculusFieldElement
  367.      * @return the parameters given the date
  368.      */
  369.     public <T extends CalculusFieldElement<T>> T[] extractParameters(final T[] parameters,
  370.                                                                  final FieldAbsoluteDate<T> date) {

  371.         // Get the drag parameter drivers of the date
  372.         final List<ParameterDriver> dragPD = getDragSensitive(date.toAbsoluteDate()).getDragParametersDrivers();

  373.         // Find out the indexes of the parameters in the whole array of parameters
  374.         final List<ParameterDriver> allParameters = getParametersDrivers();
  375.         final T[] outParameters = MathArrays.buildArray(date.getField(), dragPD.size());
  376.         int index = 0;
  377.         for (int i = 0; i < allParameters.size(); i++) {
  378.             final String driverName = allParameters.get(i).getName();
  379.             for (ParameterDriver dragDriver : dragPD) {
  380.                 if (dragDriver.getName().equals(driverName)) {
  381.                     outParameters[index++] = parameters[i];
  382.                 }
  383.             }
  384.         }
  385.         return outParameters;
  386.     }

  387.     /** Find if a parameter driver with a given name already exists in a list of parameter drivers.
  388.      * @param driversList the list of parameter drivers
  389.      * @param name the parameter driver's name to filter with
  390.      * @return true if the name was found, false otherwise
  391.      */
  392.     private boolean findByName(final List<ParameterDriver> driversList, final String name) {
  393.         for (final ParameterDriver d : driversList) {
  394.             if (d.getName().equals(name)) {
  395.                 return true;
  396.             }
  397.         }
  398.         return false;
  399.     }

  400.     /** Get the dates of the transitions for the drag sensitive models {@link TimeSpanMap}.
  401.      * @return dates of the transitions for the drag sensitive models {@link TimeSpanMap}
  402.      */
  403.     private AbsoluteDate[] getTransitionDates() {

  404.         // Get all transitions
  405.         final List<AbsoluteDate> listDates = new ArrayList<>();

  406.         // Extract all the transitions' dates
  407.         for (Transition<DragSensitive> transition = getFirstSpan().getEndTransition(); transition != null; transition = transition.next()) {
  408.             listDates.add(transition.getDate());
  409.         }
  410.         // Return the array of transition dates
  411.         return listDates.toArray(new AbsoluteDate[0]);
  412.     }

  413.     /** Change the parameter drivers names of a {@link DragSensitive} model, if needed.
  414.      * <p>
  415.      * This is done to avoid that several parameter drivers have the same name.<br>
  416.      * It is done only if the user hasn't modify the DragSensitive parameter drivers default names.
  417.      * </p>
  418.      * @param dragSensitive the DragSensitive model
  419.      * @param date the date used in the parameter driver's name
  420.      * @param datePrefix the date prefix used in the parameter driver's name
  421.      * @return the DragSensitive with its drivers' names changed
  422.      */
  423.     private DragSensitive changeDragParameterDriversNames(final DragSensitive dragSensitive,
  424.                                                           final AbsoluteDate date,
  425.                                                           final String datePrefix) {
  426.         // Loop on the parameter drivers of the DragSensitive model
  427.         for (ParameterDriver driver: dragSensitive.getDragParametersDrivers()) {
  428.             final String driverName = driver.getName();

  429.             // If the name is the default name for DragSensitive parameter drivers
  430.             // Modify the name to add the prefix and the date
  431.             if (driverName.equals(DragSensitive.GLOBAL_DRAG_FACTOR) ||
  432.                 driverName.equals(DragSensitive.DRAG_COEFFICIENT) ||
  433.                 driverName.equals(DragSensitive.LIFT_RATIO)) {
  434.                 driver.setName(driverName + datePrefix + date.toString(timeScale));
  435.             }
  436.         }
  437.         return dragSensitive;
  438.     }

  439. }