Search in sources :

Example 71 with ParameterDriver

use of org.orekit.utils.ParameterDriver in project Orekit by CS-SI.

the class RangeRateIonosphericDelayModifier method rangeRateErrorParameterDerivative.

/**
 * Compute the derivative of the delay term wrt parameters.
 *
 * @param station ground station
 * @param driver driver for the station offset parameter
 * @param state spacecraft state
 * @param delay current ionospheric delay
 * @return derivative of the delay wrt station offset parameter
 * @throws OrekitException  if frames transformations cannot be computed
 */
private double rangeRateErrorParameterDerivative(final GroundStation station, final ParameterDriver driver, final SpacecraftState state, final double delay) throws OrekitException {
    final ParameterFunction rangeError = new ParameterFunction() {

        /**
         * {@inheritDoc}
         */
        @Override
        public double value(final ParameterDriver parameterDriver) throws OrekitException {
            return rangeRateErrorIonosphericModel(station, state);
        }
    };
    final ParameterFunction rangeErrorDerivative = Differentiation.differentiate(rangeError, driver, 3, 10.0);
    return rangeErrorDerivative.value(driver);
}
Also used : ParameterFunction(org.orekit.utils.ParameterFunction) ParameterDriver(org.orekit.utils.ParameterDriver)

Example 72 with ParameterDriver

use of org.orekit.utils.ParameterDriver in project Orekit by CS-SI.

the class RangeTroposphericDelayModifier method rangeErrorParameterDerivative.

/**
 * Compute the derivative of the delay term wrt parameters.
 *
 * @param station ground station
 * @param driver driver for the station offset parameter
 * @param state spacecraft state
 * @param delay current ionospheric delay
 * @return derivative of the delay wrt station offset parameter
 * @throws OrekitException  if frames transformations cannot be computed
 */
private double rangeErrorParameterDerivative(final GroundStation station, final ParameterDriver driver, final SpacecraftState state, final double delay) throws OrekitException {
    final ParameterFunction rangeError = new ParameterFunction() {

        /**
         * {@inheritDoc}
         */
        @Override
        public double value(final ParameterDriver parameterDriver) throws OrekitException {
            return rangeErrorTroposphericModel(station, state);
        }
    };
    final ParameterFunction rangeErrorDerivative = Differentiation.differentiate(rangeError, driver, 3, 10.0);
    return rangeErrorDerivative.value(driver);
}
Also used : ParameterFunction(org.orekit.utils.ParameterFunction) ParameterDriver(org.orekit.utils.ParameterDriver)

Example 73 with ParameterDriver

use of org.orekit.utils.ParameterDriver in project Orekit by CS-SI.

the class TurnAroundRangeTroposphericDelayModifier method modify.

/**
 * {@inheritDoc}
 */
@Override
public void modify(final EstimatedMeasurement<TurnAroundRange> estimated) throws OrekitException {
    final TurnAroundRange measurement = estimated.getObservedMeasurement();
    final GroundStation masterStation = measurement.getMasterStation();
    final GroundStation slaveStation = measurement.getSlaveStation();
    final SpacecraftState state = estimated.getStates()[0];
    final double[] oldValue = estimated.getEstimatedValue();
    // Update estimated value taking into account the tropospheric delay.
    // The tropospheric delay is directly added to the TurnAroundRange.
    final double masterDelay = rangeErrorTroposphericModel(masterStation, state);
    final double slaveDelay = rangeErrorTroposphericModel(slaveStation, state);
    final double[] newValue = oldValue.clone();
    newValue[0] = newValue[0] + masterDelay + slaveDelay;
    estimated.setEstimatedValue(newValue);
    // Update estimated derivatives with Jacobian of the measure wrt state
    final double[][] masterDjac = rangeErrorJacobianState(masterStation, state);
    final double[][] slaveDjac = rangeErrorJacobianState(slaveStation, state);
    final double[][] stateDerivatives = estimated.getStateDerivatives(0);
    for (int irow = 0; irow < stateDerivatives.length; ++irow) {
        for (int jcol = 0; jcol < stateDerivatives[0].length; ++jcol) {
            stateDerivatives[irow][jcol] += masterDjac[irow][jcol] + slaveDjac[irow][jcol];
        }
    }
    estimated.setStateDerivatives(0, stateDerivatives);
    // Update derivatives with respect to master station position
    for (final ParameterDriver driver : Arrays.asList(masterStation.getEastOffsetDriver(), masterStation.getNorthOffsetDriver(), masterStation.getZenithOffsetDriver())) {
        if (driver.isSelected()) {
            double parameterDerivative = estimated.getParameterDerivatives(driver)[0];
            parameterDerivative += rangeErrorParameterDerivative(masterStation, driver, state);
            estimated.setParameterDerivatives(driver, parameterDerivative);
        }
    }
    // Update derivatives with respect to slave station position
    for (final ParameterDriver driver : Arrays.asList(slaveStation.getEastOffsetDriver(), slaveStation.getNorthOffsetDriver(), slaveStation.getZenithOffsetDriver())) {
        if (driver.isSelected()) {
            double parameterDerivative = estimated.getParameterDerivatives(driver)[0];
            parameterDerivative += rangeErrorParameterDerivative(slaveStation, driver, state);
            estimated.setParameterDerivatives(driver, parameterDerivative);
        }
    }
}
Also used : SpacecraftState(org.orekit.propagation.SpacecraftState) GroundStation(org.orekit.estimation.measurements.GroundStation) TurnAroundRange(org.orekit.estimation.measurements.TurnAroundRange) ParameterDriver(org.orekit.utils.ParameterDriver)

Example 74 with ParameterDriver

use of org.orekit.utils.ParameterDriver in project Orekit by CS-SI.

the class AbstractPropagatorConverter method setFreeParameters.

/**
 * Free some parameters.
 * @param freeParameters names of the free parameters
 * @exception OrekitException if one of the parameters cannot be free
 */
private void setFreeParameters(final Iterable<String> freeParameters) throws OrekitException {
    // start by setting all parameters as not estimated
    for (final ParameterDriver driver : builder.getPropagationParametersDrivers().getDrivers()) {
        driver.setSelected(false);
    }
    // set only the selected parameters as estimated
    for (final String parameter : freeParameters) {
        boolean found = false;
        for (final ParameterDriver driver : builder.getPropagationParametersDrivers().getDrivers()) {
            if (driver.getName().equals(parameter)) {
                found = true;
                driver.setSelected(true);
                break;
            }
        }
        if (!found) {
            // build the list of supported parameters
            final StringBuilder sBuilder = new StringBuilder();
            for (final ParameterDriver driver : builder.getPropagationParametersDrivers().getDrivers()) {
                if (sBuilder.length() > 0) {
                    sBuilder.append(", ");
                }
                sBuilder.append(driver.getName());
            }
            throw new OrekitException(OrekitMessages.UNSUPPORTED_PARAMETER_NAME, parameter, sBuilder.toString());
        }
    }
}
Also used : OrekitException(org.orekit.errors.OrekitException) ParameterDriver(org.orekit.utils.ParameterDriver)

Example 75 with ParameterDriver

use of org.orekit.utils.ParameterDriver in project Orekit by CS-SI.

the class JacobianPropagatorConverter method fillRows.

/**
 * Fill up a few Jacobian rows (either 6 or 3 depending on velocities used or not).
 * @param value values vector
 * @param jacobian Jacobian matrix
 * @param row first row index
 * @param state spacecraft state
 * @param stateSize state size
 * @param orbitalParameters drivers for the orbital parameters
 * @param propagationParameters drivers for the propagation model parameters
 * @param mapper state mapper
 * @exception OrekitException if Jacobians matrices cannot be retrieved
 */
private void fillRows(final RealVector value, final RealMatrix jacobian, final int row, final SpacecraftState state, final int stateSize, final ParameterDriversList orbitalParameters, final ParameterDriversList propagationParameters, final JacobiansMapper mapper) throws OrekitException {
    // value part
    final PVCoordinates pv = state.getPVCoordinates(getFrame());
    value.setEntry(row, pv.getPosition().getX());
    value.setEntry(row + 1, pv.getPosition().getY());
    value.setEntry(row + 2, pv.getPosition().getZ());
    if (!isOnlyPosition()) {
        value.setEntry(row + 3, pv.getVelocity().getX());
        value.setEntry(row + 4, pv.getVelocity().getY());
        value.setEntry(row + 5, pv.getVelocity().getZ());
    }
    // Jacobian part
    final double[][] dYdY0 = new double[JacobiansMapper.STATE_DIMENSION][JacobiansMapper.STATE_DIMENSION];
    final double[][] dYdP = new double[JacobiansMapper.STATE_DIMENSION][mapper.getParameters()];
    mapper.getStateJacobian(state, dYdY0);
    mapper.getParametersJacobian(state, dYdP);
    for (int k = 0; k < stateSize; k++) {
        int index = 0;
        for (int j = 0; j < orbitalParameters.getNbParams(); ++j) {
            final ParameterDriver driver = orbitalParameters.getDrivers().get(j);
            if (driver.isSelected()) {
                jacobian.setEntry(row + k, index++, dYdY0[k][j] * driver.getScale());
            }
        }
        for (int j = 0; j < propagationParameters.getNbParams(); ++j) {
            final ParameterDriver driver = propagationParameters.getDrivers().get(j);
            jacobian.setEntry(row + k, index++, dYdP[k][j] * driver.getScale());
        }
    }
}
Also used : PVCoordinates(org.orekit.utils.PVCoordinates) ParameterDriver(org.orekit.utils.ParameterDriver)

Aggregations

ParameterDriver (org.orekit.utils.ParameterDriver)80 AbsoluteDate (org.orekit.time.AbsoluteDate)33 SpacecraftState (org.orekit.propagation.SpacecraftState)32 NumericalPropagatorBuilder (org.orekit.propagation.conversion.NumericalPropagatorBuilder)27 Test (org.junit.Test)23 Propagator (org.orekit.propagation.Propagator)23 Context (org.orekit.estimation.Context)21 ParameterDriversList (org.orekit.utils.ParameterDriversList)20 OrekitException (org.orekit.errors.OrekitException)19 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)16 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)16 ObservedMeasurement (org.orekit.estimation.measurements.ObservedMeasurement)15 Orbit (org.orekit.orbits.Orbit)15 ArrayList (java.util.ArrayList)14 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)14 ParameterFunction (org.orekit.utils.ParameterFunction)14 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)13 HashMap (java.util.HashMap)11 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)11 RealMatrix (org.hipparchus.linear.RealMatrix)10