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);
}
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);
}
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);
}
}
}
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());
}
}
}
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());
}
}
}
Aggregations